* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: 'Courier New', Courier, monospace; background: #0f0f0f; color: #e0e0e0; min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 40px 16px 60px; }
h1 { font-size: 2.4rem; font-weight: 700; letter-spacing: 0.12em; margin-bottom: 6px; color: #fff; text-align: center; }
.tagline { color: #888; font-size: 0.95rem; margin-bottom: 24px; letter-spacing: 0.05em; text-align: center; }

/* Settings */
.settings-card { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 14px; padding: 18px 20px; width: 100%; max-width: 460px; margin-bottom: 28px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.settings-label { font-size: 0.78rem; color: #777; text-transform: uppercase; letter-spacing: 0.1em; }
.seg-picker { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.seg-btn { padding: 7px 14px; border-radius: 8px; border: 2px solid #333; background: #1a1a1a; color: #aaa; cursor: pointer; font-family: inherit; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.seg-btn:hover { border-color: #ea580c; color: #fff; background: #2a1405; }
.seg-btn.active { border-color: #ea580c; color: #fff; background: #ea580c; }

/* How it works */
.howto { border-top: 1px solid #262626; padding-top: 12px; font-size: 0.82rem; line-height: 1.6; color: #aaa; }
.howto summary { cursor: pointer; color: #fdba74; font-weight: 700; letter-spacing: 0.04em; }
.howto summary:hover { color: #fff; }
.howto p { margin: 10px 0 6px; }
.howto b { color: #e0e0e0; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.chip { background: #111; border: 1px solid #262626; border-radius: 6px; padding: 4px 6px; text-align: center; font-size: 0.78rem; }
.chip b { color: #fdba74; }
.howto .ex { background: #111; border-left: 3px solid #ea580c; padding: 8px 10px; border-radius: 4px; color: #999; }

/* Tabs */
.tabs { display: flex; gap: 5px; margin-bottom: 28px; background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 12px; padding: 5px; flex-wrap: wrap; justify-content: center; }
.tab { padding: 8px 16px; border-radius: 8px; border: none; background: none; color: #666; cursor: pointer; font-family: inherit; font-size: 0.85rem; font-weight: 600; transition: background 0.15s, color 0.15s; white-space: nowrap; }
.tab.active { background: #ea580c; color: #fff; }
.tab:hover:not(.active) { color: #ccc; background: #252525; }

.mode { display: flex; flex-direction: column; align-items: center; width: 100%; }

/* Card */
.card { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 16px; padding: 26px 22px; text-align: center; width: 100%; max-width: 460px; margin-bottom: 20px; }
.card-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: #555; margin-bottom: 12px; }
.date-big { font-size: clamp(1.35rem, 6vw, 1.9rem); font-weight: 700; color: #fff; margin-bottom: 14px; }
.q-text { font-size: 0.95rem; color: #bbb; margin-bottom: 14px; min-height: 1.4em; }
.q-text strong { color: #fdba74; }
.q-sub { font-size: 0.75rem; color: #666; margin: -8px 0 14px; }

/* Worked steps */
.work { list-style: none; text-align: left; margin: 0 auto 16px; max-width: 400px; }
.work:empty { display: none; }
.work li { display: flex; gap: 10px; font-size: 0.8rem; padding: 5px 8px; border-radius: 6px; background: #141414; margin-bottom: 4px; color: #ccc; }
.work li.miss { background: #1a0d0d; }
.wk-k { color: #fdba74; font-weight: 700; min-width: 64px; }
.work li.miss .wk-k { color: #f87171; }

/* Answer buttons */
.choices { display: grid; gap: 5px; margin: 0 auto; }
.ch { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 6px 2px; border-radius: 8px; border: 2px solid #333; background: #111; color: #e0e0e0; cursor: pointer; font-family: inherit; transition: border-color 0.15s, background 0.15s; }
.ch:hover { border-color: #ea580c; }
.ch-l { font-size: 0.9rem; font-weight: 700; }
.ch-s { font-size: 0.66rem; color: #666; }
.ch.ok  { border-color: #ea580c; background: #2a1405; color: #fdba74; }
.ch.bad { border-color: #ef4444; background: #1a0808; animation: shake 0.28s; }

.numwrap { display: flex; gap: 8px; justify-content: center; align-items: center; }
.qi { background: #111; border: 2px solid #333; border-radius: 8px; color: #fff; font-family: inherit; font-size: 2rem; font-weight: 700; text-align: center; width: 96px; height: 60px; outline: none; transition: border-color 0.15s, background 0.15s; }
.qi:focus { border-color: #ea580c; }
.qi.ok  { border-color: #ea580c; background: #2a1405; }
.qi.bad { border-color: #ef4444; background: #1a0808; animation: shake 0.28s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 30%{transform:translateX(-6px)} 70%{transform:translateX(6px)} }
.fb { min-height: 22px; font-size: 0.85rem; margin-top: 12px; font-weight: 600; line-height: 1.5; }
.fb.ok  { color: #fdba74; }
.fb.bad { color: #ef4444; }

.counter { font-size: 0.8rem; color: #666; margin-top: 14px; }
.counter strong { color: #e0e0e0; }

/* Timer / done */
.timer-big { font-size: 2rem; font-weight: 700; color: #fff; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.timer-label { font-size: 0.72rem; color: #555; text-transform: uppercase; letter-spacing: 0.1em; }
.pb-line { font-size: 0.82rem; color: #777; margin-top: 10px; }
.pb-line strong { color: #facc15; }
.done-screen { text-align: center; padding: 8px 0 20px; width: 100%; max-width: 460px; }
.done-screen h2 { font-size: 1.9rem; margin-bottom: 10px; }
.done-stat { font-size: 0.88rem; color: #888; margin-bottom: 3px; }
.done-stat strong { color: #e0e0e0; }
.new-pb { color: #fdba74; font-weight: 700; }
.burst-score-big { font-size: 3.6rem; font-weight: 700; color: #fff; line-height: 1; margin-bottom: 6px; }
.burst-sub { font-size: 0.8rem; color: #555; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 18px; }
.misses { list-style: none; text-align: left; margin: 16px auto 18px; max-width: 420px; }
.misses li { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; font-size: 0.8rem; color: #ccc; }
.misses li span { color: #888; font-size: 0.74rem; }

.btn { display: inline-block; padding: 9px 20px; border-radius: 8px; border: none; cursor: pointer; font-family: inherit; font-size: 0.88rem; font-weight: 600; letter-spacing: 0.04em; transition: background 0.15s; margin: 4px; }
.btn-primary { background: #ea580c; color: #fff; }
.btn-primary:hover { background: #c2410c; }
.num-ok { margin: 0; }
