/* ============================================================
   Merchant Realms - Medieval Ledger UI Theme
   ============================================================ */

:root {
    --gold: #c4a35a;
    --gold-bright: #e8d48b;
    --gold-dark: #8a7232;
    --brown-dark: #2a1f14;
    --brown-medium: #3d2e1c;
    --brown-light: #5a4530;
    --parchment: #d4c5a0;
    --parchment-dark: #b8a87a;
    --blood-red: #8b2500;
    --blood-red-light: #c44e52;
    --success: #55a868;
    --info: #4c72b0;
    --warning: #ccb974;
    --danger: #c44e52;
    --text-light: #e8dcc8;
    --text-dim: #9a8b70;
    --panel-bg: rgba(30, 22, 12, 0.92);
    --panel-border: rgba(196, 163, 90, 0.35);
    --panel-border-bright: rgba(196, 163, 90, 0.6);
    --shadow: rgba(0, 0, 0, 0.5);
    --font-display: 'Cinzel', 'Georgia', serif;
    --font-body: 'MedievalSharp', 'Georgia', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #0d0a06;
    font-family: var(--font-body);
    color: var(--text-light);
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

/* ============================================================
   Canvas
   ============================================================ */

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

#minimapCanvas {
    position: fixed;
    bottom: 60px;
    right: 12px;
    width: 200px;
    height: 160px;
    z-index: 50;
    border: 2px solid var(--gold-dark);
    border-radius: 4px;
    background: rgba(10, 8, 4, 0.85);
    box-shadow: 0 0 12px var(--shadow);
    cursor: pointer;
}

/* ============================================================
   Overlays (Title, End)
   ============================================================ */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at center, rgba(42, 31, 20, 0.7) 0%, rgba(10, 8, 4, 0.95) 70%),
        linear-gradient(180deg, #0d0a06 0%, #1a140c 50%, #0d0a06 100%);
}

.overlay.hidden {
    display: none !important;
    pointer-events: none;
}

.title-content {
    text-align: center;
    max-width: 620px;
    padding: 48px 40px;
    background: linear-gradient(180deg, rgba(42, 31, 20, 0.6), rgba(20, 15, 8, 0.8));
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(196, 163, 90, 0.08);
}

.game-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 3.2rem;
    color: var(--gold);
    text-shadow: 0 2px 8px rgba(196, 163, 90, 0.3), 0 0 40px rgba(196, 163, 90, 0.1);
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.game-subtitle {
    font-family: var(--font-body);
    font-size: 1.15rem;
    color: var(--parchment-dark);
    margin-bottom: 16px;
    line-height: 1.5;
}

.title-divider {
    font-size: 1.6rem;
    color: var(--gold-dark);
    margin: 16px 0;
    opacity: 0.7;
}

.game-desc {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 32px;
}

.title-footer {
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--gold-dark);
    letter-spacing: 2px;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn-medieval {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 14px 48px;
    color: var(--brown-dark);
    background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-dark) 100%);
    border: 2px solid var(--gold-dark);
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-medieval:hover {
    background: linear-gradient(180deg, #f0dfa0 0%, var(--gold-bright) 50%, var(--gold) 100%);
    box-shadow: 0 4px 20px rgba(196, 163, 90, 0.3);
    transform: translateY(-1px);
}

.btn-medieval:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.btn-medieval.btn-large {
    padding: 16px 56px;
    font-size: 1.2rem;
}

@keyframes petitionGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(90, 173, 53, 0.4); }
    50% { box-shadow: 0 0 20px rgba(90, 173, 53, 0.8), 0 0 40px rgba(90, 173, 53, 0.3); }
}

@keyframes nobilityGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(201, 168, 76, 0.4); border-color: rgba(201, 168, 76, 0.6); }
    50% { box-shadow: 0 0 18px rgba(201, 168, 76, 0.9), 0 0 36px rgba(201, 168, 76, 0.3); border-color: rgba(201, 168, 76, 1.0); }
}

.btn-nobility-glow {
    animation: nobilityGlow 2s ease-in-out infinite;
    background: rgba(201, 168, 76, 0.12) !important;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    min-height: 28px;
    min-width: 28px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}

.btn-close:hover {
    color: var(--danger);
    background: rgba(196, 78, 82, 0.15);
}

.btn-collapse {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    cursor: pointer;
    min-height: 28px;
    min-width: 28px;
    padding: 4px 6px;
    transition: all 0.15s;
}

.btn-collapse:hover { color: var(--gold); }

/* ============================================================
   UI Panels (shared)
   ============================================================ */

.ui-panel {
    position: fixed;
    z-index: 100;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    box-shadow: 0 4px 24px var(--shadow);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.ui-panel.hidden {
    display: none;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(42, 31, 20, 0.5);
}

.panel-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 1px;
}

.panel-body {
    padding: 12px 14px;
}

.panel-body.scrollable {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-dark) var(--brown-dark);
}

.panel-body.scrollable::-webkit-scrollbar {
    width: 6px;
}

.panel-body.scrollable::-webkit-scrollbar-track {
    background: var(--brown-dark);
}

.panel-body.scrollable::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 3px;
}

/* ============================================================
   Top Bar
   ============================================================ */

.top-bar {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 6px 20px;
    border-radius: 0 0 8px 8px;
    border-top: none;
    min-width: 520px;
    z-index: 2000;
}

.top-left, .top-center, .top-right {
    display: flex;
    align-items: center;
}

.day-display {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--parchment);
    letter-spacing: 1px;
    white-space: nowrap;
}

.speed-controls {
    display: flex;
    gap: 2px;
}

.btn-speed {
    font-size: 0.8rem;
    padding: 4px 10px;
    background: rgba(90, 69, 48, 0.5);
    border: 1px solid var(--panel-border);
    color: var(--text-dim);
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-speed:hover {
    background: rgba(196, 163, 90, 0.2);
    color: var(--gold);
}

.btn-speed.active {
    background: rgba(196, 163, 90, 0.3);
    color: var(--gold);
    border-color: var(--gold-dark);
    box-shadow: 0 0 8px rgba(196, 163, 90, 0.15);
}

.notification-bell {
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}

.notification-bell:hover {
    background: rgba(196, 163, 90, 0.15);
}

.notif-count {
    position: absolute;
    top: -2px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-family: var(--font-display);
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}

/* ============================================================
   Left Panel
   ============================================================ */

.left-panel {
    top: 50px;
    left: 0;
    width: 260px;
    border-left: none;
    border-radius: 0 8px 8px 0;
}

.left-panel .panel-body.collapsed {
    display: none;
}

.stat-group {
    margin-bottom: 12px;
}

.stat-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 1rem;
    color: var(--parchment);
}

.gold-value {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--gold-bright);
    font-size: 1.15rem;
}

.player-name {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--gold);
}

.player-name-clickable {
    cursor: pointer;
    transition: color 0.15s, text-shadow 0.15s;
}

.player-name-clickable:hover {
    color: var(--gold-bright);
    text-decoration: underline;
    text-shadow: 0 0 6px rgba(232, 212, 139, 0.4);
}

.stat-row {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.stat-mini {
    font-size: 0.85rem;
    color: var(--parchment-dark);
}

.stat-icon {
    font-size: 0.9rem;
}

/* Reputation bars */
.reputation-bars {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rep-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rep-bar-name {
    font-size: 0.75rem;
    color: var(--text-dim);
    width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rep-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(90, 69, 48, 0.4);
    border-radius: 4px;
    overflow: hidden;
}

.rep-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Meter / Notoriety */
.meter-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meter {
    flex: 1;
    height: 10px;
    background: rgba(90, 69, 48, 0.4);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(90, 69, 48, 0.6);
}

.meter-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease, background 0.3s ease;
    background: var(--success);
}

.meter-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    min-width: 24px;
    text-align: right;
}

/* Food/Drink supply indicators */
.supply-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
    padding: 0 2px;
}
.supply-info {
    font-size: 0.7rem;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.btn-supply {
    font-size: 0.65rem;
    padding: 1px 6px;
    border: 1px solid #665533;
    border-radius: 3px;
    background: linear-gradient(to bottom, #3a3020, #2a2015);
    color: #ddc;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.btn-supply:hover:not(:disabled) {
    background: linear-gradient(to bottom, #4a4030, #3a3025);
    border-color: #887744;
}
.btn-supply:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ============================================================
   Right Panel
   ============================================================ */

.right-panel {
    top: 50px;
    right: 0;
    width: 340px;
    border-right: none;
    border-radius: 8px 0 0 8px;
    max-height: calc(100vh - 120px);
    z-index: 1600;
}

.right-panel .panel-body {
    max-height: calc(100vh - 180px);
}

/* Detail sections */
.detail-section {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(90, 69, 48, 0.3);
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-section h3 {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--gold-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 0.85rem;
}

.detail-row .label {
    color: var(--text-dim);
}

.detail-row .value {
    color: var(--parchment);
    font-weight: 600;
}

/* Progress/prosperity bars */
.bar-small {
    width: 80px;
    height: 6px;
    background: rgba(90, 69, 48, 0.4);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.bar-small-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ============================================================
   Bottom Bar
   ============================================================ */

.bottom-bar {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 8px 8px 0 0;
    border-bottom: none;
    max-width: 95vw;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.bar-row {
    display: flex;
    justify-content: center;
    gap: 3px;
    flex-wrap: nowrap;
}

.btn-action {
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 5px 8px;
    background: rgba(90, 69, 48, 0.4);
    border: 1px solid var(--panel-border);
    color: var(--parchment);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-action:hover {
    background: rgba(196, 163, 90, 0.25);
    border-color: var(--gold-dark);
    color: var(--gold);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.btn-action:active {
    transform: translateY(0);
}

.btn-action.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.btn-action.btn-small {
    font-size: 0.75rem;
    padding: 4px 6px;
}

#worldMapOverlay {
    image-rendering: auto;
}

/* Icon-only on narrow screens */
@media (max-width: 800px) {
    .btn-action .btn-label { display: none; }
    .btn-action { padding: 5px 7px; font-size: 1rem; }
    .btn-group-divider { display: none; }
}

@media (min-width: 801px) {
    .btn-action .btn-label { display: inline; }
}

.quick-inventory {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 2px;
    font-size: 0.8rem;
    color: var(--parchment-dark);
    max-height: 52px;
    overflow: hidden;
}

.inv-item {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 1px 4px;
    background: rgba(90, 69, 48, 0.3);
    border-radius: 3px;
    white-space: nowrap;
    font-size: 0.75rem;
}

.inv-item .qty {
    font-weight: 600;
    color: var(--parchment);
}

.win-progress {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.win-indicator {
    display: flex;
    align-items: center;
    gap: 3px;
}

.win-indicator.achieved {
    color: var(--gold);
}

/* ============================================================
   Modal
   ============================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1500;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    pointer-events: none;
}

.modal-overlay > * {
    pointer-events: auto;
}

.modal-overlay.hidden {
    display: none;
}

.modal-dialog {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border-bright);
    border-radius: 8px;
    min-width: 480px;
    max-width: 720px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.2s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(42, 31, 20, 0.5);
    border-radius: 8px 8px 0 0;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 1px;
}

.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-dark) var(--brown-dark);
}

.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: var(--brown-dark); }
.modal-body::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============================================================
   Trade Dialog
   ============================================================ */

.trade-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.trade-column h3 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-align: center;
}

.trade-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    background: rgba(90, 69, 48, 0.2);
    transition: background 0.15s;
}

.trade-item:hover {
    background: rgba(90, 69, 48, 0.4);
}

.trade-item .res-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.trade-item .price {
    font-size: 0.85rem;
    font-weight: 600;
}

.trade-item .price.good-deal { color: var(--success); }
.trade-item .price.bad-deal { color: var(--danger); }
.trade-item .price.neutral { color: var(--parchment); }

.trade-item.military-item {
    border-left: 3px solid var(--danger);
}

.trade-item.banned-item {
    border-left: 3px solid #ff4444;
    background: rgba(255, 68, 68, 0.05);
}

.trade-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.trade-qty-selector {
    display: flex;
    gap: 3px;
}

.qty-btn {
    font-family: var(--font-body);
    font-size: 0.7rem;
    padding: 4px 8px;
    min-height: 24px;
    cursor: pointer;
    background: rgba(42, 42, 42, 0.8);
    border: 1px solid #555;
    color: var(--gold);
    border-radius: 3px;
    transition: all 0.15s;
}

.qty-btn:hover {
    background: rgba(58, 58, 58, 0.9);
}

.qty-btn.qty-selected {
    background: rgba(74, 58, 26, 0.9);
    border-color: var(--gold);
    font-weight: bold;
}

.trade-preview {
    color: var(--gold);
    font-size: 0.72rem;
    white-space: nowrap;
}

.btn-trade {
    font-family: var(--font-body);
    font-size: 0.75rem;
    padding: 4px 10px;
    min-height: 24px;
    border: 1px solid var(--panel-border);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
    background: rgba(90, 69, 48, 0.3);
    color: var(--parchment);
}

.btn-trade:hover {
    background: rgba(196, 163, 90, 0.3);
    color: var(--gold);
}

.btn-trade.buy { border-color: rgba(85, 168, 104, 0.4); }
.btn-trade.buy:hover { background: rgba(85, 168, 104, 0.2); color: var(--success); }
.btn-trade.sell { border-color: rgba(196, 163, 90, 0.4); }
.btn-trade.sell:hover { background: rgba(196, 163, 90, 0.2); }

.qty-select {
    font-family: var(--font-body);
    font-size: 0.75rem;
    padding: 2px 4px;
    background: rgba(42, 31, 20, 0.6);
    border: 1px solid var(--panel-border);
    color: var(--parchment);
    border-radius: 3px;
    width: 50px;
    text-align: center;
}

.trade-summary {
    margin-top: 12px;
    padding: 10px;
    background: rgba(42, 31, 20, 0.6);
    border-radius: 4px;
    font-size: 0.85rem;
    text-align: center;
}

/* ============================================================
   Build Dialog
   ============================================================ */

.build-categories {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.btn-category {
    font-family: var(--font-body);
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(90, 69, 48, 0.3);
    border: 1px solid var(--panel-border);
    color: var(--text-dim);
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s;
}

.btn-category:hover, .btn-category.active {
    background: rgba(196, 163, 90, 0.25);
    color: var(--gold);
    border-color: var(--gold-dark);
}

.build-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.build-card {
    padding: 10px;
    background: rgba(90, 69, 48, 0.2);
    border: 1px solid rgba(90, 69, 48, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.build-card:hover {
    background: rgba(90, 69, 48, 0.4);
    border-color: var(--gold-dark);
    transform: translateY(-1px);
}

.build-card.cant-afford {
    opacity: 0.45;
    pointer-events: none;
}

.build-card .build-name {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--gold);
    margin-bottom: 4px;
}

.build-card .build-cost {
    font-size: 0.8rem;
    color: var(--parchment-dark);
    margin-bottom: 4px;
}

.build-card .build-info {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.4;
}

/* ============================================================
   Hire Dialog
   ============================================================ */

.hire-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.btn-tab {
    font-family: var(--font-body);
    font-size: 0.8rem;
    padding: 6px 16px;
    background: rgba(90, 69, 48, 0.3);
    border: 1px solid var(--panel-border);
    color: var(--text-dim);
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    transition: all 0.15s;
}

.btn-tab:hover, .btn-tab.active {
    background: rgba(196, 163, 90, 0.2);
    color: var(--gold);
    border-color: var(--gold-dark);
}

.worker-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.worker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(90, 69, 48, 0.2);
    border-radius: 4px;
    transition: background 0.15s;
}

.worker-row:hover {
    background: rgba(90, 69, 48, 0.35);
}

.worker-info {
    font-size: 0.85rem;
}

.worker-info .name { color: var(--parchment); font-weight: 600; }
.worker-info .details { color: var(--text-dim); font-size: 0.75rem; }

.btn-hire, .btn-fire, .btn-assign {
    font-family: var(--font-body);
    font-size: 0.75rem;
    padding: 5px 12px;
    min-height: 26px;
    border: 1px solid var(--panel-border);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-hire {
    background: rgba(85, 168, 104, 0.15);
    border-color: rgba(85, 168, 104, 0.3);
    color: var(--success);
}

.btn-hire:hover { background: rgba(85, 168, 104, 0.3); }

.btn-fire {
    background: rgba(196, 78, 82, 0.15);
    border-color: rgba(196, 78, 82, 0.3);
    color: var(--danger);
}

.btn-fire:hover { background: rgba(196, 78, 82, 0.3); }

.btn-assign {
    background: rgba(76, 114, 176, 0.15);
    border-color: rgba(76, 114, 176, 0.3);
    color: var(--info);
}

.btn-assign:hover { background: rgba(76, 114, 176, 0.3); }

/* ============================================================
   Caravan Dialog
   ============================================================ */

.caravan-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--gold-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group select, .form-group input {
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 6px 10px;
    background: rgba(42, 31, 20, 0.6);
    border: 1px solid var(--panel-border);
    color: var(--parchment);
    border-radius: 4px;
}

.form-group select option {
    background: var(--brown-dark);
    color: var(--parchment);
}

.caravan-goods-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.caravan-good-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: rgba(90, 69, 48, 0.2);
    border-radius: 3px;
    font-size: 0.8rem;
}

.risk-assessment {
    padding: 10px;
    background: rgba(42, 31, 20, 0.6);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.risk-assessment .risk-low { color: var(--success); }
.risk-assessment .risk-medium { color: var(--warning); }
.risk-assessment .risk-high { color: var(--danger); }

/* Active caravans list */
.caravan-active-list {
    margin-top: 12px;
    border-top: 1px solid var(--panel-border);
    padding-top: 12px;
}

.caravan-active-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(90, 69, 48, 0.2);
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.caravan-progress-track {
    flex: 1;
    height: 6px;
    background: rgba(90, 69, 48, 0.4);
    border-radius: 3px;
    overflow: hidden;
}

.caravan-progress-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ============================================================
   Event Log
   ============================================================ */

.event-log-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 400px;
    overflow-y: auto;
}

.event-log-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s;
    background: rgba(90, 69, 48, 0.15);
}

.event-log-item:hover {
    background: rgba(90, 69, 48, 0.35);
}

.event-log-item .event-day {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-dim);
    min-width: 48px;
}

.event-log-item .event-text {
    flex: 1;
}

.event-log-item.event-war { border-left: 3px solid var(--danger); }
.event-log-item.event-trade { border-left: 3px solid var(--gold); }
.event-log-item.event-personal { border-left: 3px solid var(--info); }
.event-log-item.event-world { border-left: 3px solid var(--success); }

/* ============================================================
   Toast Notifications
   ============================================================ */

.toast-container {
    position: fixed;
    top: 50px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    max-width: 340px;
    box-shadow: 0 4px 16px var(--shadow);
    pointer-events: auto;
    cursor: pointer;
    animation: toastIn 0.3s ease;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.toast-info {
    background: rgba(42, 60, 90, 0.92);
    border-color: rgba(76, 114, 176, 0.5);
    color: #a8c4e6;
}

.toast.toast-warning {
    background: rgba(60, 52, 30, 0.92);
    border-color: rgba(204, 185, 116, 0.5);
    color: #e8d48b;
}

.toast.toast-danger {
    background: rgba(70, 25, 20, 0.92);
    border-color: rgba(196, 78, 82, 0.5);
    color: #e8a0a0;
}

.toast.toast-success {
    background: rgba(30, 55, 35, 0.92);
    border-color: rgba(85, 168, 104, 0.5);
    color: #a0d8a8;
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

.toast-icon {
    font-size: 1.1rem;
}

/* ============================================================
   Tooltip
   ============================================================ */

.tooltip {
    position: fixed;
    z-index: 900;
    padding: 6px 10px;
    background: rgba(20, 15, 8, 0.95);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--parchment);
    max-width: 300px;
    pointer-events: none;
    box-shadow: 0 4px 12px var(--shadow);
    white-space: pre-line;
    line-height: 1.5;
}

.tooltip.hidden {
    display: none;
}

/* ============================================================
   Context Menu
   ============================================================ */

.context-menu {
    position: fixed;
    z-index: 600;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border-bright);
    border-radius: 6px;
    min-width: 160px;
    box-shadow: 0 6px 24px var(--shadow);
    overflow: hidden;
}

.context-menu.hidden {
    display: none;
}

.ctx-item {
    padding: 8px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.1s;
    color: var(--parchment);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ctx-item:hover {
    background: rgba(196, 163, 90, 0.2);
    color: var(--gold);
}

.ctx-item.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.ctx-separator {
    height: 1px;
    background: var(--panel-border);
    margin: 2px 0;
}

/* ============================================================
   End Screen Stats
   ============================================================ */

.end-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
    margin: 20px 0;
    text-align: left;
    font-size: 0.9rem;
}

.end-stat-label {
    color: var(--text-dim);
}

.end-stat-value {
    color: var(--gold);
    font-weight: 600;
}

/* ============================================================
   Market Price Table (in right panel)
   ============================================================ */

.price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.price-table th {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--gold-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 6px;
    text-align: left;
    border-bottom: 1px solid var(--panel-border);
}

.price-table td {
    padding: 4px 6px;
    border-bottom: 1px solid rgba(90, 69, 48, 0.15);
    color: var(--parchment);
}

.price-table tr:hover {
    background: rgba(90, 69, 48, 0.2);
}

/* ============================================================
   Misc Utility
   ============================================================ */

.text-gold { color: var(--gold); }
.text-dim { color: var(--text-dim); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }

.mt-sm { margin-top: 8px; }
.mb-sm { margin-bottom: 8px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.bold { font-weight: 600; }

.needs-bar-container {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 3px;
}

.needs-bar-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    width: 60px;
}

.needs-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(90, 69, 48, 0.4);
    border-radius: 3px;
    overflow: hidden;
}

.needs-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ============================================================
   Animations
   ============================================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.blink {
    animation: pulse 1.2s ease-in-out infinite;
}

/* ============================================================
   Responsive adjustments
   ============================================================ */

/* ============================================================
   Character Creation Screen
   ============================================================ */

.char-create-content {
    max-width: 460px;
}

.char-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
    text-align: left;
}

.char-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.char-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--gold-dark);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.char-input {
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 10px 14px;
    background: rgba(42, 31, 20, 0.7);
    border: 1px solid var(--gold-dark);
    color: var(--parchment);
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.char-input::placeholder {
    color: var(--text-dim);
    opacity: 0.5;
}

.char-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(196, 163, 90, 0.25);
}

.char-sex-toggle {
    display: flex;
    gap: 8px;
}

.char-sex-option {
    flex: 1;
    cursor: pointer;
}

.char-sex-option input[type="radio"] {
    display: none;
}

.char-sex-btn {
    display: block;
    text-align: center;
    font-family: var(--font-display);
    font-size: 0.95rem;
    padding: 10px 16px;
    background: rgba(42, 31, 20, 0.7);
    border: 1px solid var(--panel-border);
    color: var(--text-dim);
    border-radius: 4px;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.char-sex-option input[type="radio"]:checked + .char-sex-btn {
    background: rgba(196, 163, 90, 0.2);
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 0 10px rgba(196, 163, 90, 0.15);
}

.char-sex-btn:hover {
    border-color: var(--gold-dark);
    color: var(--parchment);
    background: rgba(90, 69, 48, 0.4);
}

/* ============================================================
   Kingdoms Page
   ============================================================ */

.kingdom-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.kingdom-card {
    background: rgba(42, 31, 20, 0.6);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 10px;
    font-size: 0.82rem;
}

.kingdom-card.kingdom-home {
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(196, 163, 90, 0.25);
}

.kc-header {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.kc-row {
    margin: 3px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kc-laws {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(90, 69, 48, 0.2);
}

.law-item {
    font-size: 0.75rem;
    color: var(--parchment-dark);
    margin: 2px 0;
}

.kc-home-badge {
    margin-top: 4px;
    color: var(--gold);
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 0.85rem;
}

.kc-btn {
    font-size: 0.7rem;
    padding: 3px 8px;
    background: rgba(80, 60, 30, 0.5);
    border: 1px solid rgba(180, 150, 80, 0.4);
    color: #f0d0a0;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-display);
    transition: background 0.2s, border-color 0.2s;
}
.kc-btn:hover {
    background: rgba(120, 90, 40, 0.7);
    border-color: rgba(220, 180, 60, 0.7);
}

.mini-bar {
    display: inline-block;
    width: 60px;
    height: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    overflow: hidden;
    vertical-align: middle;
}

.mini-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.diplo-matrix {
    margin: 16px 0;
    overflow-x: auto;
}

.diplo-table {
    border-collapse: collapse;
    font-size: 0.8rem;
    width: 100%;
}

.diplo-table th,
.diplo-table td {
    padding: 6px 8px;
    text-align: center;
    border: 1px solid rgba(90, 69, 48, 0.2);
}

.diplo-table th {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--gold-dark);
}

.diplo-ally { background: rgba(85, 168, 104, 0.15); }
.diplo-neutral { background: rgba(204, 185, 116, 0.1); }
.diplo-hostile { background: rgba(196, 78, 82, 0.15); }
.diplo-war { background: rgba(139, 37, 0, 0.2); }

.your-status {
    margin-top: 16px;
    padding: 12px;
    background: rgba(42, 31, 20, 0.5);
    border: 1px solid var(--gold-dark);
    border-radius: 6px;
}

.your-status h3 {
    font-family: var(--font-display);
    color: var(--gold);
    margin-bottom: 8px;
}

/* ============================================================
   Social Rank Ladder
   ============================================================ */

.rank-ladder {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rank-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.82rem;
    border-left: 3px solid transparent;
}

.rank-step.rank-current {
    background: rgba(196, 163, 90, 0.15);
    border-left-color: var(--gold);
    font-weight: 700;
}

.rank-step.rank-achieved {
    color: var(--text-light);
}

.rank-step.rank-locked {
    color: var(--text-dim);
    opacity: 0.7;
}

.rank-icon { font-size: 1.1rem; }
.rank-name { flex: 1; }
.rank-perks { font-size: 0.72rem; color: var(--parchment-dark); }
.rank-req { font-size: 0.7rem; color: var(--text-dim); }

.progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
    font-size: 0.8rem;
}

.progress-row .label {
    min-width: 80px;
    color: var(--parchment-dark);
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 5px;
    transition: width 0.3s;
}

.progress-row .value {
    min-width: 70px;
    text-align: right;
    font-size: 0.72rem;
    color: var(--text-dim);
}

/* ============================================================
   Responsive adjustments
   ============================================================ */

@media (max-width: 900px) {
    .left-panel { width: 200px; }
    .right-panel { width: 260px; }
    .modal-dialog { min-width: 360px; max-width: 95vw; }
    .build-grid { grid-template-columns: 1fr; }
    .trade-columns { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .left-panel { display: none !important; }
    .right-panel { width: 100vw; border-radius: 0; }
    .top-bar { min-width: auto; }
    .bottom-bar { flex-wrap: wrap; }
    .btn-action { font-size: 0.75rem; padding: 6px 10px; }
}

/* ============================================================
   Save Slot Picker
   ============================================================ */

.save-slots-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}

.save-slot-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border: 1px solid #30363d;
    border-radius: 6px;
    background: rgba(22, 27, 34, 0.7);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    position: relative;
}

.save-slot-row:hover {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.08);
}

.save-slot-highlighted {
    border-color: #d4af37;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
}

.save-slot-disabled {
    opacity: 0.65;
    cursor: default;
}

.save-slot-disabled .save-slot-import {
    pointer-events: auto;
    cursor: pointer;
}

.save-slot-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-slot-num {
    font-family: 'Cinzel', serif;
    color: #d4af37;
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 28px;
}

.save-slot-name {
    font-family: 'MedievalSharp', cursive;
    color: #e6edf3;
    font-size: 1rem;
}

.save-slot-empty {
    font-family: 'MedievalSharp', cursive;
    color: #484f58;
    font-style: italic;
    font-size: 0.95rem;
    margin-left: 36px;
}

.save-slot-details {
    font-size: 0.82rem;
    color: #8b949e;
    margin-left: 36px;
}

.save-slot-meta {
    font-size: 0.78rem;
    color: #6e7681;
    margin-left: 36px;
}

.save-slot-delete {
    font-size: 0.8rem;
    padding: 4px 8px;
    background: rgba(200, 50, 50, 0.15);
    border: 1px solid #6e3030;
    border-radius: 4px;
    color: #e06060;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s, border-color 0.2s;
}

.save-slot-delete:hover {
    background: rgba(200, 50, 50, 0.35);
    border-color: #e06060;
}

.save-slot-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    z-index: 2;
}

.save-slot-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.save-slot-download,
.save-slot-import {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: rgba(55, 120, 200, 0.15);
    border: 1px solid #3a5a8a;
    border-radius: 4px;
    color: #7ab0e0;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.save-slot-download:hover,
.save-slot-import:hover {
    background: rgba(55, 120, 200, 0.35);
    border-color: #7ab0e0;
}

.save-slot-disabled .save-slot-import {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* ============================================================
   Tutorial Button (title screen)
   ============================================================ */

.btn-tutorial {
    background: linear-gradient(180deg, #6a9a6a 0%, #4a7a4a 100%) !important;
    border-color: #5a8a5a !important;
    color: #111 !important;
}

.btn-tutorial:hover {
    background: linear-gradient(180deg, #7ab47a 0%, #5a9a5a 100%) !important;
    border-color: #7ab47a !important;
    color: #000 !important;
}

/* ============================================================
   Tutorial Panel & Highlight System
   ============================================================ */

.tutorial-panel {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 620px;
    max-width: 92vw;
    background: rgba(13, 17, 23, 0.96);
    border: 2px solid #d4af37;
    border-radius: 8px;
    padding: 20px 24px 16px;
    z-index: 10000;
    color: #c9d1d9;
    font-family: 'MedievalSharp', cursive;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.2), 0 8px 32px rgba(0,0,0,0.6);
}

.tutorial-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    cursor: grab;
}

.tutorial-chapter-title {
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
}

.tutorial-btn-skip {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.8rem;
    color: #8b949e;
    background: transparent;
    border: 1px solid #30363d;
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.tutorial-btn-skip:hover {
    color: #e06060;
    border-color: #e06060;
}

.tutorial-step-text {
    font-size: 1.05rem;
    line-height: 1.65;
    margin-bottom: 14px;
    color: #e6edf3;
}

.tutorial-panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-progress {
    font-size: 0.78rem;
    color: #6e7681;
    font-family: 'Cinzel', serif;
}

.tutorial-btn-next {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.95rem;
    color: #0d1117;
    background: linear-gradient(180deg, #d4af37 0%, #b8962e 100%);
    border: 1px solid #d4af37;
    border-radius: 4px;
    padding: 6px 20px;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s, box-shadow 0.2s;
}

.tutorial-btn-next:hover {
    background: linear-gradient(180deg, #e6c54a 0%, #d4af37 100%);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.tutorial-highlight {
    animation: tutorial-pulse 1.5s ease-in-out infinite !important;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6) !important;
    border-color: #d4af37 !important;
    position: relative;
    z-index: 9999;
}

@keyframes tutorial-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(212, 175, 55, 0.3); }
    50% { box-shadow: 0 0 25px rgba(212, 175, 55, 0.8); }
}

.tutorial-part-label {
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 10px;
    white-space: nowrap;
}

.tutorial-step-title {
    color: #e6c54a;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.tutorial-footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tutorial-btn-back {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #8b949e;
    background: transparent;
    border: 1px solid #30363d;
    border-radius: 4px;
    padding: 4px 12px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.tutorial-btn-back:hover {
    color: #d4af37;
    border-color: #d4af37;
}

.tutorial-transition-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.tutorial-btn-newgame {
    font-family: 'MedievalSharp', cursive;
    font-size: 1rem;
    color: #e6edf3;
    background: linear-gradient(180deg, #2a5a2a 0%, #1a3a1a 100%);
    border: 2px solid #5a8a5a;
    border-radius: 6px;
    padding: 10px 24px;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.tutorial-btn-newgame:hover {
    background: linear-gradient(180deg, #3a7a3a 0%, #2a5a2a 100%);
    border-color: #7ab47a;
    box-shadow: 0 0 12px rgba(90, 138, 90, 0.4);
}

.tutorial-btn-continue {
    font-family: 'MedievalSharp', cursive;
    font-size: 1rem;
    color: #0d1117;
    background: linear-gradient(180deg, #d4af37 0%, #b8962e 100%);
    border: 2px solid #d4af37;
    border-radius: 6px;
    padding: 10px 24px;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s, box-shadow 0.2s;
}

.tutorial-btn-continue:hover {
    background: linear-gradient(180deg, #e6c54a 0%, #d4af37 100%);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

/* ============================================================
   XP Bar
   ============================================================ */

.xp-bar-container {
    position: relative;
    width: 100%;
    height: 14px;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--gold-dark, #8b6914);
    border-radius: 7px;
    overflow: hidden;
    margin: 4px 0;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b6914, #d4af37, #f0d060);
    border-radius: 6px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.xp-bar-label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-family: 'Cinzel', serif;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    pointer-events: none;
}

.xp-bar-detail {
    font-size: 0.75rem;
    color: var(--parchment-dark, #b5a88a);
    text-align: center;
    margin-top: 2px;
}

/* ============================================================
   Hunger Bar
   ============================================================ */

.hunger-meter {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    overflow: hidden;
    height: 10px;
}

.hunger-meter .meter-fill {
    transition: width 0.5s ease, background 0.3s ease;
}

/* ============================================================
   Skill Tree
   ============================================================ */

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(212,175,55,0.1);
    border: 1px solid var(--gold-dark, #8b6914);
    border-radius: 6px;
}

.skill-sp-display {
    color: var(--gold, #d4af37);
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
}

.skill-level-display {
    color: var(--parchment-dark, #b5a88a);
    font-size: 0.8rem;
}

.skill-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--panel-border, #5a4d3a);
}

.skill-tab {
    padding: 6px 10px;
    font-size: 0.72rem;
    font-family: 'Cinzel', serif;
    background: rgba(0,0,0,0.2);
    border: none;
    color: var(--parchment, #e8dcc4);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.skill-tab:hover {
    background: rgba(212,175,55,0.15);
}

.skill-tab.active {
    background: rgba(212,175,55,0.2);
    color: var(--gold, #d4af37);
}

.skill-tab-count {
    font-size: 0.7rem;
    opacity: 0.7;
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.skill-node {
    padding: 10px;
    border-radius: 6px;
    border: 2px solid var(--panel-border, #5a4d3a);
    background: rgba(0,0,0,0.2);
    transition: border-color 0.2s, background 0.2s;
}

.skill-node.skill-unlocked {
    border-color: var(--gold, #d4af37);
    background: rgba(212,175,55,0.12);
}

.skill-node.skill-available {
    border-color: #55a868;
    background: rgba(85,168,104,0.1);
    cursor: pointer;
}

.skill-node.skill-available:hover {
    background: rgba(85,168,104,0.2);
    border-color: #7bc98a;
}

.skill-node.skill-locked {
    opacity: 0.55;
}

.skill-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.skill-name {
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    color: var(--parchment, #e8dcc4);
    font-weight: 600;
    margin-bottom: 2px;
}

.skill-cost {
    font-size: 0.75rem;
    color: var(--gold, #d4af37);
    margin-bottom: 4px;
}

.skill-desc {
    font-size: 0.7rem;
    color: var(--parchment-dark, #b5a88a);
    line-height: 1.3;
}

.skill-requires {
    font-size: 0.7rem;
    color: #c44e52;
    margin-top: 4px;
    font-style: italic;
}

.skill-learn-btn {
    margin-top: 6px;
    width: 100%;
    font-size: 0.72rem;
    padding: 4px 8px;
}

/* ============================================================
   Achievements
   ============================================================ */

.ach-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(212,175,55,0.1);
    border: 1px solid var(--gold-dark, #8b6914);
    border-radius: 6px;
}

.ach-progress {
    color: var(--gold, #d4af37);
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
}

.ach-xp-total {
    color: var(--parchment-dark, #b5a88a);
    font-size: 0.8rem;
}

.achievement-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}

.achievement-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--panel-border, #5a4d3a);
    background: rgba(0,0,0,0.15);
    transition: background 0.2s;
}

.achievement-card.ach-unlocked {
    border-color: var(--gold, #d4af37);
    background: rgba(212,175,55,0.08);
}

.achievement-card.ach-locked {
    opacity: 0.6;
}

.ach-icon {
    font-size: 1.4rem;
    min-width: 32px;
    text-align: center;
}

.ach-info {
    flex: 1;
}

.ach-name {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: var(--parchment, #e8dcc4);
    font-weight: 600;
}

.ach-desc {
    font-size: 0.7rem;
    color: var(--parchment-dark, #b5a88a);
    line-height: 1.3;
}

.ach-xp {
    font-size: 0.7rem;
    color: var(--gold, #d4af37);
    margin-top: 2px;
}

/* ============================================================
   Market Intel Section (Trade Dialog)
   ============================================================ */

.market-intel-section {
    margin-top: 12px;
    padding: 10px;
    border-top: 1px solid var(--panel-border, #5a4d3a);
    background: rgba(0,0,0,0.1);
    border-radius: 6px;
}

.market-intel-section h4 {
    margin: 0 0 8px 0;
    font-family: 'Cinzel', serif;
    color: var(--gold, #d4af37);
    font-size: 0.85rem;
}

.intel-table {
    overflow-x: auto;
}

.intel-prices {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
}

.intel-prices th {
    text-align: left;
    padding: 4px 6px;
    color: var(--gold, #d4af37);
    border-bottom: 1px solid var(--panel-border, #5a4d3a);
    font-family: 'Cinzel', serif;
    font-weight: 600;
}

.intel-prices td {
    padding: 4px 6px;
    color: var(--parchment, #e8dcc4);
    border-bottom: 1px solid rgba(90,77,58,0.3);
}

.intel-prices .good-deal {
    color: #55a868;
    font-weight: 600;
}

.intel-prices tr:hover {
    background: rgba(90, 69, 48, 0.2);
}

/* Toast for achievements */
.toast-achievement {
    background: linear-gradient(135deg, rgba(40,35,25,0.96), rgba(60,50,30,0.96));
    border-left: 4px solid var(--gold, #d4af37);
    color: var(--gold, #d4af37);
}


/* ============================================================
   Kingdom & Town Selection Screen
   ============================================================ */
#kingdomSelectScreen {
    z-index: 1200;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
}

.kingdom-select-content {
    max-width: 1400px;
    width: 100%;
    padding: 20px;
}

.kingdom-select-title {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    color: var(--gold, #d4af37);
    text-align: center;
    margin-bottom: 4px;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.8);
}

.kingdom-select-subtitle {
    font-family: 'MedievalSharp', cursive;
    font-size: 1rem;
    color: var(--parchment, #e8d5b7);
    text-align: center;
    margin-bottom: 24px;
    opacity: 0.8;
}

.kingdom-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.kingdom-card {
    background: linear-gradient(180deg, rgba(40,35,25,0.95), rgba(30,25,18,0.98));
    border: 2px solid #555;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.kingdom-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

.kingdom-card-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kingdom-card-name {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kingdom-card-badge {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.85);
    text-transform: capitalize;
    background: rgba(0,0,0,0.3);
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.kingdom-card-body {
    padding: 12px 16px;
    flex: 1;
}

.kingdom-detail-row {
    font-size: 0.85rem;
    color: var(--parchment, #e8d5b7);
    margin-bottom: 6px;
    line-height: 1.4;
}

.detail-label {
    font-weight: 600;
    color: var(--gold, #d4af37);
}

.kingdom-flavor {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: var(--parchment-dark, #c4a882);
    font-style: italic;
    margin: 8px 0;
    padding: 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    border-left: 3px solid var(--gold, #d4af37);
}

.kingdom-rel {
    display: inline-block;
    font-size: 0.75rem;
    padding: 1px 5px;
    border-radius: 3px;
    margin: 1px;
}
.rel-peace { background: rgba(85,168,104,0.2); color: #55a868; }
.rel-war { background: rgba(196,78,82,0.2); color: #c44e52; }
.rel-alliance { background: rgba(76,114,176,0.2); color: #4c72b0; }
.rel-tense { background: rgba(204,185,116,0.2); color: #ccb974; }

.law-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 6px;
    background: rgba(212,175,55,0.15);
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: 3px;
    margin: 1px;
    color: var(--gold, #d4af37);
}

.btn-kingdom-select {
    display: block;
    width: calc(100% - 32px);
    margin: auto 16px 16px;
    text-align: center;
}

/* Town Selection */
.town-selection-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-back, .btn-random-town {
    font-size: 0.9rem;
    padding: 8px 16px;
}

.town-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.town-card {
    background: linear-gradient(180deg, rgba(40,35,25,0.95), rgba(30,25,18,0.98));
    border: 2px solid rgba(212,175,55,0.3);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.town-card-header {
    padding: 10px 14px;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.town-card-name {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--gold, #d4af37);
}

.town-port-badge {
    font-size: 0.75rem;
    background: rgba(76,114,176,0.3);
    color: #7db3e8;
    padding: 2px 6px;
    border-radius: 3px;
}

.town-island-badge {
    font-size: 0.75rem;
    background: rgba(196,78,82,0.3);
    color: #e88;
    padding: 2px 6px;
    border-radius: 3px;
}

.town-diff-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: auto;
}
.diff-easy { background: rgba(85,168,104,0.3); color: #55a868; }
.diff-medium { background: rgba(204,185,116,0.3); color: #ccb974; }
.diff-hard { background: rgba(196,78,82,0.3); color: #e88; }

.town-card-body {
    padding: 10px 14px;
    flex: 1;
}

.town-detail-row {
    font-size: 0.8rem;
    color: var(--parchment, #e8d5b7);
    margin-bottom: 4px;
}

.btn-town-select {
    display: block;
    width: calc(100% - 28px);
    margin: 10px 14px 14px;
    text-align: center;
    font-size: 0.85rem;
}

/* ============================================================
   Leaderboard
   ============================================================ */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.leaderboard-table th {
    background: rgba(212,175,55,0.15);
    color: var(--gold, #d4af37);
    padding: 8px 10px;
    text-align: left;
    border-bottom: 2px solid var(--gold, #d4af37);
    font-family: 'Cinzel', serif;
}

.leaderboard-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: var(--parchment, #e8d5b7);
}

.leaderboard-player {
    background: rgba(212,175,55,0.12) !important;
}

.leaderboard-player td {
    color: var(--gold, #d4af37);
    font-weight: 600;
}

.kingdom-color-badge {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 4px;
}

/* ============================================================
   Work & Street Trading Dialogs
   ============================================================ */
.work-intro, .street-intro {
    font-size: 0.85rem;
    color: var(--parchment-dark, #c4a882);
    margin-bottom: 12px;
    font-style: italic;
}

.job-list, .street-trade-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.job-item, .street-trade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 6px;
}

.job-info, .street-trade-info {
    flex: 1;
}

.job-name, .street-npc-name {
    font-weight: 600;
    color: var(--parchment, #e8d5b7);
    display: block;
}

.job-details {
    font-size: 0.8rem;
    color: var(--parchment-dark, #c4a882);
}

.btn-work, .btn-street-sell {
    padding: 6px 14px;
    font-size: 0.8rem;
    margin-left: 10px;
}

.street-trade-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.street-price {
    color: var(--gold, #d4af37);
    font-weight: 600;
}

.street-market-price {
    font-size: 0.75rem;
    color: var(--parchment-dark, #c4a882);
}

.street-have {
    font-size: 0.75rem;
    color: var(--parchment-dark, #c4a882);
}

.btn-street-sell:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================================
   Pause Indicator
   ============================================================ */

.pause-indicator {
    position: fixed;
    top: 54px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold-bright);
    background: rgba(20, 15, 8, 0.85);
    border: 2px solid var(--gold-dark);
    border-radius: 6px;
    padding: 8px 28px;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(196, 163, 90, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: pausePulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pausePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ============================================================
   Button Group Dividers (Bottom Bar)
   ============================================================ */

.btn-group {
    display: flex;
    gap: 4px;
}

.btn-group-divider {
    width: 1px;
    align-self: stretch;
    margin: 2px 6px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        var(--gold-dark) 30%,
        var(--gold-dark) 70%,
        transparent 100%
    );
    opacity: 0.5;
}

.btn-action-schemes {
    border-color: rgba(196, 78, 82, 0.4);
}

.btn-action-schemes:hover {
    border-color: var(--danger);
    color: var(--blood-red-light);
    background: rgba(196, 78, 82, 0.15);
}

.btn-action-help {
    opacity: 0.75;
    font-size: 0.8rem;
}

.btn-action-help:hover {
    opacity: 1;
}

/* ============================================================
   Tax Details Accordion (Trade Dialog)
   ============================================================ */

.tax-details-accordion {
    margin-bottom: 10px;
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    background: rgba(42, 31, 20, 0.3);
}

.tax-details-summary {
    cursor: pointer;
    padding: 6px 10px;
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--gold);
    letter-spacing: 0.5px;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.tax-details-summary::-webkit-details-marker {
    display: none;
}

.tax-details-summary::before {
    content: '▶';
    font-size: 0.7rem;
    color: var(--text-dim);
    transition: transform 0.2s ease;
    display: inline-block;
}

.tax-details-accordion[open] .tax-details-summary::before {
    transform: rotate(90deg);
}

.tax-details-summary:hover {
    color: var(--gold-bright);
}

.tax-details-body {
    padding: 6px 10px 8px;
    border-top: 1px solid var(--panel-border);
}

/* ============================================================
   Help Dialog
   ============================================================ */

.help-section {
    margin-bottom: 16px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-heading {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--gold);
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--panel-border);
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.help-table tr {
    border-bottom: 1px solid rgba(90, 69, 48, 0.2);
}

.help-table td {
    padding: 4px 8px;
    vertical-align: top;
}

.help-key {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--gold);
    white-space: nowrap;
    min-width: 140px;
    font-weight: 600;
}

.help-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-list li {
    padding: 4px 0 4px 16px;
    font-size: 0.82rem;
    position: relative;
    line-height: 1.4;
    color: var(--parchment-dark);
}

.help-list li::before {
    content: '⚜';
    position: absolute;
    left: 0;
    color: var(--gold-dark);
    font-size: 0.7rem;
    top: 6px;
}

.help-list li strong {
    color: var(--parchment);
}

/* ============================================================
   UI/UX Improvements — Enhanced readability & data presentation
   ============================================================ */

/* Wider modal on large screens for data-heavy dialogs */
@media (min-width: 900px) {
    .modal-dialog {
        max-width: 820px;
    }
}

/* Town detail section headers — bolder with icon alignment */
.detail-section h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

/* Improved line-height for dense info sections */
.detail-row {
    line-height: 1.5;
}

/* Clickable detail rows get hover state */
.detail-row[onclick],
.detail-row[style*="cursor:pointer"],
.detail-row.clickable {
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 4px;
    margin-left: -4px;
    margin-right: -4px;
    transition: background 0.15s ease;
}

.detail-row[onclick]:hover,
.detail-row[style*="cursor:pointer"]:hover,
.detail-row.clickable:hover {
    background: rgba(90, 69, 48, 0.25);
}

/* Building management cards — improved readability */
.build-card .build-info {
    line-height: 1.5;
}

/* Speed control labels — ensure readable at all sizes */
.btn-speed {
    min-width: 32px;
    min-height: 28px;
}

/* Toll road badge in town detail */
.toll-route-badge {
    display: inline-block;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--gold, #d4af37);
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 4px;
}

/* Destroyed town indicator in town detail */
.town-status-destroyed {
    color: #c44e52;
    font-weight: 600;
}

.town-status-struggling {
    color: #ccb974;
}

/* ═══════════════════════════════════════════════════════════
   GAME START SCENARIO SELECTION
   ═══════════════════════════════════════════════════════════ */
.start-scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 4px;
}
.start-scenario-card {
    background: linear-gradient(180deg, rgba(40,35,25,0.95), rgba(30,25,18,0.98));
    border: 2px solid rgba(212,175,55,0.3);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
}
.start-scenario-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(212,175,55,0.2);
}
.start-scenario-card.start-selected {
    border: 3px solid #FFD700;
    box-shadow: 0 0 16px rgba(255,215,0,0.4);
}
.start-scenario-header {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
}
.start-icon { font-size: 1.4rem; }
.start-name { font-size: 1rem; }
.start-scenario-body { padding: 8px 12px; flex: 1; }
.start-diff-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 3px;
    color: #fff;
    margin-bottom: 6px;
}
.start-description {
    font-size: 0.8rem;
    color: var(--parchment, #e8d5b7);
    margin: 6px 0;
    line-height: 1.4;
}
.start-details {
    font-size: 0.75rem;
    color: #aaa;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.start-unique-warning {
    font-size: 0.7rem;
    color: #ffaa55;
    margin-top: 6px;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════
   SPECIAL START STATUS INDICATOR
   ═══════════════════════════════════════════════════════════ */
.special-start-indicator {
    cursor: pointer;
    background: rgba(40,35,25,0.9);
    border: 1px solid rgba(212,175,55,0.4);
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 0.75rem;
    color: #e8d5b7;
    white-space: nowrap;
    transition: background 0.2s;
}
.special-start-indicator:hover {
    background: rgba(60,50,35,0.95);
    border-color: #d4af37;
}
.special-status-header {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #d4af37;
    text-align: center;
    margin-bottom: 8px;
}
.special-status-info {
    text-align: center;
    color: #e8d5b7;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════
   FAMILY PANEL
   ═══════════════════════════════════════════════════════════ */
.family-panel { max-height: 60vh; overflow-y: auto; }
.family-member-card {
    background: rgba(40,35,25,0.9);
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
}
.family-member-header {
    padding: 6px 10px;
    background: rgba(0,0,0,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Cinzel', serif;
    color: #d4af37;
    font-size: 0.95rem;
}
.family-role-badge {
    font-size: 0.7rem;
    background: rgba(212,175,55,0.2);
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: capitalize;
}
.family-member-body {
    padding: 8px 10px;
    font-size: 0.8rem;
    color: #e8d5b7;
}
.family-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.family-actions .btn-small {
    font-size: 0.7rem;
    padding: 3px 6px;
}

/* Travel HUD Panel */
.travel-panel {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    max-width: 90vw;
    background: rgba(30, 25, 20, 0.95);
    border: 1px solid rgba(201, 169, 110, 0.4);
    border-radius: 8px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.travel-panel-header {
    cursor: grab;
}

.travel-panel .btn-travel {
    font-size: 0.75rem;
    padding: 3px 8px;
    border: 1px solid rgba(201, 169, 110, 0.3);
    background: rgba(201, 169, 110, 0.1);
    color: var(--text-light, #e8dcc8);
    border-radius: 4px;
    cursor: pointer;
}
.travel-panel .btn-travel:hover {
    background: rgba(201, 169, 110, 0.25);
}

/* God Mode Panel Scrollbar */
#god-mode-panel { scrollbar-width: thin; scrollbar-color: #FFD700 #1a1a2e; }
#god-mode-panel::-webkit-scrollbar { width: 6px; }
#god-mode-panel::-webkit-scrollbar-thumb { background: #FFD700; border-radius: 3px; }
#god-mode-panel::-webkit-scrollbar-track { background: #1a1a2e; }
