.skip-link {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: -1;
}
.skip-link:focus {
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    overflow: visible;
    z-index: 9999;
    display: block;
    background: var(--bg-card, #1A1E26);
    color: var(--text-main, #EAECEF);
    padding: 12px 20px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    font-size: 0.9rem;
    text-decoration: none;
}

:root {
    /* Editorial Dark Theme Palette */
    --bg: #0D0F14;
    --bg-surface: #14171E;
    --bg-card: #1A1E26;
    
    /* Muted, specific dataviz colors for gauges */
    --gold: #D4AF37;   /* Civic Trust */
    --gold-dim: rgba(212, 175, 55, 0.1);
    --green: #6B9080;  /* Info Health */
    --amber: #E29578;  /* Warning/Alt state */
    --red: #B56576;    /* Voter Participation */
    --garnet: #8b1c2c; /* Added missing variable */
    --off-white: #f0ece4; /* Added missing variable */
    --slate: #4A5568; /* Mid-point slate — consistent with video-card usage */
    
    --text-main: #EAECEF;
    --text-muted: #9BA4B5; /* Improved color contrast */
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    
    --radius: 4px; /* Sharper corners for print aesthetic */
    --ease: cubic-bezier(0.25, 1, 0.5, 1);
    
    --font-title: 'Playfair Display', Georgia, serif;
    --font-body: 'Noto Sans', -apple-system, sans-serif;
    --font-si: 'Noto Sans Sinhala', sans-serif;
    --font-ta: 'Noto Sans Tamil', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 300;
    line-height: 1.6;
    overflow: hidden; /* Prevents any scrollbar in itch.io iframe */
    width: 100vw;
    height: 100vh;
    position: fixed; /* Locks body at exactly viewport size */
    -webkit-font-smoothing: antialiased;
}

/* Screen Background System (GDD Section 18) */
.screen-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    pointer-events: none;
}

#bg-loading { background-image: url('assets/backgrounds/bg_loading.webp'); }
#bg-language { background-image: url('assets/backgrounds/bg_language.webp'); }
#bg-main-menu { 
    background-image: url('assets/backgrounds/bg_main_menu.webp'); 
    opacity: 1; /* Full opacity so the background is completely visible */
}
#bg-char-select { background-image: url('assets/backgrounds/bg_char_select.webp'); }
#bg-opening { background-image: url('assets/backgrounds/bg_opening.webp'); }
#bg-consequence { background-image: url('assets/backgrounds/bg_consequence.webp'); opacity: 0.25; }

/* Subtle Film Grain */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 999;
}

body.lang-si { font-family: var(--font-si); }
body.lang-ta { font-family: var(--font-ta); }
body.text-large { font-size: 18px; }
body.text-xlarge { font-size: 22px; }

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body.reduce-motion *, body.reduce-motion ::before, body.reduce-motion ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

/* Common Editorial Elements */
.editorial-line {
    width: 60px;
    height: 1px;
    background-color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.editorial-line.center {
    margin: 0 auto 1.5rem auto;
}

/* Screen System */
.screen {
    position: fixed;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 600ms var(--ease), visibility 600ms;
    overflow: hidden;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.flex-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 2rem;
}

/* Screen 1: Loading */
#screen-loading {
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    width: 100%;
}
#loading-logo {
    font-family: var(--font-title);
    font-size: clamp(3.5rem, 8vw, 7rem);
    color: var(--text-main);
    line-height: 1.0;
    letter-spacing: -0.03em;
    opacity: 0;
    text-shadow: 0 0 80px rgba(212, 175, 55, 0.15);
}
#loading-tagline {
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 300;
    margin-top: 2rem;
    opacity: 0;
    max-width: 700px;
    white-space: normal;
    line-height: 1.7;
    letter-spacing: 0.01em;
}
#loading-prompt {
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 500;
    opacity: 0;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes breathe {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}
.animate-fadeUp { animation: fadeUp 1.2s forwards var(--ease); }
.animate-breathe { animation: breathe 3s infinite; }

/* Screen 2: Language */
#screen-language {
    background: transparent;
}
.lang-soon-badge {
    display: inline-block;
    font-size: 0.5rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    border-radius: 2px;
    padding: 1px 5px;
    margin-left: 8px;
    vertical-align: middle;
    opacity: 0.7;
}
.lang-prompts {
    text-align: center;
    margin-bottom: 2.5rem;
}
.lang-prompts p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 0.4rem;
    font-weight: 300;
    text-align: center;
    line-height: 1.8;
}
.lang-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 340px; /* Increased to accommodate longer button text */
}
.lang-btn {
    width: 100%;
    padding: 20px 28px;
    white-space: nowrap; /* Prevents text from breaking into two lines */
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.03);
    color: var(--text-main);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-align: center;
    transition: border-color 300ms var(--ease), color 300ms var(--ease),
                background 300ms var(--ease), transform 300ms var(--ease);
}
.lang-btn:not(:disabled):hover {
    border-color: rgba(212, 175, 55, 0.6);
    color: var(--gold);
    background: rgba(212, 175, 55, 0.06);
    transform: translateY(-3px);
}
.lang-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
/* Eradicating double borders globally while maintaining WCAG focus */
*:focus-visible {
    outline: 2px solid var(--gold) !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
}
button:focus-visible, 
.char-card:focus-visible,
select:focus-visible {
    outline: none !important;
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 1px var(--gold) !important;
}

/* Settings Sliders */
.game-slider {
    -webkit-appearance: none;
    appearance: none; 
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    outline: none;
    margin-top: 8px;
    transition: border-color 0.2s;
}
.game-slider:focus-visible {
    border-color: var(--gold) !important;
}
.game-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 10px rgba(212,175,55,0.4);
}
.game-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(212,175,55,0.6);
}

/* Screen 3: Main Menu */
#screen-mainmenu {
    background: transparent; /* Allows bg_main_menu.jpeg to show */
    display: flex;
    align-items: center;
    justify-content: flex-start;
}
.menu-center-layout {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    gap: 3rem;
    padding: 2rem 2rem 2rem 8vw;
    width: 100%;
    max-width: 560px;
}
.menu-title-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}
.menu-title {
    font-family: var(--font-title);
    font-size: clamp(3rem, 9vw, 7rem);
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -0.03em;
    text-shadow: 0 0 100px rgba(212, 175, 55, 0.1);
}
.menu-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.05em;
}
.menu-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 300px;
    align-items: flex-start;
}
.menu-btn {
    width: 100%;
    text-align: left;
    padding: 13px 0 13px 20px;
    border: none;
    border-left: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 0;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: color 200ms var(--ease), border-color 200ms var(--ease), padding-left 200ms var(--ease);
    position: relative;
}
.menu-btn.primary {
    color: var(--gold);
    border-left-color: rgba(212,175,55,0.6);
}
.menu-btn.primary:hover {
    color: var(--gold);
    border-left-color: var(--gold);
    padding-left: 26px;
}
.menu-btn:hover:not(:disabled):not(.primary),
.menu-btn:focus-visible:not(:disabled):not(.primary) {
    color: var(--text-main);
    border-left-color: var(--text-main);
    padding-left: 26px;
    background: transparent;
    outline: none;
}
.menu-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 15, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 400ms var(--ease), visibility 400ms;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.modal-content {
    background: rgba(10, 12, 17, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 2px solid var(--gold);
    border-radius: 2px;
    padding: 2.5rem 3rem;
    max-width: 480px;
    width: 90%;
    transform: translateY(16px);
    transition: transform 400ms var(--ease);
    box-shadow: 0 32px 80px rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}
#modal-settings .modal-content {
    max-width: 560px;
    padding: 2.5rem 2.5rem;
}
.modal-content h2 {
    font-family: var(--font-title);
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
    font-weight: 400;
    color: var(--text-main);
    letter-spacing: -0.02em;
}
.modal-content h2 + * {
    margin-top: 0;
}
.modal-divider {
    display: block;
    width: 32px;
    height: 1px;
    background: rgba(212,175,55,0.4);
    margin: 0.75rem 0 1.5rem 0;
}
.modal-text {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.75;
    margin-bottom: 1.5rem;
    font-weight: 300;
}
.about-legal {
    font-size: 0.72rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.about-legal-label {
    display: block;
    font-size: 0.55rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    font-weight: 600;
}
.setting-group { margin-bottom: 1.5rem; }
.setting-label { 
    display: block; 
    font-size: 0.75rem; 
    color: var(--text-main); 
    margin-bottom: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 0.12em;
    font-weight: 500;
}
.game-select-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}
.game-select-wrapper::after {
    content: '›';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    color: var(--gold);
    pointer-events: none;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
}
.game-select {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-strong);
    border-radius: 0;
    font-family: var(--font-body);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
    outline: none;
}
.game-select option {
    background: #1A1E26;
    color: #EAECEF;
}
.game-select:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.25);
}
.game-select:focus,
.game-select:focus-visible { border-color: var(--gold); } /* Removes double outer border */

.toggle-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}
.toggle-wrapper .setting-label { margin-bottom: 0; }
.game-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    flex-shrink: 0;
}
.game-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    transition: border-color 200ms var(--ease), background 200ms;
    border-radius: 0;
}
.slider:before {
    position: absolute;
    content: "";
    height: 10px;
    width: 10px;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255,255,255,0.25);
    transition: transform 200ms var(--ease), background-color 200ms;
    border-radius: 0;
}
.game-switch input:checked + .slider {
    background-color: rgba(212, 175, 55, 0.1);
    border-color: var(--gold);
}
.game-switch input:checked + .slider:before {
    transform: translateY(-50%) translateX(22px);
    background-color: var(--gold);
}
.text-link { 
    color: var(--text-muted); 
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 600;
    font-family: var(--font-body);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 200ms;
}
.text-link:hover { color: var(--text-main); text-decoration: none; }
.modal-close {
    display: block;
    width: 100%;
    padding: 10px 0;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: none;
    color: var(--text-muted);
    font-size: 0.55rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 2rem;
    cursor: pointer;
    transition: color 200ms var(--ease), border-color 200ms var(--ease);
    font-family: var(--font-body);
    text-align: center;
}
.modal-close:hover {
    color: var(--text-main);
    border-top-color: rgba(255,255,255,0.3);
}

/* ── Settings Modal Rows ────────────────────────────────────── */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.setting-row:last-of-type {
    border-bottom: none;
}
.setting-row--slider {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}
.setting-row--slider .volume-row {
    width: 100%;
}
.setting-row-label {
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    font-family: var(--font-body);
}
.setting-action-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-muted);
    font-size: 0.52rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 700;
    font-family: var(--font-body);
    padding: 7px 16px;
    cursor: pointer;
    transition: color 200ms var(--ease), border-color 200ms var(--ease);
    flex-shrink: 0;
    border-radius: 0;
}
.setting-action-btn:hover {
    color: var(--text-main);
    border-color: rgba(255,255,255,0.4);
}

/* Screen 4: Character Selection */
#screen-character { 
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 0;
    position: relative;
}
.screen-back-btn {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0 6px 14px;
    background: transparent;
    border: none;
    border-left: 2px solid rgba(255,255,255,0.15);
    border-radius: 0;
    color: var(--text-muted);
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 200ms var(--ease), border-color 200ms var(--ease);
    font-family: var(--font-body);
    font-weight: 600;
}
.screen-back-btn:hover {
    color: var(--text-main);
    border-left-color: rgba(255,255,255,0.5);
}
/* .screen-back-btn svg rules removed — arrow icon no longer used */
.char-header-area {
    text-align: center;
    padding: 1.4rem 2rem 1rem;
    flex-shrink: 0;
    background: transparent;
    position: relative;
}
.char-header-area::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: var(--gold);
    opacity: 0.5;
    margin: 0.8rem auto 0;
}
.char-header-area h1 {
    font-family: var(--font-title);
    font-size: 1.9rem;
    font-weight: 400;
    margin-bottom: 0.15rem;
    letter-spacing: -0.02em;
}
.char-subheader {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}
.char-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    flex: 1;
    min-height: 0;
    gap: 1.5rem;
    padding: 1.5rem 2vw 2rem;
    overflow: hidden; /* Removed scrollbar for locked 1920x1080 frame */
    align-items: stretch;
    max-width: clamp(900px, 85vw, 1480px);
    margin: 0 auto;
    width: 100%;
}
.char-card {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    text-align: left;
    height: 100%;
    transition: transform 300ms var(--ease), border-color 300ms,
                box-shadow 300ms var(--ease), background 300ms;
    position: relative;
    outline: none;
}
.clickable-card {
    cursor: pointer;
}
.clickable-card:hover {
    border-color: rgba(212, 175, 55, 0.8);
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 20px rgba(212,175,55,0.15);
    background: #1e2230;
}
.char-fold-btn {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    width: 100%;
    margin-top: 1rem;
    transition: all 0.2s;
}
.char-fold-btn:hover {
    color: var(--gold);
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.05);
}
.char-details-fold {
    padding: 0 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-top: 1px dashed rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
}
.char-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0), transparent);
    transition: background 500ms;
}
.clickable-card:hover::before {
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.4), transparent);
}
.char-img-wrapper {
    margin: 0;
    width: 100%;
    aspect-ratio: 3 / 4; /* Perfect locked ratio as requested */
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    border-radius: 0;
    background: var(--bg-card);
}
/* Shorter, darker gradient to anchor the portrait without bleeding into text */
.char-img-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 35%;
    background: linear-gradient(to top, rgba(20, 23, 30, 1) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}
.char-card img, .fallback-circle {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    object-position: top center;
    border: none;
    filter: brightness(0.98); /* Removed heavy grayscale so characters pop */
    transition: filter 700ms var(--ease), transform 700ms var(--ease);
    box-shadow: none;
}
.fallback-circle {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    font-family: var(--font-title);
    color: rgba(212, 175, 55, 0.5);
    background: linear-gradient(160deg, #1a1e2a 0%, #12161f 100%);
    letter-spacing: -0.02em;
}
.char-card:hover img {
    filter: grayscale(0%) brightness(1.05) contrast(1.04);
    transform: scale(1.07);
}

.char-info {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    flex-grow: 1;
    justify-content: flex-start;
}
.char-info .char-fold-btn {
    margin-top: auto; /* Pushes the trait button cleanly to the bottom */
}

.char-name {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.2rem;
    text-align: center;
}
.char-role {
    color: var(--gold);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1.5rem; /* Breathing room under title */
    line-height: 1.4;
    text-align: center;
}
.char-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem; /* Breathing room before traits */
    line-height: 1.6;
}

/* Editorial Traits List */
.char-traits {
    border-top: 1px dashed rgba(255,255,255,0.1);
    padding: 1.25rem 0 0.5rem;
    margin-top: auto; /* Pushes traits to the bottom consistently */
    display: flex;
    flex-direction: column;
    gap: 1.2rem; /* Breathing room between traits */
}
.char-trait {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.trait-label { 
    font-size: 0.65rem; 
    font-weight: 600; 
    letter-spacing: 0.1em; 
    text-transform: uppercase; 
}
.char-trait.perk .trait-label { color: var(--green); }
.char-trait.disadvantage .trait-label { color: var(--red); }
.trait-text { 
    color: var(--text-main); 
    font-size: 0.72rem;
    line-height: 1.4;
}

/* Dataviz Mini Gauges - Game-style stat bars */
.char-gauges-preview { 
    margin-bottom: 0.6rem; 
    display: flex; 
    flex-direction: column; 
    gap: 6px;
    flex-shrink: 0;
}
.mini-gauge { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 0.6rem; 
    color: var(--text-muted); 
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.mini-gauge span:first-child { width: 130px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-gauge span:last-child { width: 22px; text-align: right; color: var(--text-main); }
.mini-bar { 
    flex: 1; 
    height: 6px; 
    background: rgba(255,255,255,0.06);
    border-radius: 0;
    overflow: hidden;
    position: relative;
}
.mini-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 3px,
        rgba(0,0,0,0.3) 3px,
        rgba(0,0,0,0.3) 4px
    );
    z-index: 1;
    pointer-events: none;
}
.mini-fill { 
    height: 100%; 
    transition: width 0.6s var(--ease);
    position: relative;
}

.mini-gauge.ct .mini-fill { background: var(--gold); box-shadow: 0 0 6px rgba(212,175,55,0.5); }
.mini-gauge.ih .mini-fill { background: var(--green); box-shadow: 0 0 6px rgba(107,144,128,0.5); }
.mini-gauge.vp .mini-fill { background: var(--red);   box-shadow: 0 0 6px rgba(181,101,118,0.5); }

/* Removed char-play-btn */

/* Screen 5: Opening Animation Sequence */
#screen-opening {
    background: transparent; /* Allows bg_opening.jpeg to show */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8vw;
    text-align: center;
    cursor: default;
    user-select: none;
}
#opening-container {
    max-width: 720px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
}
#opening-lines {
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.opening-line {
    font-size: clamp(1.05rem, 2.2vw, 1.55rem);
    color: var(--text-main);
    font-weight: 300;
    text-align: center;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 1400ms cubic-bezier(0.25, 1, 0.5, 1),
                transform 1400ms cubic-bezier(0.25, 1, 0.5, 1);
    position: absolute;
    width: 100%;
    max-width: 680px;
    white-space: normal;          /* ← allows wrapping */
    line-height: 1.55;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 18px rgba(0,0,0,0.9), 0 0 40px rgba(0,0,0,0.6);
}
.opening-line.visible {
    opacity: 1;
    transform: translateY(0);
}
.opening-line.character-intro {
    font-family: var(--font-title);
    font-size: clamp(1.1rem, 2.4vw, 2rem);
    color: var(--gold);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
#opening-next {
    display: none;
    align-self: center;
    padding: 20px 64px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 2px;
    color: rgba(212, 175, 55, 0.9);
    font-size: 0.75rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-weight: 500;
    background: rgba(212, 175, 55, 0.04);
    transition: all 500ms var(--ease);
    cursor: pointer;
    text-align: center;
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.0);
    animation: entryPulse 3s ease-in-out infinite;
}
#opening-next:hover {
    border-color: rgba(212, 175, 55, 0.7);
    color: var(--gold);
    background: rgba(212, 175, 55, 0.08);
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.15);
    transform: scale(1.03);
    animation: none;
}
@keyframes entryPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.0); }
    50%       { box-shadow: 0 0 30px rgba(212, 175, 55, 0.12); }
}
.skip-prompt {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.25);
    position: fixed;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    pointer-events: none;
    transition: color 300ms;
    white-space: nowrap;
}
/* Hold-to-skip progress bar */
#skip-hold-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: transparent;
    z-index: 10;
}
#skip-hold-fill {
    height: 100%;
    width: 0%;
    background: rgba(255,255,255,0.3);
    transition: none;
}

/* Screen 6: Game & Map */
.top-bar {
    position: relative;
    background: rgba(10, 12, 17, 0.98);
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
    padding: 10px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 40;
    flex-wrap: nowrap;
    gap: 16px;
    flex-shrink: 0; /* Prevents top-bar from being crushed by map flex growth */
    min-height: 60px;
}
/* ── Gauges ─────────────────────────────────────────────────── */
.gauges {
    display: flex;
    gap: 2px;
    flex-grow: 1;
    align-items: stretch;
}

.gauge-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 0 20px 0 16px;
    border-left: 3px solid transparent;
    min-width: 160px;
    width: clamp(160px, 16vw, 260px);
    position: relative;
}

/* Colour accent — left border per gauge */
.gauge-container[data-gauge="ct"] { border-left-color: var(--gold); }
.gauge-container[data-gauge="ih"] { border-left-color: var(--green); }
.gauge-container[data-gauge="vp"] { border-left-color: var(--red); }

@media (min-width: 1440px) {
    .gauge-container { width: clamp(220px, 14vw, 300px); }
    .gauges { gap: 4px; }
}

.gauge-header {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.gauge-name {
    flex: 1;
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.gauge-readout {
    font-size: 0.82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    min-width: 26px;
    text-align: right;
    line-height: 1;
}
.gauge-container[data-gauge="ct"] .gauge-readout { color: var(--gold); }
.gauge-container[data-gauge="ih"] .gauge-readout { color: var(--green); }
.gauge-container[data-gauge="vp"] .gauge-readout { color: var(--red); }

.gauge-info-btn {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    font-size: 0.48rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 200ms;
    line-height: 1;
    padding: 0;
    background: transparent;
    font-family: var(--font-body);
}
.gauge-info-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.gauge-track {
    height: 4px;
    background: rgba(255,255,255,0.07);
    border-radius: 0;
    overflow: hidden;
    position: relative;
    width: 100%;
}
.gauge-fill {
    height: 100%;
    width: 50%;
    border-radius: 0;
    transition: width 900ms var(--ease), background-color 600ms;
}
#fill-ct { background: var(--gold);  box-shadow: 0 0 6px rgba(212,175,55,0.5); }
#fill-ih { background: var(--green); box-shadow: 0 0 6px rgba(107,144,128,0.5); }
#fill-vp { background: var(--red);   box-shadow: 0 0 6px rgba(181,101,118,0.5); }
.week-indicator {
    font-family: var(--font-title);
    font-size: clamp(1.8rem, 2.2vw, 2.6rem);
    color: var(--text-main);
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 0 24px;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.week-label {
    font-family: var(--font-body);
    font-size: 0.55rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    transform: translateY(-4px);
}

.top-bar-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.pause-btn {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    border-radius: var(--radius);
    padding: 7px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 300ms var(--ease);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-family: var(--font-body);
    font-weight: 700;
}

.pause-btn:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.35);
    color: var(--text-main);
}

.pause-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 18, 0.80);
    backdrop-filter: blur(14px) saturate(0.7);
    -webkit-backdrop-filter: blur(14px) saturate(0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 300ms var(--ease), visibility 300ms;
}

.pause-overlay.active {
    opacity: 1;
    visibility: visible;
}

.pause-content {
    text-align: left;
    width: 100%;
    max-width: 560px;
    padding: 2rem;
    margin-left: clamp(2rem, 8vw, 100px);
}

#objective-bar {
    position: fixed;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 12, 17, 0.90);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.72rem;
    padding: 7px 18px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 4px;
    font-weight: 500;
    letter-spacing: 0.08em;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    white-space: normal;
    text-align: center;
    max-width: min(620px, 88vw);
    pointer-events: none;
    transition: opacity 600ms ease;
}

#objective-icon {
    font-size: 0.52rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    font-family: var(--font-body);
    opacity: 0.5;
    margin-right: 6px;
}

#week-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%) scale(0.95);
    background: var(--bg-card);
    border: 1px solid rgba(212,175,55,0.3);
    color: var(--text-main);
    padding: 24px 48px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-title);
    z-index: 100;
    opacity: 0;
    transition: all 600ms var(--ease);
    box-shadow: 0 24px 64px rgba(0,0,0,0.7);
    text-align: center;
    letter-spacing: 0.02em;
    pointer-events: none;
    max-width: 480px;
    width: 90%;
}
#week-banner.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
#week-banner strong {
    display: block;
    color: var(--gold);
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-family: var(--font-title);
    font-weight: 400;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

/* Base styles for your Illustrator roads */
#road-network path {
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Center Pulse Stylization (smooth, soft, perfectly centered) */
.map-loc-label {
    font-family: 'Playfair Display', serif;
    font-size: 10px;
    font-weight: 600;
    fill: #3a2e1a;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-anchor: middle;
    pointer-events: none;
    paint-order: stroke;
    stroke: #f5eedc;
    stroke-width: 3px;
    stroke-linejoin: round;
}

.dialogue-scene-wrapper {
    position: fixed;
    inset: 0;
    z-index: 28;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 400ms var(--ease), visibility 400ms;
}
.dialogue-scene-wrapper.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Hide objective bar during prologue (dialogue hiding is handled via JS) */
.prologue-active #objective-bar {
    opacity: 0;
    pointer-events: none;
}

.location-bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: auto;
}

/* ── Back-to-map button ──────────────────────────────────── */
#location-back-btn {
    position: absolute;
    top: 86px;
    left: 32px;
    z-index: 10;
    pointer-events: auto;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 6px 0 6px 14px;
    background: transparent;
    border: none;
    border-left: 2px solid rgba(255,255,255,0.15);
    border-radius: 0;
    color: var(--text-muted);
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 200ms var(--ease), border-color 200ms var(--ease);
    font-family: var(--font-body);
    font-weight: 600;
}
#location-back-btn.visible {
    display: flex;
}
#location-back-btn:hover {
    color: var(--text-main);
    border-left-color: rgba(255,255,255,0.5);
}

/* Dialogue Panel — Centered modal */
#dialogue-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 12, 0.60);
    z-index: 10; /* Keeps the overlay behind characters */
}
#dialogue-panel {
    position: absolute;
    bottom: -300px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: min(92vw, 1000px);
    height: 210px;                 /* FIXED — every dialogue line occupies identical panel height */
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-top: 2px solid rgba(212,175,55,0.25);
    border-radius: 6px;
    z-index: 30; /* Forces the dialogue panel to render IN FRONT of the characters */
    transition: bottom 400ms var(--ease);
    box-shadow: 0 -8px 48px rgba(0,0,0,0.4), 0 32px 80px rgba(0,0,0,0.7);
    overflow: visible;
}
#dialogue-panel.panel-expanded {
    height: auto;                  /* Grows only when choice buttons are present */
    min-height: 210px;
}
#dialogue-panel.open {
    bottom: 2rem;
}
.dialogue-content-wrapper {
    padding: 2rem 2.5rem;
    position: relative;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;        /* Text anchors to bottom — visual novel convention */
    overflow: visible;                /* CRITICAL FIX: prevents the portrait from being clipped and hidden */
}
.panel-expanded .dialogue-content-wrapper {
    height: auto;
    overflow: visible;
}
#dialogue-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--text-muted);
    transition: color 200ms var(--ease), border-color 200ms var(--ease);
    z-index: 31;
    padding: 5px 12px;
    font-size: 0.52rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 700;
    font-family: var(--font-body);
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    cursor: pointer;
}
#dialogue-close:hover {
    color: var(--text-main);
    border-bottom-color: rgba(255,255,255,0.4);
}

.dialogue-header {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 0;
    pointer-events: none;
    z-index: 20;
}

/* VN Style Portrait Layout */
.vn-portrait-container {
    position: absolute;
    bottom: 0;
    height: 55vh; 
    max-height: 520px; 
    width: 45vw; 
    max-width: 600px; 
    display: flex;
    align-items: flex-end;
    z-index: 20; 
    pointer-events: none;
}
.vn-portrait-container.vn-left {
    left: 15vw; /* Pulls character inward toward the dialogue box */
    justify-content: center;
}
.vn-portrait-container.vn-right {
    right: 15vw; /* Pulls character inward toward the dialogue box */
    justify-content: center;
}

.npc-portrait-img,
.pc-portrait-img {
    width: auto;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: bottom;
    display: block;
    /* mix-blend-mode removed to allow normal JPEG/PNG rendering */
    transition: filter 400ms var(--ease), opacity 400ms var(--ease), transform 400ms var(--ease);
    transform-origin: bottom center;
}

/* PC native art is drawn facing left (inward), so no flip is needed here */
.pc-portrait-img {
    transform: scaleX(1); 
}
.npc-portrait-img.npc-flipped {
    transform: scaleX(-1); /* Horizontal flip toggle for NPCs from JS engine */
}

/* Inactive states (dims and slightly scales down the non-speaking character) */
.pc-portrait-img.portrait-inactive {
    transform: scale(0.96); 
    filter: brightness(0.75) saturate(0.85);
    opacity: 0.9;
}
.npc-portrait-img.portrait-inactive {
    transform: scale(0.96);
    filter: brightness(0.75) saturate(0.85);
    opacity: 0.9;
}
.npc-portrait-img.npc-flipped.portrait-inactive {
    transform: scaleX(-1) scale(0.96);
    filter: brightness(0.75) saturate(0.85);
    opacity: 0.9;
}

.vn-portrait-container .fallback-circle {
    width: 180px;
    height: 240px;
    font-size: 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 4vw; /* Add padding so it isn't completely flush to the edge */
}

.dialogue-meta {
    position: absolute;
    top: -1.4rem;
    left: 2rem;
    background: var(--bg-card);
    padding: 5px 16px 5px 12px;
    border: 1px solid var(--border-strong);
    border-left: 3px solid rgba(212,175,55,0.6);
    border-radius: 4px;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
#dialogue-npc-name {
    font-family: var(--font-body);
    font-size: 0.72rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 700;
}

.dialogue-body-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}
@media (max-width: 680px) {
    .dialogue-body-grid { gap: 1rem; }
    .dialogue-content-wrapper { padding: 1.75rem 1.5rem; min-height: 120px; }
    .dialogue-header img { width: 110px; height: 160px; }
}

#dialogue-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-main);
    font-weight: 300;
    cursor: pointer;
    min-height: 80px;
    transition: opacity 0.15s ease;
}
#dialogue-text p { margin-bottom: 1rem; }

.dialogue-continue-btn {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-main);
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
    transition: all 250ms var(--ease);
    align-self: flex-end;
    margin-top: 1rem;
    font-family: var(--font-body);
}
.dialogue-continue-btn::after {
    content: none;
}
.dialogue-continue-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(212, 175, 55, 0.08);
    transform: translateX(4px);
}
.dialogue-continue-btn:hover::after {
    content: none;
}

#dialogue-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.option-btn {
    text-align: left;
    padding: 16px 16px 16px 20px;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-left: 3px solid transparent;
    border-radius: var(--radius);
    color: var(--text-main);
    font-size: 0.9rem;
    transition: all 200ms var(--ease);
}
.option-btn:hover,
.option-btn:focus-visible {
    border-color: rgba(212,175,55,0.5);
    border-left-color: var(--gold);
    background: rgba(212,175,55,0.04);
    outline: none;
    transform: translateX(3px);
}
.option-btn.curiosity-option {
    border-color: rgba(107, 144, 128, 0.5);
    border-left-color: var(--green);
    color: var(--text-muted);
}
.option-btn.curiosity-option::before {
    content: none;
}

.notice-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    line-height: 1.6;
}
.notice-item:last-child { border-bottom: none; }
.notice-item strong {
    font-family: var(--font-title);
    color: var(--text-main);
    font-weight: 400;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* ── Screen 7: Consequence & Ending ─────────────────────────── */
#screen-consequence {
    background: rgba(8, 10, 14, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 200;
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Phase 1: single-choice consequence ── */
.cons-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 24px;
    max-width: 640px;
    width: 100%;
    text-align: center;
}
.cons-eyebrow {
    font-size: 0.58rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.cons-text {
    max-width: 580px;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.9;
    margin: 0 0 2.5rem;
    font-weight: 300;
}
.cons-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 3rem;
}
.cons-badge {
    padding: 8px 18px;
    border: 1px solid;
    border-radius: var(--radius);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    background: rgba(255,255,255,0.02);
}
.cons-badge.pos { border-color: var(--green); color: var(--green); background: rgba(107,144,128,0.06); }
.cons-badge.neg { border-color: var(--red);   color: var(--red);   background: rgba(181,101,118,0.06); }
.cons-badge.ct  { border-color: var(--gold);  color: var(--gold);  background: rgba(212,175,55,0.06); }

.cons-btn {
    padding: 12px 0 12px 20px;
    border: none;
    border-left: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-family: var(--font-body);
    font-weight: 500;
    transition: color 200ms var(--ease), border-color 200ms var(--ease), padding-left 200ms var(--ease);
    width: 100%;
    text-align: left;
}
.cons-btn:hover {
    color: var(--text-main);
    border-left-color: var(--text-main);
    padding-left: 26px;
}
.cons-btn.primary {
    color: var(--gold);
    border-left-color: rgba(212,175,55,0.6);
}
.cons-btn.primary:hover {
    color: var(--gold);
    border-left-color: var(--gold);
    padding-left: 26px;
}

/* ── Phase 2: game ending / final score ── */
.ending-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 24px;
    max-width: 680px;
    width: 100%;
    text-align: center;
    gap: 0;
}
.ending-eyebrow {
    font-size: 0.58rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.2rem;
    font-weight: 600;
}
.ending-title {
    font-family: var(--font-title);
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--text-main);
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}
.ending-body {
    max-width: 540px;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.9;
    font-weight: 300;
    margin-bottom: 3rem;
}

/* Final gauge display */
.ending-gauges {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3.5rem;
}
.ending-gauge-row {
    display: grid;
    grid-template-columns: 160px 1fr 40px;
    align-items: center;
    gap: 14px;
}
.ending-gauge-label {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: right;
    font-weight: 600;
}
.ending-gauge-bar-wrap {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 1px;
    overflow: hidden;
}
.ending-gauge-bar {
    height: 100%;
    width: 0;
    border-radius: 1px;
    transition: width 1.4s var(--ease);
}
.ending-gauge-bar.ct { background: var(--gold);  box-shadow: 0 0 8px rgba(212,175,55,0.5); }
.ending-gauge-bar.ih { background: var(--green); box-shadow: 0 0 8px rgba(107,144,128,0.5); }
.ending-gauge-bar.vp { background: var(--red);   box-shadow: 0 0 8px rgba(181,101,118,0.5); }
.ending-gauge-val {
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
    text-align: left;
}

.ending-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
    width: 100%;
    max-width: 280px;
    border-left: 1px solid var(--border);
    padding-left: 0;
}

/* Achievements / Toasts */
.achievement-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--gold);
    border-radius: 4px;
    padding: 14px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    z-index: 9000;
    opacity: 0;
    transform: translateX(calc(100% + 2rem));
    transition: opacity 500ms var(--ease), transform 500ms var(--ease);
    max-width: 300px;
    width: 90vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    pointer-events: none;
}
.achievement-toast.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}
.ach-icon {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--gold);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    flex-shrink: 0;
    padding-right: 10px;
    border-right: 1px solid var(--border-strong);
    padding-top: 2px;
}
.ach-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.ach-title {
    font-family: var(--font-title);
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.3;
}
.ach-desc {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

@keyframes map-pulse {
    0%, 100% { filter: drop-shadow(0 0 0px transparent); }
    50% { filter: drop-shadow(0 0 12px var(--gold, #C9A84C)); }
}

/* Unlocked polling station */
.map-location.unlocked-loc {
    opacity: 1;
    pointer-events: auto;
}

/* Next-week banner button hover */
#next-week-banner button:hover {
    background: #b8963e;
    transform: scale(1.02);
    transition: all 0.15s;
}

#screen-game {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: fixed;
    inset: 0;
}

/* =============================================================================
   DIALOGUE ENGINE v2 — Line Type Styles
   All types: dialogue, narration, whatsapp, voicenote, screenshot,
               notice, document, comparison, video, choice, stats
   ============================================================================= */

/* --- Base dialogue text area — definition merged above --- */

/* --- Speaker name inside dialogue lines --- */
.speaker-name {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold, #c9a84c);
    margin-bottom: 0.4em;
}

/* --- Narration lines --- */
.line-narration em {
    font-style: italic;
    color: var(--text-muted, rgba(255,255,255,0.6));
    font-size: 0.95rem;
    line-height: 1.7;
    display: block;
}

/* --- Choice prompt --- */
.choice-prompt {
    display: block;
    font-weight: 500;
    font-size: 1rem;
    color: var(--off-white, #f0ece4);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* === MEDIA CARDS (WhatsApp, VoiceNote, Screenshot, Video) === */

.media-card {
    background: rgba(10, 10, 10, 0.65);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    max-width: 520px;
    margin: 0 auto;
    font-size: 0.88rem;
    line-height: 1.6;
}

.media-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.media-platform {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold, #c9a84c);
    font-weight: 600;
}

.media-group {
    font-size: 0.72rem;
    color: var(--text-muted, rgba(255,255,255,0.5));
}

.media-card-sender {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--off-white, #f0ece4);
    margin-bottom: 0.25rem;
}

.media-time {
    font-weight: 400;
    font-size: 0.72rem;
    color: var(--text-muted, rgba(255,255,255,0.45));
    margin-left: 0.5rem;
}

.media-forwarded {
    font-size: 0.72rem;
    color: var(--text-muted, rgba(255,255,255,0.45));
    font-style: italic;
    margin-bottom: 0.35rem;
}

.media-card-body {
    color: var(--off-white, #f0ece4);
    font-size: 0.9rem;
    line-height: 1.65;
}

/* WhatsApp — green left accent */
.whatsapp-card {
    border-left: 3px solid #25d366;
}

/* --- Voice Note --- */
.voicenote-card {
    border-left: 3px solid #25d366;
}

.media-voicenote-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    margin: 0.5rem 0;
}

.voicenote-icon {
    font-size: 1.1rem;
}

.voicenote-waveform {
    flex: 1;
    height: 28px;
    background: repeating-linear-gradient(
        to right,
        rgba(255,255,255,0.15) 0px,
        rgba(255,255,255,0.15) 2px,
        transparent 2px,
        transparent 6px
    );
    border-radius: 4px;
}

.voicenote-duration {
    font-size: 0.78rem;
    color: var(--text-muted, rgba(255,255,255,0.5));
    min-width: 36px;
    text-align: right;
}

.media-transcript {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.6;
}

/* --- Screenshot --- */
.screenshot-card {
    border-left: 3px solid var(--garnet, #8b1c2c);
}

.media-caption {
    font-size: 0.82rem;
    color: var(--off-white, #f0ece4);
    margin: 0.4rem 0;
}

.screenshot-description {
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.12);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.55;
    margin: 0.4rem 0;
    font-style: italic;
}

.screenshot-cues {
    list-style: none;
    padding: 0;
    margin: 0.4rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.screenshot-cues li {
    font-size: 0.72rem;
    background: rgba(139,28,44,0.35);
    border: 1px solid rgba(139,28,44,0.6);
    color: #f0a0a0;
    border-radius: 4px;
    padding: 2px 8px;
}

/* --- Video --- */
.video-card {
    border-left: 3px solid var(--slate, #6b7a8d);
}

.video-still {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 0.5rem 0;
    gap: 0.5rem;
}

.video-play-icon {
    font-size: 2.2rem;
    color: rgba(255,255,255,0.5);
}

.video-description {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.6);
    text-align: center;
    line-height: 1.55;
}

/* === DOCUMENT CARDS (Notice, Document, Comparison) === */

.document-card {
    background: rgba(240, 236, 228, 0.04);
    border: 1px solid rgba(240,236,228,0.12);
    border-radius: 10px;
    padding: 1.25rem 1.4rem;
    max-width: 540px;
    margin: 0 auto;
    font-size: 0.88rem;
    line-height: 1.65;
}

/* --- Notice Card --- */
.notice-header {
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold, #c9a84c);
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.3rem;
}

.notice-title {
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    color: var(--off-white, #f0ece4);
    margin-bottom: 0.8rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.notice-body {
    color: rgba(255,255,255,0.82);
    font-size: 0.88rem;
    line-height: 1.7;
    white-space: pre-line;
}

.notice-footer {
    margin-top: 0.8rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.72rem;
    color: var(--text-muted, rgba(255,255,255,0.45));
    text-align: center;
    font-style: italic;
}

/* --- Document Card --- */
.doc-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--off-white, #f0ece4);
    margin-bottom: 0.2rem;
}

.doc-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted, rgba(255,255,255,0.5));
    margin-bottom: 0.8rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.doc-sections {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.doc-section-heading {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold, #c9a84c);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.doc-section-text {
    color: rgba(255,255,255,0.78);
    font-size: 0.86rem;
    line-height: 1.65;
}

/* --- Comparison Card --- */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 0.75rem 0;
}

.comparison-label {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold, #c9a84c);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.comparison-text {
    font-size: 0.84rem;
    color: rgba(255,255,255,0.78);
    line-height: 1.6;
    padding: 0.6rem;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.06);
}

.comparison-note {
    font-size: 0.78rem;
    color: var(--garnet, #e05a72);
    font-style: italic;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.07);
}

/* === STATS CARD === */

.stats-card {
    max-width: 420px;
    margin: 0 auto;
    background: rgba(10,10,10,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    overflow: hidden;
}

.stats-title {
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold, #c9a84c);
    font-weight: 700;
    text-align: center;
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.78);
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-val {
    font-weight: 700;
    color: var(--off-white, #f0ece4);
}

/* === RESPONSIVE === */

@media (max-width: 600px) {
    .media-card,
    .document-card {
        padding: 0.8rem 0.9rem;
        font-size: 0.84rem;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   ASSET SLOTS — fill these in as assets are generated
   Characters: assets/characters/char_{name}_{state}.png
   NPCs:       assets/npcs/npc_{name}_{state}.png
   UI:         assets/ui/{component}.png / .svg
   Props:      assets/props/{item}.png
   ============================================================ */

/* Characters — currently rendered via JS into .dialogue-header img */
/* No CSS overrides needed; sizes are controlled by .dialogue-header img rules above */

/* NPC portraits — same as characters */
/* No CSS overrides needed */

/* UI: WhatsApp bubble chrome */
.whatsapp-card {
    position: relative;
}
.whatsapp-card::before { 
    content: '';
    position: absolute;
    top: 0.5rem; right: 0.5rem;
    width: 48px; height: 48px;
    background-image: url('assets/ui/whatsapp_bubble.png'); 
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.15;
    pointer-events: none;
}

/* UI: EC board stamp overlay on notice cards */
.notice-card {
    position: relative;
}
.notice-card::after {
    content: '';
    position: absolute;
    bottom: 1rem; right: 1rem;
    width: 70px; height: 70px;
    background: url('assets/ui/ec_stamp.png') no-repeat center/contain;
    opacity: 0.25;
    pointer-events: none;
}

/* Props: manifesto document image */
.document-card.manifesto-card { 
    background-image: url('assets/props/manifesto_2025.png'); 
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
    background-color: rgba(240, 236, 228, 0.95);
}

/* Audio: referenced in JS, no CSS needed */

/* =====================================================
   WEEK ADVANCE BANNER — sits at screen bottom,
   below all dialogue (z-index 18 = under top-bar 20)
   ===================================================== */
#next-week-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: linear-gradient(to right, rgba(6,8,12,0.99), rgba(13,15,20,0.97));
    border-top: 1px solid rgba(212,175,55,0.32);
    padding: 20px 40px;
    font-family: var(--font-body);
    box-shadow: 0 -16px 48px rgba(0,0,0,0.55);
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 350ms ease, transform 350ms ease;
}
.week-banner-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.week-banner-eyebrow {
    font-size: 0.53rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
    opacity: 0.9;
}
.week-banner-headline {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 400;
    letter-spacing: -0.01em;
}
.week-banner-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}
.week-banner-stay {
    background: transparent !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border) !important;
    padding: 9px 20px !important;
    border-radius: 2px !important;
    cursor: pointer !important;
    font-size: 0.62rem !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    font-family: var(--font-body) !important;
    font-weight: 500 !important;
    transition: all 0.2s !important;
}
.week-banner-stay:hover {
    color: var(--text-main) !important;
    border-color: var(--border-strong) !important;
}
#next-week-banner.visible {
    opacity: 1;
    transform: translateY(0);
}
.week-banner-advance {
    background: rgba(212,175,55,0.1) !important;
    color: var(--gold) !important;
    border: 1px solid rgba(212,175,55,0.5) !important;
    padding: 9px 24px !important;
    border-radius: 2px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    font-size: 0.7rem !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    font-family: var(--font-body) !important;
    transition: all 0.2s !important;
}
.week-banner-advance:hover {
    background: rgba(212,175,55,0.18) !important;
    border-color: var(--gold) !important;
}

/* override the old blanket button rule from before */
#next-week-banner button:hover {
    transform: none !important;
}

/* =============================================================
   GAUGE TUTORIAL OVERLAY — shown once on first game start
   ============================================================= */
#gauge-tutorial {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 400ms var(--ease);
    pointer-events: none;
}
#gauge-tutorial.visible {
    opacity: 1;
    pointer-events: auto;
}
.gauge-tutorial-inner {
    background: var(--bg-card);
    border: 1px solid rgba(212,175,55,0.2);
    border-top: 2px solid rgba(212,175,55,0.35);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 32px 80px rgba(0,0,0,0.7);
}
.gauge-tutorial-inner h2 {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.4rem;
    color: var(--text-main);
    letter-spacing: -0.01em;
}
.gauge-tutorial-subtitle {
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 1.8rem;
    line-height: 1.6;
}
.tutorial-gauges {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-bottom: 2rem;
}
.tg-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0.8rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.tg-icon {
    font-size: 1.1rem;
    width: 28px;
    flex-shrink: 0;
    text-align: center;
    margin-top: 1px;
}
.tg-name {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}
.tg-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
}
.gauge-tutorial-inner .tut-btn {
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(212,175,55,0.4);
    color: var(--gold);
    background: transparent;
    border-radius: var(--radius);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 300ms;
    font-family: var(--font-body);
}
.gauge-tutorial-inner .tut-btn:hover {
    background: rgba(212,175,55,0.08);
    border-color: var(--gold);
}

/* Gauge tooltip panel */
.gauge-tooltip-panel {
    /* position: fixed escapes the sticky top-bar stacking context
       so it won't be buried under the objective-bar (z-25) */
    position: fixed;
    top: 76px;   /* sits just below the top-bar */
    left: 32px;  /* overridden per-gauge by toggleGaugeInfo() */
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-top: 2px solid rgba(212,175,55,0.35);
    border-radius: var(--radius);
    padding: 14px 16px;
    width: 244px;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.65;
    z-index: 200;  /* well above everything */
    box-shadow: 0 10px 28px rgba(0,0,0,0.6);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 200ms, transform 200ms;
}
.gauge-tooltip-panel.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.gauge-tooltip-panel strong {
    display: block;
    color: var(--text-main);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.gauge-container { position: relative; }

/* =============================================================
   PAUSE MENU: achievements log section
   ============================================================= */
.pause-achievements {
    margin-top: 2rem;
    max-width: 360px;
    width: 100%;
    text-align: left;
}
.pause-ach-title {
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.pause-ach-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 160px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
}
.pause-ach-list::-webkit-scrollbar {
    width: 4px;
}
.pause-ach-list::-webkit-scrollbar-track {
    background: transparent;
}
.pause-ach-list::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
    border-radius: 10px;
}
.pause-ach-list::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}
.pause-ach-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
}
.pause-ach-item:last-child { border-bottom: none; }
.pause-ach-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    flex-shrink: 0;
}
.pause-ach-dot.locked { background: var(--border-strong); }
.pause-ach-name { color: var(--text-main); font-weight: 500; }
.pause-ach-desc { color: var(--text-muted); font-size: 0.7rem; display: none; }
.pause-ach-item.earned .pause-ach-desc { display: block; }
.pause-ach-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.5rem 0;
}

/* itch.io / Steam fullscreen compatibility */
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none; /* Prevents mobile scroll interfering with game */
}

/* Prevent text selection during gameplay */
.screen, #overlay-pause, #dialogue-panel {
    user-select: none;
    -webkit-user-select: none;
}

/* Allow text selection only in modal text (About, Settings) */
.modal-content p, .modal-text {
    user-select: text;
    -webkit-user-select: text;
}

/* Ensure game always fills viewport, even on unusual resolutions */
#screen-game {
    min-height: 100vh;
    min-width: 100vw;
}

/* Copyright Notice */
.copyright-notice {
    position: absolute;
    bottom: 2rem;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    pointer-events: none;
}

/* (duplicate .game-slider block removed — definition kept above) */

/* Volume Row (Settings) */
.volume-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    flex: 1;
}
.volume-icon {
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
    font-family: var(--font-body);
}
.volume-val {
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 28px;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.setting-divider {
    height: 1px;
    background: var(--border);
    margin: 1rem 0 1.5rem;
}

/* Credits Modal Blocks */
.credits-block {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.credits-block:last-of-type {
    border-bottom: none;
}
.credits-section-label {
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.4rem;
    font-weight: 600;
}
.credits-block .modal-text {
    margin-bottom: 0;
    color: var(--text-main);
    font-size: 0.9rem;
}

/* Character Confirmation Modal */
.char-confirm-modal {
    text-align: left;
    max-width: 520px;
}
.char-confirm-eyebrow {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}
.char-confirm-name {
    font-family: var(--font-title);
    font-size: 2.6rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    font-weight: 400;
}
.char-confirm-tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
}
.char-confirm-counter {
    color: var(--gold);
    font-weight: 600;
}
.char-confirm-traits {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.char-confirm-trait {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
}
.char-confirm-trait-label {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    flex-shrink: 0;
    width: 90px;
    padding-top: 2px;
}
.char-confirm-trait.perk .char-confirm-trait-label { color: var(--green); }
.char-confirm-trait.dis .char-confirm-trait-label { color: var(--red); }
.char-confirm-trait-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.char-confirm-gauges {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1.25rem;
    padding: 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.char-confirm-warning {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1.5rem;
}
.char-confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: flex-start;
}
.char-confirm-actions .menu-btn {
    flex: 1;
    text-align: center;
    font-size: 0.72rem;
    padding: 14px 12px;
}

/* Achievements Screen */
#screen-achievements {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.achievements-screen-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 4rem 6vw 2rem;
    overflow: hidden;
}
.achievements-screen-header {
    flex-shrink: 0;
    margin-bottom: 2rem;
}
.achievements-screen-title {
    font-family: var(--font-title);
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}
.achievements-counter {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    flex: 1;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
}
.achievements-grid::-webkit-scrollbar {
    width: 4px;
}
.achievements-grid::-webkit-scrollbar-track {
    background: transparent;
}
.achievements-grid::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
    border-radius: 10px;
}
.achievements-grid::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}
.ach-tile {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: border-color 200ms;
}
.ach-tile.earned {
    border-color: rgba(212,175,55,0.3);
    background: rgba(212,175,55,0.03);
}
.ach-tile.hidden-tile {
    border-style: dashed;
    opacity: 0.45;
}
.ach-tile-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-strong);
    flex-shrink: 0;
    margin-top: 5px;
}
.ach-tile.earned .ach-tile-dot { background: var(--gold); box-shadow: 0 0 8px rgba(212,175,55,0.4); }
.ach-tile-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;          /* Prevents long names from overflowing the tile */
}
.ach-tile-category {
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.ach-tile-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.3rem;
}
.ach-tile.hidden-tile .ach-tile-name { color: var(--text-muted); font-style: italic; }
.ach-tile-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.ach-category-header {
    grid-column: 1 / -1;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 1rem 0 0.4rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
}

/* ── Cinematic Credits Screen ────────────────────────────────── */
.credits-screen {
    background: #080a0e;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.credits-scroll-outer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.credits-scroll-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 30vh 2rem 30vh;
    width: 100%;
    max-width: 640px;
    will-change: transform;
    /* transform is set entirely by JS — no CSS animation */
}

.credits-title-card {
    text-align: center;
    padding: 0 0 10rem;
}
.credits-game-title {
    font-family: var(--font-title);
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 1rem;
}
.credits-game-sub {
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.credits-section {
    text-align: center;
    padding: 3.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    width: 100%;
}
.credits-section--thanks {
    padding: 5rem 0;
}
.credits-section--legal {
    padding: 4rem 0;
    border-bottom: none;
}

.credits-role {
    font-size: 0.58rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1rem;
    font-weight: 600;
}
.credits-name {
    font-family: var(--font-body);
    font-size: 1.25rem;
    color: var(--text-main);
    font-weight: 300;
    letter-spacing: 0.02em;
    line-height: 1.6;
}
.credits-name-small {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-top: 0.4rem;
    line-height: 1.8;
}
.credits-legal-text {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    line-height: 2;
    text-align: center;
}

.credits-final-card {
    text-align: center;
    padding: 8rem 0 2rem;
}
.credits-final-line {
    font-family: var(--font-title);
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
}
.credits-final-sub {
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.2);
}

.credits-close-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10;
    background: transparent;
    border: none;
    border-left: 2px solid rgba(255,255,255,0.15);
    border-radius: 0;
    color: var(--text-muted);
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 6px 0 6px 14px;
    cursor: pointer;
    transition: color 200ms var(--ease), border-color 200ms var(--ease);
    font-family: var(--font-body);
    font-weight: 600;
}
.credits-close-btn:hover {
    color: var(--text-main);
    border-left-color: var(--text-main);
}

/* ── Achievements menu button restored to normal weight */

#map-svg-container {
    position: relative;
    flex: 1;
    width: 100%;
    overflow: hidden;
    background: #0f0c08;
    z-index: 1;
    min-height: 0; /* Required: lets flex child shrink below natural height */
}

#map-inner-wrap {
    position: absolute;
    width: 1920px;
    height: 1080px;
    transform-origin: top left;
    /* transform: translate(Xpx, Ypx) scale(N) — set dynamically by scaleMap() in script.js */
}

.background-map {
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
    z-index: 1;
    pointer-events: none;
    display: block;
}

.map-location {
    position: absolute;
    cursor: pointer;
    z-index: 2;
    transition: filter 0.25s ease, transform 0.25s ease;
    transform: translate(-50%, -50%); /* Centers the image directly on exact X/Y coordinates */
}

.map-location:not(.pulse-active):hover {
    z-index: 5;
    filter: brightness(1.12) drop-shadow(0 4px 16px rgba(212,175,55,0.25));
    transform: translate(-50%, -50%) translateY(-4px);
}
.map-location.pulse-active:hover {
    z-index: 5;
}

.map-asset {
    display: block;
    mix-blend-mode: multiply;
    pointer-events: none;
}

/* Base dot — hidden by default; only shown on pulse-active target */
.base-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold, #D4AF37);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 400ms ease;
}

/* Radar ripple — invisible by default; only animates on pulse-active target */
.radar-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.7);
    background: transparent;
    z-index: 3;
    pointer-events: none;
    animation: none;
    opacity: 0;
}

@keyframes radar-pulse {
    0%   { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(4); opacity: 0; }
}

/* Pulse-active state — highlighted target location for current week objective */
.map-location.pulse-active .radar-ripple {
    border-color: var(--gold, #D4AF37);
    border-width: 3px;
    animation: radar-pulse-fast 1.2s ease-out infinite;
    width: 18px;
    height: 18px;
}

.map-location.pulse-active .base-dot {
    opacity: 1;
    background: #ffffff;
    box-shadow: 0 0 18px rgba(212, 175, 55, 1);
}

@keyframes radar-pulse-fast {
    0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    60%  { opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(7); opacity: 0; }
}

/* Second ring for double-pulse effect */
.map-location.pulse-active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.5);
    background: transparent;
    pointer-events: none;
    animation: radar-pulse-fast 1.2s ease-out 0.6s infinite;
    z-index: 3;
}

/* Unlocked state — Skeptics Cafe revealed after 3 verifications */
.map-location.unlocked .map-asset {
    filter: drop-shadow(0 0 10px rgba(107, 144, 128, 0.75));
}

/* Polling station unlock on Election Day — JS sets opacity and pointer-events directly */
.map-location.unlocked-loc {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Reduce motion — disable all map animations */
body.reduce-motion .radar-ripple,
body.reduce-motion .map-location.pulse-active .radar-ripple {
    animation: none !important;
    opacity: 0.5;
}
/* Ensure dot is still visible without transitions for reduce-motion users */
body.reduce-motion .map-location.pulse-active .base-dot {
    opacity: 1 !important;
    transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .radar-ripple {
        animation: none !important;
        opacity: 0.5;
    }
}

#game-container-16x9 {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Polling station — unlocked on Election Day */
#loc9-node.polling-unlocked {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Locked character cards (Kamala, Kumaran — not yet available) */
.char-card--locked {
    opacity: 1;
    cursor: not-allowed;
    pointer-events: none;
    filter: saturate(0.3) brightness(0.75);
}
.char-locked-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(13, 15, 20, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--gold);
    font-size: 0.52rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 0;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    font-family: var(--font-body);
}

/* Achievements screen background */
#bg-achievements {
    background-image: url('assets/backgrounds/bg_char_select.webp');
}
