@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* =========================================
   1. CORE & ANIMATIONS
   ========================================= */
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: #2c2c2c;
    overflow-x: hidden;
    
    /* 1. Base Color: Warm Cream */
    background-color: #fdfbf7;

    /* 2. The aesthetic layers */
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(255, 194, 209, 0.4) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(140, 167, 193, 0.4) 0%, transparent 40%);

    /* 3. Size */
    background-size: 100% 100%, 100% 100%;

    /* 4. Lock background */
    background-attachment: fixed;
    background-position: center;

    opacity: 1; 
    animation: fadeIn 1s ease-out;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes indieFadeIn { 0% { opacity: 0; transform: translateY(15px); filter: blur(5px); } 100% { opacity: 1; transform: translateY(0); filter: blur(0); } }
@keyframes buttonClickPulse { 0% { transform: scale(1); background-color: transparent; } 50% { transform: scale(0.95); color: #8ca7c1; } 100% { transform: scale(1); color: #8ca7c1; } }
@keyframes titleFloatUp { 0% { opacity: 0; transform: translateY(40px); filter: blur(4px); } 100% { opacity: 1; transform: translateY(0); filter: blur(0); } }
@keyframes mushroomPop { 0% { opacity: 0; transform: scale(0.8) translateX(-20px); } 100% { opacity: 1; transform: scale(1) translateX(0); } }
@keyframes pulseDot { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }
@keyframes dust-float { 100% { transform: translate(-50px, -50px); } }

/* =========================================
   2. GLOBAL UI COMPONENTS (Navbar)
   ========================================= */
#global-ui {
    position: relative; 
    z-index: 2147483647 !important; /* Max value allowed in CSS */
    pointer-events: none; /* Let clicks pass through the empty areas */
}

/* Wrapper */
.game-nav-wrapper {
    position: fixed;
    top: 24px;
    left: 0;
    width: 100%;
    padding: 0 32px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none; 
    z-index: 1000;
    transition: transform 0.4s ease-in-out;
    transform: translateY(0);
    will-change: transform;
}

.navbar-hidden {
    /* Moves the navbar up by 150% of its height, ensuring it clears the screen */
    transform: translateY(-200%);
}

/* Left: Standalone Text */
.nav-text-wrapper { pointer-events: auto; display: flex; align-items: center; }
.nav-title-link { text-decoration: none !important; }

.nav-title-standalone {
    font-family: 'Inter', sans-serif;
    font-weight: 700; 
    font-size: 1rem;
    letter-spacing: 4px;
    color: #4a5d6a; 
    text-transform: uppercase;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-title-standalone .title-highlight { font-weight: 400; color: #8ca7c1; }

.nav-title-link:hover .nav-title-standalone {
    color: #1e1e1e;
    transform: translateY(-2px) scale(1.2); 
    text-shadow: 0 4px 8px rgba(0,0,0,0.1); 
}

/* Right: Glass Pill */
.nav-pill {
    pointer-events: auto; 
    background: rgba(255, 255, 255, 0.65); 
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02), 0 10px 15px rgba(0, 0, 0, 0.03);
    border-radius: 50px; 
    padding: 8px 16px;
    display: flex; align-items: center; gap: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nav-pill:hover { background: rgba(255, 255, 255, 0.85); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(140, 167, 193, 0.25); }
.nav-icon { display: flex; align-items: center; justify-content: center; transition: transform 0.2s; opacity: 0.7; }
.nav-icon img { width: 24px; height: 24px; display: block; }
.nav-icon:hover { transform: scale(1.2); opacity: 1; }

/* =========================================
   3. HOME & MENU SPECIFICS
   ========================================= */

/* Home Layout */
.center-container {
    display: flex; justify-content: center; align-items: center; 
    height: 80vh; position: relative; z-index: 10;
    padding-bottom: 12vh; 
}

.home-ui-wrapper {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10vh; z-index: 10; position: relative;
}

.main-game-title {
    font-family: 'Inter', sans-serif;
    font-weight: 300; color: #5d7486; 
    font-size: 3rem; text-transform: uppercase;
    letter-spacing: 14px; margin: 0; line-height: 1.2;
    opacity: 0; animation: titleFloatUp 1.5s ease-out forwards;
}

.main-game-title .title-highlight { font-weight: 300; color: #8ca7c1; opacity: 0.8; }

.fancy-btn {
    background: transparent; color: #2c2c2c;
    border: 2px solid #8ca7c1; padding: 12px 36px;
    font-size: 1rem; font-weight: 500; border-radius: 6px;
    cursor: pointer; transition: all 0.3s ease; text-decoration: none;
    text-transform: uppercase; letter-spacing: 1px; margin: 0 10px;
}
.fancy-btn:hover { background-color: #8ca7c1; color: #ffffff; box-shadow: 0 0 10px rgba(140,167,193,0.3); }

/* Bubbles */
.background-animation { position: fixed; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: -1; }
.bubble { position: absolute; left: 0; top: 0; width: var(--size, 100px); height: var(--size, 100px); object-fit: contain; pointer-events: auto; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); opacity: 0.7; }

/* Menu Cards */
.button-row { display: flex; justify-content: center; gap: 30px; width: 100%; flex-wrap: nowrap; }
.case-container { position: relative; display: flex; flex-direction: column; align-items: center; height: 50px; transition: 0.3s; }

.case-btn {
    display: flex; justify-content: center; align-items: center; width: 100px; height: 50px;
    background: #ffffff; border: 2px solid #8ca7c1; border-radius: 12px;
    color: #2c2c2c; font-weight: 600; cursor: pointer; transition: 0.35s; z-index: 1;
}
.case-container:hover .case-btn { opacity: 0; }

.case-card {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.8);
    width: 220px; height: auto; min-height: 280px; background: #ffffff;
    border: 2px solid #8ca7c1; border-radius: 12px; overflow: hidden;
    opacity: 0; pointer-events: none; transition: 0.45s;
    box-shadow: 0 16px 30px rgba(0,0,0,0.18); z-index: 2;
    display: flex; flex-direction: column; padding: 8px;
}
.case-container:hover .case-card { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.case-card img { width: 100%; height: 120px; object-fit: cover; margin-bottom: 6px; }
.case-card h3 { margin: 4px 0 2px 0; font-size: 1rem !important; color: #2c2c2c; font-weight: 700; }
.case-card p { margin: 0; font-size: 0.8rem !important; color: #555; line-height: 1.3; }

/* Briefing Overlay */
#briefing-screen { z-index: 100; box-sizing: border-box; overflow: hidden; }
.nav-text-btn {
    background: none; border: none; font-family: 'Inter', sans-serif;
    font-size: 1rem; font-weight: 600; color: #9b8579;
    text-transform: uppercase; letter-spacing: 2px; cursor: pointer;
    padding: 10px 20px; position: relative; transition: 0.4s;
}
.nav-text-btn:hover { color: #2c2c2c; transform: translateY(-2px); }
.nav-text-btn::after { content: ''; position: absolute; bottom: 0; left: 50%; width: 0; height: 2px; background: #8ca7c1; transition: 0.4s; transform: translateX(-50%); }
.nav-text-btn:hover::after { width: 100%; }

/* =========================================
   4. GAMEPLAY (CASE.HTML) SPECIFICS
   ========================================= */

.game-wrapper-centered {
    max-width: 800px; margin: 80px auto; position: relative; z-index: 10; padding: 0 32px;
}

.video-game-box {
    background: #ffffff; border-radius: 12px; padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); margin-bottom: 30px;
}

/* --- Layout --- */
.narrative-row {
    display: flex; justify-content: center; align-items: flex-start;
    position: relative; /* Crucial for mushroom absolute positioning */
    width: 100%;
}

.dialogue-area {
    width: 100%; margin: 0 auto; position: relative; z-index: 2;
}

/* --- The Glass Mushroom Panel --- */
.info-area {
    position: absolute;
    left: calc(60% + 310px); /* Center + Half Dialogue + Gap */
    top: 0;
    width: 260px;
    
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    
    border: 1px solid rgba(140, 167, 193, 0.3); 
    border-left: 4px solid #8ca7c1;
    border-radius: 8px; 
    
    padding: 20px;
    
    box-shadow: 0 10px 30px rgba(140, 167, 193, 0.15), 0 4px 6px rgba(0,0,0,0.02);
    
    display: none; flex-direction: column;
    transform-origin: left center;
    animation: mushroomPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    z-index: 10;
}

/* Info Header */
.info-header {
    font-family: 'Inter', sans-serif; font-size: 0.7rem; text-transform: uppercase;
    letter-spacing: 2px; font-weight: 700; color: #8ca7c1; margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
    border-bottom: 1px solid rgba(140, 167, 193, 0.2); padding-bottom: 8px;
}
.info-header::before {
    content: ''; display: block; width: 6px; height: 6px;
    background-color: #8ca7c1; border-radius: 50%;
    box-shadow: 0 0 8px rgba(140, 167, 193, 0.8); animation: pulseDot 2s infinite;
}
.info-body { font-size: 0.95rem; line-height: 1.5; color: #4a5d6a; }

/* Close Button (Aesthetic) */
.info-close-btn {
    position: absolute; top: 12px; right: 15px;
    background: transparent; border: none; outline: none; padding: 0;
    font-family: 'Inter', sans-serif; font-weight: 300; font-size: 1.6rem;
    line-height: 1; color: #8ca7c1; opacity: 0.6; cursor: pointer; z-index: 20;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.info-close-btn:hover {
    opacity: 1; color: #5d7486; text-shadow: 0 0 12px rgba(140, 167, 193, 0.8);
    transform: rotate(90deg) scale(1.1);
}

/* --- Narrative Text --- */
.narrative-p, .briefing-p, .system-response-p, .user-reply {
    font-family: 'Inter', sans-serif; font-size: 1.05rem; line-height: 1.7; color: #2c2c2c;
    margin-bottom: 15px; text-align: left; opacity: 0; animation: indieFadeIn 0.8s ease forwards;
}

.user-reply { color: #8ca7c1; font-weight: 600; border-left: 4px solid #8ca7c1; padding-left: 15px; margin-top: 25px; }
.system-response-p { background-color: #f8f9fa; padding: 15px; border-radius: 8px; margin-top: 10px; }
.narrative-note { font-style: italic; color: #666; }

/* --- Choices Menu --- */
#choices-container { display: none; opacity: 0; margin-top: 20px; }
.fade-in-ui { opacity: 1 !important; animation: indieFadeIn 1s ease forwards; }
.fade-in-menu { opacity: 1 !important; animation: indieFadeIn 1s ease forwards; }

.menu-label {
    background: #2c2c2c; color: white; padding: 2px 12px; border-radius: 4px;
    display: inline-block; margin-bottom: 15px; font-size: 0.9rem;
}

.game-choice-node {
    background: transparent; border: none; border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 15px 10px 15px 40px; width: 100%; margin-bottom: 8px;
    font-family: 'Inter', sans-serif; font-size: 1.05rem; color: #2c2c2c;
    text-align: left; position: relative; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.game-choice-node::before {
    content: '▶'; position: absolute; left: 10px; top: 50%;
    transform: translateY(-50%) scale(0.8); color: #8ca7c1; opacity: 0; transition: 0.2s;
}
.game-choice-node:hover { transform: translateX(10px); color: #000; font-weight: 500; border-bottom-color: rgba(140,167,193,0.5); }
.game-choice-node:hover::before { opacity: 1; left: 15px; transform: translateY(-50%) scale(1); }
.game-choice-node.btn-clicked-anim {
    animation: buttonClickPulse 0.4s ease forwards;
    pointer-events: none; font-weight: bold; border-bottom: 2px solid #8ca7c1; color: #8ca7c1 !important;
}

/* --- Side UI (Hearts/Portrait) --- */
/* --- Side UI (Hearts/Portrait) --- */
    .ui-side-panel { 
        /* 1. STICKY: Follows the screen as you scroll down */
        position: sticky; 
        top: 12%; /* Stops 120px from the top (below the navbar) */
        
        /* 2. POSITIONING: Pulls it to the left of the dialogue box */
        /* Since it's inside the wrapper, it starts at the text's edge. 
        We move it left by 170px to sit in the empty space. */
        transform: translateX(-220px); 
        
        /* 3. LAYOUT: Takes up zero space inside the box so text doesn't wrap */
        width: 1px; 
        height: 0; 
        overflow: visible; /* Allows the image to spill out of the 1px box */
        
        display: flex; 
        gap: 12px; 
        z-index: 100; 
    }

    .character-portrait-mini { 
        width: 160px; 
        height: 160px; 
        overflow: hidden; 
        flex-shrink: 0;
    }

    .character-portrait-mini img { 
        width: 100%; 
        height: 100%; 
        object-fit: contain; 
        transition: opacity 0.3s ease-in-out, filter 0.5s ease-in-out; 
    }

.portrait-faded { opacity: 0 !important; }
.portrait-contrast-boost { filter: contrast(150%) !important; }
.portrait-damage {
    filter: grayscale(100%) sepia(100%) hue-rotate(-50deg) saturate(300%) brightness(0.7);
    animation: shakeEffect 0.5s ease-in-out;
}

@keyframes shakeEffect {
    0% { transform: translateX(0); } 25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); } 75% { transform: translateX(-5px); } 100% { transform: translateX(0); }
}

.hearts-container { display: flex; flex-direction: column; gap: 10px; }
.heart-icon { font-size: 24px; transition: 0.3s; }
.pulse-red { animation: heartPulse 0.4s ease infinite; color: red; }

/* Responsive adjustments */
@media (max-width: 1000px) {
    .info-area {
        position: relative; left: auto; top: auto;
        width: 100%; max-width: 600px;
        margin-top: 15px; transform: none;
        animation: indieFadeIn 0.5s ease forwards;
    }
    .narrative-row { flex-direction: column; align-items: center; }
}
@media (max-width: 900px) {
    #briefing-screen { flex-direction: column !important; padding: 10px !important; overflow-y: auto; }
}

/* =========================================
   6. FOOLPROOF CURSOR
   ========================================= */
/* 1. Cursor logic applies to EVERYTHING */
html, body, * { 
    cursor: none !important; 
}

/* 2. Scroll logic applies ONLY to the main window */
html, body {
    height: auto !important;
    min-height: 110vh !important; /* Force page to be taller than screen */
    overflow-y: auto !important;   /* Allow window scrolling */
    overflow-x: hidden;
}

/* 3. The cursor element itself */
.cursor-arrow {
    position: fixed; top: 0; left: 0; width: 24px; height: 24px;
    background-color: #f07795; border: 2px solid #ffffff;
    z-index: 2147483647 !important; pointer-events: none;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
    clip-path: polygon(50% 0%, 0% 100%, 50% 80%, 100% 100%);
    transform: translate(-50%, -10%) rotate(-25deg); transition: transform 0.1s;
}

body.hovering .cursor-arrow {
    transform: translate(-50%, -10%) rotate(-25deg) scale(1);
    background-color: #f83b7a; border-color: #ffc2d1;
}

/* =========================================
   7. FINAL SCREEN & OVERLAYS
   ========================================= */
#briefing-screen {
    position: fixed; top: 0; left: 0; height: 100vh; width: 100vw; z-index: 2;
    display: flex; gap: 3%; flex-direction: row; align-items: center; justify-content: center; padding: 0 5%;
    background-color: #fdfbf7;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(255, 194, 209, 0.5) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(140, 167, 193, 0.5) 0%, transparent 50%);
    background-attachment: fixed; background-repeat: no-repeat; background-size: cover;
}

.vignette-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 90;
    background: radial-gradient(circle at center, transparent 80%, rgba(0, 0, 0, 0.6) 120%);
    mix-blend-mode: normal; opacity: 0.8;
}

.dust-container { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 80; overflow: hidden; }
.dust-layer {
    position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background-image: radial-gradient(circle, #727171 2px, transparent 2.5px);
    background-repeat: repeat;
}
.layer-1 { background-size: 500px 500px; opacity: 0.25; animation: dust-float 50s linear infinite; }
.layer-2 { background-size: 300px 300px; opacity: 0.20; animation: dust-float 35s linear infinite reverse; }
.layer-3 { background-size: 200px 200px; opacity: 0.15; animation: dust-float 20s linear infinite; }

#final-screen {
    align-items: flex-start !important; padding-top: 10vh !important;
    flex-direction: row !important; justify-content: center; display: none;
}
#final-screen .briefing-text-container, #final-screen .briefing-image-container { height: auto; max-height: 75vh; }

@media (max-width: 900px) {
    #final-screen {
        flex-direction: column !important; align-items: center !important;
        padding-top: 5vh !important; overflow-y: auto;
    }
}
/* =========================================
   8. FLUID ENGINE (Tuned for Laptops)
   ========================================= */

/* 1. MASTER SCALER (The Fix)
   Old Math: 0.8vw + 10px -> Resulted in 18px on laptops (Too Big)
   New Math: 0.5vw + 9px  -> Results in ~15.5px on laptops (Elegant)
   
   - Phones: ~13px
   - Laptops: ~15px - 16px
   - Desktops: 18px
*/
html {
    font-size: clamp(13px, 0.5vw + 9px, 18px);
}

/* 2. FLUID HOME TITLE */
.main-game-title {
    /* Slightly smaller max size to fit laptop screens better */
    font-size: clamp(2rem, 4vw, 4.5rem); 
    letter-spacing: clamp(4px, 1vw, 14px);
}

/* 3. CONTAINER WIDTH
   On laptops, we want more empty space on the sides so it doesn't feel full.
   Changed max-width from 90vw (90%) to 85vw (85%) for that "breathing room". */
.game-wrapper-centered {
    width: clamp(600px, 85vw, 800px);
    margin-top: 7%;
}

/* 4. LAPTOP ADAPTER (1024px - 1440px) 
   This is the specific range for "Regular Laptops". 
   We force the mushroom panel to scale down to 85% so it doesn't crowd the text. */
@media (min-width: 1024px) and (max-width: 1450px) {
    .info-area {
        left: calc(50% + 280px); /* Tucked closer to box */
        transform: scale(0.85);  /* Smaller mushroom */
        transform-origin: top left;
    }
    .game-wrapper-centered {
        margin-left: 8%; /* Shift center slightly left to balance */
        width: 75%;      /* Narrower box on laptops */
    }
}

/* 5. TABLET & MOBILE STACKING (< 1024px) */
@media (max-width: 1024px) {
    .narrative-row {
        flex-direction: column;
        align-items: center;
    }
    
    .info-area {
        position: relative;
        left: auto; top: auto;
        width: 100%; 
        max-width: 100%; /* Fill the container width */
        margin-top: 20px;
        transform: none;
        animation: indieFadeIn 0.5s ease forwards;
    }
    .ui-side-panel {
            /* DISABLE STICKY ON MOBILE */
            position: relative; 
            top: auto; 
            
            /* Reset the side positioning so it sits ON TOP of the text */
            transform: none; 
            
            /* Center it */
            width: 100%; 
            height: auto; 
            margin: 0 auto 20px auto; 
            justify-content: center;
            
            /* Scale it down slightly */
            transform: scale(0.8);
            transform-origin: center bottom;
        }
    
    .game-wrapper-centered {
        margin: 7% auto;
        width: 85%; /* More margin on tablets */
    }
}

/* 6. MOBILE PHONE TWEAKS (< 600px) */
@media (max-width: 600px) {
    .video-game-box { padding: 30px 20px; } /* More internal breathing room */
    
    .main-game-title { font-size: 1.8rem; letter-spacing: 4px; text-align: center; }
    .home-ui-wrapper { gap: 5vh; }
    .button-row { flex-direction: column; gap: 15px; margin-top: 70px; }
    .nav-title-standalone { font-size: 0.8rem; letter-spacing: 2px; }
}

/* =========================================
   9. MOBILE ADAPTATION (ADDITIVE - FINAL)
   ========================================= */

@media (max-width: 768px) {
    /* --- 1. General Layout --- */
    .game-wrapper-centered {
        margin: 80px auto 20px auto;
        padding: 0 15px;
        width: 95%;
        overflow: visible !important;
    }

    /* --- 2. Narrative/Gameplay Stacking --- */
    .narrative-row {
        flex-direction: column;
        align-items: center;
    }

    /* Portrait and Hearts move to the top, side-by-side */
    .ui-side-panel {
        position: relative; 
        top: 0 !important;
        margin: 0 0 20px 0 !important;
        transform: none !important;
        width: 100% !important;
        height: auto !important;
        flex-direction: row; 
        justify-content: center;
        gap: 15px;
        display: flex;
    }

    .character-portrait-mini {
        width: 100px;
        height: 100px;
    }

    .hearts-container {
        flex-direction: row;
        gap: 8px;
    }

    /* --- 3. UI Boxes & Interaction --- */
    .video-game-box {
        padding: 25px 15px;
        font-size: 1rem;
    }

    .game-choice-node {
        padding: 18px 15px 18px 40px;
        margin-bottom: 10px;
        border-radius: 8px;
        background: rgba(140, 167, 193, 0.05);
    }

    /* Mushroom Panel (Dato Clave) stack naturally */
    .info-area {
        position: relative;
        left: 0 !important;
        top: 0 !important;
        width: 100%;
        margin-top: 15px;
        transform: none !important;
        box-shadow: none;
        border: 2px solid #8ca7c1;
    }

    /* --- 4. Menu / Case Selection (FIXED) --- */
    .button-row {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin-top: 180px; /* Adjusted to prevent navbar overlap */
        padding-bottom: 10px;
    }

    .case-container {
        height: auto;
        width: 100%;
        max-width: 300px;
        position: relative;
        overflow: hidden; /* Keeps the expansion neat */
    }

    /* THE BUTTON: Reverts to flex automatically when .mobile-open is removed */
    .case-btn {
        display: flex !important; /* Forces it back to flex on mobile */
        opacity: 1;
        max-height: 100px; 
        transition: all 0.4s ease;
        position: relative;
        top: auto; left: auto; transform: none; /* Reset desktop absolute positioning */
    }

    /* Hide button when card is open */
    .case-container.mobile-open .case-btn {
        opacity: 0;
        max-height: 0;
        margin: 0;
        pointer-events: none;
    }

    /* THE CARD: Changed from display:none to max-height for smooth sliding */
    .case-card {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: translateY(20px) scale(0.95) !important;
        opacity: 0 !important;
        display: flex !important; /* Always flex, but height 0 */
        max-height: 0;
        pointer-events: none;
        margin: 0 auto;
        transition: 
            max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.4s ease,
            transform 0.4s ease;
    }

    /* Expand the card elegantly */
    .case-container.mobile-open .case-card {
        opacity: 1 !important;
        max-height: 500px; /* Large enough for content */
        transform: translateY(0) scale(1) !important;
        pointer-events: auto !important;
        padding: 15px 8px;
    }

    /* --- 5. Briefing & Final Screens --- */
    #briefing-screen, #final-screen {
        flex-direction: column !important;
        padding: 40px 20px !important;
        overflow-y: auto;
    }

    /* Shrink the large images for phone screens */
    #briefing-img {
        max-width: 65% !important;
        max-height: 25vh !important;
        margin-bottom: 10px;
    }

    #final-img {
        max-width: 55% !important;
        max-height: 20vh !important;
    }

    .briefing-text-container {
        padding: 10px !important;
        text-align: center !important;
        align-items: center !important;
    }

    /* Stack buttons vertically for thumb-tapping */
    .briefing-nav, .final-nav {
        flex-direction: column;
        gap: 15px !important;
        width: 100%;
        align-items: center;
    }

    .nav-text-btn {
        width: 80%;
        text-align: center;
    }
}