* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #c8c8c8;
    overflow: hidden;
}

/* —— Level 1: eyes background, darkened —— */
.stage--one {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: #050505;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.72)),
        url('StayAwayFromTheDark.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* —— Level 3: hills background, darkened —— */
.stage--three {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: #0a0a0a;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)),
        url('hills.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* —— Level 4: missing poster — timestamp hidden in image —— */
.stage--four {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: #111;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
        url('missing.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* —— Level 5: retro terminal —— */
.stage--five {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background: #000000;
    color: #ffffff;
    font-family: 'Consolas', 'Courier New', monospace;
    position: relative;
    overflow: hidden;
}

.terminal {
    width: 100vw;
    height: 100vh;
    border: none;
    background: #000000;
    box-shadow: none;
    padding: 18px 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    opacity: 1;
    transition: opacity 1s ease;
}

.terminal.is-fading {
    opacity: 0;
}

.terminal::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.03),
            rgba(255, 255, 255, 0.03) 1px,
            rgba(0, 0, 0, 0) 2px,
            rgba(0, 0, 0, 0) 4px
        );
    opacity: 0.18;
    pointer-events: none;
}

.terminal-output {
    flex: 1;
    overflow: auto;
    word-break: break-word;
    padding-right: 6px;
    font-size: 15px;
    line-height: 1.4;
}

.terminal-line {
    white-space: pre-wrap;
}

.terminal-line--success {
    color: #53ff53;
    text-shadow: 0 0 8px rgba(83, 255, 83, 0.35);
}

.terminal-line--error {
    color: #ff6b6b;
}

.terminal-inputRow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 1.35;
}

.terminal-prompt {
    color: rgba(255, 255, 255, 0.9);
    user-select: none;
}

.terminal-input {
    flex: 1;
    background: transparent;
    color: #ffffff;
    border: none;
    outline: none;
    font: inherit;
    caret-color: #ffffff;
}

.stage5-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000000;
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
    z-index: 5;
}

.stage5-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.final-reveal-message {
    color: #ffffff;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: clamp(22px, 4vw, 46px);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 18px;
}

.continue-btn {
    margin-top: 8px;
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.65);
    padding: 8px 22px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    cursor: pointer;
}

.continue-btn:hover,
.continue-btn:focus-visible {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.end-title {
    color: #ffffff;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: clamp(40px, 8vw, 100px);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.end-credits {
    max-width: 760px;
    padding: 0 22px;
    color: rgba(255, 255, 255, 0.82);
    text-align: center;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: clamp(14px, 2vw, 20px);
    line-height: 1.55;
}

.terminal-output::-webkit-scrollbar {
    width: 10px;
}
.terminal-output::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
}

.checkpoint--missing {
    background: rgba(0, 0, 0, 0.62);
}

.title--video {
    letter-spacing: 0.2em;
    text-indent: 0;
    animation: none;
}

.video-copy {
    color: #ffffff;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-indent: 0;
    word-break: break-all;
    user-select: all;
    cursor: text;
}

/* —— Level 2: solid dark base; hue shifts via JS on .stage--two —— */
.stage--two {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: #0a0a0a;
    transition: background-color 1.4s ease;
}

.stage[hidden] {
    display: none !important;
}

/* Wifies-style checkpoint card with your own touches */
.checkpoint {
    text-align: center;
    width: min(92vw, 440px);
    padding: 2.25rem 2rem 2.5rem;
    background: rgba(8, 8, 8, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 4px;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.5),
        0 24px 48px rgba(0, 0, 0, 0.45);
    animation: fadeUp 0.6s ease-out;
}

.checkpoint--bare {
    background: rgba(6, 6, 6, 0.55);
    border-color: rgba(255, 255, 255, 0.05);
}

.checkpoint-label {
    font-size: 0.65rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: #5a5a5a;
    margin-bottom: 1.75rem;
}

.title {
    font-size: 1.35rem;
    font-weight: 400;
    letter-spacing: 0.45em;
    text-indent: 0.45em;
    color: #d4d4d4;
    margin-bottom: 1rem;
    text-shadow: 0 0 24px rgba(255, 255, 255, 0.12);
    animation: flicker 0.12s infinite;
}

.clue {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    color: #6a6a6a;
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

.code-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid #3a3a3a;
    border-radius: 2px;
    color: #b8b8b8;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-align: center;
    outline: none;
    font-family: 'Consolas', 'Courier New', monospace;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.code-input::placeholder {
    color: #454545;
    letter-spacing: 0.2em;
    text-transform: lowercase;
}

.code-input:focus {
    border-color: #6a6a6a;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
    color: #e0e0e0;
}

/* Hidden bottom-right trigger for code.wav on level 2 */
.audio-hotspot {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 72px;
    height: 72px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    opacity: 0;
}

.audio-hotspot:focus-visible {
    opacity: 0.15;
    outline: 1px dashed #444;
    outline-offset: -8px;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.94; }
}
