/* --- VARIABLES & CORE --- */
* {
    box-sizing: border-box;
}

:root {
    --bg-color: #050505;
    /* PREMIUM COLOR PALETTE */
    --primary: #D4AF37;
    /* Rich Gold - Sophisticated and luxurious */
    --secondary: #4ECDC4;
    /* Emerald Teal - Elegant positive state */
    --warning: #FFB84D;
    /* Amber Gold - Refined warning */
    --danger: #FF6B6B;
    /* Soft Coral - Less aggressive danger */
    --accent: #A8D5E8;
    /* Steel Blue - Tech elegance */
    --dim: rgba(212, 175, 55, 0.15);
    /* Gold tint for subtle elements */

    --pulse-speed: 2s;
    --breath-speed: 4s;
    --scan-speed: 5s;

    --font-tech: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    margin: 0;
    overflow: hidden;
    background: #000;
    color: var(--primary);
    font-family: var(--font-tech);
    height: 100vh;
    width: 100vw;
    width: 100vw;
    /* Custom Tech Cursor */
    cursor: url("data:image/svg+xml,%3Csvg width='28' height='28' viewBox='0 0 28 28' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 2L10 26L14 15L26 10L2 2Z' fill='rgba(0,0,0,0.7)' stroke='%2300f0ff' stroke-width='1.5'/%3E%3C/svg%3E") 2 2, crosshair;
    transition: filter 0.5s;
    text-shadow: 0 0 2px rgba(212, 175, 55, 0.3);


    /* FORCE CUSTOM CURSOR ON INTERACTIVE ELEMENTS */
    button,
    a,
    .choice-btn,
    .menu-btn,
    .blink-btn {
        cursor: url("data:image/svg+xml,%3Csvg width='28' height='28' viewBox='0 0 28 28' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 2L10 26L14 15L26 10L2 2Z' fill='rgba(0,0,0,0.7)' stroke='%2300f0ff' stroke-width='1.5'/%3E%3C/svg%3E") 2 2, crosshair !important;
    }

    /* Prevent zoom on mobile */
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
}

/* --- 3D CANVAS --- */
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.8;
}

/* --- VISUAL LAYERS --- */
.ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
    transition: opacity 1s ease;
}

body.intro-mode #vignette,
body.intro-mode #scanlines,
body.intro-mode #noise,
body.intro-mode #scanner-beam {
    opacity: 0 !important;
}

#vignette {
    background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.8) 90%);
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 1);
}

#scanlines {
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.5) 50%);
    background-size: 100% 3px;
    opacity: 0.05;
    /* Reduced from 0.4 for cleaner look */
}

#noise {
    opacity: 0.02;
    /* Reduced from 0.05 for cleaner look */
    background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.6" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noise)" opacity="1"/%3E%3C/svg%3E');
    animation: grain 0.5s steps(5) infinite;
}

#scanner-beam {
    display: none !important;
    /* Disabled - User found it annoying */
}

@keyframes scan {
    0% {
        transform: translateY(-10vh);
    }

    100% {
        transform: translateY(110vh);
    }
}

@keyframes grain {

    0%,
    100% {
        transform: translate(0, 0)
    }

    10% {
        transform: translate(-5%, -5%)
    }

    20% {
        transform: translate(-10%, 5%)
    }

    30% {
        transform: translate(5%, -10%)
    }
}

/* --- HUD LAYOUT --- */
#ar-hud {
    position: relative;
    z-index: 10;
    height: 100%;
    width: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto;
    /* Adaptive rows */
    padding: 2rem;
    box-sizing: border-box;
    pointer-events: none;
}

.hud-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s;
    pointer-events: auto;
}

/* Desktop Defaults */
.top-left {
    position: absolute;
    top: 40px;
    left: 40px;
    width: 280px;
}

.top-right {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 280px;
    text-align: right;
    align-items: flex-end;
}

.bottom-center {
    position: absolute;
    bottom: 30px;
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 20px;
    pointer-events: auto;
}

.tech-label {
    font-size: 0.7rem;
    opacity: 0.8;
    letter-spacing: 2px;
    color: var(--primary);
    text-shadow: 0 0 5px var(--primary);
}

/* --- BIOMETRICS --- */
.pulse-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: dash var(--pulse-speed) linear infinite;
    filter: drop-shadow(0 0 5px var(--primary));
}

@keyframes dash {
    to {
        stroke-dashoffset: -200;
    }
}

.breath-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.breath-bar {
    height: 100%;
    width: 100%;
    /* Stable protection */
    background: linear-gradient(90deg,
            rgba(0, 255, 65, 0.2) 0%,
            var(--secondary) 50%,
            rgba(0, 255, 65, 0.2) 100%);
    background-size: 200% 100%;
    box-shadow: 0 0 5px var(--secondary);
    animation: shield-scan 3s linear infinite;
}

@keyframes shield-scan {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.progress-line-container {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    margin-top: 5px;
}

.progress-line {
    height: 100%;
    background: var(--primary);
    transition: width 0.5s ease;
    box-shadow: 0 0 8px var(--primary);
    position: relative;
}

.progress-line.warning {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

/* --- BOTTOM PANELS --- */
/* --- RIGHT SIDEBAR MONITOR --- */
.sidebar-v-container {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 60px;
    height: 70vh;
    display: none !important;
    /* Completely hidden - no vertical line */
    opacity: 0;
    flex-direction: column;
    align-items: center;
    z-index: 900;
    pointer-events: none;
    transition: opacity 1.5s ease;
}

.sidebar-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.65rem;
    letter-spacing: 5px;
    color: var(--primary);
    opacity: 0.8;
    margin-bottom: 20px;
    text-transform: uppercase;
    text-shadow: 0 0 10px var(--primary);
    filter: brightness(1.2);
}

.sidebar-monitor {
    width: 100%;
    flex: 1;
    /* Take remaining space */
    background: linear-gradient(to bottom, transparent, rgba(0, 20, 30, 0.3), transparent);
}

/* --- BOTTOM PANELS --- */
.bottom-left {
    position: absolute;
    bottom: 80px;
    left: 30px;
}

/* Console log smooth transitions */
#console-log {
    transition: opacity 0.3s ease;
}

.bottom-right {
    position: absolute;
    bottom: 80px;
    right: 30px;
    text-align: right;
    z-index: 10000;
    /* Above 3D, below overlays */
}

/* --- ENCODED DATA HOVER EFFECT --- */
.encoded-data {
    cursor: help;
    transition: all 0.3s ease;
}

.encoded-data:hover {
    opacity: 1 !important;
    color: #ffaa00;
}

.hex-code {
    font-family: 'Courier New', monospace;
    color: #666;
    transition: all 0.3s ease;
}

.encoded-data:hover .hex-code {
    display: none;
}

.encoded-data:hover::after {
    content: attr(data-decoded);
    color: #ff4444;
    font-weight: bold;
    text-shadow: 0 0 5px #ff4444;
    animation: data-leak 0.5s ease;
}

@keyframes data-leak {
    0% {
        opacity: 0;
        transform: translateX(-5px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- HEART WAVE CANVAS --- */
#heart-wave {
    border: 1px solid rgba(0, 240, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
}


/* --- CENTER FOCUS 3D --- */
.choices-box {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    /* Consistent gap */
    width: 100%;
    max-width: 900px;
    margin: 40px auto 0 auto;
    /* Fixed top margin */
    /* Removed perspective to avoid 3D shifts causing misalignment */
    transform-style: flat;
}

/* Ensure Narrative Container is stable */
.narrative-container {
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center vertically in grid cell */
    text-align: center;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    pointer-events: auto;
    height: 100%;
    /* Fill the grid row to maintain relative positioning */
}

.tech-readout {
    font-family: 'Courier New', monospace;
    /* Fallback or var(--font-tech) if exists */
    font-size: 0.85rem;
    color: var(--secondary);
    margin-bottom: 2px;
    opacity: 0;
    transition: opacity 0.5s ease;
    text-shadow: 0 0 5px var(--secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    height: 20px;
    /* Pre-allocate space or let it grow */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Stabilize Situation Text */
.situation-text {
    font-size: 1.6rem;
    line-height: 1.4;
    margin-bottom: 2rem;
    text-shadow: 0 0 8px var(--primary);
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 2px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 240, 255, 0.1),
        inset 0 0 30px rgba(0, 240, 255, 0.05);
    width: 90%;
    box-sizing: border-box;
    transform: none !important;
    position: relative;
    overflow: hidden;

    /* Breathing border animation */
    animation: question-pulse 4s ease-in-out infinite;
}

/* Breathing pulse effect */
@keyframes question-pulse {

    0%,
    100% {
        border-color: rgba(0, 240, 255, 0.3);
        box-shadow:
            0 10px 30px rgba(0, 0, 0, 0.5),
            0 0 20px rgba(0, 240, 255, 0.1),
            inset 0 0 30px rgba(0, 240, 255, 0.05);
    }

    50% {
        border-color: rgba(0, 240, 255, 0.6);
        box-shadow:
            0 10px 30px rgba(0, 0, 0, 0.5),
            0 0 30px rgba(0, 240, 255, 0.3),
            inset 0 0 40px rgba(0, 240, 255, 0.1);
    }
}

/* Scanning data effect - REMOVED per user request */

/* Subtle text glitch effect */
.situation-text::after {
    content: attr(data-text);
    position: absolute;
    top: 30px;
    left: 30px;
    right: 30px;
    color: var(--primary);
    opacity: 0;
    animation: text-glitch 8s infinite;
    pointer-events: none;
    text-shadow: 2px 0 rgba(0, 240, 255, 0.8), -2px 0 rgba(255, 0, 255, 0.8);
}

@keyframes text-glitch {

    0%,
    90%,
    100% {
        opacity: 0;
        transform: translate(0, 0);
    }

    91%,
    93%,
    95% {
        opacity: 0.7;
        transform: translate(-2px, 0);
    }

    92%,
    94% {
        opacity: 0.7;
        transform: translate(2px, 0);
    }
}

/* Corner accents (data nodes) */
.situation-text {
    /* Add corner decorations via box-shadow layers */
    background-image:
        linear-gradient(90deg, var(--primary) 2px, transparent 2px),
        linear-gradient(0deg, var(--primary) 2px, transparent 2px),
        linear-gradient(90deg, var(--primary) 2px, transparent 2px),
        linear-gradient(0deg, var(--primary) 2px, transparent 2px);
    background-size: 20px 2px, 2px 20px, 20px 2px, 2px 20px;
    background-position: 0 0, 0 0, 100% 100%, 100% 100%;
    background-repeat: no-repeat;
}

/* --- 3D BUTTONS --- */
/* --- 3D BUTTONS --- */
.choice-btn {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(5, 10, 15, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    /* Sharper tech look */

    color: var(--primary);
    padding: 25px 30px;
    font-family: var(--font-tech);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;

    cursor: pointer;
    min-width: 320px;
    position: relative;
    overflow: hidden;

    transform-style: preserve-3d;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.choice-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
    opacity: 0.5;
}

.choice-btn:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
    transform: translateY(-2px) scale(1.02);
    text-shadow: 0 0 8px var(--primary);
}

.choice-btn:hover::before {
    width: 100%;
    opacity: 0.1;
}

/* Tech accents (Top/Bottom lines) */
.choice-btn::before,
.choice-btn::after {
    content: '';
    position: absolute;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.3;
    transition: width 0.3s ease, opacity 0.3s;
}

.choice-btn::before {
    top: 0;
}

.choice-btn::after {
    bottom: 0;
}

/* 3D Orientation Defaults (Desktop) */
#btn-a {
    transform: perspective(1000px) rotateY(10deg) translateZ(0);
    border-left: 2px solid rgba(0, 240, 255, 0.3);
}

#btn-b {
    transform: perspective(1000px) rotateY(-10deg) translateZ(0);
    border-right: 2px solid rgba(0, 240, 255, 0.3);
}

/* --- STATES --- */

/* HOVER: Wake up */
.choice-btn:hover:not(:disabled) {
    background: rgba(0, 40, 60, 0.6);
    border-color: var(--primary);
    color: #fff;
    transform: perspective(1000px) rotateY(0deg) translateZ(10px) !important;
    /* Face forward, float up */
    box-shadow:
        0 15px 30px rgba(0, 0, 0, 0.5),
        /* Lifted shadow */
        inset 0 0 30px rgba(0, 240, 255, 0.2);
    /* Stronger inner glow */
    text-shadow: 0 0 8px var(--primary);
}

.choice-btn:hover::before,
.choice-btn:hover::after {
    width: 100%;
    left: 0;
    right: 0;
    opacity: 0.8;
}

/* ACTIVE (Click): Physical press */
.choice-btn:active:not(:disabled) {
    transform: perspective(1000px) scale(0.98) translateZ(-5px) !important;
    background: rgba(0, 240, 255, 0.1);
    box-shadow: inset 0 0 50px rgba(0, 240, 255, 0.4);
    /* Flash */
    transition: transform 0.05s;
}

/* DISABLED: Inert / System controlled */
.choice-btn:disabled {
    opacity: 0.3;
    filter: grayscale(1) contrast(0.8);
    background: rgba(20, 20, 20, 0.5);
    border-color: transparent;
    cursor: not-allowed;
    transform: perspective(1000px) rotateX(5deg) scale(0.95);
    box-shadow: none;
}

/* COOLDOWN STATE */
body.buttons-cooldown .choice-btn {
    opacity: 0.5 !important;
    pointer-events: none !important;
    filter: grayscale(0.8) !important;
    transition: opacity 0.3s ease;
}

/* AI SUGGESTION (Optional Class) */
.choice-btn.ai-suggested {
    border-color: var(--secondary);
    box-shadow: inset 0 0 20px rgba(0, 255, 65, 0.2);
}

.choice-btn.ai-suggested:hover {
    box-shadow: inset 0 0 40px rgba(0, 255, 65, 0.4);
    text-shadow: 0 0 10px var(--secondary);
}

.choice-btn.soft-induction {
    border-color: rgba(0, 255, 65, 0.4);
    box-shadow: inset 0 0 15px rgba(0, 255, 65, 0.15);
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.2);
}

.ai-footer-msg {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    margin-top: 40px;
    border: 1px solid var(--dim);
    transform: translateZ(10px);
    width: 100%;
    box-sizing: border-box;
}

/* --- RETICLE --- */
.center-focus {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 85vh;
    pointer-events: none;
    border: none;
    /* Removed border */
    display: none;
    /* Completely hid the reticle container */
}

.reticle-bracket {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary);
    opacity: 0.4;
    transition: all 0.5s;
}

.lt {
    top: 0;
    left: 0;
    border-right: 0;
    border-bottom: 0;
}

.rt {
    top: 0;
    right: 0;
    border-left: 0;
    border-bottom: 0;
}

.lb {
    bottom: 0;
    left: 0;
    border-right: 0;
    border-top: 0;
}

.rb {
    bottom: 0;
    right: 0;
    border-left: 0;
    border-top: 0;
}

/* --- PHASE STYLES --- */
body.phase-1 {
    --primary: #00f0ff;
}

body.phase-2 {
    --primary: #00f0ff;
    --secondary: #00ff41;
    --pulse-speed: 1.5s;
}

body.phase-3 {
    --primary: #ffae00;
    --secondary: #ffae00;
    --pulse-speed: 0.8s;
    --scan-speed: 2s;
}

body.phase-4 {
    --primary: #ff2a2a;
    --secondary: #ff2a2a;
    --pulse-speed: 0.3s;
    --scan-speed: 1s;
    animation: panic-shake 0.1s infinite;
}

@keyframes panic-shake {
    0% {
        transform: translate(0.5px, 0.5px);
    }

    100% {
        transform: translate(-0.5px, -0.5px);
    }
}

.glitch-active {
    animation: hard-glitch 0.1s steps(2) infinite;
    opacity: 0.3;
}

@keyframes hard-glitch {
    0% {
        transform: translate(5px, 0);
        filter: invert(0);
    }

    50% {
        transform: translate(-5px, 0);
        filter: invert(1);
    }
}

.tiny-btn {
    /* ... existing tiny-btn styles ... */
}

/* --- NOTIFICATION CENTER (PiP / STREAMER STYLE) --- */
#notify-bar {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%) translateX(-150%);
    /* Hidden initially */
    width: 240px;
    /* Wider */
    height: auto;
    min-height: 160px;
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 2px solid var(--secondary);
    border-radius: 12px;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 240, 255, 0.1);
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    opacity: 0;
    pointer-events: auto;
}

/* PHASE 1: COLLAPSED / MINIMIZED */
#notify-bar.collapsed {
    transform: translateY(-50%) translateX(-85%);
    /* Show only right edge/icon */
    opacity: 0.7;
    width: 60px;
    /* Small width */
    min-height: 50px;
    /* Small height */
    justify-content: center;
    transform: translateY(-50%) translateX(0);
    /* Visible at position */
    width: auto;
    min-width: 200px;
    height: 40px;
    /* Slim bar */
    min-height: 0;
    padding: 0 15px;
    background: rgba(10, 10, 12, 0.8);
    border-radius: 4px;
    justify-content: center;
    cursor: pointer;
    border-left: 3px solid var(--secondary);
}

#notify-bar.collapsed .notify-viewport {
    display: none;
}

#notify-bar.collapsed .notify-controls {
    display: none;
    /* Hide controls in collapsed mode */
}

#notify-bar.collapsed .notify-header {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

/* Hover Effect for Collapsed State (Subtle Tech Glow) */
#notify-bar.collapsed:hover {
    box-shadow: 0 0 15px var(--secondary);
    border-color: var(--secondary);
    background: rgba(10, 10, 12, 1);
}

/* Idle Breathing Animation for Collapsed State */
@keyframes notify-breath {
    0% {
        border-left-color: var(--secondary);
        box-shadow: 0 0 5px rgba(0, 240, 255, 0.1);
    }

    50% {
        border-left-color: #fff;
        box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
    }

    100% {
        border-left-color: var(--secondary);
        box-shadow: 0 0 5px rgba(0, 240, 255, 0.1);
    }
}

#notify-bar.collapsed.idle-breath {
    animation: notify-breath 4s infinite ease-in-out;
}

/* PHASE 2: NORMAL (VISIBLE / OPEN) */
#notify-bar.visible {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
    animation: panel-breathing 6s infinite ease-in-out;
}

@keyframes panel-breathing {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
        border-color: rgba(0, 240, 255, 0.5);
    }

    50% {
        box-shadow: 0 0 25px rgba(0, 240, 255, 0.5),
            0 0 40px rgba(0, 240, 255, 0.2);
        border-color: rgba(0, 240, 255, 0.8);
    }
}

/* Micro-dialogue container */
#micro-dialogue-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.micro-dialogue {
    position: absolute;
    font-size: 0.65rem;
    color: var(--secondary);
    letter-spacing: 2px;
    opacity: 0;
    text-shadow: 0 0 8px var(--secondary);
    white-space: nowrap;
    animation: micro-fade 2s ease-in-out forwards;
}

@keyframes micro-fade {
    0% {
        opacity: 0;
        transform: translateY(5px);
    }

    15% {
        opacity: 0.8;
        transform: translateY(0);
    }

    85% {
        opacity: 0.8;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-5px);
    }
}

/* PHASE 3: EXPANDED STATE (Main Screen Mode) */
/* PHASE 3: EXPANDED STATE (Main Screen Mode) */
#notify-bar.expanded {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    width: 90vw;
    height: 80vh;
    max-width: 1000px;
    z-index: 25000;
    border: 1px solid var(--secondary);
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.4), inset 0 0 30px rgba(0, 240, 255, 0.1);
    padding: 30px;
    /* Massive slow down for smoothness */
    transition: all 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    animation: expand-flash 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes expand-flash {
    0% {
        box-shadow: 0 0 100px rgba(255, 255, 255, 0.8);
        border-color: #fff;
        filter: brightness(2);
        opacity: 0.5;
        /* Fade in start */
    }

    20% {
        filter: brightness(1.5);
        opacity: 0.8;
    }

    100% {
        box-shadow: 0 0 50px rgba(0, 240, 255, 0.4), inset 0 0 30px rgba(0, 240, 255, 0.1);
        border-color: var(--secondary);
        filter: brightness(1);
        opacity: 1;
    }
}

.notify-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.7rem;
    color: #fff;
    opacity: 0.9;
    letter-spacing: 1px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    justify-content: space-between;
    white-space: nowrap;
}

.notify-icon {
    width: 6px;
    height: 6px;
    background: #ff0040;
    border-radius: 50%;
    animation: flash-rec 2s infinite;
    box-shadow: 0 0 5px #ff0040;
    flex-shrink: 0;
}

@keyframes flash-rec {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.notify-viewport {
    flex: 1;
    background: #050505;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 1);
    transition: all 0.5s;
}

/* Terminal Log Background (Expanded Only) */
.terminal-log {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--secondary);
    opacity: 0.15;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    white-space: pre-wrap;
    line-height: 1.4;
    text-transform: uppercase;
}

#notify-bar.expanded .terminal-log {
    display: block;
}

#notify-bar .terminal-log {
    display: none;
}

/* Ensure content sits above terminal log */
.notify-viewport {
    z-index: 1;
}

.notify-placeholder {
    font-size: 0.65rem;
    color: var(--secondary);
    /* Changed to secondary for tech feel */
    text-align: center;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    transition: font-size 0.5s;
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.3);
}

#notify-bar.expanded .notify-placeholder {
    font-size: 1.5rem;
    letter-spacing: 3px;
    opacity: 1;
}

#notify-expanded-content {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 5;
    overflow: hidden;
}

#calibration-canvas-nebula {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.8;
    pointer-events: none;
}

#notify-bar.expanded #notify-expanded-content {
    display: flex;
}

/* Hide standard text when expanded if desired, OR move it */
#notify-bar.expanded #notify-content-area {
    position: absolute;
    top: 20px;
    width: 100%;
    font-size: 0.8rem;
    letter-spacing: 5px;
    opacity: 0.5;
}

/* DATA CORE VISUAL */
.data-core {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
    z-index: 10;
}

/* Subtle veil behind data core for readability */
.data-core::before {
    content: '';
    position: absolute;
    top: -30px;
    left: -50px;
    right: -50px;
    bottom: -30px;
    background: radial-gradient(ellipse at center,
            rgba(0, 0, 0, 0.6) 0%,
            rgba(0, 0, 0, 0.3) 50%,
            transparent 100%);
    z-index: -1;
    border-radius: 50%;
}

.core-label {
    font-size: 0.7rem;
    color: var(--secondary);
    letter-spacing: 3px;
    opacity: 0.8;
    text-shadow: 0 0 10px var(--secondary);
}

.data-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    height: 100px;
    padding: 0 20px;
}

.data-bar {
    width: 12px;
    height: var(--height);
    background: linear-gradient(to top,
            rgba(0, 240, 255, 0.2),
            rgba(0, 240, 255, 0.8),
            rgba(255, 255, 255, 0.9));
    border: 1px solid rgba(0, 240, 255, 0.5);
    box-shadow:
        0 0 10px rgba(0, 240, 255, 0.4),
        inset 0 0 10px rgba(0, 240, 255, 0.2);
    animation: data-pulse 2s ease-in-out infinite;
    animation-delay: var(--delay);
    position: relative;
}

.data-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 8px rgba(0, 240, 255, 1);
}

@keyframes data-pulse {

    0%,
    100% {
        height: var(--height);
        opacity: 0.6;
    }

    50% {
        height: calc(var(--height) * 1.2);
        opacity: 1;
    }
}

.core-status {
    font-size: 0.65rem;
    color: var(--primary);
    letter-spacing: 2px;
    opacity: 0.7;
    animation: blink 2s infinite;
}

/* MODULE LIST */
.module-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 80%;
    max-width: 400px;
}

.module-item {
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    font-size: 0.7rem;
    font-family: 'Courier New', monospace;
    opacity: 0.7;
    transition: all 0.3s;
}

.module-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--secondary);
    opacity: 1;
}

.mod-status {
    color: var(--danger);
    font-weight: bold;
}

.mod-name {
    color: var(--secondary);
    letter-spacing: 1px;
}

.sys-msg-blink {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #fff;
    opacity: 0.8;
    animation: blink 2s infinite;
    letter-spacing: 2px;
}

/* --- CONTROLS --- */
.notify-controls {
    display: flex;
    gap: 5px;
}

.ctrl-btn {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--dim);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.ctrl-btn:hover {
    background: var(--secondary);
    color: #000;
    border-color: var(--secondary);
    box-shadow: 0 0 8px var(--secondary);
}

/* --- BUTTONS --- */
#notify-expand-btn {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
    /* Push to right */
}

#notify-expand-btn:hover {
    background: var(--secondary);
    color: #000;
}



.blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* --- MOBILE OPTIMIZATION --- */
@media (max-width: 768px) {

    /* Reset Grid */
    #ar-hud {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 5px;
        /* Minimal padding */
        height: 100%;
        overflow: hidden;
        /* Prevent scrolling if possible */
    }

    /* Move Panels to relative flow */
    .top-left,
    .top-right,
    .bottom-center {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        text-align: left;
    }

    /* Compress Header */
    .top-left {
        order: 1;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        margin-bottom: 2px;
        transform: scale(0.85);
        /* Scale down header */
        transform-origin: top left;
        width: 115%;
        /* Compensate for scale */
    }

    .top-right {
        order: 2;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        align-items: center;
        margin-bottom: 5px;
        transform: scale(0.85);
        /* Scale down stats */
        transform-origin: top left;
        width: 115%;
    }

    /* Adjust Stat Bars for Mobile */
    .stat-unit {
        width: 48%;
    }

    /* Side by side */
    .bio-row {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* Main Content */
    .narrative-container {
        order: 3;
        flex-grow: 1;
        width: 100%;
        margin-top: 0;
        justify-content: center;
        /* Center content vertically */
    }

    .situation-text {
        font-size: 1rem;
        /* Smaller text */
        line-height: 1.3;
        padding: 15px;
        margin-bottom: 10px;
        transform: none;
        max-height: 40vh;
        /* Prevent taking too much space */
        overflow-y: auto;
        /* Scroll text if needed */
    }

    .choices-box {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        margin-top: 10px;
    }

    /* Buttons full width and simpler 3D */
    .choice-btn {
        width: 100%;
        min-width: 0;
        padding: 15px;
        /* reduced padding */
        font-size: 0.9rem;
        /* reduced font */
        transform: rotateX(5deg);
        border: 1px solid var(--primary);
    }

    #btn-a,
    #btn-b {
        transform: rotateX(5deg);
        border-left: 1px solid var(--primary);
        border-right: 1px solid var(--primary);
    }

    /* Footer Elements */
    .bottom-left,
    .bottom-right {
        display: none !important;
        /* Hide less critical info on mobile to save space */
    }

    /* Footer */
    .bottom-center {
        order: 4;
        margin-top: 10px;
    }

    /* Hide decorative reticles on mobile to save space */
    .center-focus {
        display: none;
    }
}

/* --- EPIC ENDING STYLES --- */
.end-text-sm {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: var(--primary);
    opacity: 0.7;
    letter-spacing: 3px;
    text-shadow: 0 0 5px var(--primary);
    margin-bottom: 20px;
}

.epic-glitch,
.epic-glitch-overlay {
    font-family: 'Courier New', monospace;
    font-size: 3rem;
    font-weight: 900;
    color: red;
    text-shadow: 3px 3px 0px #fff, -3px -3px 0px #000;
    letter-spacing: 5px;
    text-transform: uppercase;
    position: relative;
    animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    margin: 40px 0;
    line-height: 1.2;
    background: #000;
    padding: 20px;
    border: 2px solid red;
    box-shadow: 0 0 30px red;
}

.epic-glitch::before,
.epic-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.epic-glitch::before {
    left: 2px;
    text-shadow: -2px 0 #00ffaa;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.epic-glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00f0ff;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

.end-quote {
    font-size: 1.3rem;
    line-height: 1.6;
    color: #eee;
    max-width: 800px;
    margin-top: 50px;
    text-align: center;
    font-weight: 400;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }

    20% {
        transform: skew(-10deg);
    }

    40% {
        transform: skew(10deg);
    }

    60% {
        transform: skew(-5deg);
    }

    80% {
        transform: skew(5deg);
    }

    100% {
        transform: skew(0deg);
    }
}

@keyframes glitch-anim {
    0% {
        clip: rect(12px, 9999px, 59px, 0);
    }

    100% {
        clip: rect(89px, 9999px, 20px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(89px, 9999px, 20px, 0);
    }

    100% {
        clip: rect(12px, 9999px, 59px, 0);
    }
}

/* --- INTRO OVERLAY (CLINICAL UX) --- */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #05080a;
    /* Deep cold black */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', 'Roboto', 'Arial', sans-serif;
    /* Clean scientific font */
    color: #aaccff;
    transition: opacity 2s ease;
    opacity: 1;
}

.intro-content {
    width: 600px;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.intro-logo {
    font-size: 1.5rem;
    letter-spacing: 4px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.intro-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.intro-label {
    font-size: 0.7rem;
    color: #446677;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.intro-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.intro-fill {
    height: 100%;
    background: #00f0ff;
    width: 0%;
    transition: width 0.5s ease;
}

.intro-status {
    font-size: 0.9rem;
    color: #00f0ff;
    transition: opacity 0.2s ease;
    /* Fast fade for rapid text cycling */
}

.intro-terminal {
    margin-top: 30px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #557788;
    height: 20px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

@keyframes fadeOutIntro {
    to {
        opacity: 0;
        pointer-events: none;
    }
}

/* --- BLINK SEQUENCE CSS (GLITCH TECH) --- */
#blink-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 11000;
    display: flex;
    justify-content: center;
    align-items: center;

    /* Sci-Fi Noir Background - More transparent to show 3D */
    background-color: rgba(0, 0, 0, 0.4);

    /* Entry Animation handled by script mostly, but base opacity transition */
    transition: opacity 1s ease;
}

/* Background Noise Overlay Removed */

.blink-container {
    position: relative;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 85vh;
    /* Occupy most of the screen */
    justify-content: space-between;
    /* Maximum separation */
    padding-top: 5vh;
}

.blink-message {
    font-family: var(--font-tech);
    color: var(--primary);
    font-size: 0.85rem;
    /* Much smaller */
    letter-spacing: 1.5px;
    background: rgba(0, 5, 10, 0.7);
    padding: 8px 16px;
    /* Compact padding */
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-left: 3px solid var(--primary);
    text-shadow: 0 0 5px var(--primary);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    position: relative;
    text-transform: uppercase;
    animation: text-glitch-stable 4s infinite;
}

.blink-message::after {
    content: '_';
    display: inline-block;
    color: var(--primary);
    animation: blink-cursor 1s step-end infinite;
    margin-left: 5px;
    text-shadow: 0 0 5px var(--primary);
}

@keyframes blink-cursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes text-flicker {

    0%,
    19.9%,
    22%,
    62.9%,
    64%,
    64.9%,
    70%,
    100% {
        opacity: 0.99;
        text-shadow: 0 0 5px var(--primary), 0 0 10px var(--primary);
    }

    20%,
    21.9%,
    63%,
    63.9%,
    65%,
    69.9% {
        opacity: 0.2;
        text-shadow: none;
    }
}

.blink-actions {
    display: flex;
    gap: 40px;
    margin-bottom: 20px;
    /* Space above message */
    margin-top: auto;
    /* Push to bottom if needed, though space-between handles it */
}

.blink-btn {
    font-family: var(--font-tech);
    font-size: 1.2rem;
    /* Increased font size */
    font-weight: 700;
    padding: 22px 70px;
    /* Larger padding */
    cursor: pointer;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(5px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 3px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    color: var(--primary);
    border: 1px solid rgba(0, 240, 255, 0.2);
    /* Premium Cut Corners */
    clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);

    display: flex;
    align-items: center;
    justify-content: center;
}

.blink-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 40%, rgba(0, 240, 255, 0.1) 50%, transparent 60%);
    background-size: 200% 100%;
    transition: background-position 0.5s;
    opacity: 0;
}

/* DECORATIVE CORNERS (Pseudo-borders logic handled by drop-shadow for clip-path or inset box-shadow) */

.blink-btn.primary {
    box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.05);
}

.blink-btn.primary:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.3), inset 0 0 0 1px var(--primary);
    transform: translateY(-2px);
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    letter-spacing: 5px;
    /* Premium expansion effect */
}

.blink-btn.primary:hover::before {
    opacity: 1;
    background-position: 100% 0;
}

.blink-btn.disabled {
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    /* Allow click */
    background: rgba(20, 20, 20, 0.8);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    box-shadow: none;
    transform: none !important;
    font-size: 0.9rem;
    transition: all 0.1s ease;
}

.blink-btn.denied {
    border-color: #ff0000;
    color: #ff0000;
    background: rgba(255, 0, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
    text-shadow: 0 0 10px #ff0000;
    animation: deny-shake 0.3s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes deny-shake {

    10%,
    90% {
        transform: translate3d(-2px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(4px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-6px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(6px, 0, 0);
    }
}

.blink-system-name {
    font-family: var(--font-tech);
    font-size: 7rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 25px;
    margin-bottom: 0;
    margin-top: 0;
    /* Clean spacing handled by container */

    /* Static, strong tech glow */
    text-shadow:
        0 0 10px rgba(0, 240, 255, 0.8),
        0 0 20px rgba(0, 240, 255, 0.6),
        0 0 40px rgba(0, 240, 255, 0.4),
        0 0 80px rgba(0, 240, 255, 0.2);
    position: relative;
    mix-blend-mode: normal;
}

.glitch-letter {
    display: inline-block;
    color: #fff;
    position: relative;
    /* Intense static glow for I and D */
    text-shadow:
        0 0 20px var(--primary),
        0 0 40px var(--primary),
        0 0 80px var(--primary);
}

/* Broken LED Effect for "D" */
.glitch-led {
    display: inline-block;
    color: #fff;
    position: relative;
    /* Base broken state */
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    animation: led-flicker 5s infinite;
}

@keyframes led-flicker {

    0%,
    90% {
        opacity: 1;
        text-shadow: 0 0 20px var(--primary);
        color: #fff;
    }

    91% {
        opacity: 0.1;
        text-shadow: none;
        color: #111;
    }

    92% {
        opacity: 1;
        text-shadow: 0 0 30px #ff0000, 0 0 10px #ff0000;
        color: #ff0000;
    }

    /* Evil Red Flash */
    93% {
        opacity: 0.1;
        text-shadow: none;
        color: #111;
    }

    94% {
        opacity: 1;
        text-shadow: 0 0 30px #ff0000;
        color: #ff0000;
    }

    /* Second Red Pulse */
    95% {
        opacity: 0.3;
        text-shadow: 0 0 5px var(--primary);
        color: #fff;
    }

    96%,
    100% {
        opacity: 1;
        text-shadow: 0 0 20px var(--primary);
        color: #fff;
    }
}

/* Make parameters more visible in the blink section */
#blink-overlay~.bottom-right,
#blink-overlay~.bottom-left {
    opacity: 1 !important;
}

.hud-panel.bottom-right div {
    opacity: 0.9 !important;
    /* Increase visibility of parameters */
    text-shadow: 0 0 3px rgba(0, 240, 255, 0.5);
}


/* --- ORGANIC BLINK EFFECT --- */
#eyelids {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 12000;
    pointer-events: none;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8));
    /* Vignette feel on edges */
}

.lid {
    position: absolute;
    left: 0;
    width: 100%;
    height: 55%;
    /* Overlap slightly */
    background: #050505;
    transition: transform 0.1s ease-out;
}

.lid.top {
    top: 0;
    transform: translateY(-100%);
    border-bottom-left-radius: 40% 60px;
    border-bottom-right-radius: 40% 60px;
}

.lid.bottom {
    bottom: 0;
    transform: translateY(100%);
    border-top-left-radius: 40% 60px;
    border-top-right-radius: 40% 60px;
}

/* Blink Animation Classes */
.blink-shut .lid.top {
    transform: translateY(0);
}

.blink-shut .lid.bottom {
    transform: translateY(0);
}

/* Waking up organic ease */
.blink-open .lid.top {
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
    transform: translateY(-100%);
}

.blink-open .lid.bottom {
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
    transform: translateY(100%);
}

/* Blur Effect for Body */
.blur-active {
    animation: vision-clear 2.5s ease-out forwards;
}

@keyframes vision-clear {
    0% {
        filter: blur(10px);
    }

    30% {
        filter: blur(6px);
    }

    100% {
        filter: blur(0);
    }
}

@keyframes slow-pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 10px var(--primary);
    }
}

/* UI Reveal Animation helper */
.ui-reveal {
    animation: fade-in-up 0.8s forwards;
    opacity: 0;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.intro-narrative {
    min-height: 40px;
    margin-top: 15px;
    margin-bottom: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #668899;
    text-align: left;
    opacity: 0;
    transition: opacity 1s ease;
    border-left: 2px solid rgba(0, 240, 255, 0.3);
    padding-left: 15px;
    width: 100%;
}

/* UI Reveal Animation */
.ui-reveal {
    animation: ui-fade-in 1.5s ease-out forwards !important;
}

@keyframes ui-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fix overlay blockage */
#intro-overlay,
#blink-overlay,
#eyelids {
    pointer-events: none;
}

#intro-overlay .intro-content,
#blink-overlay .blink-container,
#btn-blink {
    pointer-events: auto;
}

@keyframes prob-scan {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.menu-btn {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 30px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 2000;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
    text-transform: uppercase;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
}

.menu-btn:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary);
    text-shadow: none;
}

.menu-btn:active {
    transform: translateX(-50%) scale(0.95);
}

.menu-btn {
    /* Removed absolute positioning here as it's now handled by the parent container in HTML */
    position: relative;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 30px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
    text-transform: uppercase;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.2);
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 5px rgba(0, 255, 170, 0.2);
    }

    50% {
        box-shadow: 0 0 15px rgba(0, 255, 170, 0.6);
        border-color: #fff;
    }

    100% {
        box-shadow: 0 0 5px rgba(0, 255, 170, 0.2);
    }
}

.menu-btn:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 25px var(--primary);
    text-shadow: none;
    transform: scale(1.05);
}

.menu-btn:active {
    transform: scale(0.95);
}

/* Easter Egg Char */
.diff-char {
    display: inline-block;
    transition: all 0.2s;
}

.diff-char:hover {
    color: #fff !important;
    text-shadow: 2px 0 var(--danger), -2px 0 blue;
    transform: scale(1.2);
}

.diff-char:active {
    transform: scale(0.9);
}

/* CYBER INPUTS */
.cyber-input {
    width: 100%;
    background: rgba(10, 20, 30, 0.8);
    border: 1px solid var(--dim);
    border-left: 3px solid var(--accent);
    color: var(--primary);
    padding: 10px;
    font-family: var(--font-tech);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    text-transform: uppercase;
}

.cyber-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
    background: rgba(15, 25, 35, 0.95);
}

/* TECH HAZ CLOSING ANIMATION */
.closing-haz {
    animation: tech-haz-collapse 0.8s forwards ease-in-out;
    pointer-events: none;
}

@keyframes tech-haz-collapse {
    0% {
        transform: scale(1);
        filter: brightness(1);
        opacity: 1;
    }

    40% {
        transform: scale(1.05);
        filter: brightness(2);
    }

    100% {
        transform: scale(0.01);
        filter: brightness(20);
        /* Flash */
        opacity: 0;
    }
}

.tech-tooltip {
    text-shadow: 0 0 5px var(--primary);
    animation: text-flicker 4s infinite alternate;
}

/* MINI FORM INPUTS */
.cyber-input-mini {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-bottom: 1px solid var(--accent);
    color: #fff;
    padding: 5px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    outline: none;
    transition: all 0.3s;
}

.cyber-input-mini:focus {
    border-bottom-color: var(--primary);
    background: rgba(0, 50, 60, 0.2);
}

.blink-btn-mini {
    background: var(--primary);
    color: #000;
    border: none;
    width: 100%;
    padding: 8px;
    font-family: var(--font-tech);
    font-weight: bold;
    cursor: pointer;
    margin-top: 5px;
    transition: all 0.2s;
}

.blink-btn-mini:hover {
    background: #fff;
    box-shadow: 0 0 10px #fff;
}

@keyframes text-flicker {
    0% {
        opacity: 0.7;
    }

    90% {
        opacity: 1;
    }

    95% {
        opacity: 0.3;
    }

    100% {
        opacity: 0.8;
    }
}

/* WELCOME MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 20000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.modal-content {
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid var(--primary);
    padding: 40px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
    min-width: 300px;
    transform: scale(0.9);
    transition: transform 0.5s ease;
}

.modal-content h2 {
    font-family: 'Orbitron', monospace;
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.modal-content p {
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 15px;
}

.loader-line {
    width: 100%;
    height: 2px;
    background: #333;
    position: relative;
    overflow: hidden;
}

.loader-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: var(--primary);
    animation: loadScan 1.5s infinite linear;
    box-shadow: 0 0 10px var(--primary);
}

@keyframes loadScan {
    0% {
        left: -30%;
    }

    100% {
        left: 100%;
    }
}

/* TOOLTIPS & STATS INTERACTION */
.param-item {
    cursor: help;
    transition: color 0.3s;
    position: relative;
    /* Needed for absolute tooltip */
}

#private-data-box {
    overflow: visible !important;
    /* Ensure tooltips show */
}

.param-item:hover {
    color: #fff;
    text-shadow: 0 0 5px var(--primary);
}

.param-item::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 220px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--primary);
    color: var(--accent);
    padding: 10px;
    font-size: 0.75rem;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 99999;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
    text-align: left;
    white-space: normal;
    font-family: 'Courier New', monospace;
    line-height: 1.2;
}

.param-item:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: 110%;
    /* Slight lift */
}

.stat-unit {
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 4px;
}

.stat-unit:hover {
    transform: scale(1.02);
    background: rgba(0, 255, 170, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.2);
    border: 1px solid rgba(0, 255, 170, 0.3);
}


/* OVERRIDE FOR BROKEN CHAR */
.diff-char {
    display: inline-block;
    transition: all 0.2s;
    transform: rotate(15deg) translateY(4px) !important;
    color: var(--danger) !important;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
    font-weight: bold;
}

@keyframes title-entry-thriller {
    0% {
        opacity: 0;
        transform: scale(1.1);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

/* Force standard size prevent shrinking */
#blink-title-center h1 {
    font-size: 5rem !important;
}



/* CUSTOM CURSOR TRAIL */
.cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    mix-blend-mode: screen;
    box-shadow: 0 0 5px var(--secondary);
}

@keyframes ghost-flicker {

    0%,
    100% {
        opacity: 1;
        filter: blur(0px);
        transform: scale(1);
    }

    50% {
        opacity: 0.2;
        filter: blur(4px);
        transform: scale(0.98);
    }

    70% {
        opacity: 0.6;
        filter: blur(2px);
        transform: scale(1.02);
    }
}

.ghost-btn {
    animation: ghost-flicker 2s infinite ease-in-out;
    pointer-events: none !important;
    cursor: not-allowed !important;
    border-color: var(--dim) !important;
    color: var(--dim) !important;
}


/* === PREMIUM FORM EFFECTS === */

/* Scanner Beam Animation */
@keyframes formScan {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(500px);
        opacity: 0;
    }
}

/* Premium Input Styling */
.premium-input {
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid var(--dim) !important;
    border-left: 2px solid var(--primary) !important;
    color: var(--primary) !important;
    padding: 8px 10px !important;
    font-size: 0.7rem !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3) !important;
}

.premium-input:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow:
        0 0 15px rgba(0, 240, 255, 0.3),
        inset 0 0 15px rgba(0, 240, 255, 0.1) !important;
    background: rgba(0, 20, 20, 0.3) !important;
    text-shadow: 0 0 5px var(--primary) !important;
}

.premium-input::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
    opacity: 1 !important;
}

#doomsday-timer {
    position: fixed;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 90%;

    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;

    color: var(--danger);
    text-shadow: 0 0 10px var(--danger);

    background: transparent;
    border-bottom: 2px solid var(--danger);
    padding: 5px 10px 5px 10px;

    z-index: 2000;
    pointer-events: none;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

#doomsday-timer::before {
    content: '/// AUTO_ELECTION_MODE ///';
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--danger);
    letter-spacing: 2px;
    opacity: 0.8;
}

/* AI GHOST CURSOR */
.ai-cursor {
    position: fixed;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 20px solid var(--primary);
    transform: rotate(-45deg);
    pointer-events: none;
    z-index: 10000;
    filter: drop-shadow(0 0 10px var(--primary));
    opacity: 0;
    transition: opacity 0.2s;
}

.ai-cursor::after {
    content: '';
    position: absolute;
    top: 20px;
    left: -12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--primary);
    opacity: 0.5;
    animation: ping 1s infinite;
}

@keyframes ping {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0;
    }

    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

@keyframes rainbow-frenzy {
    0% {
        border-color: red;
        color: red;
        box-shadow: 0 0 10px red;
        text-shadow: 0 0 5px red;
    }

    15% {
        border-color: yellow;
        color: yellow;
        box-shadow: 0 0 10px yellow;
    }

    30% {
        border-color: lime;
        color: lime;
        box-shadow: 0 0 10px lime;
    }

    45% {
        border-color: cyan;
        color: cyan;
        box-shadow: 0 0 10px cyan;
    }

    60% {
        border-color: blue;
        color: blue;
        box-shadow: 0 0 10px blue;
    }

    75% {
        border-color: magenta;
        color: magenta;
        box-shadow: 0 0 10px magenta;
    }

    90% {
        border-color: orange;
        color: orange;
        box-shadow: 0 0 10px orange;
    }

    100% {
        border-color: red;
        color: red;
        box-shadow: 0 0 10px red;
    }
}

.frenetic-rainbow {
    animation: rainbow-frenzy 0.1s infinite linear !important;
    background: #000 !important;
    transform: scale(1.1);
}

@keyframes doomsday-pulse {
    0% {
        transform: translateX(-50%) scale(1);
        border-color: rgba(255, 0, 0, 0.5);
    }

    50% {
        transform: translateX(-50%) scale(1.05);
        border-color: red;
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
    }

    100% {
        transform: translateX(-50%) scale(1);
        border-color: rgba(255, 0, 0, 0.5);
    }
}

/* Premium Button Styling */
.premium-btn {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 40, 40, 0.6)) !important;
    border: 2px solid var(--primary) !important;
    color: var(--primary) !important;
    letter-spacing: 3px !important;
    font-weight: bold !important;
    text-shadow: 0 0 10px var(--primary) !important;
    box-shadow:
        0 0 20px rgba(0, 240, 255, 0.2),
        inset 0 0 15px rgba(0, 240, 255, 0.05) !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

.premium-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.premium-btn:hover {
    background: linear-gradient(135deg, rgba(0, 40, 40, 0.8), rgba(0, 60, 60, 0.6)) !important;
    box-shadow:
        0 0 30px rgba(0, 240, 255, 0.4),
        inset 0 0 25px rgba(0, 240, 255, 0.15) !important;
    transform: translateY(-2px) !important;
    border-color: #00ffff !important;
}

.premium-btn:hover::before {
    left: 100%;
}

.premium-btn:active {
    transform: translateY(0) !important;
    box-shadow:
        0 0 15px rgba(0, 240, 255, 0.3),
        inset 0 0 20px rgba(0, 240, 255, 0.2) !important;
}

/* --- DOOMSDAY TIMER --- */
#doomsday-timer {
    position: fixed;
    bottom: 110px;
    /* A bit higher to avoid collision with question box */
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    /* Smaller size */
    font-family: var(--font-tech);
    font-weight: 700;
    color: #00f0ff;
    text-shadow: 0 0 8px #00f0ff;
    letter-spacing: 3px;
    z-index: 10001;
    pointer-events: none;
    animation: timer-pulse 1s ease-in-out infinite;
}

@keyframes timer-pulse {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translateX(-50%) scale(1.02);
        opacity: 0.85;
    }
}

/* --- GHOST CURSOR (AI CONTROL) --- */
.ghost-cursor {
    position: fixed;
    width: 24px;
    height: 24px;
    background: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 2L10 22L13 13L22 10L2 2Z' fill='rgba(255, 0, 0, 0.5)' stroke='%23ff0000' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat;
    pointer-events: none;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.5s ease;
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.8));
    transform: translate(-2px, -2px);
    /* Aligns tip with coordinates */
}

@keyframes ghost-flicker {

    0%,
    100% {
        opacity: 0.8;
        filter: drop-shadow(0 0 8px red);
    }

    50% {
        opacity: 0.4;
        filter: drop-shadow(0 0 2px red);
    }
}

/* --- DENIAL MESSAGE (FINAL STAGE) --- */
.denial-msg {
    position: fixed;
    transform: translate(-50%, -50%);
    color: #ff0000;
    font-family: var(--font-tech);
    font-weight: 900;
    font-size: 1.2rem;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #ff0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
    pointer-events: none;
    z-index: 100000;
    animation: denial-pop 1.5s ease-out forwards;
    letter-spacing: 2px;
}

@keyframes denial-pop {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }

    10% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }

    20% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    80% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -80%) scale(0.9);
        opacity: 0;
    }
}

/* --- ROCKET & STAR ANIMATIONS --- */
.rocket-container {
    display: inline-block;
    position: relative;
    animation: rocket-vibration 0.1s ease-in-out infinite alternate;
}

@keyframes rocket-vibration {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(1px, -1px);
    }
}

.rocket-stars {
    position: absolute;
    top: 50%;
    left: -15px;
    width: 20px;
    height: 10px;
    pointer-events: none;
}

.star-particle {
    position: absolute;
    background: #fff;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    opacity: 0;
    animation: star-fly 0.4s linear infinite;
}

@keyframes star-fly {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-40px, 20px);
        opacity: 0;
    }
}