﻿:root {
    --stats-bar-h: 44px;
    --color-bg: #0d0b07;
    --color-bg-warm: #110e08;
    --color-gold: #d4af37;
    --color-gold-dim: #c0a062;
    --color-cream: #f5e6c8;
    --color-aged-cream: #e8d5b0;
    --color-burgundy: #4a0e0e;
    --color-blood: #8b0000;
    --color-olive: #3a3a2a;
    --color-btn-bg-top: #201c14;
    --color-btn-bg-bottom: #12100a;
    --color-btn-hover-top: #2a2518;
    --color-btn-hover-bottom: #1a1610;
    --color-panel-bg: rgba(18, 16, 10, 0.7);
    --color-panel-border: #333;
    --color-statsbar-top: #1a1508;
    --color-statsbar-bottom: #0a0804;
    --color-section-accent: rgba(74, 14, 14, 0.4);
    --font-heading: 'Playfair Display SC', 'Playfair Display', 'Georgia', serif;
    --font-body: 'Libre Baskerville', 'Georgia', 'Times New Roman', serif;
    --font-typewriter: 'Special Elite', 'Courier New', monospace;
    --font-display: 'Playfair Display', 'Georgia', serif;
}

/* ===== Font Style Overrides ===== */
html[data-font="typewriter"] {
    --font-body: 'Special Elite', 'Courier New', monospace;
    --font-heading: 'Special Elite', 'Courier New', monospace;
    --font-display: 'Special Elite', 'Courier New', monospace;
}
html[data-font="elegant"] {
    --font-body: 'Lora', 'Georgia', serif;
    --font-heading: 'Playfair Display SC', 'Georgia', serif;
    --font-display: 'Playfair Display', 'Georgia', serif;
}
html[data-font="clean"] {
    --font-body: 'Inter', 'Segoe UI', sans-serif;
    --font-heading: 'Inter', 'Segoe UI', sans-serif;
    --font-display: 'Inter', 'Segoe UI', sans-serif;
}

/* ===== Font Size Overrides ===== */
html[data-fontsize="small"]  { font-size: 14px; }
html[data-fontsize="medium"] { font-size: 16px; }
html[data-fontsize="large"]  { font-size: 18px; }
html[data-fontsize="xlarge"] { font-size: 20px; }

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-cream);
    text-align: center;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    transition: background 0.5s ease-in-out;
    overflow-x: hidden;
}

/* Vintage paper noise texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* Sepia vignette overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(10, 8, 4, 0.6) 100%);
}

/* Loading Screen Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes toastFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

@keyframes ornamentPulse {
    0%, 100% { opacity: 0.3; transform: rotate(45deg) scale(0.8); }
    50% { opacity: 1; transform: rotate(45deg) scale(1.2); }
}

#loading-screen {
    animation: fadeIn 0.5s ease-in-out;
    background: #000;
}

#loading-screen h2 {
    animation: fadeIn 1s ease-in-out 0.3s both;
    color: var(--color-gold);
    font-family: var(--font-heading);
    letter-spacing: 6px;
}

#loading-screen p {
    animation: fadeIn 1s ease-in-out 0.6s both;
    color: #8a7a5a;
}

/* Seasonal Background Classes - Vintage/Faded */
body.season-spring {
    background: linear-gradient(135deg, #141a0e 0%, #0d0b07 100%);
}

body.season-summer {
    background: linear-gradient(135deg, #1a1208 0%, #0d0b07 100%);
}

body.season-autumn {
    background: linear-gradient(135deg, #1a150a 0%, #0d0b07 100%);
}

body.season-winter {
    background: linear-gradient(135deg, #0e1118 0%, #0d0b07 100%);
}

#game {
    /* Container for intro and special screens only - main game screens now use full-page layouts */
    width: 90%;
    max-width: 800px;
    margin: auto;
}

#stats-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to bottom, var(--color-statsbar-top), var(--color-statsbar-bottom));
    color: var(--color-gold);
    padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    border-bottom: 2px solid var(--color-gold);
    box-shadow: 0 2px 10px rgba(0,0,0,0.8);
    box-sizing: border-box;
    min-height: 44px;
    font-family: var(--font-typewriter);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

#player-portrait {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-gold-dim);
    box-shadow: 0 0 8px rgba(192, 160, 98, 0.4);
    flex-shrink: 0;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    filter: sepia(25%) contrast(1.1) brightness(0.95);
}

.player-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#player-name-display {
    font-weight: bold;
    font-size: 12px;
    color: var(--color-cream);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#stats-bar p {
    margin: 0;
    padding: 2px 6px;
    background: rgba(0,0,0,0.3);
    border-radius: 2px;
    font-weight: bold;
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dirty money uses the same base pill styling as other stats; no extra highlight needed. */

.stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
    align-items: center;
}

.stats-primary {
    display: contents;
}

.stats-secondary {
    display: contents;
}

/* Season display styling */
#season-display {
    font-weight: bold;
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Larger screen optimization */
@media (min-width: 1200px) {
    #stats-bar {
        padding: 10px 15px;
    }
    
    #stats-bar p {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* ── Simplified Main Hub ── */
.main-hub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 30px 20px;
    max-width: 700px;
    margin: 0 auto;
}

.hub-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    border: 2px solid var(--color-gold);
    border-radius: 2px;
    background: linear-gradient(145deg, rgba(26, 22, 14, 0.95), rgba(13, 11, 7, 0.98));
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 160px;
    box-shadow: inset 0 1px 0 rgba(212, 175, 55, 0.1), 0 2px 8px rgba(0,0,0,0.5);
}
.hub-btn:hover {
    box-shadow: inset 0 1px 0 rgba(212, 175, 55, 0.2), 0 4px 20px rgba(212, 175, 55, 0.2);
    border-color: #f1c40f;
    background: linear-gradient(145deg, rgba(30, 26, 16, 0.98), rgba(16, 14, 8, 0.99));
}
.hub-btn:active {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

.hub-icon {
    font-size: 2.8em;
    margin-bottom: 10px;
    display: block;
}
.hub-label {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--color-cream);
    letter-spacing: 2px;
    display: block;
    font-family: var(--font-heading);
    text-transform: uppercase;
}
.hub-desc {
    font-size: 0.8em;
    color: #8a7a5a;
    margin-top: 6px;
    display: block;
    font-family: var(--font-body);
}

/* Accent borders per button — period-appropriate muted palette */
.hub-jobs  { border-left: 5px solid #6b7c4a; } /* muted olive */
.hub-ops   { border-left: 5px solid var(--color-burgundy); } /* deep burgundy */
.hub-motor { border-left: 5px solid #4a3a2a; } /* leather brown */
.hub-cmd   { border-left: 5px solid var(--color-gold-dim); } /* aged gold */

@media (max-width: 500px) {
    .main-hub-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 20px 12px;
    }
    .hub-btn { min-height: 120px; padding: 20px 14px; }
    .hub-icon { font-size: 2.2em; }
}

/* ── Full SafeHouse Grid ── */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    overflow-x: hidden;
}

/* Custom scrollbar for menu */
.menu-grid::-webkit-scrollbar {
    width: 12px;
}

.menu-grid::-webkit-scrollbar-track {
    background: #14120a;
    border-radius: 2px;
    border: 1px solid #333;
}

.menu-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8b0000, #500000); /* Blood red gradient */
    border-radius: 2px;
    border: 1px solid #d4af37; /* Gold border */
}

.menu-grid::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a00000, #600000);
}

button {
    margin: 5px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    background: linear-gradient(to bottom, var(--color-btn-bg-top), var(--color-btn-bg-bottom));
    color: var(--color-gold);
    border: 1px solid var(--color-gold);
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 0 rgba(212, 175, 55, 0.08);
    min-height: 50px;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 1px 1px 0 #000;
    position: relative;
}

/* Double-border inset frame effect */
button::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: inherit;
    pointer-events: none;
}

button:hover {
    background: linear-gradient(to bottom, var(--color-btn-hover-top), var(--color-btn-hover-bottom));
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15), inset 0 1px 0 rgba(212, 175, 55, 0.15);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.3), 1px 1px 0 #000;
}

button:active {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

button:disabled {
    background: #1a1a14;
    color: #555;
    border-color: #444;
    cursor: not-allowed;
    box-shadow: none;
    text-shadow: none;
}

button:disabled::after {
    border-color: rgba(100, 100, 100, 0.08);
}

/* ==================== COMMAND CENTER PROGRESSIVE UNLOCK STYLES ==================== */

/* Unlocked menu button with tooltip subtitle */
.menu-btn-unlocked {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 12px;
    min-height: 68px;
    text-transform: uppercase;
}

.menu-btn-unlocked .menu-btn-label {
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #d4af37;
}

.menu-btn-unlocked .menu-btn-tip {
    font-size: 10px;
    font-weight: normal;
    color: #8a7a5a;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.2;
    opacity: 0.85;
}

.menu-btn-unlocked:hover .menu-btn-tip {
    color: #bdc3c7;
    opacity: 1;
}

/* Locked menu button */
.menu-btn-locked {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 12px;
    min-height: 68px;
    background: linear-gradient(to bottom, #1a1a1a, #111) !important;
    border-color: #444 !important;
    opacity: 0.5;
    cursor: not-allowed !important;
    text-transform: uppercase;
}

.menu-btn-locked .menu-btn-label {
    font-size: 14px;
    font-weight: bold;
    color: #666;
    letter-spacing: 1px;
}

.menu-btn-locked .menu-btn-tip {
    font-size: 10px;
    font-weight: normal;
    color: #555;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.2;
}

/* Locked section header */
.menu-locked-section {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 5px;
    padding-top: 15px;
    border-top: 1px solid rgba(102, 102, 102, 0.3);
}

.menu-locked-header {
    grid-column: 1 / -1;
    text-align: center;
    color: #7f8c8d;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: var(--font-display);
    padding-bottom: 5px;
}

/* Remaining locked count */
.menu-locked-remaining {
    grid-column: 1 / -1;
    text-align: center;
    color: #555;
    font-size: 12px;
    font-style: italic;
    padding: 10px 0 5px;
    font-family: var(--font-display);
}

/* Unlock toast animation */
@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#unlock-toast > div {
    transition: opacity 0.5s ease-out;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.skill {
    background: rgba(15, 13, 8, 0.9);
    padding: 20px;
    border-radius: 2px;
    border: 1px solid var(--color-gold);
    transition: box-shadow 0.3s ease;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.skill:hover {
    border-color: var(--color-cream);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2), inset 0 0 20px rgba(0,0,0,0.8);
}

.skill h3 {
    color: #d4af37;
    margin-top: 0;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
}

.achievements-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.achievement {
    padding: 15px;
    border-radius: 2px;
    border: 1px solid #444;
    transition: all 0.3s ease;
    background: #0f0d08;
}

.achievement.unlocked {
    background: linear-gradient(135deg, #1a2f1a 0%, #0f1f0f 100%);
    border-color: #8a9a6a;
    color: #8a9a6a;
}

.achievement.locked {
    background: #14120a;
    border-color: #444;
    color: #666;
}

.achievement h3 {
    margin-top: 0;
    font-size: 1.2em;
}

.alert-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #14120a;
    color: var(--color-gold);
    padding: 20px 30px;
    border-radius: 2px;
    border: 2px solid var(--color-gold);
    box-shadow: 0 0 50px rgba(0,0,0,0.9);
    z-index: 2000;
    max-width: 400px;
    text-align: center;
    font-weight: bold;
    animation: alertSlideIn 0.3s ease-out;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.alert-box.red-alert {
    background: #1a0000;
    border-color: #ff0000;
    color: #ff0000;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Special full-width screens that should not have side panel padding */
#intro-screen,
#character-creation-screen,
#death-screen {
    padding: 20px !important;
}

.game-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--color-bg);
    overflow-y: auto;
    padding: calc(var(--stats-bar-h) + 96px) 260px 40px 290px;
    box-sizing: border-box;
    z-index: 5;
    scrollbar-width: thin;
    scrollbar-color: var(--color-gold) #1a1508;
}

/* For screens without side panels (like intro, character creation) */
.game-screen.full-width {
    padding: calc(var(--stats-bar-h) + 96px) 20px 20px 20px;
}

/* Page Header - Always visible at top of each screen */
.page-header {
    position: fixed;
    top: var(--stats-bar-h);
    left: 290px;
    right: 260px;
    background: linear-gradient(to bottom, #1a1508 0%, var(--color-bg) 100%);
    border-bottom: 1px solid var(--color-gold);
    padding: 12px 30px;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
    overflow: visible;
}

/* Art Deco ornamental divider below page header */
.page-header::after {
    content: '\25C6 \2022 \25C6';
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-gold);
    font-size: 10px;
    letter-spacing: 4px;
    background: var(--color-bg);
    padding: 0 16px;
    white-space: nowrap;
}

.page-header h1 {
    margin: 0;
    padding: 0;
    color: var(--color-gold);
    font-size: 1.8em;
    text-transform: uppercase;
    letter-spacing: 4px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: var(--font-heading);
}

.page-header h1 .icon {
    font-size: 1.2em;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.85em;
    color: #888;
    flex-wrap: wrap;
    overflow: visible;
    white-space: normal;
}

.breadcrumb a {
    color: #d4af37;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--color-cream);
    text-decoration: underline;
}

.breadcrumb .separator {
    color: #555;
}

.breadcrumb .current {
    color: var(--color-cream);
    font-weight: bold;
}

/* Section Headers within pages */
.section-header {
    background: linear-gradient(to right, var(--color-section-accent) 0%, transparent 100%);
    border-left: 4px solid var(--color-gold);
    padding: 12px 20px;
    margin: 30px 0 20px 0;
    color: var(--color-gold);
    font-size: 1.3em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-family: var(--font-heading);
}

.section-divider {
    height: 1px;
    background: linear-gradient(to right, var(--color-gold) 0%, transparent 100%);
    margin: 20px 0;
    position: relative;
}

.section-divider::before {
    content: '?';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-gold);
    font-size: 8px;
    background: var(--color-bg);
    padding-right: 8px;
}

/* Page Navigation Buttons */
.page-nav {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.nav-btn-back {
    background: linear-gradient(to bottom, var(--color-btn-bg-top), var(--color-btn-bg-bottom));
    color: var(--color-gold);
    border: 2px solid var(--color-gold);
    padding: 12px 25px;
    font-size: 1em;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: var(--font-heading);
    text-shadow: 1px 1px 0 #000;
}

.nav-btn-back:hover {
    background: linear-gradient(to bottom, var(--color-btn-hover-top), var(--color-btn-hover-bottom));
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

/* Content Cards for better organization */
.content-card {
    background: var(--color-panel-bg);
    border: 1px solid var(--color-panel-border);
    border-radius: 2px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 0 30px rgba(0,0,0,0.2);
}

.content-card h3 {
    color: var(--color-gold);
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
    font-family: var(--font-heading);
    letter-spacing: 2px;
}

/* Custom scrollbars for webkit browsers */
.game-screen::-webkit-scrollbar,
#stolen-cars-content::-webkit-scrollbar {
    width: 8px;
}

.game-screen::-webkit-scrollbar-track,
#stolen-cars-content::-webkit-scrollbar-track {
    background: #14120a;
    border-radius: 2px;
}

.game-screen::-webkit-scrollbar-thumb,
#stolen-cars-content::-webkit-scrollbar-thumb {
    background: #d4af37;
    border-radius: 2px;
}

.game-screen::-webkit-scrollbar-thumb:hover,
#stolen-cars-content::-webkit-scrollbar-thumb:hover {
    background: #b59028;
}

#menu, #store-screen, #jobs-screen, #jail-screen, #court-house-screen,
#skills-screen, #gang-screen, #achievements-screen, #casino-screen, #options-screen, #jailbreak-screen, #recruitment-screen, #stolen-cars-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--color-bg);
    color: var(--color-cream);
    /* Increase top padding to clear fixed stats bar + page header */
    padding: calc(var(--stats-bar-h) + 96px) 260px 40px 290px;
    box-sizing: border-box;
    overflow-y: auto;
    z-index: 5;
    scrollbar-width: thin;
    scrollbar-color: var(--color-gold) #1a1508;
}


#death-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: #c0392b;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: deathFadeIn 1s ease-in;
}

@keyframes deathFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#death-screen h2 {
    font-size: 3.5em;
    margin-bottom: 20px;
    color: #c0392b;
    text-shadow: 0 0 20px rgba(192, 57, 43, 0.8);
    animation: deathPulse 2s infinite;
    font-family: var(--font-heading);
    letter-spacing: 6px;
}

@keyframes deathPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

#death-screen p {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #7f8c8d;
}

/* ===== Death Screen Obituary ===== */
.obituary-card {
    background: rgba(15, 13, 8, 0.9);
    border: 1px solid #c0392b;
    border-radius: 2px;
    padding: 25px 30px;
    max-width: 500px;
    width: 90%;
    margin: 15px auto;
    text-align: left;
}
.obituary-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
.obituary-portrait {
    font-size: 3em;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(192, 57, 43, 0.2);
    border-radius: 50%;
    border: 2px solid #c0392b;
}
.obituary-name-block h3 {
    margin: 0;
    color: #d4af37;
    font-size: 1.4em;
    border: none;
    padding: 0;
}
.obituary-title {
    color: #8a7a5a;
    font-size: 0.95em;
}
.obituary-cause {
    text-align: center;
    color: #8b3a3a;
    font-size: 1.1em;
    padding: 10px;
    margin-bottom: 15px;
    background: rgba(192, 57, 43, 0.15);
    border-radius: 2px;
}
.obituary-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (max-width: 480px) {
    .obituary-stats {
        grid-template-columns: 1fr;
    }
}
.obit-stat {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
}
.obit-label { color: #8a7a5a; font-size: 0.85em; }
.obit-value { color: var(--color-cream); font-weight: bold; font-size: 0.9em; }

/* ===== Death Newspaper Overlay ===== */
#death-newspaper-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: deathFadeIn 0.6s ease-in;
    cursor: pointer;
}

#death-newspaper {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 92vh;
    overflow-y: auto;
    background-color: #f2e6c9;
    background-image: url('Backgrounds/death-paper.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-blend-mode: lighten;
    border: 3px solid #8b7355;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.7), 4px 4px 12px rgba(0,0,0,0.4);
    cursor: default;
    padding: 0;
}
#death-newspaper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(242, 230, 201, 0.25);
    pointer-events: none;
    z-index: 0;
}
#newspaper-content {
    position: relative;
    z-index: 1;
}

#newspaper-close-btn {
    position: absolute;
    top: 8px; right: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #cc0000;
    border-radius: 50%;
    color: #ff3333;
    font-size: 1.6em;
    font-weight: bold;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    opacity: 0.9;
    transition: opacity 0.2s, background 0.2s;
}
#newspaper-close-btn:hover { opacity: 1; background: rgba(200, 0, 0, 0.6); }
#newspaper-close-btn:focus { opacity: 1; outline: 2px solid #cc0000; outline-offset: 2px; }

#newspaper-content {
    padding: 40px 36px 30px;
    color: #000000;
    font-weight: 700;
    font-family: var(--font-body);
    min-height: 400px;
    position: relative;
    z-index: 1;
}

.newspaper-masthead {
    text-align: center;
    border-bottom: 3px double #3a2a1a;
    padding-bottom: 10px;
    margin-bottom: 6px;
}
.newspaper-title {
    font-family: var(--font-heading);
    font-size: 2.4em;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: #0e0804;
    margin: 0;
    line-height: 1.1;
}
.newspaper-subtitle {
    font-family: var(--font-typewriter);
    font-size: 0.75em;
    letter-spacing: 3px;
    color: #000000;
    font-weight: 600;
    margin: 2px 0 0;
}
.newspaper-dateline {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-typewriter);
    font-size: 0.7em;
    color: #000000;
    font-weight: 600;
    padding: 4px 0;
    border-bottom: 1px solid #5a4a2a;
    margin-bottom: 14px;
}

.newspaper-headline {
    font-family: var(--font-display);
    font-size: 1.95em;
    text-align: center;
    color: #1a0a00;
    margin: 10px 0 4px;
    line-height: 1.15;
    font-weight: 900;
}
.newspaper-subhead {
    font-family: var(--font-body);
    font-size: 1em;
    text-align: center;
    font-style: italic;
    color: #000000;
    font-weight: 700;
    text-shadow: 0 0 0 #000000;
    -webkit-text-stroke: 0.2px #000000;
    margin: 0 0 14px;
}

.newspaper-rule {
    border: none;
    border-top: 1px solid #3a2a1a;
    margin: 10px 0;
}
.newspaper-rule-double {
    border: none;
    border-top: 3px double #3a2a1a;
    margin: 12px 0;
}

.newspaper-portrait-wrap {
    float: left;
    margin: 0 14px 8px 0;
    border: 2px solid #5a4a3a;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.25);
    background: #e8d8b8;
    padding: 3px;
    max-width: 100px;
}
.newspaper-portrait-wrap img {
    display: block;
    width: 94px;
    height: 94px;
    object-fit: cover;
    filter: sepia(0.6) contrast(1.1);
}
.newspaper-portrait-caption {
    text-align: center;
    font-family: var(--font-typewriter);
    font-size: 0.6em;
    color: #000000;
    font-weight: 700;
    margin-top: 2px;
}

.newspaper-body {
    font-family: var(--font-body);
    font-size: 0.92em;
    line-height: 1.55;
    color: #000000 !important;
    font-weight: 700;
    text-shadow: 0 0 1px #000000;
    -webkit-text-stroke: 0.3px #000000;
    text-align: justify;
    column-count: 2;
    column-gap: 20px;
    column-rule: 1px solid #5a4a2a;
}
.newspaper-body p {
    margin: 0 0 8px;
    text-indent: 1.5em;
    color: #000000 !important;
}
.newspaper-body p:first-child {
    text-indent: 0;
}
.newspaper-body p:first-child::first-letter {
    font-family: var(--font-display);
    font-size: 2.8em;
    float: left;
    line-height: 0.85;
    margin: 2px 6px 0 0;
    color: #1a0a00;
    font-weight: 900;
}

.newspaper-stats-box {
    border: 1px solid #5a4a3a;
    padding: 10px 14px;
    margin: 12px 0;
    background: rgba(220, 200, 160, 0.35);
    break-inside: avoid;
}
.newspaper-stats-box h4 {
    font-family: var(--font-heading);
    font-size: 0.85em;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 6px;
    color: #1a0a00;
    border-bottom: 1px solid #8a7a5a;
    padding-bottom: 4px;
}
.newspaper-stat-row {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-typewriter);
    font-size: 0.78em;
    padding: 2px 0;
    color: #000000 !important;
    font-weight: 700;
    -webkit-text-stroke: 0.2px #000000;
}

.newspaper-footer {
    text-align: center;
    font-family: var(--font-typewriter);
    font-size: 0.7em;
    color: #000000;
    font-weight: 700;
    margin-top: 14px;
    padding-top: 8px;
    border-top: 3px double #3a2a1a;
    font-style: italic;
}

/* Chat newspaper link */
.newspaper-chat-link {
    display: inline-block;
    cursor: pointer;
    color: #c0a040;
    text-decoration: underline;
    font-weight: bold;
    -webkit-user-select: none;
    user-select: none;
}
.newspaper-chat-link:hover {
    color: #d4af37;
}

/* Newspaper card in world chat -- prevent text selection on mobile tap */
.newspaper-chat-card {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(192, 160, 98, 0.3);
}

/* Jail Newspaper Overlay (reuses .newspaper-* classes for content) */
#jail-newspaper-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: deathFadeIn 0.6s ease-in;
    cursor: pointer;
}
#jail-newspaper {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 92vh;
    overflow-y: auto;
    background-color: #f2e6c9;
    background-image: url('Backgrounds/death-paper.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-blend-mode: lighten;
    border: 3px solid #8b7355;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.7), 4px 4px 12px rgba(0,0,0,0.4);
    cursor: default;
    padding: 0;
}
#jail-newspaper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(242, 230, 201, 0.25);
    pointer-events: none;
    z-index: 0;
}
#jail-newspaper-content {
    padding: 40px 36px 30px;
    color: #000000;
    font-weight: 700;
    font-family: var(--font-body);
    min-height: 400px;
    position: relative;
    z-index: 1;
}
#jail-newspaper .newspaper-close-btn {
    position: absolute;
    top: 8px; right: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #cc0000;
    border-radius: 50%;
    color: #ff3333;
    font-size: 1.6em;
    font-weight: bold;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    opacity: 0.9;
    transition: opacity 0.2s, background 0.2s;
}
#jail-newspaper .newspaper-close-btn:hover { opacity: 1; background: rgba(200, 0, 0, 0.6); }
#jail-newspaper .newspaper-close-btn:focus { opacity: 1; outline: 2px solid #cc0000; outline-offset: 2px; }

/* Policy Newspaper Overlay (reuses .newspaper-* classes for content) */
#policy-newspaper-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: deathFadeIn 0.6s ease-in;
    cursor: pointer;
}
#policy-newspaper {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 92vh;
    overflow-y: auto;
    background-color: #f2e6c9;
    background-image: url('Backgrounds/death-paper.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-blend-mode: lighten;
    border: 3px solid #8b7355;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.7), 4px 4px 12px rgba(0,0,0,0.4);
    cursor: default;
    padding: 0;
}
#policy-newspaper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(242, 230, 201, 0.25);
    pointer-events: none;
    z-index: 0;
}
#policy-newspaper-content {
    padding: 40px 36px 30px;
    color: #000000;
    font-weight: 700;
    font-family: var(--font-body);
    min-height: 400px;
    position: relative;
    z-index: 1;
}
#policy-newspaper .newspaper-close-btn {
    position: absolute;
    top: 8px; right: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #cc0000;
    border-radius: 50%;
    color: #ff3333;
    font-size: 1.6em;
    font-weight: bold;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    opacity: 0.9;
    transition: opacity 0.2s, background 0.2s;
}
#policy-newspaper .newspaper-close-btn:hover { opacity: 1; background: rgba(200, 0, 0, 0.6); }
#policy-newspaper .newspaper-close-btn:focus { opacity: 1; outline: 2px solid #cc0000; outline-offset: 2px; }

/* Responsive: single column on small screens */
@media (max-width: 600px) {
    /* Newspaper overlays must sit above all mobile UI (quick-actions bar, slide menu, etc.) */
    #death-newspaper-overlay,
    #jail-newspaper-overlay,
    #policy-newspaper-overlay {
        z-index: 10001;
    }
    #death-newspaper,
    #jail-newspaper,
    #policy-newspaper {
        width: 96%;
        max-height: 96vh;
    }
    #newspaper-content,
    #jail-newspaper-content,
    #policy-newspaper-content {
        padding: 24px 18px 20px;
    }
    .newspaper-title {
        font-size: 1.6em;
        letter-spacing: 3px;
    }
    .newspaper-headline {
        font-size: 1.4em;
    }
    .newspaper-body {
        column-count: 1;
    }
    .newspaper-portrait-wrap {
        float: none;
        margin: 0 auto 10px;
    }
    /* Touch-friendly close button on mobile */
    #newspaper-close-btn,
    #jail-newspaper .newspaper-close-btn,
    #policy-newspaper .newspaper-close-btn {
        font-size: 1.8em;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0.95;
    }
    /* Touch-friendly newspaper links in chat/ledger */
    .newspaper-chat-link {
        display: block;
        padding: 10px 8px;
        font-size: 14px;
        min-height: 44px;
        line-height: 24px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(192, 160, 98, 0.3);
    }
}

/* ===== Game Card Component System ===== */
.game-card {
    background: rgba(20, 18, 10, 0.6);
    border: 1px solid #333;
    border-radius: 2px;
    padding: 14px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.game-card:hover {
    border-color: #555;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Accent border variants */
.game-card--accent-left {
    border-left: 4px solid var(--card-accent, #c0a062);
}

.game-card--accent-top {
    border-top: 2px solid var(--card-accent, #c0a062);
}

/* Tier / state variants */
.game-card--tier {
    border-color: var(--card-accent, #555);
}

.game-card--tier:hover {
    border-color: var(--card-accent, #555);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.game-card--done {
    opacity: 0.45;
    pointer-events: none;
}

/* Layout helpers for cards */
.game-card__header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.game-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.game-card__title {
    color: var(--color-cream);
    font-weight: bold;
    font-size: 1.05em;
    margin: 0;
}

.game-card__subtitle {
    color: #8a7a5a;
    font-size: 0.9em;
    margin: 0;
    line-height: 1.35;
}

.game-card__price {
    color: #c0a040;
    font-weight: bold;
    font-size: 1.1em;
}

.game-card__badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-card__stats {
    display: flex;
    justify-content: space-between;
    color: #aaa;
    font-size: 0.85em;
}

.game-card__stats strong {
    color: #c0a062;
}

/* ===== Hospital Services ===== */
.hospital-services {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.hospital-option {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 2px;
    padding: 15px;
    transition: border-color 0.2s;
}
.hospital-option:hover {
    border-color: #555;
}
.hospital-option-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.hospital-icon {
    font-size: 2em;
    min-width: 40px;
    text-align: center;
}
.hospital-option-header strong {
    color: var(--color-cream);
    display: block;
    margin-bottom: 4px;
}
.hospital-option-header p {
    color: #8a7a5a;
    font-size: 0.9em;
    margin: 0;
}
.hospital-option-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.hospital-cost {
    color: #c0a040;
    font-weight: bold;
    font-size: 1.1em;
}
.hospital-option-footer button {
    padding: 8px 18px;
    border-radius: 2px;
    font-weight: bold;
}
.hospital-option-footer button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Hospital Timer Healing */
.hospital-healing-active {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid #555;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}
.hospital-healing-label {
    color: #d4c5a0;
    font-size: 1.05em;
    margin-bottom: 10px;
}
.hospital-progress-bar {
    background: #333;
    border-radius: 6px;
    height: 18px;
    overflow: hidden;
    border: 1px solid #555;
    margin: 8px 0;
}
.hospital-progress-fill {
    background: linear-gradient(90deg, #6a8a4a, #8a9a6a);
    height: 100%;
    transition: width 1s linear;
    border-radius: 6px;
}
.hospital-healing-time {
    color: #c0a062;
    font-size: 0.95em;
    margin-bottom: 12px;
}
.hospital-cancel-btn {
    background: rgba(139, 58, 58, 0.4);
    border: 1px solid #8b3a3a;
    color: #d4c5a0;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
}
.hospital-cancel-btn:hover {
    background: rgba(139, 58, 58, 0.6);
}

/* Bounty Board */
.bounty-refresh-timer {
    text-align: center;
    color: #888;
    font-size: 0.9em;
    margin-bottom: 14px;
    padding: 6px 0;
    border-bottom: 1px solid #333;
}
.bounty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.bounty-card {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid var(--tier-color, #555);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bounty-card-done {
    opacity: 0.45;
}
.bounty-card-failed {
    opacity: 0.45;
}
.bounty-card-tier {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: bold;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: fit-content;
}
.bounty-card-name {
    color: #d4c5a0;
    font-weight: bold;
    font-size: 1.05em;
}
.bounty-card-desc {
    color: #999;
    font-size: 0.85em;
    margin: 0;
    line-height: 1.35;
}
.bounty-card-stats {
    display: flex;
    justify-content: space-between;
    color: #aaa;
    font-size: 0.85em;
}
.bounty-card-stats strong {
    color: #c0a062;
}
.bounty-card-chance {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8em;
    color: #aaa;
}
.bounty-chance-bar {
    flex: 1;
    background: #333;
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
    border: 1px solid #444;
}
.bounty-chance-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}
.bounty-chance-pct {
    min-width: 32px;
    text-align: right;
    font-weight: bold;
}
.bounty-attempt-btn {
    background: linear-gradient(135deg, rgba(139, 90, 43, 0.5), rgba(92, 64, 32, 0.5));
    border: 1px solid #8b5a2b;
    color: #d4c5a0;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    width: 100%;
    text-align: center;
}
.bounty-attempt-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(139, 90, 43, 0.7), rgba(92, 64, 32, 0.7));
}
.bounty-attempt-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.bounty-status {
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85em;
    letter-spacing: 1px;
}
.bounty-complete {
    background: rgba(100, 140, 80, 0.2);
    color: #8a9a6a;
    border: 1px solid #8a9a6a;
}
.bounty-failed {
    background: rgba(139, 58, 58, 0.2);
    color: #8b3a3a;
    border: 1px solid #8b3a3a;
}

#hurt-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(139,0,0,0.6) 0%, rgba(139,0,0,0.2) 50%, transparent 100%);
    display: none;
    z-index: 999;
    animation: hurtFlash 0.2s ease-out;
}

@keyframes hurtFlash {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

#success-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(46,204,113,0.45) 0%, rgba(46,204,113,0.15) 50%, transparent 100%);
    display: none;
    z-index: 999;
    pointer-events: none;
    animation: successFlash 0.5s ease-out;
}

@keyframes successFlash {
    0% { opacity: 0; }
    30% { opacity: 1; }
    100% { opacity: 0; }
}

h1, h2 {
    font-size: 2.5em;
    margin-bottom: 25px;
    color: var(--color-gold);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 4px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

h3 {
    color: var(--color-gold-dim);
    font-size: 1.3em;
    margin-bottom: 15px;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 2px;
}

p, ul {
    font-size: 1.05em;
    margin-bottom: 15px;
    line-height: 1.7;
    color: var(--color-aged-cream);
}

#right-panel {
    position: fixed;
    top: var(--stats-bar-h);
    right: 0;
    width: 220px;
    height: calc(100vh - var(--stats-bar-h));
    background: #0f0d08;
    color: var(--color-gold);
    padding: 15px;
    overflow-y: auto;
    z-index: 15;
    font-size: 13px;
    border-left: 1px solid var(--color-gold-dim);
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
}

#right-panel h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #d4af37;
    border-bottom: 1px solid #d4af37;
    padding-bottom: 5px;
}

.quick-btn {
    width: 100%;
    margin: 3px 0;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    background: linear-gradient(to bottom, #1a1508, #0f0d08);
    color: var(--color-gold);
    border: 1px solid var(--color-gold-dim);
    border-radius: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    min-height: 35px;
    font-family: var(--font-heading);
    letter-spacing: 1px;
    text-shadow: 1px 1px 0 #000;
}

.quick-btn:hover {
    background: linear-gradient(to bottom, #201c14, #14120a);
    border-color: var(--color-gold-dim);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.15);
}

.main-menu-btn {
    background: linear-gradient(to bottom, #8b0000, #500000) !important;
    color: #fff !important;
    border: 1px solid #ff0000 !important;
    font-size: 14px !important;
    min-height: 40px !important;
    margin-bottom: 10px !important;
}

.main-menu-btn:hover {
    background: linear-gradient(to bottom, #a00000, #600000) !important;
}

.save-btn {
    background: linear-gradient(to bottom, #2c2c2c, #1a1a1a) !important;
    color: #d4af37 !important;
    border: 1px solid #d4af37 !important;
}

.save-btn:hover {
    background: linear-gradient(to bottom, #3c3c3c, #2a2a2a) !important;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 5px 0;
    padding: 5px 8px;
    background: #14120a;
    border-radius: 2px;
    font-size: 12px;
    border-bottom: 1px solid #333;
}

.stat-label {
    font-size: 14px;
    color: #8a7a5a;
}

.info-item {
    margin: 5px 0;
    padding: 3px;
    font-size: 11px;
    color: #888;
    font-style: italic;
}

#quick-actions {
    margin-bottom: 15px;
}

#store-screen ul, #jobs-screen ul {
    list-style-type: none;
    padding: 0;
}

#store-screen li, #jobs-screen li {
    margin: 15px 0;
    padding: 15px;
    background: #14120a;
    border-radius: 2px;
    border-left: 4px solid #d4af37;
    transition: all 0.3s ease;
    border: 1px solid #333;
}

#store-screen li:hover, #jobs-screen li:hover {
    background: #222;
    transform: translateX(5px);
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}

#action-log {
    position: fixed;
    top: var(--stats-bar-h);
    left: 0;
    width: 250px;
    height: calc(100vh - var(--stats-bar-h));
    background: #0f0d08;
    color: var(--color-aged-cream);
    padding: 0;
    overflow-y: auto;
    z-index: 15;
    font-size: 13px;
    border-right: 1px solid var(--color-gold-dim);
    font-family: var(--font-typewriter);
    /* Subtle ruled-paper lines */
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 27px,
        rgba(192, 160, 98, 0.06) 27px,
        rgba(192, 160, 98, 0.06) 28px
    );
    background-color: #0f0d08;
}

#action-log h3 {
    position: sticky;
    top: 0;
    margin: 0;
    font-size: 1.1em;
    color: var(--color-gold);
    background: linear-gradient(to bottom, #14120a, #0f0d08);
    border-bottom: none;
    padding: 12px 15px 8px;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-align: center;
    z-index: 2;
    box-shadow: none;
    font-family: var(--font-heading);
}

#ledger-filters {
    position: sticky;
    top: 38px;
    display: flex;
    gap: 0;
    padding: 0 10px 8px;
    background: linear-gradient(to bottom, #111, #111);
    border-bottom: 2px solid #d4af37;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.ledger-filter-btn {
    flex: 1;
    padding: 6px 4px;
    background: transparent;
    color: #7f8c8d;
    border: 1px solid #333;
    border-radius: 2px;
    cursor: pointer;
    font-size: 10px;
    font-family: var(--font-typewriter);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.ledger-filter-btn:hover {
    color: #bdc3c7;
    border-color: #555;
}

.ledger-filter-btn.active {
    color: #d4af37;
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
    font-weight: bold;
}

#action-log ul {
    list-style-type: none;
    padding: 10px 12px;
    margin: 0;
}

#action-log li {
    margin-bottom: 8px;
    padding: 8px 10px;
    background: rgba(15, 13, 8, 0.6);
    border-radius: 1px;
    border-left: 3px solid var(--color-burgundy);
    font-size: 11px;
    line-height: 1.5;
    animation: logItemSlide 0.3s ease-out;
    border-bottom: 1px solid rgba(192, 160, 98, 0.08);
    font-family: var(--font-typewriter);
    color: #a89870;
    position: relative;
}

#action-log li .log-timestamp {
    display: block;
    font-size: 9px;
    color: #6a5a3a;
    margin-top: 3px;
    font-style: italic;
}

#action-log li .log-group-count {
    display: inline-block;
    background: rgba(192, 160, 98, 0.2);
    color: #c0a062;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 2px;
    margin-left: 6px;
    font-weight: bold;
    vertical-align: middle;
}

@keyframes logItemSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#prisoner-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 20px;
}

#prisoner-list div {
    transition: all 0.3s ease;
    background: #14120a;
    border: 1px solid #333;
    margin-bottom: 5px;
    padding: 10px;
}

#prisoner-list div:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    border-color: #d4af37;
}

#jailbreak-prisoner-list {
    max-height: 500px;
    overflow-y: auto;
}

#jailbreak-prisoner-list div {
    transition: all 0.3s ease;
}

#jailbreak-prisoner-list div:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

#intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: var(--color-cream);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

#intro-screen h1 {
    font-size: 3.5em;
    margin-bottom: 30px;
    text-shadow: 0 4px 8px rgba(0,0,0,0.8);
    animation: titleGlow 3s infinite alternate;
    color: var(--color-gold);
    font-family: var(--font-heading);
    letter-spacing: 8px;
}

@keyframes titleGlow {
    from { text-shadow: 0 4px 8px rgba(0,0,0,0.8), 0 0 15px rgba(212, 175, 55, 0.3); }
    to { text-shadow: 0 4px 8px rgba(0,0,0,0.8), 0 0 25px rgba(212, 175, 55, 0.5); }
}

#intro-screen button {
    font-size: 1.3em;
    padding: 15px 30px;
    background: linear-gradient(to bottom, #201c14, #12100a);
    border: 2px solid var(--color-gold);
    color: var(--color-gold);
    transition: box-shadow 0.3s ease, background 0.3s ease;
    font-family: var(--font-heading);
    letter-spacing: 3px;
}

#intro-screen button:hover {
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.25);
    background: linear-gradient(to bottom, #2a2518, #1a1610);
}

#intro-screen button:active {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

/* Intro pitch / game description section */
.intro-pitch {
    max-width: 560px;
    width: 90%;
    margin: 0 auto 30px;
    text-align: center;
}

.intro-tagline {
    font-size: 1.15em;
    color: #d4c4a0;
    font-style: italic;
    margin: 0 0 22px;
    letter-spacing: 1px;
    line-height: 1.5;
}

.intro-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.intro-feature {
    background: linear-gradient(135deg, rgba(20, 18, 10, 0.7), rgba(30, 25, 15, 0.5));
    border: 1px solid rgba(192, 160, 98, 0.25);
    border-radius: 8px;
    padding: 14px 16px;
    text-align: left;
}

.intro-feature-title {
    display: block;
    color: #c0a062;
    font-family: var(--font-heading);
    font-size: 0.95em;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.intro-feature-desc {
    display: block;
    color: #8a7a5a;
    font-size: 0.82em;
    line-height: 1.4;
}

@media (max-width: 520px) {
    .intro-features {
        grid-template-columns: 1fr;
    }
    .intro-tagline {
        font-size: 1em;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Page Header — narrower sidebars at this breakpoint */
    .page-header {
        left: 220px;
        right: 200px;
        top: var(--stats-bar-h);
        padding: 10px 15px;
        border-radius: 0;
    }
    
    .page-header h1 {
        font-size: 1.2em;
        letter-spacing: 1px;
    }
    
    .breadcrumb {
        font-size: 0.7em;
        margin-top: 5px;
    }
    
    .section-header {
        font-size: 1em;
        padding: 10px 15px;
    }
    
    .nav-btn-back {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    
    .content-card {
        padding: 15px;
    }
    
    #stats-bar {
        flex-wrap: wrap;
        gap: 4px;
        font-size: 9px;
        padding: calc(5px + env(safe-area-inset-top, 0px)) 6px 5px 6px;
        min-height: 40px;
    }
    
    .player-info {
        margin-bottom: 0;
    }
    
    #player-portrait {
        width: 24px;
        height: 24px;
    }
    
    .stats-container {
        gap: 3px;
    }
    
    #stats-bar p {
        font-size: 8px;
        padding: 2px 4px;
        margin: 0;
    }
    
    .menu-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
        padding: 15px;
    }
    
    button {
        font-size: 14px;
        padding: 12px 15px;
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
    
    h1, h2 {
        font-size: 1.8em;
    }
    
    .game-screen {
        padding: calc(var(--stats-bar-h) + 96px) 200px 20px 220px;
    }
    
    #action-log {
        width: 200px;
        top: var(--stats-bar-h);
        height: calc(100vh - var(--stats-bar-h));
    }
    
    #right-panel {
        width: 180px;
        top: var(--stats-bar-h);
        height: calc(100vh - var(--stats-bar-h));
        padding: 10px;
        font-size: 11px;
    }
    
    #right-panel h3 {
        font-size: 1em;
    }
    
    .quick-btn {
        font-size: 11px;
        padding: 6px 8px;
        min-height: 30px;
    }
    
    .main-menu-btn {
        font-size: 12px !important;
        min-height: 35px !important;
    }
    
    .skills-container, .achievements-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    #stats-bar {
        flex-wrap: wrap;
        gap: 3px;
        font-size: 8px;
        padding: 4px;
    }
    
    .player-info {
        margin-bottom: 0;
    }
    
    .stats-container {
        gap: 2px;
    }
    
    #stats-bar p {
        font-size: 7px;
        padding: 1px 3px;
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
    }
    
    .game-screen {
        padding: calc(var(--stats-bar-h) + 76px) 180px 20px 200px;
    }
    
    /* Page header for narrow screens */
    .page-header {
        left: 200px;
        right: 180px;
    }
    
    #action-log {
        top: var(--stats-bar-h);
        height: calc(100vh - var(--stats-bar-h));
        width: 180px;
    }
    
    #right-panel {
        width: 160px;
        top: var(--stats-bar-h);
        height: calc(100vh - var(--stats-bar-h));
        padding: 8px;
        font-size: 10px;
    }
    
    #right-panel h3 {
        font-size: 0.9em;
        margin-bottom: 8px;
    }
    
    .quick-btn {
        font-size: 10px;
        padding: 5px 6px;
        min-height: 28px;
        margin: 2px 0;
    }
    
    .main-menu-btn {
        font-size: 11px !important;
        min-height: 32px !important;
    }
    
    .stat-item {
        font-size: 10px;
        padding: 3px 5px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    #intro-screen h1 {
        font-size: 2.5em;
    }
    
    #death-screen h2 {
        font-size: 2.5em;
    }
}

/* Intro Narrative Screen */
#intro-narrative {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

#intro-narrative button {
    transition: all 0.3s ease;
}

#intro-narrative button:hover {
    background: #c0392b !important;
    box-shadow: 0 8px 15px rgba(231, 76, 60, 0.3);
}

/* Recruitment Screen Styling */
#recruitment-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 900;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
}

#recruitment-content {
    max-width: 1000px;
    margin: 0 auto;
    background: linear-gradient(135deg, #0d0b07 0%, #14120a 100%);
    padding: 30px;
    border-radius: 2px;
    border: 2px solid var(--color-gold);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
    margin-top: 50px;
}

#recruitment-screen h2 {
    text-align: center;
    color: #d4af37;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#recruitment-screen ul {
    list-style: none;
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}

#recruitment-screen li {
    margin: 15px 0;
    padding: 20px;
    background: rgba(20, 18, 10, 0.8);
    border-radius: 2px;
    border: 2px solid;
    transition: all 0.3s ease;
}

#recruitment-screen li:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

#recruitment-screen button {
    padding: 12px 20px;
    border: none;
    border-radius: 2px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    font-size: 16px;
}

#recruitment-screen button:hover:not(:disabled) {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#recruitment-screen button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Character Creation Screen Styling */

/* ── Background & Perk Selection ── */
.bg-perk-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.96);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 30px 15px;
    box-sizing: border-box;
}

.bg-perk-container {
    max-width: 960px;
    width: 100%;
    background: linear-gradient(135deg, rgba(20, 18, 10, 0.98) 0%, rgba(26, 22, 14, 0.98) 100%);
    padding: 35px 30px;
    border-radius: 2px;
    border: 2px solid var(--color-gold);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    text-align: center;
    color: var(--color-cream);
    margin-bottom: 40px;
}

.bg-perk-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 16px 0;
}

.bg-perk-card {
    background: rgba(20, 18, 10, 0.6);
    border: 2px solid #555;
    border-radius: 2px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.bg-perk-card:hover {
    border-color: var(--color-gold-dim);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.2);
}

.bg-perk-card.selected {
    border-color: var(--color-gold);
    background: rgba(212, 175, 55, 0.12);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.bg-perk-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 10px;
    color: #8a9a6a;
    font-size: 1.2em;
    font-weight: bold;
}

.perk-card:hover {
    border-color: var(--perk-color, #7a8a6a);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--perk-color, #7a8a6a) 40%, transparent);
}

.perk-card.selected {
    border-color: var(--perk-color, #8a9a6a);
    background: color-mix(in srgb, var(--perk-color, #8a9a6a) 15%, transparent);
    box-shadow: 0 0 20px color-mix(in srgb, var(--perk-color, #8a9a6a) 40%, transparent);
}

.bg-perk-icon {
    font-size: 2.2em;
    margin-bottom: 6px;
}

.bg-perk-name {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--color-cream);
    margin-bottom: 6px;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.bg-perk-desc {
    font-size: 0.85em;
    color: #8a7a5a;
    line-height: 1.4;
    margin-bottom: 8px;
}

.bg-perk-bonus {
    font-size: 0.8em;
    color: var(--color-gold);
    font-weight: bold;
    background: rgba(212, 175, 55, 0.1);
    padding: 4px 8px;
    border-radius: 2px;
    display: inline-block;
}

.bg-perk-effect {
    font-size: 0.8em;
    color: var(--color-gold-dim);
    font-weight: bold;
    background: rgba(192, 160, 98, 0.1);
    padding: 4px 8px;
    border-radius: 2px;
    display: inline-block;
}

.bg-perk-preview {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
    padding: 14px 20px;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    font-size: 0.95em;
}

/* Mobile responsive for bg-perk */
@media (max-width: 768px) {
    .bg-perk-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .bg-perk-container {
        padding: 20px 15px;
    }
    .bg-perk-icon {
        font-size: 1.8em;
    }
    .bg-perk-preview {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .bg-perk-grid {
        grid-template-columns: 1fr;
    }
}

#character-creation-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    box-sizing: border-box;
}

#character-creation-content {
    max-width: 800px;
    width: 100%;
    background: linear-gradient(135deg, rgba(20, 18, 10, 0.98) 0%, rgba(26, 22, 14, 0.98) 100%);
    padding: 40px;
    border-radius: 2px;
    border: 2px solid var(--color-gold);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    text-align: center;
    color: var(--color-cream);
}

#character-creation-content h1 {
    color: var(--color-gold);
    font-size: 2.8em;
    margin-bottom: 15px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    font-family: var(--font-heading);
    letter-spacing: 5px;
}

.character-form {
    text-align: left;
    margin-top: 30px;
}

.character-form h3 {
    color: var(--color-cream);
    font-size: 1.5em;
    margin: 25px 0 15px 0;
    text-align: center;
    border-bottom: 2px solid var(--color-gold-dim);
    padding-bottom: 10px;
    font-family: var(--font-heading);
    letter-spacing: 2px;
}

.name-section input {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    border: 2px solid var(--color-gold-dim);
    border-radius: 2px;
    background: rgba(13, 11, 7, 0.8);
    color: var(--color-cream);
    text-align: center;
    box-sizing: border-box;
    font-family: var(--font-display);
    letter-spacing: 2px;
}

.name-section input:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.ethnicity-grid {
    grid-template-columns: repeat(4, 1fr);
}

.portrait-selection-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

.portrait-gender-section {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    width: 100%;
}

.portrait-gender-section h3 {
    grid-column: 1 / -1;
    margin: 0;
}

.portrait-option {
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    border: 3px solid #555;
    border-radius: 2px;
    background: rgba(20, 18, 10, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.portrait-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    border-radius: 1px;
    filter: sepia(20%) contrast(1.05);
}

.portrait-option:hover {
    border-color: var(--color-gold-dim);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.portrait-option.selected {
    border-color: var(--color-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

/* Portrait Selection Overlay (dynamically created) */
.portrait-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 40px 20px;
    box-sizing: border-box;
}

.portrait-selection-container {
    max-width: 900px;
    width: 100%;
    background: linear-gradient(135deg, rgba(20, 18, 10, 0.98) 0%, rgba(26, 22, 14, 0.98) 100%);
    padding: 40px;
    border-radius: 2px;
    border: 2px solid var(--color-gold);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    text-align: center;
    color: var(--color-cream);
    margin-bottom: 40px;
}

.selection-btn {
    padding: 20px;
    border: 3px solid #555;
    border-radius: 2px;
    background: rgba(20, 18, 10, 0.6);
    color: var(--color-cream);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1em;
    font-weight: bold;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.selection-btn:hover {
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.2);
    border-color: var(--color-gold-dim);
}

.selection-btn.selected {
    border-color: var(--color-gold);
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.portrait-btn {
    min-height: 120px;
    position: relative;
}

.portrait-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 2px solid #ecf0f1;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    transition: all 0.3s ease;
}

.portrait-btn:hover .portrait-preview {
    transform: scale(1.1);
    border-color: #7a8a6a;
}

.portrait-btn.selected .portrait-preview {
    border-color: #8a9a6a;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
}

#selected-portrait {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--color-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    filter: sepia(20%) contrast(1.1);
}

.selection-label {
    font-size: 1em;
    font-weight: bold;
}

.character-preview {
    margin: 30px 0;
    text-align: center;
}

.preview-card {
    background: rgba(20, 18, 10, 0.8);
    padding: 25px;
    border-radius: 2px;
    border: 2px solid var(--color-gold-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.preview-info {
    text-align: center;
}

.preview-info div {
    margin: 8px 0;
    font-size: 1.1em;
    font-weight: bold;
}

.creation-buttons {
    text-align: center;
    margin-top: 30px;
}

.creation-buttons button {
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#create-character-btn {
    background: linear-gradient(45deg, #8a9a6a, #7a8a5a);
    color: var(--color-cream);
}

#create-character-btn:hover:not(:disabled) {
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.4);
}

#create-character-btn:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Vehicle Garage Screen Styling */
/* Remove custom stolen-cars-screen styling */
/* #stolen-cars-screen will inherit from the main screen CSS rule above */

#stolen-cars-content {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Vehicle card hover effects for PC */
#stolen-cars-content div[style*="background: rgba(20, 18, 10, 0.8)"] {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#stolen-cars-content div[style*="background: rgba(20, 18, 10, 0.8)"]:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.7) !important;
}

#stolen-cars-content button:hover:not(:disabled) {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* ==================== MOBILE RESPONSIVE SYSTEM ==================== */

/* Mobile device classes */
.mobile-device #action-log,
.mobile-device #right-panel {
    display: none !important;
}

/* On mobile, page-headers must span the full width (no sidebars) */
.mobile-device .page-header {
    left: 0 !important;
    right: 0 !important;
    top: var(--stats-bar-h) !important;
    padding: 8px 15px !important;
}

/* Hide page-headers inside inactive screens.
   position:fixed elements can escape parent display:none in some mobile browsers.
   The .screen-active class is toggled by hideAllScreens/show* functions. */
.game-screen:not(.screen-active) > .page-header {
    visibility: hidden !important;
    pointer-events: none !important;
}

.mobile-device .game-screen,
.mobile-device #menu,
.mobile-device #safehouse,
.mobile-device #store-screen,
.mobile-device #jobs-screen,
.mobile-device #jail-screen,
.mobile-device #court-house-screen,
.mobile-device #skills-screen,
.mobile-device #gang-screen,
.mobile-device #achievements-screen,
.mobile-device #casino-screen,
.mobile-device #options-screen,
.mobile-device #jailbreak-screen,
.mobile-device #recruitment-screen,
.mobile-device #stolen-cars-screen,
.mobile-device #player-stats-screen {
    padding: calc(var(--stats-bar-h, 44px) + 86px) 15px 80px 15px !important; /* Top padding dynamically clears stats bar + page header, bottom for quick actions */
    overflow-y: auto !important;
    max-height: 100vh !important;
}

.mobile-device .menu-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
    max-height: none !important;
    padding-bottom: 40px !important;
}

.mobile-device button {
    min-height: 44px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    touch-action: manipulation;
}

/* Mobile store item layout: stack vertically so buy button doesn't overflow */
.mobile-device #item-list li {
    flex-wrap: wrap !important;
}

.mobile-device #item-list li > div:last-child {
    flex-shrink: 1 !important;
    width: 100% !important;
}

.mobile-device #item-list li > div:last-child button {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* Collapse store 2fr/1fr grid to single column on mobile */
.mobile-device #store-layout-grid {
    grid-template-columns: 1fr !important;
}

.mobile-device #store-screen .content-card {
    min-width: 0 !important;
}

/* Save slot grids: collapse 5-col to stacked on mobile */
.mobile-device .save-slot-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
}

.mobile-device .save-slot-grid > div {
    text-align: left !important;
}

/* Save management row: stack buttons below info on mobile */
.mobile-device .save-manage-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
}

.mobile-device .save-manage-row button {
    width: 100% !important;
}

/* Gang top grid: single column on mobile */
.mobile-device .gang-top-grid {
    grid-template-columns: 1fr !important;
}

/* Garage images responsive */
.mobile-device .garage-grid img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
}

/* Store category tabs scroll horizontally on mobile instead of wrapping down */
.mobile-device #store-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px !important;
}

.mobile-device #store-tabs button {
    flex-shrink: 0 !important;
    font-size: 12px !important;
    padding: 8px 12px !important;
}

/* Tablet device adjustments */
.tablet-device #action-log {
    width: 180px !important;
    font-size: 11px !important;
}

.tablet-device #right-panel {
    width: 160px !important;
    font-size: 10px !important;
}

.tablet-device .game-screen,
.tablet-device #menu {
    padding: calc(var(--stats-bar-h) + 96px) 180px 20px 200px !important; /* Adjust padding for side panels — must clear page-header */
}

/* Mobile stats bar optimization */
.mobile-device #stats-bar {
    flex-wrap: wrap !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 5px !important;
    min-height: auto !important;
    font-size: 10px !important;
    overflow: visible !important;
}

.mobile-device .player-info {
    margin-bottom: 5px !important;
    justify-self: center !important;
    flex-shrink: 0 !important;
}

.mobile-device .stats-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 3px !important;
    justify-content: center !important;
    align-items: center !important;
    max-width: 100% !important;
    overflow: visible !important;
}

.mobile-device #stats-bar p {
    font-size: 8px !important;
    padding: 2px 4px !important;
    margin: 1px !important;
    white-space: nowrap !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
}

/* Mobile bottom bar content occlusion fix — add bottom padding so content isn't hidden behind quick-actions bar */
.mobile-device #game {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Stats secondary always visible */
.mobile-device .stats-secondary {
    display: flex !important;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
}

/* Hide less critical stats on very small mobile screens to prevent overflow */
@media (max-width: 480px) {
    .mobile-device #season-display,
    .mobile-device #inventory-display,
    .mobile-device #stolen-cars-display,
    .mobile-device #gas-display {
        display: none !important;
    }
}

@media (max-width: 380px) {
    .mobile-device #skill-points-display,
    .mobile-device #ammo-display,
    .mobile-device #territory-display {
        display: none !important;
    }
}

/* Mobile quick actions bar */
#mobile-quick-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, #000000 0%, #1a1a1a 100%);
    padding: 8px 5px calc(8px + env(safe-area-inset-bottom, 0px)) 5px;
    box-sizing: border-box;
    z-index: 900;
    border-top: 2px solid #d4af37;
    backdrop-filter: blur(5px);
}

#mobile-quick-actions button {
    padding: 8px 4px !important;
    font-size: 10px !important;
    text-align: center !important;
    min-height: 44px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Style the main menu button differently in the quick actions */
#mobile-quick-actions button[onclick="goBackToMainMenu()"] {
    background: #8b3a3a !important;
}

/* Mobile menu button - REMOVED since we use quick actions bar
#mobile-menu-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: linear-gradient(45deg, #7a8a6a, #6a7a5a) !important;
    color: white !important;
    border: none !important;
    border-radius: 2px !important;
    padding: 10px 15px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3) !important;
}
*/

/* Mobile slide menu */
#mobile-slide-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #000000 0%, #1a1a1a 100%);
    z-index: 999;
    padding: 60px 20px 20px 20px;
    box-sizing: border-box;
    transition: left 0.3s ease;
    overflow-y: auto;
    border-right: 2px solid #d4af37;
    backdrop-filter: blur(10px);
}

#mobile-slide-menu button {
    width: 100% !important;
    margin: 5px 0 !important;
    padding: 12px !important;
    border: none !important;
    border-radius: 2px !important;
    font-weight: bold !important;
    cursor: pointer !important;
}

/* Touch feedback */
.mobile-device button:active,
.tablet-device button:active {
    opacity: 0.7 !important;
    transform: scale(0.98) !important;
}

/* Landscape mode adjustments */
.mobile-device.landscape-mode #stats-bar {
    min-height: 60px !important;
    font-size: 10px !important;
}

.mobile-device.landscape-mode #mobile-quick-actions {
    padding: 5px 3px !important;
}

.mobile-device.landscape-mode #mobile-quick-actions button {
    font-size: 9px !important;
    min-height: 40px !important;
    padding: 6px 2px !important;
}

/* Portrait mode optimizations */
.mobile-device.portrait-mode .game-screen,
.mobile-device.portrait-mode #menu {
    max-height: calc(100vh - 160px) !important; /* Stats bar + quick actions */
}

/* Orientation warning */
#orientation-warning {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: var(--color-cream);
    padding: 20px;
    border-radius: 2px;
    text-align: center;
    z-index: 2000;
    max-width: 300px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
}

/* Touch-friendly interactive elements */
.mobile-device .clickable,
.mobile-device .interactive,
.tablet-device .clickable,
.tablet-device .interactive {
    min-height: 44px !important;
    min-width: 44px !important;
}

/* Disable hover effects on touch devices */
@media (hover: none) {
    button:hover,
    .clickable:hover,
    .interactive:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* Very small screen adjustments */
@media (max-width: 320px) {
    .mobile-device #stats-bar {
        font-size: 8px !important;
        min-height: 100px !important;
    }
    
    .mobile-device #stats-bar p {
        font-size: 8px !important;
        padding: 2px 4px !important;
    }
    
    .mobile-device button {
        font-size: 12px !important;
        padding: 10px 12px !important;
    }
    
    .mobile-device .game-screen,
    .mobile-device #menu {
        padding: calc(var(--stats-bar-h, 44px) + 60px) 8px 80px 8px !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Keep stats bar as flex (DO NOT use grid-template-columns — it breaks the flex layout) */
    #stats-bar {
        font-size: 9px;
        padding: 4px 6px;
        gap: 6px;
    }
    
    #stats-bar p {
        font-size: 8px;
        padding: 2px 4px;
        margin: 0;
    }
    
    .menu-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
        padding: 15px;
    }
    
    button {
        font-size: 14px;
        padding: 10px 15px;
        min-height: 40px;
    }
    
    h1, h2 {
        font-size: 1.8em;
    }
    
    /* Adjust page-header to match narrower sidebars */
    .page-header {
        left: 220px;
        right: 200px;
    }
    
    /* Desktop/tablet at this breakpoint: narrower sidebars, adjusted padding */
    .desktop-device .game-screen,
    .tablet-device .game-screen {
        padding: calc(var(--stats-bar-h) + 96px) 200px 20px 220px !important;
    }
    
    #action-log {
        width: 200px;
        top: var(--stats-bar-h);
        height: calc(100vh - var(--stats-bar-h));
    }
    
    #right-panel {
        width: 180px;
        top: var(--stats-bar-h);
        height: calc(100vh - var(--stats-bar-h));
        padding: 10px;
        font-size: 11px;
    }
    
    #right-panel h3 {
        font-size: 1em;
    }
    
    .quick-btn {
        font-size: 11px;
        padding: 6px 8px;
        min-height: 30px;
    }
    
    .main-menu-btn {
        font-size: 12px !important;
        min-height: 35px !important;
    }
    
    .skills-container, .achievements-container {
        grid-template-columns: 1fr;
    }
    
    .ethnicity-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .portrait-preview {
        width: 50px;
        height: 50px;
    }
    
    #selected-portrait {
        width: 100px;
        height: 100px;
    }
    
    /* Portrait selection mobile adjustments */
    .portrait-selection-grid {
        gap: 8px;
        max-height: 60vh;
        padding: 8px;
    }
    
    .portrait-gender-section {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .portrait-option {
        border-width: 2px;
    }
    
    #character-creation-screen {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-height: 100vh;
        padding: max(100px, env(safe-area-inset-top, 100px)) 15px 20px 15px;
        align-items: flex-start;
        justify-content: flex-start;
    }
    
    #character-creation-content {
        margin-top: 40px;
        padding: 25px 15px;
    }
    
    .character-form {
        padding: 10px;
    }
    
    /* Portrait selection overlay - mobile tablet */
    .portrait-selection-overlay {
        padding: 100px 15px 40px 15px;
    }
    
    .portrait-selection-container {
        padding: 25px 15px;
    }
}

@media (max-width: 480px) {
    /* Keep stats bar as flex (DO NOT use grid-template-columns) */
    #stats-bar {
        font-size: 8px;
        padding: calc(3px + env(safe-area-inset-top, 0px)) 4px 3px 4px;
        gap: 4px;
    }
    
    #stats-bar p {
        font-size: 7px;
        padding: 1px 3px;
    }
    
    #character-creation-screen {
        padding: max(150px, calc(env(safe-area-inset-top, 100px) + 50px)) 10px 40px 10px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        align-items: flex-start;
        justify-content: flex-start;
    }
    
    #character-creation-content {
        padding: 20px 10px;
        margin-top: 0;
    }
    
    #character-creation-content h1 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
    }
    
    /* Portrait selection overlay - mobile phone */
    .portrait-selection-overlay {
        padding: max(150px, calc(env(safe-area-inset-top, 100px) + 50px)) 10px 40px 10px;
    }
    
    .portrait-selection-container {
        padding: 20px 10px;
    }
    
    .portrait-selection-container h1 {
        font-size: 1.8em !important;
    }
    
    /* Adjust page-header for even narrower sidebars */
    .page-header {
        left: 200px;
        right: 180px;
    }
    
    #action-log {
        top: var(--stats-bar-h);
        height: calc(100vh - var(--stats-bar-h));
        width: 180px;
    }
    
    #right-panel {
        width: 160px;
        top: var(--stats-bar-h);
        height: calc(100vh - var(--stats-bar-h));
        padding: 8px;
        font-size: 10px;
    }
    
    #right-panel h3 {
        font-size: 0.9em;
        margin-bottom: 8px;
    }
    
    .quick-btn {
        font-size: 10px;
        padding: 5px 6px;
        min-height: 28px;
        margin: 2px 0;
    }
    
    /* Portrait selection for very small screens */
    .portrait-selection-grid {
        gap: 6px;
        max-height: 50vh;
    }
    
    .portrait-gender-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .portrait-section h3 {
        font-size: 1.1em;
    }
    
    .main-menu-btn {
        font-size: 11px !important;
        min-height: 32px !important;
    }
    
    .stat-item {
        font-size: 10px;
        padding: 3px 5px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    #intro-screen h1 {
        font-size: 2.5em;
    }
    
    #death-screen h2 {
        font-size: 2.5em;
    }
}

/* ==================== UNIFIED POPUP/OVERLAY SYSTEM ==================== */
/* Shared classes for all dynamic popups, result screens, and modals */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    animation: popupFadeIn 0.25s ease-out;
    font-family: var(--font-display);
}

.popup-card {
    background: linear-gradient(135deg, #14120a 0%, #0f0d08 100%);
    border: 2px solid var(--color-gold-dim);
    border-radius: 2px;
    padding: 30px;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 15px rgba(192, 160, 98, 0.15);
    text-align: center;
    color: var(--color-aged-cream);
    font-family: var(--font-body);
    scrollbar-width: thin;
    scrollbar-color: var(--color-gold-dim) rgba(15, 13, 8, 0.5);
}

.popup-card.popup-wide {
    max-width: 550px;
}

.popup-card.popup-success {
    border-color: #8a9a6a;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(46, 204, 113, 0.15);
}

.popup-card.popup-danger {
    border-color: #8b3a3a;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(231, 76, 60, 0.15);
}

.popup-card.popup-warning {
    border-color: #c0a040;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(243, 156, 18, 0.15);
}

.popup-card.popup-purple {
    border-color: #9b59b6;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(155, 89, 182, 0.15);
}

.popup-card.popup-crimson {
    border-color: #8b0000;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(139, 0, 0, 0.15);
}

.popup-card::-webkit-scrollbar {
    width: 8px;
}

.popup-card::-webkit-scrollbar-track {
    background: rgba(26, 26, 46, 0.5);
    border-radius: 2px;
}

.popup-card::-webkit-scrollbar-thumb {
    background: #c0a062;
    border-radius: 2px;
}

.popup-card::-webkit-scrollbar-thumb:hover {
    background: #d4af37;
}

.popup-title {
    color: #c0a062;
    margin: 0 0 15px 0;
    font-size: 1.6em;
    letter-spacing: 1px;
}

.popup-title.popup-title-success { color: #8a9a6a; }
.popup-title.popup-title-danger { color: #8b3a3a; }
.popup-title.popup-title-warning { color: #c0a040; }
.popup-title.popup-title-purple { color: #9b59b6; }
.popup-title.popup-title-crimson { color: #8b0000; }

.popup-subtitle {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.popup-section {
    margin: 15px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    border: 1px solid rgba(192, 160, 98, 0.2);
}

.popup-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin: 15px 0;
}

.popup-stat {
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.popup-stat-value {
    font-size: 1.2em;
    font-weight: bold;
}

.popup-stat-label {
    color: #888;
    font-size: 0.8em;
    margin-top: 4px;
}

.popup-text {
    color: var(--color-aged-cream);
    line-height: 1.6;
    margin: 10px 0;
}

.popup-quote {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 2px;
    text-align: center;
    color: #888;
    font-style: italic;
    margin: 15px 0;
}

.popup-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
    color: var(--color-cream);
    letter-spacing: 1px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

.popup-btn:hover {
    filter: brightness(1.15);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.popup-btn-gold {
    background: linear-gradient(180deg, #c0a062, #8b7340);
    color: #1a1a1a;
}

.popup-btn-success {
    background: linear-gradient(180deg, #7a8a5a, #1a7a40);
}

.popup-btn-danger {
    background: linear-gradient(180deg, #c0392b, #7a1a1a);
}

.popup-btn-crimson {
    background: linear-gradient(180deg, #8b0000, #500000);
}

.popup-btn-purple {
    background: linear-gradient(180deg, #9b59b6, #6c3a87);
}

.popup-btn-secondary {
    background: #1a1610;
    color: #c0a062;
    border: 1px solid #c0a062;
}

.popup-btn-secondary:hover {
    background: #444;
}

.popup-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.popup-image-frame {
    margin: 15px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    border: 2px solid rgba(192, 160, 98, 0.3);
}

.popup-image-frame img {
    width: 200px;
    height: 150px;
    border-radius: 2px;
    object-fit: cover;
    border: 2px solid #c0a062;
    margin-bottom: 10px;
}

.popup-image-fallback {
    display: none;
    width: 200px;
    height: 150px;
    border-radius: 2px;
    background: #14120a;
    margin: 0 auto 10px auto;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #c0a062;
    border: 2px solid #c0a062;
}

@keyframes popupFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 600px) {
    .popup-card {
        padding: 20px 15px;
        max-width: 98vw;
    }

    .popup-title {
        font-size: 1.3em;
    }

    .popup-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .popup-btn {
        padding: 10px 20px;
        font-size: 0.95em;
    }

    .popup-actions {
        flex-direction: column;
    }
}

/* ==================== UI MODAL SYSTEM ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    animation: fadeIn 0.2s ease-out;
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal-container {
    background: #14120a;
    border: 2px solid var(--color-gold);
    border-radius: 2px;
    padding: 25px;
    width: 95vw;
    max-width: 500px;
    max-height: 90vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.9);
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    color: var(--color-cream);
    font-family: var(--font-body);
    overflow-y: auto;
}

.modal-header {
    margin-bottom: 15px;
    border-bottom: 1px solid #d4af37;
    padding-bottom: 10px;
}

.modal-title {
    margin: 0;
    color: #d4af37;
    font-size: 1.5em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-body {
    margin-bottom: 25px;
    font-size: 1.1em;
    line-height: 1.5;
    color: var(--color-aged-cream);
    max-height: 60vh;
    overflow-y: auto;
}

.modal-input {
    width: 100%;
    padding: 12px;
    background: #000;
    border: 1px solid #d4af37;
    border-radius: 2px;
    color: #d4af37;
    font-size: 1.1em;
    margin-top: 10px;
    box-sizing: border-box;
    font-family: var(--font-typewriter);
}

.modal-input:focus {
    outline: none;
    border-color: var(--color-cream);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    position: sticky;
    bottom: 0;
    background: #14120a;
    z-index: 1;
}
@media (max-width: 600px) {
    .modal-container {
        max-width: 98vw;
        padding: 12px 4px 12px 4px;
        font-size: 15px;
        max-height: 85vh;
        overflow-y: auto;
    }
    .modal-title {
        font-size: 18px;
    }
    .modal-body {
        font-size: 15px;
        max-height: 55vh;
        overflow-y: auto;
    }
    .modal-footer {
        flex-direction: column;
        gap: 8px;
        position: static;
    }
}

.modal-btn {
    padding: 10px 20px;
    border: 1px solid #d4af37;
    border-radius: 2px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1em;
    font-family: var(--font-display);
    text-transform: uppercase;
}

.modal-btn:focus {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}

.modal-btn-primary {
    background: linear-gradient(to bottom, #2c2c2c, #1a1a1a);
    color: #d4af37;
}

.modal-btn-primary:hover {
    background: linear-gradient(to bottom, #3c3c3c, #2a2a2a);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.modal-btn-danger {
    background: linear-gradient(to bottom, #8b0000, #500000);
    color: var(--color-cream);
    border-color: #ff0000;
}

.modal-btn-danger:hover {
    background: linear-gradient(to bottom, #a00000, #600000);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.modal-btn-secondary {
    background: linear-gradient(to bottom, #2c2c2c, #1a1a1a);
    color: #d4af37;
    border-color: #d4af37;
}

.modal-btn-secondary:hover {
    background: linear-gradient(to bottom, #3c3c3c, #2a2a2a);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #14120a;
    border-left: 4px solid var(--color-gold);
    padding: 15px 20px;
    border-radius: 2px;
    color: var(--color-cream);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    animation: slideInRight 0.3s ease-out;
    display: flex;
    align-items: center;
    min-width: 250px;
    max-width: 350px;
    border: 1px solid #333;
    font-family: var(--font-body);
}

.toast.success { border-left-color: #8a9a6a; }
.toast.error { border-left-color: #c0392b; }
.toast.warning { border-left-color: #c0a040; }
.toast.info { border-left-color: #d4af37; }

.toast-icon {
    margin-right: 10px;
    font-size: 1.2em;
}

.toast-message {
    font-size: 0.95em;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    to { opacity: 0; }
}

/* ===== Skill Tab Sections ===== */
.skill-tab-title {
    color: #7a8a6a;
    text-align: center;
    margin-bottom: 25px;
}
.skill-tab-subtitle {
    text-align: center;
    color: #bdc3c7;
    margin-bottom: 30px;
}
.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}
.skill-grid-narrow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

/* ===== RPG Skill Tree System ===== */
.rpg-skill-container {
  background: linear-gradient(135deg, #14120a, #0d0b07);
  padding: 24px;
  border-radius: 2px;
  color: var(--color-cream);
}
.rpg-skill-header {
  text-align: center;
  margin-bottom: 20px;
}
.rpg-skill-title {
  color: #d4af37;
  font-size: 2.2em;
  margin: 0 0 8px;
}
.rpg-skill-points {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(212, 175, 55, 0.15);
  border: 2px solid #d4af37;
  border-radius: 2px;
  padding: 8px 20px;
  margin-bottom: 6px;
}
.rpg-sp-label {
  color: #bdc3c7;
  font-size: 0.95em;
}
.rpg-sp-value {
  color: #d4af37;
  font-size: 1.6em;
  font-weight: 800;
}
.rpg-skill-summary {
  color: #7f8c8d;
  font-size: 0.85em;
  margin-top: 4px;
}

/* Tree selector tabs */
.rpg-tree-tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.rpg-tree-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(20, 18, 10, 0.6);
  border: 2px solid rgba(127, 140, 141, 0.4);
  border-radius: 2px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  min-width: 80px;
  color: #bdc3c7;
}
.rpg-tree-tab:hover {
  border-color: var(--tab-color, #7a8a6a);
  background: rgba(20, 18, 10, 0.9);
}
.rpg-tree-tab-active {
  background: linear-gradient(135deg, rgba(20, 18, 10, 0.95), rgba(13, 11, 7, 0.95)) !important;
  border-color: var(--tab-color, #c0a062) !important;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}
.rpg-tree-tab-icon {
  font-size: 1.5em;
}
.rpg-tree-tab-name {
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rpg-tree-tab-pts {
  font-size: 0.7em;
  color: #d4af37;
}

/* Tree panel */
.rpg-tree-panel {
  background: rgba(22, 33, 62, 0.8);
  border: 2px solid rgba(127, 140, 141, 0.3);
  border-radius: 2px;
  padding: 20px;
}
.rpg-tree-title-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.rpg-tree-title-icon {
  font-size: 2.2em;
}
.rpg-tree-title {
  color: var(--tree-color, #7a8a6a);
  margin: 0;
  font-size: 1.4em;
}
.rpg-tree-desc {
  color: #8a7a5a;
  margin: 4px 0 0;
  font-size: 0.85em;
}
.rpg-tree-invested {
  margin-left: auto;
  color: #d4af37;
  font-weight: 700;
  font-size: 1.1em;
  white-space: nowrap;
}

/* Tier sections */
.rpg-tier-section {
  margin-bottom: 16px;
}
.rpg-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(20, 18, 10, 0.4);
  border-radius: 2px;
  margin-bottom: 10px;
}
.rpg-tier-label {
  color: var(--color-cream);
  font-weight: 700;
  font-size: 0.95em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rpg-tier-req {
  font-size: 0.8em;
  color: #8b3a3a;
}
.rpg-tier-unlocked {
  color: #8a9a6a !important;
}

/* Connector line between tiers */
.rpg-tier-connector {
  display: flex;
  justify-content: center;
  padding: 4px 0 10px;
}
.rpg-connector-line {
  width: 2px;
  height: 20px;
  background: linear-gradient(to bottom, rgba(212, 175, 55, 0.6), rgba(212, 175, 55, 0.15));
}

/* Nodes grid */
.rpg-tier-nodes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

/* Individual node card */
.rpg-node {
  background: rgba(20, 18, 10, 0.7);
  border: 2px solid rgba(127, 140, 141, 0.3);
  border-radius: 2px;
  padding: 16px;
  transition: all 0.25s ease;
}
.rpg-node:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.rpg-node-available {
  border-color: var(--node-color, #7a8a6a);
}
.rpg-node-maxed {
  border-color: #d4af37 !important;
  background: rgba(212, 175, 55, 0.08);
}
.rpg-node-locked {
  opacity: 0.55;
  filter: grayscale(40%);
}
.rpg-node-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.rpg-node-icon {
  font-size: 1.8em;
}
.rpg-node-title {
  flex: 1;
}
.rpg-node-name {
  display: block;
  color: var(--color-cream);
  font-weight: 700;
  font-size: 1.05em;
}
.rpg-node-rank {
  color: #d4af37;
  font-size: 0.85em;
  font-weight: 600;
}

/* Rank progress bar */
.rpg-node-bar {
  height: 6px;
  background: rgba(20, 18, 10, 0.6);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.rpg-node-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.rpg-node-desc {
  color: #bdc3c7;
  font-size: 0.85em;
  margin: 0 0 4px;
}
.rpg-node-effect {
  color: #c0a040;
  font-size: 0.8em;
  margin: 0 0 6px;
  font-style: italic;
}
.rpg-node-stats {
  font-size: 0.78em;
  margin: 0 0 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.rpg-node-prereqs {
  font-size: 0.78em;
  color: #8a7a5a;
  margin-bottom: 8px;
}

/* Upgrade button */
.rpg-node-btn {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 2px;
  font-weight: 700;
  font-size: 0.9em;
  cursor: not-allowed;
  background: #7f8c8d;
  color: #bdc3c7;
  transition: all 0.2s ease;
}
.rpg-node-btn-active {
  background: linear-gradient(135deg, var(--node-color, #7a8a6a), rgba(var(--node-color, 52, 152, 219), 0.8));
  color: var(--color-cream);
  cursor: pointer !important;
}
.rpg-node-btn-active:hover {
  filter: brightness(1.15);
}
.rpg-node-btn-cancel {
  background: #8b3a3a !important;
  color: #f5e6c8 !important;
  cursor: pointer !important;
}
.rpg-node-btn-cancel:hover {
  filter: brightness(1.2);
}

/* Training banner at top of skill panel */
.skill-training-banner {
  background: linear-gradient(135deg, rgba(26,188,156,0.15), rgba(212,175,55,0.1));
  border: 1px solid #1abc9c;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  text-align: center;
}
.skill-training-banner-info {
  color: #f5e6c8;
  font-size: 1em;
  margin-bottom: 8px;
}
.skill-training-banner-info strong {
  color: #d4af37;
}
.skill-training-countdown {
  color: #1abc9c;
  font-weight: bold;
  margin-left: 8px;
  font-size: 1.1em;
}
.skill-training-progress {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.skill-training-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1abc9c, #d4af37);
  border-radius: 3px;
  transition: width 1s linear;
}
.skill-training-cancel-btn {
  background: #8b3a3a;
  color: #f5e6c8;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: bold;
}
.skill-training-cancel-btn:hover {
  filter: brightness(1.2);
}

/* Node-level training timer */
.rpg-node-training {
  border-color: #1abc9c !important;
  box-shadow: 0 0 12px rgba(26,188,156,0.3);
}
.rpg-node-training-timer {
  margin-bottom: 6px;
}
.rpg-node-training-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.rpg-node-training-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1abc9c, #d4af37);
  border-radius: 2px;
  transition: width 1s linear;
}
.rpg-node-training-time {
  color: #1abc9c;
  font-weight: bold;
  font-size: 0.85em;
}

/* Cost warning under train button */
.rpg-node-cost-warn {
  display: block;
  color: #e74c3c;
  font-size: 0.75em;
  margin-top: 4px;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .rpg-tree-tabs {
    gap: 4px;
  }
  .rpg-tree-tab {
    min-width: 60px;
    padding: 8px 8px;
  }
  .rpg-tree-tab-name {
    font-size: 0.65em;
  }
  .rpg-tier-nodes {
    grid-template-columns: 1fr;
  }
  .rpg-skill-title {
    font-size: 1.6em;
  }
  .rpg-tree-title-bar {
    flex-wrap: wrap;
  }
}

/* ===== Mentor Cards ===== */
.mentor-card {
    background: linear-gradient(135deg, rgba(20, 18, 10, 0.8), rgba(20, 18, 10, 0.6));
    border: 1px solid rgba(142, 68, 173, 0.5);
    border-radius: 2px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.mentor-card:hover {
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3);
}
.mentor-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.mentor-card-icon {
    font-size: 2em;
    margin-right: 15px;
}
.mentor-card-name {
    color: #8e44ad;
    margin: 0;
}
.mentor-card-faction {
    color: #bdc3c7;
    margin: 5px 0;
    font-size: 0.9em;
}
.mentor-card-quote {
    color: var(--color-cream);
    font-size: 0.9em;
    margin-bottom: 15px;
    font-style: italic;
}
.mentor-specialties-title {
    color: #c0a040;
    margin: 0 0 10px 0;
}
.mentor-specialty-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
    padding: 5px;
    background: rgba(142, 68, 173, 0.2);
    border-radius: 2px;
}
.mentor-specialty-icon {
    margin-right: 10px;
}
.mentor-specialty-name {
    color: var(--color-cream);
    font-size: 0.9em;
}
.mentor-session-info {
    color: #8a7a5a;
    font-size: 0.9em;
    margin-bottom: 15px;
}
.mentor-train-btn {
    color: var(--color-cream);
    border: none;
    padding: 12px 20px;
    border-radius: 2px;
    font-weight: bold;
    width: 100%;
    cursor: pointer;
}
.mentor-train-btn:disabled {
    background: #7f8c8d !important;
    cursor: not-allowed;
}
.mentor-train-btn.available {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
}
.mentor-tips {
    margin-top: 30px;
    padding: 20px;
    background: rgba(243, 156, 18, 0.2);
    border-radius: 2px;
    border: 1px solid #c0a040;
}
.mentor-tips h4 {
    color: #c0a040;
    margin: 0 0 15px 0;
}
.mentor-tips ul {
    color: #bdc3c7;
    margin: 0;
    padding-left: 20px;
}
.mentor-empty-state {
    text-align: center;
    padding: 40px;
    background: rgba(20, 18, 10, 0.3);
    border-radius: 2px;
}
.mentor-empty-icon {
    font-size: 4em;
    opacity: 0.5;
}
.mentor-empty-title {
    color: #8a7a5a;
    margin: 20px 0;
}
.mentor-empty-desc {
    color: #bdc3c7;
    margin: 0;
}

/* ==================== MOBILE FIX PASS ==================== */

/* Intro screen: stack buttons vertically on mobile */
.mobile-device #intro-screen button {
    display: block !important;
    width: 100% !important;
    margin: 8px 0 !important;
    box-sizing: border-box !important;
}

/* Store screen: collapse 2-column grid to single column on mobile */
.mobile-device #store-screen > div[style*="grid"] {
    grid-template-columns: 1fr !important;
}

/* Toast notifications above the quick actions bar on mobile */
.mobile-device .toast-container {
    bottom: 80px !important;
}

/* Mini-games grid: fit on small phones */
@media (max-width: 480px) {
    #panel-minigames div[style*="minmax(300px"],
    #minigames-card-grid {
        grid-template-columns: 1fr !important;
    }
}

/* TikTakToe cells: smaller on mobile */
.mobile-device .tiktaktoe-cell,
.mobile-device .mg-tiktaktoe-cell {
    width: 60px !important;
    height: 60px !important;
    font-size: 20px !important;
}

.mobile-device #tiktaktoe-board,
.mobile-device #mg-tiktaktoe-board {
    grid-template-columns: repeat(3, 60px) !important;
}

/* Casino game selection grid: smaller minimum on very narrow screens */
@media (max-width: 380px) {
    #casino-game-select div[style*="minmax(150px"] {
        grid-template-columns: 1fr !important;
    }
}

/* ==================== AUTH & CLOUD SAVE ==================== */
/* Full-screen auth page */
.auth-fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #0a0908 0%, #14120a 40%, #0d0b07 100%);
    z-index: 99999;
    overflow-y: auto;
    animation: authFadeIn 0.3s ease;
}
@keyframes authFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.auth-fullscreen-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 30px 60px;
    position: relative;
}

/* Hero / header area */
.auth-hero {
    text-align: center;
    margin-bottom: 35px;
}
.auth-hero-logo {
    max-width: 340px;
    width: 80%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    border: 2px solid #d4af37;
    margin-bottom: 14px;
}
.auth-hero-tagline {
    color: #c0a062;
    font-size: 1.15em;
    font-style: italic;
    letter-spacing: 1px;
    margin: 0;
}

/* Two-column layout: features | form */
.auth-content-wrap {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* Features column */
.auth-features-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.auth-feature-card {
    background: rgba(20, 18, 10, 0.7);
    border: 1px solid #3a3220;
    border-radius: 2px;
    padding: 16px 18px;
}
.auth-feature-title {
    display: block;
    color: #c0a062;
    font-size: 1em;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.auth-feature-desc {
    display: block;
    color: #8a7a5a;
    font-size: 0.88em;
    line-height: 1.4;
}

/* Form column */
.auth-form-col {
    flex: 1;
    background: linear-gradient(135deg, #14120a 0%, #1a1610 50%, #0d0b07 100%);
    border: 2px solid var(--color-gold);
    border-radius: 2px;
    padding: 30px 28px;
    text-align: center;
}

.auth-close {
    position: absolute;
    top: 12px; right: 18px;
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
    z-index: 1;
}
.auth-close:hover { color: var(--color-cream); }
.auth-title {
    color: var(--color-gold);
    font-size: 1.5em;
    margin: 0 0 5px;
    font-family: var(--font-heading);
    letter-spacing: 2px;
}
.auth-subtitle {
    color: #8899aa;
    font-size: 0.9em;
    margin: 0 0 22px;
}
.auth-field {
    margin-bottom: 14px;
    text-align: left;
}
.auth-field label {
    display: block;
    color: #bbb;
    font-size: 0.85em;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.auth-field input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #444;
    border-radius: 2px;
    color: var(--color-cream);
    font-size: 1em;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.auth-field input:focus {
    border-color: #d4af37;
}
.auth-field-hint {
    color: #8a7a5a;
    font-size: 0.8em;
    margin: 5px 0 0;
    line-height: 1.35;
}
.auth-error {
    color: #ff6b6b;
    font-size: 0.85em;
    min-height: 20px;
    margin: 5px 0 10px;
}
.auth-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 2px;
    font-size: 1em;
    font-family: var(--font-heading);
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.2s;
    font-weight: bold;
    letter-spacing: 1px;
}
.auth-btn-primary {
    background: linear-gradient(to bottom, #c0a050, #8b7530);
    color: #1a1a1a;
}
.auth-btn-primary:hover:not(:disabled) {
    background: linear-gradient(to bottom, #d4b44e, #a08830);
    transform: translateY(-1px);
}
.auth-btn-secondary {
    background: linear-gradient(to bottom, #2a3a4a, #1a2a3a);
    color: #8899aa;
    border: 1px solid #3a4a5a;
}
.auth-btn-secondary:hover:not(:disabled) {
    background: linear-gradient(to bottom, #3a4a5a, #2a3a4a);
    color: #aabbcc;
}
.auth-btn-danger {
    background: transparent;
    color: #ff6b6b;
    border: 1px solid #553333;
    font-size: 0.9em;
}
.auth-btn-danger:hover { background: rgba(255, 50, 50, 0.1); }
.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.auth-toggle {
    color: #778;
    font-size: 0.85em;
    margin-top: 15px;
}
.auth-link {
    color: #4a9eff;
    cursor: pointer;
    text-decoration: underline;
}
.auth-link:hover { color: #7bb8ff; }
.auth-profile-info {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #333;
}
.auth-profile-info p {
    margin: 5px 0;
    color: var(--color-aged-cream);
}
.auth-save-info {
    font-size: 0.85em;
    color: #888 !important;
    margin-top: 8px !important;
}

/* Responsive: stack on mobile */
@media (max-width: 700px) {
    .auth-fullscreen-inner {
        padding: 25px 16px 40px;
    }
    .auth-content-wrap {
        flex-direction: column;
        gap: 24px;
    }
    .auth-features-col {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .auth-form-col {
        padding: 24px 18px;
    }
    .auth-hero-logo {
        max-width: 260px;
    }
}
@media (max-width: 440px) {
    .auth-features-col {
        grid-template-columns: 1fr;
    }
}

/* Auth status in stats bar */
.auth-status-indicator {
    cursor: pointer;
    font-size: 0.85em;
}
.auth-status-online {
    color: #4a9eff;
}
.auth-status-offline {
    color: #666;
}

/* ==================== EXPANDED GAMEPLAY STYLES ==================== */
/* Merged from expanded-styles.css */

/* Overlay for expanded screens */
.expanded-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    overflow-y: auto;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.expanded-screen {
    max-width: 1400px;
    margin: 0 auto;
    background: linear-gradient(135deg, #0d0b07 0%, #1a1610 100%);
    border: 2px solid var(--color-gold);
    border-radius: 2px;
    padding: 30px;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.15);
}

.expanded-screen h2 {
    color: #d4af37;
    font-size: 2.5em;
    margin: 0 0 10px 0;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.subtitle {
    color: #8a7a5a;
    font-style: italic;
    margin-bottom: 30px;
}

/* Gang Management Styles */
.gang-stats {
    display: flex;
    justify-content: space-around;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid #d4af37;
    border-radius: 2px;
    padding: 15px;
    margin-bottom: 30px;
}

.gang-stats p {
    margin: 5px;
    color: var(--color-cream);
}

.member-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.gang-member-card {
    background: linear-gradient(135deg, #1a1610 0%, #0d0b07 100%);
    border: 2px solid #444;
    border-radius: 2px;
    padding: 20px;
    transition: all 0.3s ease;
}

.gang-member-card:hover {
    border-color: var(--color-gold-dim);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.gang-member-card.injured {
    border-color: #ff6b35;
    opacity: 0.8;
}

.gang-member-card.jailed {
    border-color: #ff0000;
    opacity: 0.6;
}

.gang-member-card.dead {
    border-color: #333;
    opacity: 0.3;
    filter: grayscale(100%);
}

.member-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.member-header h3 {
    margin: 0;
    color: #d4af37;
    font-size: 1.3em;
}

.status-badge {
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 2px;
    font-size: 0.9em;
    color: var(--color-cream);
    font-family: var(--font-typewriter);
}

.member-role {
    color: #8a7a5a;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.member-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
}

.stat {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 2px;
    font-size: 0.9em;
    font-family: var(--font-typewriter);
}

.member-perk {
    background: rgba(212, 175, 55, 0.2);
    border-left: 3px solid #d4af37;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.member-traits {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.trait-badge {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--color-gold-dim);
    padding: 4px 8px;
    border-radius: 2px;
    font-size: 0.85em;
    color: var(--color-aged-cream);
    font-family: var(--font-typewriter);
}

.assignment {
    background: rgba(0, 255, 0, 0.1);
    border-left: 3px solid #00ff00;
    padding: 8px;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.member-actions {
    display: flex;
    gap: 10px;
}

.member-actions button {
    flex: 1;
    padding: 8px;
    font-size: 0.85em;
}

.gang-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

/* Territory Map Styles */
.territory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.territory-card {
    background: linear-gradient(135deg, #1a1610 0%, #0d0b07 100%);
    border: 2px solid #444;
    border-radius: 2px;
    padding: 20px;
    transition: all 0.3s ease;
}

.territory-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    border-color: var(--color-gold-dim);
}

.territory-card.controlled {
    border-color: #00ff00;
}

.territory-card.uncontrolled {
    border-color: #ff6b35;
}

.territory-card.low {
    background: linear-gradient(135deg, #2a3a2a 0%, #1a2a1a 100%);
}

.territory-card.medium {
    background: linear-gradient(135deg, #3a3a2a 0%, #2a2a1a 100%);
}

.territory-card.high {
    background: linear-gradient(135deg, #3a2a2a 0%, #2a1a1a 100%);
}

.territory-card.very-high {
    background: linear-gradient(135deg, #4a1a1a 0%, #3a0a0a 100%);
}

.territory-card h3 {
    color: #d4af37;
    margin: 0 0 10px 0;
}

.territory-description {
    color: #8a7a5a;
    font-size: 0.9em;
    margin-bottom: 15px;
    font-style: italic;
}

.territory-info {
    margin-bottom: 15px;
}

.territory-info div {
    padding: 5px;
    color: var(--color-aged-cream);
}

.territory-status {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    padding: 10px;
    margin: 15px 0;
}

.territory-status strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.territory-status.controlled strong {
    color: #00ff00;
}

.territory-status.uncontrolled strong {
    color: #ff6b35;
}

.territory-actions {
    display: flex;
    gap: 10px;
}

.territory-actions button {
    flex: 1;
    padding: 10px;
    font-size: 0.9em;
}

.territory-legend {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 2px;
    margin-bottom: 20px;
}

.territory-legend h3 {
    margin: 0 0 10px 0;
    color: #d4af37;
}

.territory-legend span {
    display: inline-block;
    padding: 5px 15px;
    margin-right: 10px;
    margin-bottom: 5px;
    border-radius: 2px;
}

.risk-low { background: #2a4a2a; }
.risk-medium { background: #4a4a2a; }
.risk-high { background: #4a2a2a; }
.risk-very-high { background: #5a1a1a; }

/* Defender Manager */
.defender-manager {
    max-width: 800px;
    margin: 0 auto;
    background: #14120a;
    padding: 30px;
    border-radius: 2px;
}

.current-defenders, .available-members {
    margin-bottom: 30px;
}

.current-defenders h3, .available-members h3 {
    color: #d4af37;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.defender-item, .member-item {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid #666;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.defender-item button, .member-item button {
    padding: 5px 15px;
}

/* Interactive Events */
.interactive-event {
    max-width: 900px;
    margin: 0 auto;
    background: #14120a;
    padding: 40px;
    border-radius: 2px;
    border: 2px solid #ff6b35;
}

.interactive-event h2 {
    font-size: 2.5em;
    margin: 0 0 20px 0;
    text-align: center;
}

.event-description {
    font-size: 1.2em;
    color: var(--color-aged-cream);
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.6;
}

.event-choices {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.event-choice {
    background: linear-gradient(135deg, #1a1610 0%, #0d0b07 100%);
    border: 2px solid #d4af37;
    border-radius: 2px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.event-choice:hover:not(.disabled) {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    transform: translateX(5px);
}

.event-choice.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #666;
}

.event-choice h3 {
    color: #d4af37;
    margin: 0 0 10px 0;
}

.success-chance {
    background: rgba(0, 255, 0, 0.2);
    border-left: 3px solid #00ff00;
    padding: 5px 10px;
    margin: 10px 0;
    font-weight: bold;
}

.requirements {
    color: #8a7a5a;
    font-size: 0.9em;
    margin-top: 10px;
}

.requirements-not-met {
    color: #ff6b35;
    font-weight: bold;
    margin-top: 10px;
}

/* Event Outcome */
.event-outcome {
    max-width: 700px;
    margin: 0 auto;
    background: #14120a;
    padding: 40px;
    border-radius: 2px;
    text-align: center;
}

.event-outcome.success {
    border: 3px solid #00ff00;
}

.event-outcome.failure {
    border: 3px solid #ff0000;
}

.event-outcome h2 {
    font-size: 3em;
    margin: 0 0 20px 0;
}

.outcome-message {
    font-size: 1.3em;
    line-height: 1.6;
    margin-bottom: 30px;
    color: var(--color-aged-cream);
}

.outcome-effects {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    padding: 20px;
    margin-bottom: 30px;
}

.outcome-effects div {
    font-size: 1.1em;
    padding: 8px;
    color: var(--color-cream);
}

/* Rival Kingpins */
.rivals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.rival-card {
    background: linear-gradient(135deg, #2a1a1a 0%, #1a0a0a 100%);
    border: 2px solid #ff6b35;
    border-radius: 2px;
    padding: 20px;
    transition: all 0.3s ease;
}

.rival-card:hover {
    border-color: #ff9b65;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

.rival-card h3 {
    color: #ff6b35;
    margin: 0 0 5px 0;
    font-size: 1.4em;
}

.rival-faction {
    color: #8a7a5a;
    text-transform: uppercase;
    font-size: 0.85em;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.rival-stats {
    margin-bottom: 15px;
}

.rival-stats div {
    padding: 5px;
    color: var(--color-aged-cream);
}

.rival-personality {
    background: rgba(255, 107, 53, 0.1);
    border-left: 3px solid #ff6b35;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.rival-ability {
    background: rgba(212, 175, 55, 0.2);
    border-left: 3px solid #d4af37;
    padding: 10px;
    font-size: 0.9em;
}

/* Don's Vault */
.vault-completion {
    background: rgba(212, 175, 55, 0.1);
    border: 2px solid #d4af37;
    border-radius: 2px;
    padding: 20px;
    margin-bottom: 30px;
}

.vault-completion h3 {
    margin: 0 0 15px 0;
    color: #d4af37;
    text-align: center;
}

.progress-bar {
    background: rgba(0, 0, 0, 0.5);
    height: 30px;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #d4af37 0%, #ffd700 100%);
    height: 100%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.vault-category {
    margin-bottom: 40px;
}

.vault-category h3 {
    color: #d4af37;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.collectibles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.collectible-card {
    background: linear-gradient(135deg, #1a1610 0%, #0d0b07 100%);
    border: 2px solid #666;
    border-radius: 2px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.collectible-card.collected {
    border-color: #d4af37;
}

.collectible-card.collected:hover {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

.collectible-card.locked {
    opacity: 0.3;
}

.collectible-card h4 {
    margin: 0 0 10px 0;
    color: #d4af37;
}

.rarity {
    font-size: 0.85em;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: bold;
}

.rarity-legendary { color: #ff6600; }
.rarity-epic { color: #9933ff; }
.rarity-rare { color: #0099ff; }
.rarity-uncommon { color: #00ff00; }

.value {
    font-size: 0.9em;
    color: #8a7a5a;
}

.locked-message {
    color: #666;
    font-style: italic;
}

/* Relationships */
.relationships-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.relationship-card {
    background: linear-gradient(135deg, #1a1610 0%, #0d0b07 100%);
    border: 2px solid #666;
    border-radius: 2px;
    padding: 20px;
    transition: all 0.3s ease;
}

.relationship-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.relationship-card.very-high { border-color: #00ff00; }
.relationship-card.high { border-color: #88ff88; }
.relationship-card.neutral { border-color: #8a7a5a; }
.relationship-card.low { border-color: #ff8800; }
.relationship-card.very-low { border-color: #ff0000; }

.relationship-card h3 {
    margin: 0 0 10px 0;
    color: #d4af37;
}

.respect-value {
    font-size: 1.1em;
    margin-bottom: 15px;
    font-weight: bold;
}

.respect-bar-container {
    background: rgba(0, 0, 0, 0.5);
    height: 20px;
    border-radius: 2px;
    overflow: hidden;
}

.respect-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.respect-bar-fill.very-high { background: #00ff00; }
.respect-bar-fill.high { background: #88ff88; }
.respect-bar-fill.neutral { background: #aaa; }
.respect-bar-fill.low { background: #ff8800; }
.respect-bar-fill.very-low { background: #ff0000; }

.respect-legend {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 2px;
    margin-bottom: 20px;
}

.respect-legend h3 {
    margin: 0 0 15px 0;
    color: #d4af37;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: var(--color-aged-cream);
}

.legend-item .respect-bar {
    display: inline-block;
    width: 60px;
    height: 20px;
    border-radius: 2px;
    margin-right: 10px;
}

/* ==================== OPERATIONS / MISSIONS SCREEN ==================== */

/* Tab navigation bar */
.ops-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #333;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.ops-tab {
    flex: 1;
    min-width: 140px;
    padding: 14px 10px;
    background: transparent;
    color: #777;
    border: none;
    border-bottom: 3px solid transparent;
    font-family: var(--font-display);
    font-size: 0.95em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: color 0.25s, border-color 0.25s, background 0.25s;
    text-align: center;
    position: relative;
}

.ops-tab:hover {
    color: #d4af37;
    background: rgba(212,175,55,0.05);
}

.ops-tab.active {
    color: #d4af37;
    border-bottom-color: #d4af37;
    background: rgba(212,175,55,0.08);
}

.ops-tab .tab-icon {
    display: block;
    font-size: 1.3em;
    margin-bottom: 4px;
}

.ops-tab .tab-count {
    display: inline-block;
    background: #8b0000;
    color: var(--color-cream);
    font-size: 0.7em;
    padding: 1px 6px;
    border-radius: 2px;
    margin-left: 6px;
    vertical-align: middle;
    font-family: Arial, sans-serif;
}

/* Tab content panels */
.ops-panel {
    display: none;
    animation: opsFadeIn 0.3s ease;
}

.ops-panel.active {
    display: block;
}

@keyframes opsFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Faction intel strip (compact top bar) */
.ops-intel-strip {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid #333;
    border-radius: 2px;
    overflow-x: auto;
    flex-wrap: wrap;
}

.ops-intel-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
    border-left: 3px solid var(--family-color, #666);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 0;
}

.ops-intel-chip .chip-name {
    color: var(--family-color, #d4af37);
    font-weight: bold;
    font-size: 0.85em;
}

.ops-intel-chip .chip-meta {
    color: #888;
    font-size: 0.75em;
}

.ops-intel-chip .chip-rep {
    color: #d4af37;
    font-size: 0.8em;
    font-weight: bold;
}

/* Section within a panel */
.ops-section {
    margin-bottom: 28px;
}

.ops-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #d4af37;
    font-family: var(--font-display);
    font-size: 1.15em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212,175,55,0.25);
}

.ops-section-title .title-icon {
    font-size: 1.2em;
}

/* Mission card (used across all tabs) */
.ops-card {
    background: rgba(26, 26, 26, 0.7);
    border: 1px solid #2a2a2a;
    border-radius: 2px;
    padding: 16px 18px;
    margin-bottom: 12px;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.15s;
    position: relative;
}

.ops-card:hover {
    border-color: #444;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    transform: translateY(-1px);
}

.ops-card.card-available {
    border-left: 4px solid #8a9a6a;
}

.ops-card.card-locked {
    border-left: 4px solid #555;
    opacity: 0.65;
}

.ops-card.card-locked:hover {
    opacity: 0.85;
}

.ops-card.card-signature {
    border-left: 4px solid #9b59b6;
    background: rgba(155, 89, 182, 0.06);
}

.ops-card.card-boss {
    border-left: 4px solid #9b59b6;
}

.ops-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.ops-card .card-title {
    color: var(--color-cream);
    font-family: var(--font-display);
    font-size: 1.05em;
    font-weight: bold;
    margin: 0;
}

.ops-card.card-available .card-title {
    color: #f0e6d2;
}

.ops-card.card-locked .card-title {
    color: #888;
}

.ops-card .card-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 2px;
    font-size: 0.7em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.card-badge.badge-available { background: rgba(46,204,113,0.2); color: #8a9a6a; border: 1px solid rgba(46,204,113,0.3); }
.card-badge.badge-locked { background: rgba(100,100,100,0.2); color: #888; border: 1px solid #444; }
.card-badge.badge-signature { background: rgba(155,89,182,0.2); color: #9b59b6; border: 1px solid rgba(155,89,182,0.3); }
.card-badge.badge-cooldown { background: rgba(230,126,34,0.2); color: #e67e22; border: 1px solid rgba(230,126,34,0.3); }
.card-badge.badge-boss { background: rgba(155,89,182,0.2); color: #9b59b6; border: 1px solid rgba(155,89,182,0.3); }

.ops-card .card-desc {
    color: #8a7a5a;
    font-size: 0.88em;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* Stat row inside a card */
.ops-card .card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-bottom: 10px;
}

.ops-card .stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8em;
    color: #999;
}

.ops-card .stat .stat-val {
    color: #d4af37;
    font-weight: bold;
}

.ops-card .stat .stat-val.val-danger {
    color: #8b3a3a;
}

.ops-card .stat .stat-val.val-ok {
    color: #8a9a6a;
}

/* Requirements strip */
.ops-card .card-reqs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.ops-card .req-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 2px;
    font-size: 0.75em;
    font-weight: 600;
}

.req-tag.req-met { background: rgba(46,204,113,0.12); color: #8a9a6a; border: 1px solid rgba(46,204,113,0.2); }
.req-tag.req-unmet { background: rgba(231,76,60,0.12); color: #8b3a3a; border: 1px solid rgba(231,76,60,0.2); }

/* Action button at card bottom */
.ops-card .card-action {
    display: inline-block;
    padding: 10px 22px;
    border: none;
    border-radius: 2px;
    font-family: var(--font-display);
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s;
}

.ops-card .card-action:hover:not(:disabled) {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.ops-card .card-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.card-action.act-go { background: linear-gradient(135deg, #8a9a6a, #7a8a5a); color: var(--color-cream); }
.card-action.act-boss { background: linear-gradient(135deg, #9b59b6, #8e44ad); color: var(--color-cream); }
.card-action.act-signature { background: linear-gradient(135deg, #9b59b6, #7d3c98); color: var(--color-cream); }
.card-action.act-locked { background: #1a1610; color: #666; }

/* Campaign (story) panel specifics */
.ops-campaign-box {
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid #333;
    border-left: 4px solid #d4af37;
    border-radius: 2px;
    padding: 20px 22px;
    margin-bottom: 16px;
}

.ops-campaign-box .chapter-label {
    color: #d4af37;
    font-family: var(--font-display);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.ops-campaign-box .chapter-title {
    color: #f0e6d2;
    font-family: var(--font-display);
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.ops-campaign-box .chapter-desc {
    color: #bbb;
    font-size: 0.9em;
    line-height: 1.6;
    margin-bottom: 16px;
}

.ops-objective {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.03);
    border-radius: 2px;
    border-left: 3px solid #555;
    transition: border-color 0.2s;
}

.ops-objective.obj-done {
    border-left-color: #8a9a6a;
}

.ops-objective .obj-check {
    font-size: 1.1em;
    flex-shrink: 0;
}

.ops-objective .obj-text {
    color: var(--color-aged-cream);
    font-size: 0.88em;
    flex: 1;
}

.ops-objective.obj-done .obj-text {
    color: #8a9a6a;
    text-decoration: line-through;
    text-decoration-color: rgba(46,204,113,0.4);
}

.ops-objective .obj-progress {
    color: #d4af37;
    font-size: 0.8em;
    font-weight: bold;
    white-space: nowrap;
}

.ops-rewards-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(46,204,113,0.08);
    border: 1px solid rgba(46,204,113,0.15);
    border-radius: 2px;
    margin-top: 12px;
}

.ops-rewards-bar .reward-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82em;
    color: #8a7a5a;
}

.ops-rewards-bar .reward-item .reward-val {
    color: #8a9a6a;
    font-weight: bold;
}

/* Family group within faction tab */
.ops-family-group {
    margin-bottom: 22px;
    border: 1px solid #2a2a2a;
    border-radius: 2px;
    overflow: hidden;
}

.ops-family-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0,0,0,0.5);
    border-bottom: 1px solid #2a2a2a;
    cursor: pointer;
    transition: background 0.2s;
    border-left: 4px solid var(--family-color, #666);
}

.ops-family-header:hover {
    background: rgba(255,255,255,0.03);
}

.ops-family-header .fam-name {
    color: var(--family-color, #d4af37);
    font-family: var(--font-display);
    font-size: 1em;
    font-weight: bold;
}

.ops-family-header .fam-meta {
    color: #888;
    font-size: 0.78em;
}

.ops-family-header .fam-toggle {
    color: #666;
    font-size: 1.2em;
    transition: transform 0.25s;
}

.ops-family-header.expanded .fam-toggle {
    transform: rotate(180deg);
}

.ops-family-body {
    padding: 12px 16px;
    display: none;
}

.ops-family-body.expanded {
    display: block;
}

/* Territory info bar */
.ops-territory-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid #333;
    border-radius: 2px;
    margin-bottom: 18px;
    align-items: center;
}

.ops-territory-info .info-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: #8a7a5a;
}

.ops-territory-info .info-item .info-val {
    color: #d4af37;
    font-weight: bold;
}

/* Back button styled to match game theme */
.ops-back-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 28px;
    background: linear-gradient(to bottom, #2c2c2c, #1a1a1a);
    color: #d4af37;
    border: 2px solid #d4af37;
    border-radius: 2px;
    font-family: var(--font-display);
    font-size: 0.95em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.ops-back-btn:hover {
    background: linear-gradient(to bottom, #3c3c3c, #2a2a2a);
    box-shadow: 0 0 15px rgba(212,175,55,0.4);
}

/* Locked toggle link */
.ops-locked-toggle {
    display: inline-block;
    padding: 6px 0;
    color: #666;
    font-size: 0.82em;
    cursor: pointer;
    border: none;
    background: none;
    transition: color 0.2s;
    margin-top: 8px;
}

.ops-locked-toggle:hover {
    color: #999;
}

/* Responsive adjustments for ops screen */
@media (max-width: 900px) {
    .ops-tabs {
        gap: 0;
    }
    .ops-tab {
        min-width: 0;
        padding: 10px 6px;
        font-size: 0.8em;
    }
    .ops-tab .tab-icon {
        font-size: 1.1em;
    }
    .ops-intel-strip {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    .ops-card .card-stats {
        gap: 4px 10px;
    }
}

@media (max-width: 480px) {
    .ops-tab {
        padding: 8px 3px;
        font-size: 0.68em;
        letter-spacing: 0.5px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Expanded screens responsive adjustments */
@media (max-width: 768px) {
    .expanded-screen-overlay {
        padding: 10px;
    }
    
    .expanded-screen {
        padding: 20px;
    }
    
    .member-list,
    .territory-grid,
    .rivals-grid,
    .perks-grid,
    .collectibles-grid,
    .relationships-grid {
        grid-template-columns: 1fr;
    }
    
    .gang-stats {
        flex-direction: column;
    }
    
    .event-choices {
        gap: 15px;
    }
}

/* ══════════════════════════════════════════════════════
   STORY MODE — Immersive SP narrative screens
   ══════════════════════════════════════════════════════ */

/* ── Shared screen wrapper ── */
.story-screen {
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 18px 40px;
    color: var(--color-cream);
    font-family: var(--font-display);
}

/* ── Family Picker ── */
.story-title-block {
    text-align: center;
    margin-bottom: 32px;
}

.story-main-title {
    font-size: 2em;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0 0 6px;
    text-shadow: 0 2px 12px rgba(212,175,55,0.35);
}

.story-subtitle {
    color: #999;
    font-style: italic;
    font-size: 0.95em;
    margin: 0;
}

.story-family-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.story-family-card {
    background: rgba(15, 13, 8, 0.85);
    border: 1px solid #2a2a2a;
    border-radius: 2px;
    padding: 22px 18px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* ==================== THEME SYSTEM ==================== */

/* -- Classic (default, no override needed) -- */

/* -- Midnight Blue -- */
[data-theme="midnight"] {
    --color-bg: #0a0c14;
    --color-bg-warm: #0e1018;
    --color-gold: #5b8dd9;
    --color-gold-dim: #3a6bbd;
    --color-cream: #c8d8f0;
    --color-aged-cream: #a8bdd8;
    --color-burgundy: #1a2a4a;
    --color-blood: #2a4a7a;
    --color-olive: #2a2a3a;
    --color-btn-bg-top: #141828;
    --color-btn-bg-bottom: #0a0e1a;
    --color-btn-hover-top: #1a2038;
    --color-btn-hover-bottom: #101428;
    --color-panel-bg: rgba(10, 14, 26, 0.7);
    --color-panel-border: #2a3050;
    --color-statsbar-top: #0e1220;
    --color-statsbar-bottom: #060a14;
    --color-section-accent: rgba(30, 50, 100, 0.4);
}

/* -- Blood Red -- */
[data-theme="blood"] {
    --color-bg: #0e0606;
    --color-bg-warm: #120808;
    --color-gold: #c43030;
    --color-gold-dim: #8b2020;
    --color-cream: #f0d0d0;
    --color-aged-cream: #d8b0b0;
    --color-burgundy: #3a0a0a;
    --color-blood: #aa1a1a;
    --color-olive: #3a2a2a;
    --color-btn-bg-top: #281414;
    --color-btn-bg-bottom: #1a0a0a;
    --color-btn-hover-top: #382020;
    --color-btn-hover-bottom: #281414;
    --color-panel-bg: rgba(26, 10, 10, 0.7);
    --color-panel-border: #502a2a;
    --color-statsbar-top: #200e0e;
    --color-statsbar-bottom: #100606;
    --color-section-accent: rgba(100, 20, 20, 0.4);
}

/* -- Emerald -- */
[data-theme="emerald"] {
    --color-bg: #060e08;
    --color-bg-warm: #081208;
    --color-gold: #3aaa5c;
    --color-gold-dim: #2a8a4a;
    --color-cream: #d0f0d8;
    --color-aged-cream: #b0d8b8;
    --color-burgundy: #0a2a10;
    --color-blood: #1a5a2a;
    --color-olive: #2a3a2a;
    --color-btn-bg-top: #142818;
    --color-btn-bg-bottom: #0a1a0c;
    --color-btn-hover-top: #1a3820;
    --color-btn-hover-bottom: #102814;
    --color-panel-bg: rgba(10, 26, 14, 0.7);
    --color-panel-border: #2a502a;
    --color-statsbar-top: #0e200e;
    --color-statsbar-bottom: #061006;
    --color-section-accent: rgba(20, 80, 30, 0.4);
}

/* -- Royal Purple -- */
[data-theme="purple"] {
    --color-bg: #0c0810;
    --color-bg-warm: #100c14;
    --color-gold: #9b6ad4;
    --color-gold-dim: #7a50b0;
    --color-cream: #e0d0f0;
    --color-aged-cream: #c8b0d8;
    --color-burgundy: #2a0e3a;
    --color-blood: #5a1a7a;
    --color-olive: #2a2a3a;
    --color-btn-bg-top: #201428;
    --color-btn-bg-bottom: #140c1a;
    --color-btn-hover-top: #2a1a38;
    --color-btn-hover-bottom: #1a1028;
    --color-panel-bg: rgba(20, 12, 28, 0.7);
    --color-panel-border: #3a2a50;
    --color-statsbar-top: #180e22;
    --color-statsbar-bottom: #0c0614;
    --color-section-accent: rgba(60, 20, 80, 0.4);
}

/* -- Copper -- */
[data-theme="copper"] {
    --color-bg: #0e0a06;
    --color-bg-warm: #120e08;
    --color-gold: #c87040;
    --color-gold-dim: #a05830;
    --color-cream: #f0dcc8;
    --color-aged-cream: #d8c0a8;
    --color-burgundy: #3a1a0a;
    --color-blood: #7a3a1a;
    --color-olive: #3a2a1a;
    --color-btn-bg-top: #281c10;
    --color-btn-bg-bottom: #1a1008;
    --color-btn-hover-top: #382818;
    --color-btn-hover-bottom: #281c10;
    --color-panel-bg: rgba(26, 16, 8, 0.7);
    --color-panel-border: #503828;
    --color-statsbar-top: #201408;
    --color-statsbar-bottom: #100a04;
    --color-section-accent: rgba(100, 50, 20, 0.4);
}

/* -- Noir -- */
[data-theme="noir"] {
    --color-bg: #0a0a0a;
    --color-bg-warm: #0e0e0e;
    --color-gold: #a0a0a0;
    --color-gold-dim: #808080;
    --color-cream: #e0e0e0;
    --color-aged-cream: #c0c0c0;
    --color-burgundy: #1a1a1a;
    --color-blood: #3a3a3a;
    --color-olive: #2a2a2a;
    --color-btn-bg-top: #1c1c1c;
    --color-btn-bg-bottom: #101010;
    --color-btn-hover-top: #282828;
    --color-btn-hover-bottom: #1c1c1c;
    --color-panel-bg: rgba(14, 14, 14, 0.7);
    --color-panel-border: #333;
    --color-statsbar-top: #161616;
    --color-statsbar-bottom: #0a0a0a;
    --color-section-accent: rgba(40, 40, 40, 0.4);
}

/* -- Frost -- */
[data-theme="frost"] {
    --color-bg: #080c10;
    --color-bg-warm: #0c1014;
    --color-gold: #60b8d0;
    --color-gold-dim: #4898b0;
    --color-cream: #d0e8f0;
    --color-aged-cream: #b0d0d8;
    --color-burgundy: #0a1a2a;
    --color-blood: #1a4a5a;
    --color-olive: #2a3038;
    --color-btn-bg-top: #141c24;
    --color-btn-bg-bottom: #0a1018;
    --color-btn-hover-top: #1c2430;
    --color-btn-hover-bottom: #141c24;
    --color-panel-bg: rgba(10, 16, 24, 0.7);
    --color-panel-border: #2a3848;
    --color-statsbar-top: #0e161e;
    --color-statsbar-bottom: #060c12;
    --color-section-accent: rgba(20, 60, 80, 0.4);
}

/* -- Old Money -- */
[data-theme="oldmoney"] {
    --color-bg: #0c0a06;
    --color-bg-warm: #100e0a;
    --color-gold: #b8a040;
    --color-gold-dim: #988030;
    --color-cream: #f0e8d0;
    --color-aged-cream: #d8d0b0;
    --color-burgundy: #2a2410;
    --color-blood: #5a4a20;
    --color-olive: #3a3820;
    --color-btn-bg-top: #242010;
    --color-btn-bg-bottom: #181408;
    --color-btn-hover-top: #302a18;
    --color-btn-hover-bottom: #242010;
    --color-panel-bg: rgba(24, 20, 10, 0.7);
    --color-panel-border: #484028;
    --color-statsbar-top: #1c180c;
    --color-statsbar-bottom: #0e0c06;
    --color-section-accent: rgba(70, 60, 20, 0.4);
}

/* -- Inferno -- */
[data-theme="inferno"] {
    --color-bg: #100804;
    --color-bg-warm: #140c06;
    --color-gold: #e88020;
    --color-gold-dim: #c06818;
    --color-cream: #f0dcc0;
    --color-aged-cream: #d8c4a0;
    --color-burgundy: #3a1808;
    --color-blood: #8a3810;
    --color-olive: #3a2a18;
    --color-btn-bg-top: #2a1c0e;
    --color-btn-bg-bottom: #1c1008;
    --color-btn-hover-top: #3a2814;
    --color-btn-hover-bottom: #2a1c0e;
    --color-panel-bg: rgba(28, 16, 8, 0.7);
    --color-panel-border: #503818;
    --color-statsbar-top: #221408;
    --color-statsbar-bottom: #120a04;
    --color-section-accent: rgba(100, 40, 10, 0.4);
}

/* -- Absinthe -- */
[data-theme="absinthe"] {
    --color-bg: #080c06;
    --color-bg-warm: #0c1008;
    --color-gold: #90b830;
    --color-gold-dim: #709820;
    --color-cream: #e0f0c8;
    --color-aged-cream: #c0d8a8;
    --color-burgundy: #1a2a0a;
    --color-blood: #4a6a1a;
    --color-olive: #2a3818;
    --color-btn-bg-top: #182010;
    --color-btn-bg-bottom: #0e1408;
    --color-btn-hover-top: #202a14;
    --color-btn-hover-bottom: #182010;
    --color-panel-bg: rgba(14, 20, 8, 0.7);
    --color-panel-border: #304020;
    --color-statsbar-top: #12180c;
    --color-statsbar-bottom: #080e04;
    --color-section-accent: rgba(40, 70, 10, 0.4);
}

/* -- Syndicate (Teal & Silver) -- */
[data-theme="syndicate"] {
    --color-bg: #080c0c;
    --color-bg-warm: #0c1010;
    --color-gold: #50b0a0;
    --color-gold-dim: #389080;
    --color-cream: #d0f0e8;
    --color-aged-cream: #b0d8d0;
    --color-burgundy: #0a2a24;
    --color-blood: #1a5a4a;
    --color-olive: #2a3830;
    --color-btn-bg-top: #142420;
    --color-btn-bg-bottom: #0a1814;
    --color-btn-hover-top: #1c302a;
    --color-btn-hover-bottom: #142420;
    --color-panel-bg: rgba(10, 24, 20, 0.7);
    --color-panel-border: #284840;
    --color-statsbar-top: #0e1c18;
    --color-statsbar-bottom: #060e0c;
    --color-section-accent: rgba(20, 60, 50, 0.4);
}

/* -- Rose Gold -- */
[data-theme="rosegold"] {
    --color-bg: #0e0a0a;
    --color-bg-warm: #120e0e;
    --color-gold: #c88080;
    --color-gold-dim: #a86868;
    --color-cream: #f0d8d8;
    --color-aged-cream: #d8c0c0;
    --color-burgundy: #2a1418;
    --color-blood: #6a3040;
    --color-olive: #3a2a2e;
    --color-btn-bg-top: #281818;
    --color-btn-bg-bottom: #1a0e0e;
    --color-btn-hover-top: #382020;
    --color-btn-hover-bottom: #281818;
    --color-panel-bg: rgba(26, 14, 14, 0.7);
    --color-panel-border: #483038;
    --color-statsbar-top: #201010;
    --color-statsbar-bottom: #100808;
    --color-section-accent: rgba(80, 30, 40, 0.4);
}

/* Theme picker grid */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.theme-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: 2px solid var(--color-panel-border);
    border-radius: 2px;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--color-panel-bg);
    min-height: 50px;
}

.theme-swatch:hover {
    border-color: var(--color-gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.theme-swatch.active {
    border-color: var(--color-gold);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3), inset 0 0 15px rgba(212, 175, 55, 0.08);
}

.theme-swatch-colors {
    display: flex;
    gap: 4px;
}

.theme-swatch-colors span {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
}

.theme-swatch-label {
    font-size: 0.75em;
    color: var(--color-cream);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-heading);
    text-align: center;
}

/* ===== Font Picker Swatches ===== */
.font-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.font-swatch,
.fontsize-swatch {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border: 2px solid var(--color-panel-border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--color-panel-bg);
    min-height: 42px;
}

.font-swatch:hover,
.fontsize-swatch:hover {
    border-color: var(--color-gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.font-swatch.active,
.fontsize-swatch.active {
    border-color: var(--color-gold);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3), inset 0 0 15px rgba(212, 175, 55, 0.08);
}

.font-swatch-preview {
    font-size: 1em;
    color: var(--color-cream);
    letter-spacing: 1px;
}

.fontsize-swatch-label {
    font-size: 0.8em;
    color: var(--color-cream);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-heading);
}

.story-family-card:hover {
    border-color: var(--color-gold);
    box-shadow: 0 0 15px rgba(212,175,55,0.15);
}

.story-family-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
    display: block;
}

.story-family-name {
    color: #f0e6d2;
    font-size: 1.25em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.story-family-story-title {
    color: #d4af37;
    font-style: italic;
    font-size: 0.9em;
    margin-bottom: 6px;
}

.story-family-tagline {
    color: #888;
    font-size: 0.82em;
    line-height: 1.4;
    margin-bottom: 10px;
    min-height: 40px;
}

.story-family-buff {
    display: inline-block;
    background: rgba(212,175,55,0.12);
    color: #d4af37;
    font-size: 0.78em;
    padding: 4px 10px;
    border-radius: 2px;
    border: 1px solid rgba(212,175,55,0.2);
    margin-bottom: 8px;
}

.story-family-chapters {
    color: #666;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.story-pledge-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #d4af37, #b8941e);
    color: #1a1a1a;
    border: none;
    border-radius: 2px;
    font-family: var(--font-display);
    font-weight: bold;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.story-pledge-btn:hover {
    background: linear-gradient(135deg, #e6c040, #d4af37);
}

.story-back-btn {
    display: block;
    margin: 20px auto 0;
    padding: 8px 24px;
    background: rgba(100,100,100,0.2);
    color: #888;
    border: 1px solid #444;
    border-radius: 2px;
    font-family: var(--font-display);
    font-size: 0.85em;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.story-back-btn:hover {
    color: var(--color-aged-cream);
    border-color: #666;
}

/* ── Chapter Screen ── */
.story-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(212,175,55,0.15);
}

.story-fam-icon {
    font-size: 2.2em;
    flex-shrink: 0;
}

.story-header-info {
    flex: 1;
}

.story-header-title {
    font-size: 1.2em;
    color: #f0e6d2;
    font-weight: bold;
    margin: 0 0 4px;
}

.story-header-meta {
    color: #999;
    font-size: 0.82em;
}

.story-header-meta span {
    margin-right: 14px;
}

/* Chapter progress pips */
.story-chapter-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
}

.story-ch-pip {
    flex: 1;
    height: 6px;
    border-radius: 2px;
    background: #2a2a2a;
    transition: background 0.3s;
}

.story-ch-pip.completed {
    background: #d4af37;
}

.story-ch-pip.current {
    background: linear-gradient(90deg, #d4af37, #e6c040);
    box-shadow: 0 0 8px rgba(212,175,55,0.4);
}

/* Act banner */
.story-act-banner {
    text-align: center;
    margin-bottom: 22px;
}

.story-act-label {
    display: inline-block;
    background: rgba(212,175,55,0.08);
    color: #d4af37;
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 4px 16px;
    border-radius: 2px;
    border: 1px solid rgba(212,175,55,0.12);
    margin-bottom: 6px;
}

.story-chapter-title {
    color: #f0e6d2;
    font-size: 1.6em;
    font-weight: bold;
    margin: 8px 0 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* ── Narrative blocks ── */
.story-narrative {
    margin-bottom: 28px;
}

.story-block {
    margin-bottom: 16px;
    line-height: 1.7;
    font-size: 0.95em;
}

.story-scene {
    color: #a0a0a0;
    font-style: italic;
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border-left: 3px solid #444;
    border-radius: 0 4px 4px 0;
}

.story-dialogue {
    padding: 10px 16px;
    background: rgba(212,175,55,0.04);
    border-left: 3px solid rgba(212,175,55,0.35);
    border-radius: 0 4px 4px 0;
}

.story-speaker {
    color: #d4af37;
    font-weight: bold;
    font-size: 0.88em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.story-dialogue p {
    color: #ddd;
    margin: 0;
}

.story-narration {
    color: #c0c0c0;
    padding-left: 16px;
}

/* ── Objectives ── */
.story-objectives {
    margin-bottom: 24px;
}

.story-objectives h3 {
    color: #d4af37;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 10px;
}

.story-objective {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(26,26,26,0.5);
    border: 1px solid #2a2a2a;
    border-radius: 2px;
    margin-bottom: 6px;
    font-size: 0.88em;
    transition: border-color 0.2s;
}

.story-objective.obj-met {
    border-color: rgba(46,204,113,0.4);
    background: rgba(46,204,113,0.05);
}

.story-objective .obj-icon {
    font-size: 1.1em;
    flex-shrink: 0;
}

.story-objective .obj-text {
    flex: 1;
    color: #bbb;
}

.story-objective.obj-met .obj-text {
    color: #8a9a6a;
}

.story-objective .obj-progress {
    color: #888;
    font-size: 0.82em;
    font-family: monospace;
    white-space: nowrap;
}

/* ── Rewards ── */
.story-rewards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.story-reward-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 2px;
    font-size: 0.78em;
    background: rgba(46,204,113,0.1);
    color: #8a9a6a;
    border: 1px solid rgba(46,204,113,0.2);
}

.story-reward-tag.rank-up {
    background: rgba(155,89,182,0.12);
    color: #9b59b6;
    border-color: rgba(155,89,182,0.25);
    font-weight: bold;
}

/* ── Choice block ── */
.story-choice-block {
    background: rgba(212,175,55,0.04);
    border: 1px solid rgba(212,175,55,0.15);
    border-radius: 2px;
    padding: 18px;
    margin-bottom: 24px;
}

.story-choice-prompt {
    color: #f0e6d2;
    font-size: 1em;
    font-weight: bold;
    margin: 0 0 14px;
}

.story-choice-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.story-choice-btn {
    padding: 10px 16px;
    background: rgba(212,175,55,0.08);
    color: #e0d9c6;
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 2px;
    font-family: var(--font-display);
    font-size: 0.9em;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.story-choice-btn:hover {
    background: rgba(212,175,55,0.15);
    border-color: rgba(212,175,55,0.4);
    transform: translateX(4px);
}

.story-choice-result {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(46,204,113,0.06);
    border-left: 3px solid #8a9a6a;
    border-radius: 0 4px 4px 0;
    color: #8a7a5a;
    font-style: italic;
    font-size: 0.88em;
}

/* ── Boss fight block ── */
.story-boss-block {
    background: rgba(155,89,182,0.06);
    border: 1px solid rgba(155,89,182,0.2);
    border-radius: 2px;
    padding: 18px;
    margin-bottom: 24px;
}

.story-boss-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.story-boss-header h3 {
    color: #9b59b6;
    font-size: 1.1em;
    margin: 0;
}

.story-boss-intro {
    color: #bbb;
    font-style: italic;
    font-size: 0.88em;
    margin-bottom: 12px;
    line-height: 1.5;
}

.story-boss-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 14px;
    font-size: 0.82em;
    color: #999;
}

.story-boss-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.story-boss-stats .stat-val {
    color: #d4af37;
    font-weight: bold;
}

.story-boss-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #9b59b6, #7d3c98);
    color: var(--color-cream);
    border: none;
    border-radius: 2px;
    font-family: var(--font-display);
    font-weight: bold;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.story-boss-btn:hover {
    background: linear-gradient(135deg, #a86cc1, #9b59b6);
}

.story-boss-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.story-boss-victory {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(46,204,113,0.06);
    border-left: 3px solid #8a9a6a;
    border-radius: 0 4px 4px 0;
    color: #8a9a6a;
    font-weight: bold;
    font-size: 0.9em;
}

/* ── Completion / Advance ── */
.story-completion-narrative {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(212,175,55,0.04);
    border: 1px solid rgba(212,175,55,0.1);
    border-radius: 2px;
}

.story-completion-narrative .story-block {
    margin-bottom: 8px;
}

.story-advance-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #d4af37, #b8941e);
    color: #1a1a1a;
    border: none;
    border-radius: 2px;
    font-family: var(--font-display);
    font-weight: bold;
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.story-advance-btn:hover {
    background: linear-gradient(135deg, #e6c040, #d4af37);
    box-shadow: 0 4px 16px rgba(212,175,55,0.3);
}

.story-advance-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Epilogue / Empire dashboard ── */
.story-epilogue-text {
    color: #bbb;
    font-style: italic;
    line-height: 1.7;
    margin-bottom: 24px;
    font-size: 0.95em;
}

.story-empire-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.empire-stat {
    background: rgba(26,26,26,0.7);
    border: 1px solid #2a2a2a;
    border-radius: 2px;
    padding: 16px;
    text-align: center;
}

.empire-stat .stat-label {
    color: #888;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.empire-stat .stat-value {
    color: #d4af37;
    font-size: 1.4em;
    font-weight: bold;
}

.story-action-btn {
    display: inline-block;
    padding: 10px 20px;
    margin: 4px;
    background: rgba(212,175,55,0.1);
    color: #d4af37;
    border: 1px solid rgba(212,175,55,0.25);
    border-radius: 2px;
    font-family: var(--font-display);
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.story-action-btn:hover {
    background: rgba(212,175,55,0.2);
    border-color: rgba(212,175,55,0.45);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .story-screen {
        padding: 16px 10px 30px;
    }

    .story-main-title {
        font-size: 1.5em;
        letter-spacing: 2px;
    }

    .story-family-grid {
        grid-template-columns: 1fr;
    }

    .story-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .story-chapter-title {
        font-size: 1.25em;
    }

    .story-choice-options {
        gap: 6px;
    }

    .story-empire-stats {
        grid-template-columns: 1fr;
    }
}

/* ==================== STORY EXPANSION STYLES ==================== */

/* Street story events — richer description blocks */
.interactive-event .event-description {
    text-align: left;
    font-size: 1.1em;
    line-height: 1.7;
    color: var(--color-aged-cream);
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #333;
}

.interactive-event .event-description:last-of-type {
    border-bottom: none;
    margin-bottom: 25px;
}

/* Side quest objective in quest screen */
.story-objective {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 2px;
    margin: 6px 0;
}

.story-objective.obj-met {
    background: rgba(46, 204, 113, 0.1);
    border-left: 3px solid #8a9a6a;
}

.story-objective .obj-val {
    margin-left: auto;
    font-weight: bold;
    color: #f1c40f;
}

/* Endgame arc cards hover */
[onclick^="showPostDonArc"]:hover {
    border-color: #f1c40f !important;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.25);
    transition: all 0.3s ease;
}

/* ===== Store Item Styles ===== */
.store-item-img {
    width: 80px;
    height: 80px;
    border-radius: 2px;
    object-fit: cover;
    border: 2px solid var(--color-cream);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.store-item-img-fallback {
    display: none;
    width: 80px;
    height: 80px;
    border-radius: 2px;
    background: #6a5a3a;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    border: 2px solid var(--color-cream);
    text-align: center;
}

/* ===== Shared Buy/Action Button ===== */
.store-buy-btn {
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 2px;
    font-weight: bold;
    font-size: 14px;
    min-width: 120px;
    transition: background 0.2s, box-shadow 0.2s;
    font-family: var(--font-body);
}

.store-buy-btn--active {
    background: #7a8a5a;
    cursor: pointer;
}

.store-buy-btn--active:hover {
    background: #229954;
    box-shadow: 0 2px 8px rgba(34, 153, 84, 0.3);
}

.store-buy-btn--disabled {
    background: #6a5a3a;
    cursor: not-allowed;
    opacity: 0.7;
}








