/* ========================================
   THAT AWKWARD QUESTION — Visual Novel Stylesheet
   Warm Suburban / Hospital White / Intimate Darkness
   Guilt & desire themed — Farrah's story
   ======================================== */

:root {
    /* === Warm Suburban Palette === */
    --bg-darker: #0a0808;
    --bg-dark: #1a1210;
    --bg-medium: #2a1e1a;
    --bg-card: #1e1410;
    --accent: #c45c3e;
    --accent-primary: #c45c3e;
    --accent-glow: #d4724e;
    --accent-secondary: #d4a574;
    --text: #f0e8e0;
    --text-secondary: #c0b0a0;
    --text-narrator: #d8c8b8;
    --text-dim: #a08870;
    --danger: #cc2233;
    --danger-glow: rgba(204, 34, 51, 0.35);
    --gold: #d4a574;
    --gold-glow: rgba(212, 165, 116, 0.25);

    /* Legacy compat aliases */
    --neon-amber: var(--accent);
    --neon-amber-glow: rgba(196, 92, 62, 0.4);
    --neon-amber-dim: #a0503a;
    --neon-pink: var(--danger);
    --neon-pink-glow: var(--danger-glow);
    --neon-blue: var(--accent-secondary);
    --text-primary: var(--text);

    /* Glass effects */
    --glass-bg: rgba(15, 10, 8, 0.8);
    --glass-bg-heavy: rgba(10, 7, 5, 0.92);
    --glass-border: rgba(196, 92, 62, 0.15);
    --glass-border-bright: rgba(196, 92, 62, 0.4);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-med: 0.4s ease;
    --transition-slow: 0.7s ease;
    --transition-cinematic: 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Fonts */
    --font-ui: 'Raleway', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Cinzel', Georgia, 'Times New Roman', serif;
    --font-handwritten: 'Caveat', 'Segoe Script', 'Comic Sans MS', cursive;

    /* Shadows */
    --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow-accent: 0 0 30px rgba(196, 92, 62, 0.15);
    --shadow-glow-amber: var(--shadow-glow-accent);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-darker);
    font-family: var(--font-ui);
    color: var(--text);
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== SCREEN MANAGEMENT ===== */
.screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: none;
    z-index: 1;
}
.screen.active {
    display: block;
}
.hidden { display: none !important; }

/* ===== LOADING SCREEN ===== */
#loading-screen {
    background: var(--bg-darker);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
/* IMPORTANT: Only .active gets display:flex — loading screen fix */
#loading-screen.active {
    display: flex;
}

.loading-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at 50% 50%, rgba(196, 92, 62, 0.04) 0%, transparent 60%);
}

.loading-content {
    position: relative;
    text-align: center;
    z-index: 2;
}

.loading-logo {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.2em;
    margin-bottom: 40px;
    text-shadow: 0 0 30px var(--neon-amber-glow);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.loading-bar-outer {
    width: 300px;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 20px;
}

.loading-bar-inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #8b3a24, var(--accent), #d4724e);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.loading-text {
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* ===== TITLE SCREEN ===== */
#title-screen {
    background: var(--bg-darker);
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.25;
    z-index: 0;
    filter: blur(2px) saturate(0.7);
    transition: opacity 1s ease;
}

#title-particles {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Warm suburban sunset vignette */
.title-vignette {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at 50% 60%,
        rgba(196, 92, 62, 0.06) 0%,
        rgba(42, 30, 26, 0.4) 40%,
        rgba(10, 8, 8, 0.85) 100%
    );
    z-index: 2;
    pointer-events: none;
}

.title-scanlines {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.04) 2px,
        rgba(0, 0, 0, 0.04) 4px
    );
    z-index: 3;
    pointer-events: none;
}

/* Title content — overflow-y: auto fix preserved */
.title-content {
    position: relative;
    z-index: 4;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    max-height: 100vh;
    padding: 24px 16px;
    overflow-y: auto;
    animation: title-fade-in 1.5s ease forwards;
}

@keyframes title-fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.title-pre {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 0.5em;
    text-transform: uppercase;
    margin-bottom: 8px;
    opacity: 0;
    animation: title-element-in 0.8s ease 0.3s forwards;
}

/* === Title Main: warm copper glow === */
.title-main {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5.5vw, 4.5rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    color: var(--accent);
    text-shadow:
        0 0 20px var(--neon-amber-glow),
        0 0 60px rgba(196, 92, 62, 0.2),
        0 0 120px rgba(196, 92, 62, 0.08),
        0 2px 0 rgba(140, 60, 40, 0.8),
        0 4px 8px rgba(0, 0, 0, 0.8);
    animation: title-glow 4s ease-in-out infinite alternate;
    line-height: 1;
}

@keyframes title-glow {
    from {
        text-shadow:
            0 0 20px var(--neon-amber-glow),
            0 0 60px rgba(196, 92, 62, 0.15),
            0 0 120px rgba(196, 92, 62, 0.05),
            0 2px 0 rgba(140, 60, 40, 0.8),
            0 4px 8px rgba(0, 0, 0, 0.8);
        filter: brightness(1);
    }
    to {
        text-shadow:
            0 0 40px var(--neon-amber-glow),
            0 0 100px rgba(196, 92, 62, 0.25),
            0 0 160px rgba(196, 92, 62, 0.1),
            0 2px 0 rgba(140, 60, 40, 0.8),
            0 4px 8px rgba(0, 0, 0, 0.8);
        filter: brightness(1.1);
    }
}

@keyframes title-element-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Divider: simple line, no spade === */
.title-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    opacity: 0;
    animation: title-element-in 0.8s ease 0.6s forwards;
}
.title-divider span:first-child,
.title-divider span:last-child {
    display: block;
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-amber-dim), transparent);
}

/* === Divider center: simple dot instead of spade === */
.divider-diamond {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--neon-amber-glow);
    transform: none;
    font-size: 0;
    line-height: 0;
}
.divider-diamond::before {
    content: none;
}

/* === Tagline: slow pulsing opacity === */
.title-tagline {
    font-family: var(--font-ui);
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    font-weight: 300;
    font-style: italic;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    margin-top: 8px;
    opacity: 0;
    animation: title-element-in 0.8s ease 0.9s forwards;
}
/* Tagline pulse after initial fade-in */
.title-tagline.visible,
.title-content .title-tagline {
    animation: title-element-in 0.8s ease 0.9s forwards, tagline-breathe 4s ease-in-out 2s infinite;
}
@keyframes tagline-breathe {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

/* === Title Menu: warm dark glass, copper border === */
.title-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 280px;
    opacity: 0;
    animation: title-element-in 0.8s ease 1.2s forwards;
}

.menu-btn {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 400;
    padding: 14px 32px;
    background: rgba(15, 10, 8, 0.75);
    color: var(--text);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.menu-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(196, 92, 62, 0.1), transparent);
    transition: left 0.5s ease;
}
.menu-btn:hover::before {
    left: 100%;
}
.menu-btn:hover:not(:disabled) {
    background: rgba(196, 92, 62, 0.14);
    border-color: var(--glass-border-bright);
    color: var(--accent);
    box-shadow: var(--shadow-glow-accent), inset 0 0 30px rgba(196, 92, 62, 0.04);
    transform: translateY(-1px);
}
.menu-btn:active:not(:disabled) {
    transform: scale(0.97) translateY(0);
}
.menu-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 0.85rem;
    opacity: 0.7;
}
.btn-text {
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.title-credit {
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    opacity: 0;
    animation: title-element-in 0.8s ease 1.5s forwards;
}

.neon-flicker {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 3;
    background: radial-gradient(ellipse at 50% 100%, rgba(196, 92, 62, 0.03) 0%, transparent 60%);
    animation: flicker 6s ease-in-out infinite;
}

/* Title bottom fade to black */
#title-screen::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 30%;
    background: linear-gradient(0deg, var(--bg-darker) 0%, transparent 100%);
    z-index: 1;
    pointer-events: none;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    48% { opacity: 0.8; }
    50% { opacity: 1; }
    52% { opacity: 0.7; }
    53% { opacity: 1; }
    70% { opacity: 0.9; }
    72% { opacity: 1; }
}

/* ===== GAME SCREEN ===== */
#game-screen {
    background: var(--bg-dark);
}

/* Background Layer */
#scene-background, #scene-background-next {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--bg-dark);
    transition: opacity var(--transition-cinematic);
    z-index: 0;
}
#scene-background-next {
    opacity: 0;
    z-index: 1;
}

/* Video Background Layer */
#scene-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0;
    transition: opacity var(--transition-cinematic);
    pointer-events: none;
    background: transparent;
}
#scene-video.active {
    opacity: 1;
}

/* Atmospheric Overlays */
#atmosphere-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2;
    pointer-events: none;
}

.vignette-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(10, 8, 8, 0.55) 100%);
}

.mood-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease, background 1.5s ease;
    mix-blend-mode: overlay;
}

/* Mood color grades — warm suburban tones */
.mood-overlay.mood-warm { background: rgba(196, 92, 62, 0.08); opacity: 1; }
.mood-overlay.mood-danger { background: rgba(200, 30, 30, 0.12); opacity: 1; }
.mood-overlay.mood-intimate { background: rgba(180, 80, 60, 0.12); opacity: 1; }
.mood-overlay.mood-cold { background: rgba(80, 120, 200, 0.08); opacity: 1; }
.mood-overlay.mood-clinical { background: rgba(220, 230, 240, 0.06); opacity: 1; }
.mood-overlay.mood-guilt {
    background: radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(180, 20, 20, 0.12) 100%);
    opacity: 1;
}
.mood-overlay.mood-ecstasy {
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.12) 0%, rgba(196, 92, 62, 0.08) 100%);
    opacity: 1;
    animation: ecstasy-pulse 2s ease-in-out infinite;
}

/* Dialogue box border glow matches mood */
#game-screen.scene-ecstasy .dialogue-inner::before {
    background: linear-gradient(90deg, transparent 5%, var(--danger) 30%, var(--accent) 50%, var(--danger) 70%, transparent 95%);
    opacity: 0.7;
    animation: ecstasy-pulse 2s ease-in-out infinite;
}
#game-screen.scene-danger .dialogue-inner::before {
    background: linear-gradient(90deg, transparent 5%, #cc2233 30%, #dd4444 50%, #cc2233 70%, transparent 95%);
    opacity: 0.6;
}
#game-screen.scene-intimate .dialogue-inner::before {
    background: linear-gradient(90deg, transparent 5%, var(--accent) 30%, var(--accent-secondary) 50%, var(--accent) 70%, transparent 95%);
    opacity: 0.5;
}

@keyframes ecstasy-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

#game-particles {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* Screen Flash */
#screen-flash {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 45;
    pointer-events: none;
    opacity: 0;
}
#screen-flash.flash-white {
    background: white;
    animation: flash 0.5s ease-out forwards;
}
#screen-flash.flash-amber {
    background: var(--accent);
    animation: flash 0.6s ease-out forwards;
}
#screen-flash.flash-pink {
    background: var(--danger);
    animation: flash 0.8s ease-out forwards;
}
#screen-flash.flash-red {
    background: #aa1122;
    animation: flash 0.7s ease-out forwards;
}

@keyframes flash {
    0% { opacity: 0.7; }
    100% { opacity: 0; }
}

/* Letterbox */
.letterbox {
    position: absolute;
    left: 0;
    width: 100%;
    height: 0;
    background: black;
    z-index: 40;
    transition: height 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
#letterbox-top { top: 0; }
#letterbox-bottom { bottom: 0; }
.letterbox.active { height: 8vh; }

/* ===== CHAPTER CARD — Warm toned lined-paper aesthetic ===== */
#chapter-card {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 8, 8, 0.92);
    z-index: 50;
    opacity: 0;
    transition: opacity 1s ease;
}
#chapter-card.visible {
    opacity: 1;
}

.chapter-card-inner {
    display: flex;
    align-items: center;
    gap: 30px;
    position: relative;
}

/* Clean lines at chapter card edges — no spades */
.chapter-line-left, .chapter-line-right {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent));
    transition: width 1s ease 0.3s;
    position: relative;
}
.chapter-line-right {
    background: linear-gradient(90deg, var(--accent), transparent);
}
#chapter-card.visible .chapter-line-left,
#chapter-card.visible .chapter-line-right {
    width: 120px;
}

.chapter-text-block {
    text-align: center;
}

/* Chapter number */
.chapter-number {
    display: block;
    font-family: var(--font-handwritten), var(--font-ui);
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.6s ease 0.5s;
}
#chapter-card.visible .chapter-number {
    opacity: 1;
    transform: translateY(0);
}

.chapter-title {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--text);
    text-shadow: 0 0 40px rgba(196, 92, 62, 0.25);
    letter-spacing: 0.05em;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.6s ease 0.7s;
}
#chapter-card.visible .chapter-title {
    opacity: 1;
    transform: translateY(0);
}

/* Simple thin line under chapter title instead of spade */
.chapter-text-block::after {
    content: '';
    display: block;
    margin: 14px auto 0;
    width: 40px;
    height: 1px;
    background: var(--accent-secondary);
    opacity: 0.35;
}

/* Faint lined-paper effect on the chapter card — warm tones */
#chapter-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        180deg,
        transparent 0px,
        transparent 38px,
        rgba(196, 92, 62, 0.02) 38px,
        rgba(196, 92, 62, 0.02) 40px
    );
    pointer-events: none;
    z-index: -1;
}

/* ===== CHARACTER SPRITES ===== */
#character-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 5;
    pointer-events: none;
}

.character-sprite {
    position: absolute;
    bottom: 170px;
    height: 85vh;
    max-width: 40vw;
    object-fit: contain;
    opacity: 0;
    transition: all var(--transition-med) ease, filter 0.3s ease;
    filter: drop-shadow(0 4px 25px rgba(0, 0, 0, 0.7));
}
.character-sprite.visible {
    opacity: 1;
}
.character-sprite.pos-left {
    left: 3%;
    transform: translateX(0);
}
.character-sprite.pos-left.enter {
    animation: sprite-enter-left 0.5s ease forwards;
}
.character-sprite.pos-center {
    left: 50%;
    transform: translateX(-50%);
}
.character-sprite.pos-center.enter {
    animation: sprite-enter-center 0.5s ease forwards;
}
.character-sprite.pos-right {
    right: 3%;
}
.character-sprite.pos-right.enter {
    animation: sprite-enter-right 0.5s ease forwards;
}
.character-sprite.dimmed {
    filter: brightness(0.45) saturate(0.6) drop-shadow(0 4px 25px rgba(0, 0, 0, 0.7));
}

@keyframes sprite-enter-left {
    from { opacity: 0; transform: translateX(-60px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes sprite-enter-center {
    from { opacity: 0; transform: translateX(-50%) scale(0.95); }
    to { opacity: 1; transform: translateX(-50%) scale(1); }
}
@keyframes sprite-enter-right {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== DIALOGUE BOX ===== */
#dialogue-box {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    padding: 0 2.5vw 1.5vh 2.5vw;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.dialogue-inner {
    background: linear-gradient(180deg, rgba(15, 10, 8, 0.85) 0%, rgba(10, 8, 6, 0.95) 100%);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid var(--glass-border);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    padding: 20px 32px 24px;
    min-height: 150px;
    position: relative;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.dialogue-inner::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent 5%, var(--neon-amber-dim) 30%, var(--accent) 50%, var(--neon-amber-dim) 70%, transparent 95%);
    opacity: 0.5;
}

#char-name-wrapper {
    margin-bottom: 10px;
    min-height: 2em;
}

#char-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 12px var(--gold-glow);
    letter-spacing: 0.05em;
    transition: color var(--transition-fast);
}

.name-underline {
    width: 0;
    height: 2px;
    margin-top: 4px;
    border-radius: 1px;
    background: var(--gold);
    transition: width 0.3s ease;
    opacity: 0.5;
}
.name-underline.visible {
    width: 60px;
}

/* ===== CHARACTER NAME COLORS ===== */
/* Farrah — copper/red (protagonist) */
#char-name.char-farrah { color: #c45c3e; text-shadow: 0 0 12px rgba(196, 92, 62, 0.3); }
#char-name.char-farrah ~ .name-underline { background: #c45c3e; }
/* Jeremy — trustworthy blue (husband) */
#char-name.char-jeremy { color: #6a9fd8; text-shadow: 0 0 12px rgba(106, 159, 216, 0.25); }
#char-name.char-jeremy ~ .name-underline { background: #6a9fd8; }
/* Jackson — warm charcoal with amber edge */
#char-name.char-jackson { color: #b8a088; text-shadow: 0 0 12px rgba(184, 160, 136, 0.2); }
#char-name.char-jackson ~ .name-underline { background: #b8a088; }
/* Doctor — clinical white */
#char-name.char-doctor { color: #d8dde4; text-shadow: 0 0 12px rgba(216, 221, 228, 0.2); }
#char-name.char-doctor ~ .name-underline { background: #d8dde4; }
/* Narrator — subtle */
#char-name.char-narrator { color: var(--text-secondary); font-style: italic; font-family: var(--font-ui); font-weight: 300; opacity: 0.6; }
#char-name.char-narrator ~ .name-underline { background: var(--text-secondary); opacity: 0.3; }
/* Inner thoughts — warm copper italic */
#char-name.char-inner { color: #c45c3e; font-style: italic; font-family: var(--font-ui); font-weight: 300; }
#char-name.char-inner ~ .name-underline { background: #c45c3e; opacity: 0.4; }

/* ===== CHARACTER-SPECIFIC DIALOGUE BOX STYLING ===== */

/* Farrah — copper/red left-border accent */
#dialogue-box.char-farrah .dialogue-inner {
    border-left: 3px solid rgba(196, 92, 62, 0.45);
}

/* Jeremy — blue left-border (kind, trustworthy) */
#dialogue-box.char-jeremy .dialogue-inner {
    border-left: 3px solid rgba(106, 159, 216, 0.35);
}

/* Jackson — dark/charcoal left-border with warm accent */
#dialogue-box.char-jackson .dialogue-inner {
    border-left: 3px solid rgba(184, 160, 136, 0.4);
    background: linear-gradient(180deg, rgba(20, 14, 10, 0.9) 0%, rgba(14, 10, 8, 0.96) 100%);
}

/* Doctor — white/clinical left-border */
#dialogue-box.char-doctor .dialogue-inner {
    border-left: 3px solid rgba(216, 221, 228, 0.4);
    background: linear-gradient(180deg, rgba(18, 16, 16, 0.88) 0%, rgba(12, 10, 10, 0.95) 100%);
}

/* Narrator — very subtle, no border accent, transparent */
#dialogue-box.char-narrator .dialogue-inner {
    border-left: none;
    background: linear-gradient(180deg, rgba(15, 10, 8, 0.72) 0%, rgba(10, 8, 6, 0.82) 100%);
}

/* Inner thoughts (Farrah's mind) — thought-bubble look in warm copper */
#dialogue-box.char-inner .dialogue-inner {
    background: rgba(15, 10, 8, 0.55);
    border: 1.5px dashed rgba(196, 92, 62, 0.25);
    border-bottom: 1.5px dashed rgba(196, 92, 62, 0.25);
    border-radius: 18px 18px 8px 8px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}
#dialogue-box.char-inner .dialogue-inner::before {
    opacity: 0.2;
}

/* ===== INNER THOUGHTS EFFECT ===== */
#dialogue-box.inner-thoughts .dialogue-inner {
    background: rgba(15, 10, 8, 0.45);
    border: 1.5px dashed rgba(196, 92, 62, 0.2);
    border-radius: 18px 18px 8px 8px;
    animation: thoughts-breathe 3s ease-in-out infinite;
}
#dialogue-box.inner-thoughts #dialogue-text {
    font-style: italic;
    color: rgba(220, 200, 180, 0.8);
}
#dialogue-box.inner-thoughts .advance-arrow {
    opacity: 0.35;
}
#dialogue-box.inner-thoughts .dialogue-inner::before {
    opacity: 0.15;
}

@keyframes thoughts-breathe {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

#dialogue-text {
    font-family: var(--font-ui);
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    font-weight: 400;
    line-height: 1.85;
    color: var(--text);
    min-height: 3.6em;
    letter-spacing: 0.01em;
}

#dialogue-text.narrator-text {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    color: var(--text-narrator);
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
}

#dialogue-text.inner-text {
    font-style: italic;
    font-weight: 300;
    color: #c45c3e;
    opacity: 0.85;
    text-shadow: 0 0 20px rgba(196, 92, 62, 0.2);
}

/* Typewriter cursor */
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1.15em;
    background: var(--accent);
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: cursor-blink 0.7s step-end infinite;
    box-shadow: 0 0 6px var(--neon-amber-glow);
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

#advance-indicator {
    position: absolute;
    bottom: 10px;
    right: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#advance-indicator.visible {
    opacity: 1;
}
#advance-indicator.auto-mode .advance-arrow {
    color: var(--danger);
    animation: auto-pulse 1.5s ease-in-out infinite;
}
@keyframes auto-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; transform: translateY(3px); }
}
.advance-arrow {
    font-size: 0.8rem;
    color: var(--accent);
    opacity: 0.7;
    animation: bounce-arrow 1.2s ease-in-out infinite;
}

@keyframes bounce-arrow {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(5px); opacity: 1; }
}

/* ===== CHOICE CONTAINER ===== */
#choice-container {
    position: absolute;
    bottom: 190px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 420px;
    max-width: 620px;
    width: 50vw;
}

/* === Choice Buttons: warm glass morphism, copper accent, warm glow hover === */
.choice-btn {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 400;
    padding: 18px 28px;
    background: linear-gradient(135deg, rgba(10, 8, 6, 0.92) 0%, rgba(26, 18, 16, 0.92) 100%);
    color: var(--text);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    text-align: left;
    opacity: 0;
    transform: translateX(-20px);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}
/* Copper left-accent bar on hover */
.choice-btn::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 3px; height: 100%;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.choice-btn:hover::before {
    opacity: 1;
}
/* Warm glow on hover instead of spade watermark */
.choice-btn::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 80px;
    height: 100%;
    background: radial-gradient(ellipse at 100% 50%, rgba(196, 92, 62, 0.12) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.choice-btn:hover::after {
    opacity: 1;
}
.choice-btn.appear {
    animation: choice-slide-in 0.4s ease forwards;
}
.choice-btn:nth-child(1).appear { animation-delay: 0.05s; }
.choice-btn:nth-child(2).appear { animation-delay: 0.15s; }
.choice-btn:nth-child(3).appear { animation-delay: 0.25s; }

@keyframes choice-slide-in {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.choice-btn:hover {
    background: linear-gradient(135deg, rgba(196, 92, 62, 0.15) 0%, rgba(196, 92, 62, 0.06) 100%);
    border-color: var(--glass-border-bright);
    color: var(--accent-glow);
    box-shadow: 0 0 30px rgba(196, 92, 62, 0.1), inset 0 0 30px rgba(196, 92, 62, 0.03);
    transform: translateX(4px);
}
.choice-btn:active {
    transform: scale(0.98);
    transition-duration: 0.05s;
    background: rgba(196, 92, 62, 0.25);
    box-shadow: 0 0 40px rgba(196, 92, 62, 0.2);
}

.choice-label {
    display: block;
    line-height: 1.5;
}
/* Hint text in copper */
.choice-hint {
    display: block;
    font-size: 0.78rem;
    font-weight: 300;
    font-style: italic;
    color: var(--accent);
    margin-top: 5px;
    opacity: 0.5;
}

/* ===== STATS PANEL ===== */
#stats-panel {
    position: absolute;
    top: 60px;
    left: 16px;
    z-index: 15;
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 16px 20px 14px;
    min-width: 200px;
    transition: all var(--transition-med);
    box-shadow: var(--shadow-heavy);
    animation: panel-slide-in 0.3s ease;
}

@keyframes panel-slide-in {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Stats header — "Farrah's State" */
.stats-header {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(196, 92, 62, 0.15);
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.stat-row:last-child { margin-bottom: 0; }

.stat-icon {
    font-size: 0.7rem;
    width: 16px;
    text-align: center;
    opacity: 0.7;
    transition: all 0.3s ease;
}
/* Innocence icon — clean white */
.stat-icon.icon-pride,
.stat-icon.icon-innocence {
    font-size: 0.85rem;
    color: #e8e4e0;
    opacity: 0.9;
}
/* Guilt icon — glows red when high */
.stat-icon.icon-acceptance,
.stat-icon.icon-guilt {
    transition: text-shadow 0.5s ease, color 0.5s ease;
}
.stat-icon.icon-acceptance.high-value,
.stat-icon.icon-guilt.high-value {
    color: var(--danger);
    text-shadow: 0 0 10px var(--danger-glow);
    opacity: 1;
}
/* Desire icon — pulses when active */
.stat-icon.icon-arousal,
.stat-icon.icon-desire {
    transition: all 0.3s ease;
}
.stat-icon.icon-arousal.arousal-active,
.stat-icon.icon-desire.desire-active {
    color: var(--accent-secondary);
    animation: heart-pulse 1s ease-in-out infinite;
}
@keyframes heart-pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.25); opacity: 1; }
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    width: 70px;
    flex-shrink: 0;
}

.stat-bar-outer {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.stat-bar-inner {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}
.stat-bar-inner::after {
    content: '';
    position: absolute;
    right: 0; top: 0;
    width: 6px; height: 100%;
    background: white;
    opacity: 0.5;
    border-radius: 0 2px 2px 0;
    filter: blur(2px);
}

/* Stat bar colors — Innocence: white/clean, Guilt: red/crimson, Desire: warm amber */
.bar-confidence { background: linear-gradient(90deg, #c8c4c0, #f0ece8); width: 50%; }
.bar-submission { background: linear-gradient(90deg, #8b1a2a, #cc2233); width: 0%; }
.bar-arousal { background: linear-gradient(90deg, #b87840, #d4a574); width: 0%; }

/* === Innocence bar dims as it drops === */
.bar-confidence.pride-low {
    animation: innocence-dim 2s ease-in-out infinite;
    filter: brightness(0.5);
}
@keyframes innocence-dim {
    0%, 100% { opacity: 0.5; filter: brightness(0.4); }
    50% { opacity: 0.7; filter: brightness(0.6); }
}

/* === Guilt Bar Animations === */
.bar-submission.guilt-high {
    animation: guilt-intensify 1.2s ease-in-out infinite;
}
.bar-submission.guilt-critical {
    background: linear-gradient(90deg, #aa1122, #cc2233, #dd3344);
    animation: guilt-critical-throb 0.6s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(204, 34, 51, 0.5), 0 0 20px rgba(204, 34, 51, 0.2);
}
@keyframes guilt-intensify {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.4); }
}
@keyframes guilt-critical-throb {
    0%, 100% { filter: brightness(1); box-shadow: 0 0 8px rgba(204, 34, 51, 0.4); }
    50% { filter: brightness(1.6); box-shadow: 0 0 16px rgba(204, 34, 51, 0.7), 0 0 30px rgba(204, 34, 51, 0.3); }
}

/* === Desire/Arousal Bar Animations === */
.bar-arousal.arousal-high {
    animation: arousal-throb 1.2s ease-in-out infinite;
}
.bar-arousal.arousal-critical {
    background: linear-gradient(90deg, #c48040, #d4a574, #e0b888);
    animation: arousal-critical-throb 0.6s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(212, 165, 116, 0.5), 0 0 20px rgba(212, 165, 116, 0.2);
}
@keyframes arousal-throb {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.4); }
}
@keyframes arousal-critical-throb {
    0%, 100% { filter: brightness(1); box-shadow: 0 0 8px rgba(212, 165, 116, 0.4); }
    50% { filter: brightness(1.6); box-shadow: 0 0 16px rgba(212, 165, 116, 0.7), 0 0 30px rgba(212, 165, 116, 0.3); }
}

.stat-value {
    font-size: 0.65rem;
    color: var(--text-dim);
    width: 24px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}
.stat-value.changed {
    color: var(--accent);
}

/* Stat change flash */
.stat-flash {
    animation: stat-pulse 0.5s ease;
}
@keyframes stat-pulse {
    0% { filter: brightness(1); }
    50% { filter: brightness(2); }
    100% { filter: brightness(1); }
}

/* ===== SCENE PROGRESS ===== */
#scene-progress {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 2px;
    z-index: 15;
    background: rgba(255, 255, 255, 0.03);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    transition: width 0.8s ease;
    box-shadow: 0 0 8px var(--neon-amber-glow);
}

/* ===== QUICK MENU ===== */
#quick-menu {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 15;
    display: flex;
    gap: 6px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}
#quick-menu:hover {
    opacity: 1;
}

.qm-btn {
    width: 34px;
    height: 34px;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.qm-btn svg {
    width: 15px;
    height: 15px;
}
.qm-btn:hover {
    background: rgba(196, 92, 62, 0.12);
    border-color: var(--glass-border-bright);
    color: var(--accent);
    box-shadow: 0 0 15px rgba(196, 92, 62, 0.1);
}
.qm-btn.active {
    background: rgba(196, 92, 62, 0.18);
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== OVERLAYS ===== */
.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 8, 8, 0.88);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlay-in 0.3s ease;
}

@keyframes overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.overlay-panel {
    background: linear-gradient(180deg, rgba(26, 18, 16, 0.97) 0%, rgba(14, 10, 8, 0.97) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 40px 48px;
    min-width: 340px;
    text-align: center;
    box-shadow: var(--shadow-heavy), 0 0 60px rgba(0, 0, 0, 0.5);
    animation: panel-pop 0.3s ease;
}
.overlay-wide {
    min-width: 500px;
    max-width: 700px;
    width: 50vw;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

@keyframes panel-pop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.overlay-panel h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 28px;
    text-shadow: 0 0 20px rgba(196, 92, 62, 0.2);
    letter-spacing: 0.08em;
}

.overlay-panel .menu-btn {
    display: flex;
    width: 100%;
    margin-bottom: 8px;
    font-size: 0.95rem;
}
.overlay-panel .menu-btn:last-child { margin-bottom: 0; }

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 16px;
}
.setting-row label {
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--text-secondary);
    min-width: 100px;
    text-align: left;
}
.setting-row input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
    height: 4px;
}
.setting-val {
    font-size: 0.8rem;
    color: var(--accent);
    min-width: 30px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.shortcuts-info {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}
.shortcuts-title {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 10px;
}
.shortcut-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.shortcut-key {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 2px 8px;
    color: var(--accent);
}

.button-row {
    margin-top: 24px;
}

/* ===== HISTORY LOG ===== */
.history-log {
    flex: 1;
    overflow-y: auto;
    text-align: left;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 16px;
    max-height: 50vh;
}
.history-log::-webkit-scrollbar {
    width: 4px;
}
.history-log::-webkit-scrollbar-track {
    background: transparent;
}
.history-log::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 2px;
}
.history-entry {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.history-entry:last-child {
    margin-bottom: 0;
    border-bottom: none;
}
.history-name {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 3px;
}
.history-text {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* === History character color-coding === */
.history-entry.history-farrah .history-name {
    color: #c45c3e;
}
.history-entry.history-farrah .history-text {
    color: var(--text-secondary);
}
.history-entry.history-jeremy .history-name {
    color: #6a9fd8;
}
.history-entry.history-jeremy .history-text {
    color: var(--text-secondary);
}
.history-entry.history-jackson .history-name {
    color: #b8a088;
}
.history-entry.history-jackson .history-text {
    color: var(--text-secondary);
}
.history-entry.history-doctor .history-name {
    color: #d8dde4;
}
.history-entry.history-doctor .history-text {
    color: var(--text-secondary);
}
.history-entry.history-narrator .history-name {
    color: var(--text-dim);
    font-weight: 300;
    font-style: italic;
}
.history-entry.history-narrator .history-text {
    color: var(--text-dim);
}
.history-entry.history-inner .history-name {
    color: #c45c3e;
    font-style: italic;
    font-weight: 400;
}
.history-entry.history-inner .history-text {
    color: rgba(196, 92, 62, 0.7);
    font-style: italic;
}

/* ===== NOTIFICATION ===== */
#notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    z-index: 200;
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border-bright);
    border-radius: 10px;
    padding: 10px 28px;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: var(--shadow-glow-accent);
}
#notification.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    display: block !important;
}

/* ===== SCENE TRANSITION ===== */
#scene-transition {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: black;
    z-index: 35;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}
#scene-transition.active {
    opacity: 1;
    transition: opacity 0.4s ease;
}

/* Scanlines on game screen */
#game-scanlines {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.015) 2px,
        rgba(0, 0, 0, 0.015) 4px
    );
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}
#game-scanlines.active { opacity: 1; }

/* Dialogue fade effect */
#dialogue-text.text-fade-in {
    animation: textFadeIn 0.2s ease;
}
@keyframes textFadeIn {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

/* Quick menu auto-hide */
#quick-menu.dim {
    opacity: 0.1;
}

/* ===== CLICK HINT ===== */
#click-hint {
    position: fixed;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 8px 24px;
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
}
#click-hint.visible {
    display: block !important;
    animation: hintPulse 4s ease-in-out forwards;
}
@keyframes hintPulse {
    0% { opacity: 0; }
    15% { opacity: 0.7; }
    70% { opacity: 0.7; }
    100% { opacity: 0; display: none; }
}

/* ===== SCREEN EFFECTS ===== */
.screen-shake {
    animation: shake 0.4s ease-in-out;
}
@keyframes shake {
    0%, 100% { transform: translate(0); }
    15% { transform: translate(-5px, 3px); }
    30% { transform: translate(5px, -2px); }
    45% { transform: translate(-3px, 5px); }
    60% { transform: translate(3px, -3px); }
    75% { transform: translate(-2px, 2px); }
}

.screen-pulse {
    animation: screen-pulse 0.6s ease;
}
@keyframes screen-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

/* ===================================================
   GUILT-HEAVY EFFECT — red vignette around edges
   =================================================== */
.guilt-heavy {
    position: relative;
}
.guilt-heavy::after {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 44;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 50%,
        transparent 40%,
        rgba(160, 20, 20, 0.08) 60%,
        rgba(120, 10, 10, 0.18) 80%,
        rgba(80, 5, 5, 0.3) 100%
    );
    animation: guilt-vignette-breathe 4s ease-in-out infinite;
}
@keyframes guilt-vignette-breathe {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ===================================================
   DESIRE-HIGH EFFECT — warm amber pulse on borders
   =================================================== */
.desire-high .dialogue-inner {
    animation: desire-border-pulse 2s ease-in-out infinite;
    border-color: rgba(212, 165, 116, 0.3);
}
@keyframes desire-border-pulse {
    0%, 100% {
        border-color: rgba(212, 165, 116, 0.15);
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
    }
    50% {
        border-color: rgba(212, 165, 116, 0.4);
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(212, 165, 116, 0.1);
    }
}

/* ===================================================
   CONTRACTION EFFECT — faster heartbeat (1s cycle)
   =================================================== */
@keyframes contraction {
    0% { transform: scale(1); }
    12% { transform: scale(1.008); }
    24% { transform: scale(1); }
    36% { transform: scale(1.005); }
    48% { transform: scale(1); }
    100% { transform: scale(1); }
}

#game-screen.contraction {
    animation: contraction 1s ease-in-out infinite;
}

#game-screen.contraction .vignette-overlay {
    animation: contraction-vignette 1s ease-in-out infinite;
}

@keyframes contraction-vignette {
    0% {
        background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(10, 8, 8, 0.55) 100%);
        box-shadow: inset 0 0 80px transparent;
    }
    12% {
        background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(80, 15, 15, 0.3) 100%);
        box-shadow: inset 0 0 80px rgba(196, 92, 62, 0.06);
    }
    24% {
        background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(10, 8, 8, 0.55) 100%);
        box-shadow: inset 0 0 80px transparent;
    }
    36% {
        background: radial-gradient(ellipse at 50% 50%, transparent 42%, rgba(60, 12, 12, 0.22) 100%);
        box-shadow: inset 0 0 60px rgba(196, 92, 62, 0.04);
    }
    48%, 100% {
        background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(10, 8, 8, 0.55) 100%);
        box-shadow: inset 0 0 80px transparent;
    }
}

/* ===================================================
   GUILT PULSE — screen briefly red-tinted then fades
   =================================================== */
@keyframes guilt-pulse {
    0% {
        background: rgba(180, 20, 20, 0);
        opacity: 0;
    }
    15% {
        background: rgba(180, 20, 20, 0.12);
        opacity: 1;
    }
    40% {
        background: rgba(120, 10, 10, 0.08);
        opacity: 0.8;
    }
    100% {
        background: rgba(180, 20, 20, 0);
        opacity: 0;
    }
}

.guilt-pulse-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 44;
    pointer-events: none;
    animation: guilt-pulse 1.5s ease-out forwards;
}

/* ===================================================
   HEARTBEAT EFFECT
   =================================================== */
#game-screen.heartbeat {
    animation: heartbeat-screen 0.833s ease-in-out infinite; /* ~72bpm */
}

#game-screen.heartbeat .vignette-overlay {
    animation: heartbeat-vignette 0.833s ease-in-out infinite;
}

@keyframes heartbeat-screen {
    0% { transform: scale(1); }
    15% { transform: scale(1.005); }
    30% { transform: scale(1); }
    45% { transform: scale(1.003); }
    60% { transform: scale(1); }
    100% { transform: scale(1); }
}

@keyframes heartbeat-vignette {
    0% {
        background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(10, 8, 8, 0.55) 100%);
        box-shadow: inset 0 0 80px transparent;
    }
    15% {
        background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(60, 10, 20, 0.35) 100%);
        box-shadow: inset 0 0 80px rgba(196, 92, 62, 0.06);
    }
    30% {
        background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(10, 8, 8, 0.55) 100%);
        box-shadow: inset 0 0 80px transparent;
    }
    45% {
        background: radial-gradient(ellipse at 50% 50%, transparent 42%, rgba(50, 8, 18, 0.28) 100%);
        box-shadow: inset 0 0 60px rgba(196, 92, 62, 0.04);
    }
    60%, 100% {
        background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(10, 8, 8, 0.55) 100%);
        box-shadow: inset 0 0 80px transparent;
    }
}

/* ===================================================
   INNOCENCE CRACK EFFECT (adapted from pride crack)
   =================================================== */
#game-screen.pride-crack::before,
#game-screen.innocence-crack::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 46;
    pointer-events: none;
    background:
        /* Crack fracture lines */
        linear-gradient(135deg,
            transparent 42%,
            rgba(196, 92, 62, 0.4) 42.5%,
            rgba(255, 255, 255, 0.6) 43%,
            rgba(196, 92, 62, 0.3) 43.5%,
            transparent 44%
        ),
        linear-gradient(160deg,
            transparent 48%,
            rgba(196, 92, 62, 0.3) 48.3%,
            rgba(255, 255, 255, 0.4) 48.6%,
            rgba(196, 92, 62, 0.2) 48.9%,
            transparent 49.2%
        ),
        linear-gradient(115deg,
            transparent 51%,
            rgba(196, 92, 62, 0.25) 51.2%,
            rgba(255, 255, 255, 0.35) 51.5%,
            transparent 51.8%
        );
    animation: pride-crack-appear 1.2s ease-out forwards;
}

@keyframes pride-crack-appear {
    0% {
        opacity: 0;
        filter: brightness(5);
    }
    8% {
        opacity: 1;
        filter: brightness(3);
    }
    20% {
        opacity: 1;
        filter: brightness(1);
    }
    100% {
        opacity: 0;
        filter: brightness(1);
    }
}

/* ===== ENDING SCREEN ===== */
.ending-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow:
        0 0 40px var(--neon-amber-glow),
        0 0 80px rgba(196, 92, 62, 0.15),
        0 0 120px rgba(196, 92, 62, 0.08);
    margin-bottom: 16px;
    opacity: 0;
    animation: title-element-in 1s ease 0.3s forwards;
}
.ending-title {
    letter-spacing: 0.1em;
}

.ending-tagline {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 300;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 32px;
    opacity: 0;
    animation: title-element-in 0.8s ease 0.8s forwards;
}
.ending-stats {
    display: flex;
    gap: 40px;
    justify-content: center;
    margin-bottom: 32px;
    opacity: 0;
    animation: title-element-in 0.8s ease 1.2s forwards;
}
.ending-stat {
    text-align: center;
}
.ending-stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}
.ending-stat-value.stat-confidence { color: #e8e4e0; }
.ending-stat-value.stat-submission { color: var(--danger); }
.ending-stat-value.stat-arousal { color: var(--accent-secondary); }
.ending-stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.ending-credit {
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    margin-bottom: 32px;
    opacity: 0;
    animation: title-element-in 0.8s ease 1.6s forwards;
}
.ending-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    opacity: 0;
    animation: title-element-in 0.8s ease 2s forwards;
}
.ending-buttons .menu-btn {
    min-width: 160px;
}

/* Ending screen background — warm copper vignette */
#ending-screen,
.screen.ending-screen {
    background: var(--bg-darker);
}
#ending-screen::before,
.screen.ending-screen::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at 50% 50%, transparent 20%, rgba(120, 50, 30, 0.08) 60%, rgba(10, 8, 8, 0.9) 100%);
    pointer-events: none;
}

/* ===== FADE TRANSITIONS ===== */
.fade-in { animation: fadeIn 0.6s ease forwards; }
.fade-out { animation: fadeOut 0.6s ease forwards; }
.fade-in-slow { animation: fadeIn 1.2s ease forwards; }

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

/* ===== DIALOGUE BOX BREATHING ===== */
#dialogue-box .dialogue-inner::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(180deg, transparent 70%, rgba(196, 92, 62, 0.02) 100%);
    pointer-events: none;
    border-radius: inherit;
}

/* ===== AMBIENT GLOW ===== */
.character-sprite.visible {
    animation: sprite-breathe 4s ease-in-out infinite;
}
@keyframes sprite-breathe {
    0%, 100% { filter: drop-shadow(0 4px 25px rgba(0, 0, 0, 0.7)); }
    50% { filter: drop-shadow(0 4px 30px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 5px rgba(196, 92, 62, 0.05)); }
}
.character-sprite.dimmed {
    animation: none;
    filter: brightness(0.45) saturate(0.6) drop-shadow(0 4px 25px rgba(0, 0, 0, 0.7));
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .dialogue-inner {
        padding: 14px 18px 18px;
        min-height: 120px;
    }
    #char-name { font-size: 1rem; }
    #dialogue-text { font-size: 0.9rem; }
    #choice-container {
        min-width: unset;
        width: 92vw;
        bottom: 160px;
    }
    .choice-btn { font-size: 0.9rem; padding: 14px 20px; }
    .character-sprite { height: 70vh; max-width: 50vw; bottom: 140px; }
    #stats-panel { top: 50px; left: 8px; padding: 10px 14px; min-width: 160px; }
    .overlay-panel { padding: 28px 24px; min-width: 280px; }
    .overlay-wide { min-width: unset; width: 92vw; }
    .title-main { letter-spacing: 0.06em; }

    /* Simplify contraction on mobile for perf */
    #game-screen.contraction {
        animation: contraction 1s ease-in-out infinite;
    }

    /* Simplify heartbeat on mobile for perf */
    #game-screen.heartbeat {
        animation: heartbeat-screen 0.833s ease-in-out infinite;
    }
}
