* { box-sizing: border-box; margin: 0; padding: 0; }
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.8rem; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 6px; color: #fff; }
.tagline { color: #888; font-size: 0.95rem; margin-bottom: 24px; letter-spacing: 0.05em; }

/* Settings */
.settings-card { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 14px; padding: 18px 28px; width: 100%; max-width: 420px; margin-bottom: 28px; text-align: center; }
.settings-label { font-size: 0.88rem; color: #aaa; margin-bottom: 14px; }
.settings-label strong { color: #fff; font-size: 1.1rem; }
input[type=range] { -webkit-appearance: none; width: 100%; height: 4px; background: #333; border-radius: 99px; outline: none; margin-bottom: 8px; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #7c3aed; cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; font-size: 0.72rem; color: #555; }

/* Tabs */
.tabs { display: flex; gap: 5px; margin-bottom: 32px; 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: #7c3aed; color: #fff; }
.tab:hover:not(.active) { color: #ccc; background: #252525; }

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

/* Digit grid */
.digit-grid-wrap { background: #111; border: 1px solid #1e1e1e; border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; max-height: 200px; overflow-y: auto; width: 100%; max-width: 420px; }
.digit-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.dg { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; border-radius: 4px; }
.dg.future  { background: #1a1a1a; border: 1px solid #222; color: #2e2e2e; }
.dg.done    { background: #1a0a2e; border: 1px solid #4c1d95; color: #a78bfa; }
.dg.current { background: #7c3aed; border: 1px solid #8b5cf6; color: #fff; }
.dg.shown   { background: #1a1a1a; border: 1px solid #2a2a2a; color: #666; }
.dg.blank   { background: #111; border: 2px dashed #3a3a3a; color: transparent; cursor: text; }
.dg.blank input { background: transparent; border: none; color: #fff; font-family: inherit; font-size: 0.78rem; font-weight: 700; text-align: center; width: 100%; height: 100%; outline: none; padding: 0; caret-color: #7c3aed; }
.dg.gok  { background: #1a0a2e; border: 2px solid #7c3aed; color: #a78bfa; }
.dg.gbad { background: #1a0808; border: 2px solid #ef4444; animation: shake 0.28s; }

/* Progress */
.progress-bar-wrap { width: 100%; max-width: 420px; height: 5px; background: #1e1e1e; border-radius: 99px; margin-bottom: 8px; overflow: hidden; }
.progress-bar { height: 100%; background: #7c3aed; border-radius: 99px; transition: width 0.3s; }
.counter { font-size: 0.8rem; color: #555; margin-bottom: 16px; text-align: center; }

/* Card */
.card { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 16px; padding: 28px 32px; text-align: center; width: 100%; max-width: 420px; margin-bottom: 20px; }
.card-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: #555; margin-bottom: 14px; }

/* Context row */
.ctx-row { display: flex; gap: 4px; justify-content: center; align-items: center; flex-wrap: wrap; margin-bottom: 18px; min-height: 34px; }
.ctx-d { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; border-radius: 4px; background: #12082a; border: 1px solid #2e1a5e; color: #a78bfa; }
.ctx-dot { color: #444; font-size: 1.1rem; line-height: 1; padding: 0 1px; }
.ctx-pi-label { font-size: 0.82rem; color: #444; margin-right: 4px; }

/* Input */
.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: 72px; height: 64px; outline: none; transition: border-color 0.15s, background 0.15s; }
.qi:focus { border-color: #7c3aed; }
.qi.ok  { border-color: #7c3aed; background: #12082a; }
.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.88rem; margin-top: 10px; font-weight: 600; }
.fb.ok  { color: #a78bfa; }
.fb.bad { color: #ef4444; }

/* Timer */
.timer-big { font-size: 2.8rem; 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; margin-bottom: 16px; }
.pb-line { font-size: 0.82rem; color: #777; margin-top: 10px; }
.pb-line strong { color: #facc15; }

/* Done screen */
.done-screen { text-align: center; padding: 8px 0 20px; width: 100%; max-width: 420px; }
.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: #a78bfa; font-weight: 700; }

/* Buttons */
.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: #7c3aed; color: #fff; }
.btn-primary:hover { background: #6d28d9; }
.btn-ghost { background: #1e1e1e; color: #aaa; border: 1px solid #333; }
.btn-ghost:hover { background: #2a2a2a; color: #fff; }

/* Speed tape */
.speed-tape { display: flex; gap: 4px; justify-content: center; margin-bottom: 14px; flex-wrap: nowrap; overflow: hidden; max-width: 420px; }
.tape-d { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; border-radius: 4px; flex-shrink: 0; }
.tape-d.past    { background: #12082a; border: 1px solid #2e1a5e; color: #a78bfa; }
.tape-d.current { background: #7c3aed; border: 1px solid #8b5cf6; color: #fff; }
.tape-d.ahead   { background: #1a1a1a; border: 1px solid #222; color: #333; }

/* Gaps status */
.gaps-status { font-size: 0.82rem; color: #777; margin-bottom: 12px; text-align: center; }
.gaps-status strong { color: #e0e0e0; }

/* Burst */
.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; }
