:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --dim-color: #888;
    --accent-color: #00ff41;
    --accent-glow: rgba(0, 255, 65, 0.3);
    --error-color: #ff3333;
    --error-glow: rgba(255, 51, 51, 0.5);
    --font-stack: 'Space Mono', 'Courier Prime', monospace;
    --border-color: #333;

    /* Enhanced variables for spectacle */
    --neon-green: #00ff41;
    --neon-cyan: #00ffff;
    --deep-shadow: rgba(0, 0, 0, 0.9);
    --glass-blur: blur(10px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

::selection {
    background: var(--accent-color);
    color: var(--bg-color);
    text-shadow: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-stack);
    min-height: 100svh;
    width: 100%;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;

    /* Subtle HDR boost for deeper blacks and brighter colors */
    filter: contrast(1.05) saturate(1.15) brightness(0.98);
}

/* --- Enhanced CRT & Atmospheric Effects --- */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.03) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.015), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.015));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 100;
    animation: crtFlicker 0.15s infinite alternate;
    opacity: 0.6;
}

@keyframes crtFlicker {
    0% {
        opacity: 0.58;
    }

    100% {
        opacity: 0.62;
    }
}

.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.7) 85%, rgba(0, 0, 0, 0.95) 100%);
    pointer-events: none;
    z-index: 99;
}

#p5-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /* Fallback */
    height: 100dvh;
    /* Dynamic viewport height for mobile */
    z-index: -1;
    background-color: #000;
    /* Prevents mobile browser address bar jumps affecting the background */
    touch-action: none;
}

/* Cinematic fade-in with slight scale */
.fade-in {
    animation: fadeInScale 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.98);
        filter: blur(4px);
    }

    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

/* --- Enhanced Typography with Glow --- */
.terminal-text {
    text-transform: uppercase;
    letter-spacing: 1.5px;
    line-height: 1.7;
}

h1 {
    font-size: 1rem;
    letter-spacing: 3px;
    color: var(--dim-color);
    text-align: center;
    position: relative;
    display: inline-block;
    padding-bottom: 0.8rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color), 0 0 20px rgba(0, 255, 65, 0.5);
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 10px var(--accent-color), 0 0 20px rgba(0, 255, 65, 0.5);
        opacity: 1;
    }

    50% {
        box-shadow: 0 0 15px var(--accent-color), 0 0 30px rgba(0, 255, 65, 0.7);
        opacity: 0.9;
    }
}

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch::before {
    animation: glitchTop 3s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    text-shadow: -2px 0 var(--error-color);
}

.glitch::after {
    animation: glitchBottom 2.5s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
    text-shadow: 2px 0 var(--neon-cyan);
}

@keyframes glitchTop {

    0%,
    100% {
        transform: translate(0);
    }

    2% {
        transform: translate(-2px, 2px);
    }

    4% {
        transform: translate(2px, -2px);
    }

    6% {
        transform: translate(0);
    }
}

@keyframes glitchBottom {

    0%,
    100% {
        transform: translate(0);
    }

    3% {
        transform: translate(2px, 1px);
    }

    5% {
        transform: translate(-2px, -1px);
    }

    7% {
        transform: translate(0);
    }
}

/* --- Enhanced Layout --- */
/* 1. LAYOUT FIX: Make the main interface full height and centered */
#main-interface {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100dvh;
    /* Full viewport height */
    margin: 0;

    /* FIX: Add padding bottom to prevent overlap with the 60px footer */
    /* 60px (footer height) + 20px (breathing room) */
    padding: 0 0 80px 0;

    display: flex;
    flex-direction: column;
    /* Stack Center Stage + Footer */
    justify-content: center;
    /* Vertically center the content */
    align-items: center;
    overflow: hidden;
    /* Prevent scrolling if possible */
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 2. WRAPPER: Holds Poem and Input together */
.center-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    /* Reduced from 1.5rem */
    transform: translateY(0);
    /* Reset transform to let Flexbox handle centering naturally */
    width: 100%;
    max-width: 800px;
    padding: 0 1.5rem;
}

#main-interface.visible {
    opacity: 1;
}

.hidden {
    display: none !important;
}

/* --- Enhanced Poem Section --- */
/* 1. COMPRESS THE POEM (Solves "Too High") */
.compact-poem {
    /* Reduce padding to pull borders in */
    padding: 1.2rem 1.5rem;
    max-width: 550px;
    background: rgba(2, 2, 2, 0.6);
    border: none;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 500px;
    /* Arbitrary large number for animation */
    opacity: 1;
    margin-bottom: 2rem;
}

.compact-poem.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    transform: translateY(-20px);
}

.poem-body {
    /* Smaller font and tighter lines to reduce vertical height */
    font-size: 0.7rem;
    line-height: 1.3;
    text-align: center;
    color: var(--dim-color);
}

.poem-body .highlight {
    font-size: 0.9rem;
    display: block;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4), 0 0 20px rgba(255, 255, 255, 0.2);
    animation: textPulse 3s ease-in-out infinite;
}

.instruction-text {
    color: var(--accent-color);
    font-size: 0.75rem;
    letter-spacing: 2px;
}

@keyframes textPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

.dim {
    color: var(--dim-color);
    font-size: 0.85rem;
    opacity: 0.7;
}

/* --- Shared Glass HUD --- */
.glass-hud {
    position: relative;
    background: rgba(2, 2, 2, 0.92);
    /* Darker background for contrast */
    border: 1px solid rgba(0, 255, 65, 0.2);
    /* Subtle edge definition */
    padding: 1.5rem 2rem;
    /* CHANGED: Tighter padding */
    backdrop-filter: blur(16px);
    /* Blur the particles behind the text */
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.9),
        inset 0 0 80px rgba(0, 0, 0, 0.8);
    border-radius: 0px;
    /* CHANGED: Make borders sharper */
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Cyberpunk "Corner Brackets" via pseudo-elements */
.glass-hud::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--accent-color);
    border-left: 2px solid var(--accent-color);
    transition: all 0.3s ease;
}

.glass-hud::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid var(--accent-color);
    border-right: 2px solid var(--accent-color);
    transition: all 0.3s ease;
}

/* Hover state for interactivity */
.glass-hud:hover::before,
.glass-hud:hover::after {
    width: 100%;
    height: 100%;
    opacity: 0.15;
    /* Subtle flash of full border on hover */
}

/* Mute the flavor text inside the HUD */
.glass-hud .poem-body,
.glass-hud h2 {
    color: var(--dim-color);
    /* Use the grey variable */
    opacity: 0.8;
    text-shadow: none;
    /* Remove glow to reduce visual noise */
    font-size: 0.85rem;
}

/* Highlight key terms if needed (optional) */
.glass-hud .highlight {
    color: var(--text-color);
    /* Bring back to white */
    opacity: 1;
}

/* --- SYSTEM WINDOW (Updated for Readability) --- */
.form-container {
    width: 100%;
    max-width: 420px;
    /* Reduced from 480px */
    position: relative;
}

.system-window {
    /* Base styles now handled by .glass-hud, but keeping specific overrides if any */
    position: relative;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    /* Lift it off the page */
    border: 1px solid rgba(0, 255, 65, 0.4);
    /* Brighter border than poem */
}

.system-window:hover {
    /* Hover effects now handled by .glass-hud mostly, but keeping transform */
    transform: translateY(-2px);
}

.window-header {
    position: absolute;
    top: -11px;
    /* Slight adjustment for tighter border */
    left: 10px;
    background: linear-gradient(180deg, rgba(5, 5, 5, 1) 0%, rgba(5, 5, 5, 0.9) 100%);
    padding: 2px 8px;
    font-size: 0.55rem;
    /* Slightly smaller tech text */
    color: var(--accent-color);
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(0, 255, 65, 0.4);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

.status-light {
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--accent-color), 0 0 10px var(--accent-color);
    animation: statusBlink 2s ease-in-out infinite;
}

@keyframes statusBlink {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 5px var(--accent-color), 0 0 10px var(--accent-color);
    }

    50% {
        opacity: 0.5;
        box-shadow: 0 0 3px var(--accent-color), 0 0 6px var(--accent-color);
    }
}

/* --- Input Fields --- */
/* Tighten the gap between label and input */
.system-window #stage-emotion {
    margin-top: 0.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    /* Reduced from 1rem */
    font-size: 0.65rem;
    color: var(--dim-color);
    /* Make label dimmer so input pops */
    letter-spacing: 1px;
    font-weight: 700;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
}

/* 3. SURGICAL INPUT BOX (Solves "Way too much") */
/* --- 3. INPUT FIELD (Clean & Full Width) --- */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: none;
    border-bottom: 2px solid #222;
    padding: 0;
    height: 36px;
    /* Removed margin-bottom here, moved to action container */
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    /* We can hide overflow again since button is gone */
    cursor: text;
    /* UX: Shows user this entire area is clickable */
    z-index: 20;
    /* FIX: Ensure it sits above any potential noise/particles */
}

/* The glowing underline effect */
.input-wrapper::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-wrapper:focus-within {
    border-bottom-color: transparent;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 5px 20px -10px var(--accent-glow);
}

.input-wrapper:focus-within::after {
    width: 100%;
}

/* 4. OPTIONAL: Refine the Prompt Character ">" alignment */
.prompt-char {
    margin-right: 10px;
    color: var(--accent-color);
    font-size: 1rem;
    padding-left: 10px;
    /* Add breathing room from left edge */
    font-weight: 700;
    transform: translateY(-1px);
    /* Optical alignment fix */
}

.prompt-char.paused {
    animation: none;
    opacity: 1;
}

@keyframes promptBlink {

    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0.3;
    }
}

input[type="text"],
input[type="email"] {
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-stack);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0;
    height: 100%;
    width: 100%;
    /* Full width now! */
    outline: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    filter: drop-shadow(0 0 5px var(--accent-glow));

    /* FIX: Ensure input sits above decorative elements */
    position: relative;
    z-index: 10;
}

input::placeholder {
    color: #444;
    opacity: 1;
    font-style: italic;
    text-shadow: none;
}

input:focus::placeholder {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* NEW: Custom Caret Animation */
@keyframes blinkCaret {

    0%,
    100% {
        border-color: var(--accent-color);
    }

    50% {
        border-color: transparent;
    }
}

input:focus {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* --- Buttons --- */
button {
    width: 100%;
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    font-family: var(--font-stack);
    padding: 1.2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 0.9rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.1), inset 0 0 20px rgba(0, 255, 65, 0.05);
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
}

button:hover::before {
    width: 300%;
    height: 300%;
    opacity: 0.2;
}

button:hover {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
    box-shadow: 0 0 40px var(--accent-glow), 0 0 60px rgba(0, 255, 65, 0.3), inset 0 0 30px rgba(0, 255, 65, 0.2);
    transform: translateY(-2px);
    letter-spacing: 4px;
}

button:active {
    transform: scale(0.98) translateY(0);
    box-shadow: 0 0 20px var(--accent-glow), inset 0 0 20px rgba(0, 255, 65, 0.3);
}

button:disabled {
    background: #1a1a1a;
    border-color: #333;
    color: #555;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

button:disabled::before {
    display: none;
}

/* --- 4. ACTION LINE (The Button Below) --- */
.action-container {
    height: 40px;
    /* Reserve space */
    display: flex;
    justify-content: flex-end;
    /* Align button to the right */
    align-items: flex-start;
    padding-top: 8px;
    margin-bottom: 1rem;
    opacity: 1;
    transition: all 0.5s ease;
    position: relative;
    z-index: 25;
    /* FIX: Ensure button sits on top of everything */
}

.action-container.hidden {
    opacity: 0;
    transform: translateY(-5px);
    pointer-events: none;
    /* Prevent clicking when hidden */
}

.terminal-action {
    color: var(--dim-color);
    font-size: 0.75rem;
    letter-spacing: 2px;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 6px 12px;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);

    /* FIX: Improve hit area */
    user-select: none;
    /* Prevents text highlighting when clicking repeatedly */
    touch-action: manipulation;
    /* Improves mobile tap response */
}

/* Connect the button visually to the system */
.terminal-action:hover {
    background: var(--accent-color);
    color: #000 !important;
    /* Force black text */
    font-weight: 700;
    /* Make text bolder */
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
    text-shadow: none;
    /* Remove text glow so it's sharp black */
}

.terminal-action.active {
    animation: blinkBorder 2s infinite;
    border-color: rgba(0, 255, 65, 0.3);
    color: var(--accent-color);
}

@keyframes blinkBorder {

    0%,
    100% {
        border-color: var(--accent-color);
    }

    50% {
        border-color: transparent;
    }
}

/* --- Success State --- */
#success-message {
    text-align: center;
    animation: successAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    border: 2px solid var(--accent-color);
    padding: 2.5rem;
    background: rgba(0, 255, 65, 0.05);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.2), inset 0 0 30px rgba(0, 255, 65, 0.05);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

#success-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.2), transparent);
    animation: successScan 2s ease-in-out;
}

@keyframes successAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes successScan {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

#success-message h2 {
    color: var(--accent-color);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    letter-spacing: 3px;
    text-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

/* --- Boot Sequence --- */
#boot-sequence {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 50;
    padding: 4rem;
    font-family: var(--font-stack);
    color: var(--accent-color);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: opacity 0.5s ease;
}

#boot-text {
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.4);
}

.anomaly-line {
    color: var(--error-color);
    font-weight: 700;
    text-shadow: -2px 0 0 rgba(255, 0, 0, 0.7), 2px 0 0 rgba(0, 255, 255, 0.5), 0 0 10px rgba(255, 51, 51, 0.5);
    display: inline-block;
    margin-top: 1rem;
    animation: anomalyGlitch 0.3s ease-in-out infinite;
}

@keyframes anomalyGlitch {

    0%,
    100% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 1px);
    }

    40% {
        transform: translate(2px, -1px);
    }

    60% {
        transform: translate(-1px, 2px);
    }

    80% {
        transform: translate(1px, -2px);
    }
}

.skip-hint {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    color: #444;
    font-size: 0.7rem;
    letter-spacing: 1px;
    animation: skipHintBlink 2s ease-in-out infinite;
    text-shadow: 0 0 5px rgba(68, 68, 68, 0.3);
}

@keyframes skipHintBlink {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

/* --- Footer --- */
/* 5. NEW FIXED FOOTER / STATUS BAR */
footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    background: linear-gradient(to top, #000 0%, transparent 100%);
    pointer-events: none;
    /* Let clicks pass through transparent parts */
    z-index: 20;
}

.footer-left,
.footer-right {
    pointer-events: all;
    width: 200px;
}

.footer-right {
    text-align: right;
}

.footer-center {
    flex-grow: 1;
    text-align: center;
    opacity: 0.6;
}

.small-status {
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: var(--accent-color);
}

#audio-toggle {
    background: transparent;
    border: 1px solid transparent;
    color: var(--dim-color);
    font-size: 0.6rem;
    cursor: pointer;
    padding: 4px 8px;
    width: auto;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

#audio-toggle:hover {
    color: var(--accent-color);
    border-color: rgba(0, 255, 65, 0.3);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
    background: rgba(0, 255, 65, 0.05);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* --- Mobile Optimizations --- */
/* --- Mobile Optimizations (CORRECTED) --- */
@media (max-width: 768px) {

    /* 1. FIX: Allow scrolling and align to top instead of center */
    #main-interface {
        justify-content: flex-start;
        /* Start from top */
        overflow-y: auto;
        /* Allow scrolling if content is tall */
        padding-top: 60px;
        /* Add breathing room from top edge */
        padding-bottom: 100px;
        /* Ensure space for footer/scrolling */
        height: auto;
        /* Let it grow naturally */
        min-height: 100dvh;
        /* Minimum full height */
    }

    /* 2. FIX: Remove the negative transform that pushes text off-screen */
    .center-stage {
        transform: none;
        margin-bottom: 2rem;
    }

    .compact-poem {
        padding: 1rem;
        margin-bottom: 0;
    }

    .poem-body {
        font-size: 0.65rem;
    }

    footer {
        /* Ensure footer doesn't float weirdly over content when scrolling */
        position: fixed;
        bottom: 0;
        background: linear-gradient(to top, #050505 20%, transparent 100%);
        /* darker bg for readability */
        flex-direction: column;
        height: auto;
        padding-bottom: 1rem;
        gap: 0.5rem;
    }

    .footer-center {
        order: -1;
        margin-bottom: 5px;
    }

    .footer-left,
    .footer-right {
        width: auto;
        text-align: center;
    }

    .system-window {
        padding: 1.8rem;
        margin-top: 1rem;
    }

    #boot-sequence {
        padding: 2rem;
        font-size: 0.85rem;
    }

    button {
        padding: 1rem;
        font-size: 0.85rem;
    }

    .crt-overlay {
        opacity: 0.4;
    }
}

/* --- Reduced Motion Support --- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .crt-overlay {
        animation: none;
    }

    .glitch::before,
    .glitch::after {
        display: none;
    }
}

/* --- CRITICAL FIXES FOR INTERACTION --- */

/* 1. Lift the whole email form above the previous stage and footer */
#verification-form {
    position: relative;
    z-index: 50 !important;
    /* Forces form above Footer (z-20) */
}

/* 2. Fix the Button Unclickable Issue */
#submit-btn {
    position: relative;
    z-index: 51 !important;
    /* Forces button above Input Wrapper (z-20) */
}

/* 3. Ensure Email Input is the absolute top layer */
/* Note: We target the specific ID to be safe */
#subject-id {
    position: relative;
    z-index: 52 !important;
    /* Topmost element */
    pointer-events: auto !important;
    /* Force clickability */
}

/* 4. Safety check for the footer */
footer {
    z-index: 10 !important;
    /* Lower the footer so it doesn't fight the form */
    pointer-events: none;
    /* Ensure clicks pass through the footer container */
}

/* Restore clicks only for the footer buttons/text */
.footer-left,
.footer-right,
.footer-center {
    pointer-events: auto;
}

/* --- Sandbox / God Mode (Verified State) --- */
.auth-mode label {
    color: var(--neon-cyan) !important;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
}

.auth-mode .input-wrapper {
    border-bottom-color: var(--neon-cyan) !important;
}

.auth-mode .input-wrapper:focus-within {
    box-shadow: 0 5px 20px -10px rgba(0, 255, 255, 0.4);
}

.auth-mode .input-wrapper::after {
    background: var(--neon-cyan) !important;
    box-shadow: 0 0 10px var(--neon-cyan) !important;
}

.auth-mode .prompt-char {
    color: var(--neon-cyan) !important;
}

.auth-mode input {
    color: #fff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.auth-mode .terminal-action:hover {
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

/* 5. Ensure Success Message is clickable */
#success-message {
    position: relative;
    z-index: 50 !important;
    /* Matches the form's elevation */
    pointer-events: auto !important;
}

/* 6. Ensure Continue Button is clickable */
#continue-btn {
    position: relative;
    z-index: 51 !important;
    /* Sits on top of the message container */
    pointer-events: auto !important;
    /* Ensure the base state has the right text color */
    color: var(--accent-color);
    border-color: var(--accent-color);
}

#continue-btn:hover {
    background-color: var(--accent-color);
    /* CRITICAL FIX: Turn text black on hover */
    color: #000 !important;
    box-shadow: 0 0 20px var(--accent-glow);
}