:root {
    --bg: #0b1210;
    --panel: #0f1a16;
    --line: #1e3a30;
    --text: #c9e8d8;
    --muted: #6f8f80;
    --accent: #3ddc84;
    --danger: #ff5f56;
    --font: "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    background:
        radial-gradient(ellipse at 50% -10%, rgba(61, 220, 132, 0.12), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    display: flex;
    justify-content: center;
}

.screen {
    width: 100%;
    max-width: 860px;
    padding: 40px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.prompt { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.prompt__path { color: var(--accent); }

.title {
    margin: 0 0 20px;
    font-size: clamp(28px, 6vw, 52px);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.title__accent { color: var(--accent); }

.cursor {
    display: inline-block;
    width: 0.55em;
    height: 0.95em;
    margin-left: 6px;
    vertical-align: -0.1em;
    background: var(--accent);
    animation: blink 1.1s steps(1) infinite;
}

.tagline { margin: 0 0 20px; color: var(--muted); font-size: 14px; letter-spacing: 0.04em; }

.progress {
    position: relative;
    height: 22px;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 4px;
    overflow: hidden;
}
.progress__bar {
    height: 100%;
    width: 0;
    background: repeating-linear-gradient(135deg, var(--accent) 0 10px, #2fb56c 10px 20px);
    animation: fill 2.4s cubic-bezier(.2, .7, .2, 1) forwards;
}
.progress__label {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 12px;
    color: #04130b;
    mix-blend-mode: normal;
    font-weight: 700;
}

.arcade__canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 10 / 3;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    touch-action: manipulation;
    outline: none;
    cursor: pointer;
}
.arcade__canvas:focus-visible { border-color: var(--accent); }
.arcade__hint { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: 13px; }

kbd {
    padding: 1px 6px;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: var(--panel);
    font: inherit;
    color: var(--text);
}

.stack__groups { margin: 12px 0 0; display: grid; gap: 10px; }
.stack__group { display: grid; grid-template-columns: 88px 1fr; gap: 12px; align-items: baseline; }
.stack__group dt { color: var(--accent); font-size: 14px; }
.stack__group dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.stack__group span {
    padding: 2px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    font-size: 13px;
    transition: border-color 0.15s, color 0.15s;
}
.stack__group span:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 520px) {
    .stack__group { grid-template-columns: 1fr; gap: 4px; }
}

.notify {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    padding: 16px;
    animation: rise 0.35s ease-out;
}
.notify[hidden], .secret[hidden] { display: none; }
.notify__line { margin: 0 0 12px; color: var(--accent); }
.notify__form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notify__sign { color: var(--muted); }
.notify__input {
    flex: 1 1 200px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}
.notify__input:focus { outline: none; border-color: var(--accent); }
.notify__button {
    padding: 10px 16px;
    border: 1px solid var(--accent);
    border-radius: 4px;
    background: transparent;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
}
.notify__button:hover:not(:disabled) { background: var(--accent); color: #04130b; }
.notify__button:disabled { opacity: 0.5; cursor: default; }
.notify__status { min-height: 1.5em; margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.notify__status--ok { color: var(--accent); }
.notify__status--error { color: var(--danger); }

.secret { margin: 0; color: var(--muted); animation: rise 0.35s ease-out; }

.screen__footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}
.screen__link { color: var(--muted); text-decoration: none; }
.screen__link:hover { color: var(--accent); }
.screen__link--button { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@keyframes blink { 50% { opacity: 0; } }
@keyframes fill { to { width: 73%; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .cursor, .progress__bar, .notify, .secret { animation: none; }
    .progress__bar { width: 73%; }
}
