:root {
    --phosphor: #39ff7a;
    --phosphor-dim: #1f8f45;
    --amber: #ffb000;
    --red: #ff4d5e;
    --bg: #030805;
}
* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--phosphor);
    font-family: ui-monospace, "SFMono-Regular", "DejaVu Sans Mono", Menlo, Consolas, monospace;
    overflow: hidden;
}
body {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: flicker 6s infinite steps(1);
}
.rain {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.18;
}
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0 1px, transparent 1px 3px);
    z-index: 5;
}
.scanlines::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 18vh;
    background: linear-gradient(to bottom, transparent, rgba(57, 255, 122, 0.06), transparent);
    animation: sweep 7s linear infinite;
}
.vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.85) 100%);
    z-index: 6;
}
.screen {
    position: relative;
    z-index: 2;
    width: min(760px, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    overflow: hidden;
    padding: 1.25rem 1.5rem 1.5rem;
    border: 1px solid rgba(57, 255, 122, 0.35);
    border-radius: 14px;
    background: rgba(2, 14, 6, 0.82);
    box-shadow: 0 0 40px rgba(57, 255, 122, 0.15), inset 0 0 60px rgba(57, 255, 122, 0.06);
    text-shadow: 0 0 6px rgba(57, 255, 122, 0.7);
    animation: power-on 0.9s ease-out both;
}
.titlebar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    color: var(--phosphor-dim);
}
.dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    border: 1px solid var(--phosphor-dim);
}
.title {
    margin-left: auto;
    letter-spacing: 0.1em;
}
.log {
    font-size: clamp(0.72rem, 2.4vw, 0.95rem);
    line-height: 1.55;
}
.line {
    margin: 0;
    display: flex;
    gap: 0.5ch;
    white-space: nowrap;
}
.prompt {
    color: var(--phosphor-dim);
}
.dots {
    flex: 1;
    min-width: 2ch;
    overflow: hidden;
    color: var(--phosphor-dim);
}
.dots::before {
    content: "........................................................................";
}
.value {
    color: var(--amber);
    text-shadow: 0 0 6px rgba(255, 176, 0, 0.6);
}
.state-ok {
    color: var(--phosphor);
}
.state-fail {
    color: var(--red);
    text-shadow: 0 0 8px rgba(255, 77, 94, 0.8);
}
.bar {
    flex: 1;
    height: 0.8em;
    margin-top: 0.35em;
    border: 1px solid var(--phosphor-dim);
    position: relative;
}
.fill {
    position: absolute;
    inset: 1px auto 1px 1px;
    width: 0;
    background: repeating-linear-gradient(90deg, var(--phosphor) 0 6px, transparent 6px 8px);
    box-shadow: 0 0 8px var(--phosphor);
}
.glitch {
    position: relative;
    margin: 1.6rem 0 0.4rem;
    font-size: clamp(1.4rem, 6.5vw, 3rem);
    letter-spacing: 0.08em;
    line-height: 1.1;
}
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.glitch::before {
    color: var(--red);
    animation: glitch-a 2.6s infinite linear alternate-reverse;
    opacity: 0.8;
}
.glitch::after {
    color: #4de1ff;
    animation: glitch-b 3.1s infinite linear alternate-reverse;
    opacity: 0.8;
}
.status-line {
    margin: 0;
    color: var(--phosphor-dim);
    font-size: 0.9rem;
}
.cursor {
    animation: blink 1s steps(1) infinite;
}
.ticker {
    margin: 1rem 0 0;
    height: 4.6em;
    overflow: hidden;
    font: inherit;
    font-size: 0.7rem;
    line-height: 1.15;
    color: var(--phosphor-dim);
    text-shadow: none;
    mask-image: linear-gradient(to bottom, transparent, #000 60%);
}
.js .line,
.js .glitch,
.js .status-line {
    visibility: hidden;
}
.js .line.shown,
.js .glitch.shown,
.js .status-line.shown {
    visibility: visible;
}
.glitch.shown {
    animation: jitter 4s infinite;
}
.aux {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
@keyframes power-on {
    0% {
        transform: scaleY(0.01) scaleX(0.6);
        filter: brightness(4);
        opacity: 0;
    }
    40% {
        transform: scaleY(0.02) scaleX(1);
        opacity: 1;
    }
    100% {
        transform: none;
        filter: none;
    }
}
@keyframes flicker {
    0%,
    100% {
        opacity: 1;
    }
    47% {
        opacity: 0.94;
    }
    48% {
        opacity: 1;
    }
    83% {
        opacity: 0.97;
    }
}
@keyframes sweep {
    from {
        top: -20vh;
    }
    to {
        top: 110vh;
    }
}
@keyframes blink {
    50% {
        opacity: 0;
    }
}
@keyframes glitch-a {
    0% { clip-path: inset(10% 0 80% 0); transform: translate(-2px, 0); }
    20% { clip-path: inset(60% 0 5% 0); transform: translate(2px, 0); }
    40% { clip-path: inset(30% 0 50% 0); transform: translate(-3px, 1px); }
    60% { clip-path: inset(85% 0 2% 0); transform: translate(1px, 0); }
    80% { clip-path: inset(5% 0 70% 0); transform: translate(-1px, -1px); }
    100% { clip-path: inset(45% 0 35% 0); transform: translate(3px, 0); }
}
@keyframes glitch-b {
    0% { clip-path: inset(70% 0 10% 0); transform: translate(2px, 0); }
    25% { clip-path: inset(15% 0 65% 0); transform: translate(-2px, 1px); }
    50% { clip-path: inset(40% 0 40% 0); transform: translate(3px, 0); }
    75% { clip-path: inset(0 0 85% 0); transform: translate(-1px, 0); }
    100% { clip-path: inset(55% 0 25% 0); transform: translate(-3px, -1px); }
}
@keyframes jitter {
    0%, 92%, 100% { transform: none; }
    93% { transform: translate(-2px, 1px) skewX(-6deg); }
    95% { transform: translate(3px, -1px) skewX(4deg); }
    97% { transform: translate(-1px, 0); }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
    }
    .rain,
    .scanlines::after {
        display: none;
    }
}
@media (max-width: 480px) {
    .screen {
        padding: 1rem;
    }
    .value {
        display: none;
    }
}
.js .line .dots {
    max-width: 0;
    transition: max-width 0.35s steps(12);
}
.js .line.done .dots {
    max-width: 100%;
}
.js .line .value,
.js .line .state {
    opacity: 0;
}
.js .line.done .value,
.js .line.done .state {
    opacity: 1;
}
.burst .screen {
    transform: translateX(-3px) skewX(-2deg);
    filter: hue-rotate(40deg) contrast(1.4);
}
.burst .rain {
    opacity: 0.35;
}
