:root {
  --bench: #C9C5BC;
  --pop: #F4C430;
  --shell: #F3F1EC;
  --shell-2: #E6E3DC;
  --line: #CFCBC2;
  --ink: #1B1A18;
  --soft: #77736A;
  --screen: #111110;
  --lit: #F0EDE5;
  --orange: #FF4B14;
  --orange-lo: #C93406;
  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45;
  background: radial-gradient(ellipse 1200px 760px at 50% 26%, color-mix(in srgb, var(--pop) 78%, #fff) 0, var(--pop) 62%, color-mix(in srgb, var(--pop) 86%, #000) 100%) no-repeat, var(--pop);
  transition: background-color .4s;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.tiny { font: 500 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; }

.bench { width: min(980px, 100%); margin: 0 auto; padding: 44px 20px 60px; }

/* ---------- the recorder ---------- */
.unit {
  background: linear-gradient(180deg, #FAF9F6 0, var(--shell) 40%, #ECE9E3 100%); border-radius: 34px; padding: 22px 28px 40px;
  box-shadow: inset 0 1.5px 0 #fff, inset 0 -3px 0 #D6D2C9, 0 1px 0 #A9A59B, 0 60px 70px -30px rgba(40, 34, 22, .55), 0 18px 28px -10px rgba(40, 34, 22, .3);
}
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 4px 18px; }
.word { font-size: 27px; font-weight: 700; letter-spacing: -0.045em; line-height: 1; }
.word i { display: inline-block; width: 9px; height: 9px; margin-left: 3px; border-radius: 50%; background: var(--orange); }
.top-right { display: flex; align-items: center; gap: 8px; }
.tries { display: flex; gap: 6px; margin-right: 10px; }
.tries i { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #B9B5AB; }
.tries i.used { background: var(--ink); box-shadow: none; }
.tries i.win { background: var(--orange); box-shadow: none; }
.pill { height: 32px; padding: 0 14px; border-radius: 16px; font-size: 13.5px; font-weight: 600; background: var(--shell-2); box-shadow: inset 0 0 0 1px var(--line); }
.pill:hover { background: #DDD9D1; }

.body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 20px; }
.well { position: relative; border-radius: 22px; background: radial-gradient(circle, rgba(60, 52, 36, .16) 1.3px, transparent 1.6px) 0 0 / 11px 11px, linear-gradient(180deg, #DEDAD2, #E9E6DF); box-shadow: inset 0 3px 8px rgba(60, 52, 36, .28), inset 0 0 0 1px #C4C0B6, 0 1.5px 0 #fff; display: grid; place-items: center; padding: 10px 8px; }
#deck { display: block; width: 100%; height: auto; }
.reel { transform-box: fill-box; transform-origin: center; }
.unit.playing .reel { animation: spin 1.7s linear infinite; }
.unit.playing .reel.take { animation-duration: 2.4s; }
@keyframes spin { to { transform: rotate(360deg); } }
.unit.playing #recdot { animation: blink .8s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- the display ---------- */
.screen { border-radius: 22px; background: var(--screen); color: var(--lit); padding: 20px 22px 16px; font-family: var(--mono);
  box-shadow: inset 0 0 0 1px #000, inset 0 0 40px rgba(255, 255, 255, .035), 0 1.5px 0 #fff; display: flex; flex-direction: column; }
.screen-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.screen .tiny { color: #8C887F; }
.title { margin-top: 5px; font: 700 30px/1.05 var(--sans); letter-spacing: -0.03em; color: var(--lit); }
.title.known { color: var(--orange); }
.title.reveal { animation: reveal .7s ease both; }
@keyframes reveal { from { opacity: 0; filter: blur(8px); letter-spacing: .2em; } }
.time { text-align: right; white-space: nowrap; }
.time b { display: block; font-size: 30px; font-weight: 500; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.time span { font-size: 11px; color: #8C887F; letter-spacing: .06em; }
.scope-box { position: relative; height: 46px; margin: 12px 0; }
.scope { position: absolute; inset: 0; width: 100%; height: 100%; }
.screen { min-width: 0; }
.screen.nope { animation: shake .3s; }
.level { display: grid; grid-template-columns: repeat(32, 1fr); gap: 3px; height: 9px; margin: 16px 0 18px; }
.level i { border-radius: 1.5px; background: #2A2927; }
.level i.on { background: var(--lit); }
.level i.on.hot { background: var(--orange); }
.band { display: grid; grid-template-columns: 1fr; gap: 5px; padding: 4px 0; }
.ask { font: 600 12.5px var(--sans); color: #A8A49B; letter-spacing: -0.01em; }
.band .tiny { color: #8C887F; }
.cells { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; }
.cell { position: relative; height: 34px; border-radius: 8px; display: grid; place-items: center; text-align: center; font: 600 12px/1 var(--sans); letter-spacing: -0.01em;
  color: #111110; background: var(--lit); transition: color .3s, background .3s, opacity .3s; }
/* ruled out: emptied, dimmed and struck through with a diagonal */
.cell.off { color: #5E5A53; background: transparent; box-shadow: inset 0 0 0 1px #2B2926;
  background-image: linear-gradient(to top right, transparent calc(50% - .6px), #3A3733 calc(50% - .6px), #3A3733 calc(50% + .6px), transparent calc(50% + .6px)); }
.cell.yes { background: var(--orange); color: #160600; font-weight: 700; }
.cell.yes::after { content: "✓"; position: absolute; right: 5px; top: 3px; font-size: 9px; }
.cell { white-space: nowrap; height: 32px; }
.cell.flick { animation: flick .4s steps(4); }
@keyframes flick { 25% { opacity: .15; } 50% { opacity: 1; } 75% { opacity: .3; } }
.screen-note { margin: auto 0 0; padding-top: 12px; font-size: 11.5px; color: #8C887F; }

/* ---------- controls ---------- */
.controls { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.round { position: relative; flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: var(--ink);
  background: linear-gradient(#FFFFFF, #E9E6DF); box-shadow: 0 4px 0 #BDB9AF, 0 10px 14px -4px rgba(40, 34, 22, .35), inset 0 0 0 1px #D2CEC5; transition: transform .06s, box-shadow .06s; }
.round.play { color: #fff; background: linear-gradient(#FF6A38, var(--orange)); box-shadow: 0 4px 0 var(--orange-lo), 0 10px 14px -4px rgba(180, 50, 0, .5); }
.round:active { transform: translateY(3px); box-shadow: 0 1px 0 #BDB9AF, 0 4px 8px -3px rgba(40, 34, 22, .35), inset 0 0 0 1px #D2CEC5; }
.round.play:active, .unit.playing #play { transform: translateY(3px); box-shadow: 0 1px 0 var(--orange-lo), 0 4px 8px -3px rgba(180, 50, 0, .5); }
.under { position: absolute; left: 50%; top: calc(100% + 9px); transform: translateX(-50%); white-space: nowrap; font: 500 10.5px var(--mono); letter-spacing: .04em; color: var(--soft); pointer-events: none; }
.entry { flex: 1; min-width: 0; display: flex; gap: 10px; margin-left: 8px; }
.field { position: relative; flex: 1; min-width: 0; }
.field input { width: 100%; height: 64px; padding: 0 22px; border-radius: 32px; border: 0; outline: none; font-size: 18px; font-weight: 500; color: var(--ink);
  background: #fff; box-shadow: inset 0 2px 5px rgba(60, 52, 36, .22), inset 0 0 0 1px #C4C0B6; }
.field input::placeholder { color: #A29E94; font-weight: 500; }
.field input:focus { box-shadow: inset 0 2px 5px rgba(60, 52, 36, .22), inset 0 0 0 2px var(--ink); }
.btn { height: 64px; padding: 0 30px; border-radius: 32px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: #fff; background: var(--ink); white-space: nowrap;
  box-shadow: 0 4px 0 #000, 0 10px 14px -4px rgba(0, 0, 0, .4); transition: transform .06s, box-shadow .06s, background .15s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.btn:disabled { background: #B9B5AB; color: #EDEAE4; box-shadow: 0 4px 0 #A29E94; cursor: not-allowed; }
.btn.light { color: var(--ink); background: linear-gradient(#FFFFFF, #E9E6DF); box-shadow: 0 4px 0 #BDB9AF, inset 0 0 0 1px #D2CEC5; }
.options { position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); z-index: 6; list-style: none; margin: 0; padding: 8px; max-height: 300px; overflow: auto;
  background: #fff; border-radius: 22px; box-shadow: 0 24px 50px -10px rgba(40, 34, 22, .5), 0 0 0 1px #C4C0B6; }
.options li { padding: 11px 16px; border-radius: 14px; cursor: pointer; font-size: 17px; font-weight: 500; }
.options li.on, .options li:hover { background: var(--ink); color: #fff; }
.options li.none { color: var(--soft); cursor: default; background: none; font-size: 15px; }
.after { flex: 1; display: flex; align-items: center; gap: 10px; margin-left: 8px; flex-wrap: wrap; }
.next { margin-left: auto; font: 500 13px var(--mono); color: var(--soft); font-variant-numeric: tabular-nums; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

/* ---------- under the recorder ---------- */
.clue, .fact { margin: 26px auto 0; max-width: 640px; text-align: center; font-size: 18px; font-weight: 500; background: #FBFAF7; border-radius: 20px; padding: 18px 24px; box-shadow: 0 2px 0 rgba(0,0,0,.18), 0 14px 22px -12px rgba(40, 34, 22, .4); }
.fact p { margin: 0; }
.credit { margin-top: 6px !important; font: 400 12px var(--mono); color: var(--soft); }
.credit a, #creditList a { color: inherit; }
.labels { list-style: none; margin: 30px auto 0; padding: 0; max-width: 640px; display: grid; gap: 9px; }
.labels li { display: grid; grid-template-columns: 26px 1fr 150px 46px; align-items: center; gap: 12px; height: 46px; padding: 0 18px 0 14px; border-radius: 8px;
  background: #FBFAF7; box-shadow: 0 1px 0 #fff inset, 0 2px 0 #B5B0A6, 0 8px 14px -8px rgba(40, 34, 22, .35); font-family: var(--mono); }
.labels .n { font-size: 11px; color: #A29E94; }
.labels .g { font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.labels li.skipped { background: rgba(255, 255, 255, .28); box-shadow: inset 0 0 0 1.5px rgba(27, 26, 24, .35); }
.labels li.skipped .g { font-weight: 500; color: rgba(27, 26, 24, .7); }
.labels li.right { background: var(--orange); color: #fff; box-shadow: 0 2px 0 var(--orange-lo), 0 8px 14px -8px rgba(180, 50, 0, .5); }
.labels li.right .n, .labels li.right .p { color: #fff; }
.sig { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; height: 12px; }
.sig i { background: #E1DED6; border-radius: 1px; }
.sig i.on { background: var(--ink); }
.sig.cold i.on { background: #4F6BF2; }
.sig.warm i.on { background: #F0A202; }
.sig.hot i.on { background: var(--orange); }
.labels li.right .sig i { background: rgba(255, 255, 255, .35); }
.labels li.right .sig i.on { background: #fff; }
.labels .p { font-size: 13px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.labels li.fresh { animation: print .4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes print { from { opacity: 0; transform: translateY(-14px) scaleY(.6); } }

footer { text-align: center; }
.textlink { font-size: 13px; font-weight: 600; color: rgba(27, 26, 24, .7); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- sheets ---------- */
dialog { width: min(460px, calc(100vw - 28px)); max-height: 88vh; border: 0; border-radius: 28px; padding: 28px; background: var(--shell); color: var(--ink); box-shadow: 0 40px 90px rgba(30, 24, 12, .6); }
dialog::backdrop { background: rgba(60, 55, 45, .6); backdrop-filter: blur(3px); }
dialog h2 { margin: 0 0 14px; font-size: 30px; font-weight: 700; letter-spacing: -0.04em; }
dialog p { margin: 0 0 12px; }
.steps { margin: 0 0 20px; padding-left: 22px; display: grid; gap: 10px; }
.steps li::marker { font-weight: 700; color: var(--orange); }
dialog form { margin-top: 18px; display: grid; }
dialog ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 22px; }
.statrow b { display: block; font-size: 38px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.statrow span { font: 500 10.5px var(--mono); color: var(--soft); text-transform: uppercase; letter-spacing: .1em; }
.sub { font-weight: 700; margin-bottom: 8px; }
.dist { display: grid; gap: 5px; font: 700 13px var(--mono); }
.dist div { display: flex; align-items: center; gap: 10px; }
.dist i { display: block; height: 24px; min-width: 26px; background: #D6D2C9; border-radius: 6px; font-style: normal; text-align: right; padding: 0 8px; line-height: 24px; }
.dist i.top { background: var(--orange); color: #fff; }
.toast { position: fixed; left: 50%; top: 20px; transform: translateX(-50%); z-index: 30; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; padding: 11px 20px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .bench { padding: 14px 10px 50px; }
  .unit { border-radius: 26px; padding: 16px 14px 20px; }
  .entry, .after { margin-top: 4px; }
  .top { padding-bottom: 14px; }
  .word { font-size: 24px; }
  .pill { padding: 0 11px; font-size: 13px; }
  .tries { display: none; }
  /* on a phone the play button and guess box sit above the hints, so nothing important is below the fold */
  .unit { display: flex; flex-direction: column; }
  .body { display: contents; }
  .top { order: 0; } .well { order: 1; } .controls { order: 2; } .screen { order: 3; margin-top: 16px; }
  .well { padding: 0 54px; }
  .screen { padding: 16px 14px 14px; border-radius: 18px; }
  .title, .time b { font-size: 26px; }
  .band { grid-template-columns: 44px 1fr; gap: 6px; }
  .cells { gap: 3px; }
  .cell { font: 600 11px/1 var(--sans); height: 34px; letter-spacing: -0.02em; border-radius: 6px; }
  .band { grid-template-columns: 1fr !important; gap: 5px !important; padding: 6px 0; }
  .controls { flex-wrap: wrap; gap: 12px; margin-top: 14px; row-gap: 26px; }
  .round { width: 58px; height: 58px; }
  .entry, .after { flex-basis: 100%; margin-left: 0; }
  .field input, .btn { height: 56px; }
  .btn { padding: 0 22px; }
  .options { bottom: auto; top: calc(100% + 8px); }
  .labels li { grid-template-columns: 18px 1fr 84px 40px; gap: 8px; padding: 0 12px 0 10px; }
  .labels .g { font-size: 13px; letter-spacing: .05em; }
  .sig { grid-template-columns: repeat(10, 1fr); }
  .sig i:nth-child(even) { display: none; }
  .next { margin-left: 0; flex-basis: 100%; text-align: center; }
  .after .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .unit.playing .reel, .unit.playing #recdot, .cell.flick, .labels li.fresh, .title.reveal, .shake { animation: none; }
}

.badge { position: absolute; left: 14px; top: 14px; padding: 5px 10px 5px; border-radius: 6px; background: var(--pop); color: var(--ink); font: 700 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; box-shadow: 0 1.5px 0 rgba(0, 0, 0, .25); transform: rotate(-2deg); }
.bit { position: absolute; z-index: 40; width: 10px; height: 14px; border-radius: 2px; pointer-events: none; }
.word { display: flex; align-items: center; }

.word i { align-self: flex-end; margin-bottom: 4px; }
@media (prefers-reduced-motion: reduce) { .screen.nope { animation: none; } }

/* archive */
dialog ul.tapes { list-style: none; padding: 0; gap: 7px; max-height: 46vh; overflow: auto; margin: 0 -6px; padding: 2px 6px 6px; }
.tapes .empty { color: var(--soft); font-size: 15px; }
.tape-row { width: 100%; display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 10px; text-align: left;
  background: #FBFAF7; box-shadow: 0 2px 0 #C4C0B6, inset 0 0 0 1px #DAD6CE; font-family: var(--mono); font-size: 13px; }
.tape-row:hover { background: #fff; }
.tape-row b { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; }
.tape-row .what { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--soft); }
.tape-row .status { font-size: 11.5px; color: var(--soft); }
.tape-row.won { box-shadow: 0 2px 0 var(--orange-lo), inset 0 0 0 1.5px var(--orange); }
.tape-row.won .status { color: var(--orange-lo); font-weight: 700; }
.tape-row.won .what, .tape-row.lost .what { color: var(--ink); font-weight: 700; }
@media (max-width: 760px) { .pill { padding: 0 9px; font-size: 12.5px; } .top-right { gap: 5px; } .word { font-size: 22px; } .word::before { margin-right: 6px; } }

/* six stretches of tape */
.tape-steps { display: flex; gap: 4px; margin: 0 0 12px; }
.step:nth-child(1) { flex: 5 0 0; } .step:nth-child(2) { flex: 6 0 0; } .step:nth-child(3) { flex: 8 0 0; } .step:nth-child(4) { flex: 10 0 0; } .step:nth-child(5) { flex: 13 0 0; } .step:nth-child(6) { flex: 17 0 0; }
.step { height: 20px; border-radius: 5px; display: grid; place-items: center; font-size: 10px; letter-spacing: .02em; color: #55524C; box-shadow: inset 0 0 0 1px #2E2C29; }
.step.open { background: #2E2C29; color: var(--lit); box-shadow: none; }
.step.now { background: var(--lit); color: var(--screen); font-weight: 700; }
.step.win { background: var(--orange); color: #160600; font-weight: 700; }
.scope-box { margin: 10px 0 8px; }
.stats-result { margin: -4px 0 22px; padding-bottom: 20px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.stats-result p { margin: 0; font-weight: 600; }
.stats-result .marks { margin: 0; padding: 14px 16px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font: 500 14px/1.55 var(--sans); white-space: pre-wrap; user-select: all; }

.stats-result .tiny { color: var(--soft); }

.legend { display: flex; gap: 16px; margin: auto 0 0; padding-top: 12px; font: 500 12px var(--sans); color: #A8A49B; }
.legend span { display: flex; align-items: center; gap: 6px; }
.k { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.k.open { background: var(--lit); }
.k.out { box-shadow: inset 0 0 0 1px #4B4843; background-image: linear-gradient(to top right, transparent calc(50% - .6px), #5E5A53 calc(50% - .6px), #5E5A53 calc(50% + .6px), transparent calc(50% + .6px)); }
.k.yes { background: var(--orange); }
/* the plain-words verdict on each guess */
.labels li { height: auto; min-height: 46px; padding-top: 9px; padding-bottom: 9px; row-gap: 7px; }
.says { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.says b { font: 600 11.5px var(--sans); letter-spacing: 0; padding: 3px 8px; border-radius: 999px; background: #ECE9E2; color: #3A3733; }
.says b.ok { background: var(--orange); color: #fff; }
@media (max-width: 760px) { .band { grid-template-columns: 1fr !important; } .ask { font-size: 12.5px; } .cell { font-size: 11px !important; letter-spacing: -0.02em !important; } .legend { gap: 12px; font-size: 11.5px; } }

.crowd { color: var(--orange-lo); font-weight: 700 !important; }
.crowd:empty { display: none; }
/* phones: no double-tap zoom, text never auto-zooms on focus, room for the home bar */
button, input, .tape-row { touch-action: manipulation; }
@media (max-width: 760px) { .field input { font-size: 17px; } .bench { padding-bottom: calc(50px + env(safe-area-inset-bottom)); } }

/* logo */
.word { color: inherit; text-decoration: none; gap: 0; }
.mark { width: 25px; height: 32px; margin-right: 8px; flex: none; transform-origin: 50% 60%; }
.unit.playing .mark { animation: listen .5s ease-in-out infinite alternate; }
@keyframes listen { to { transform: rotate(-8deg) scale(1.06); } }
footer p { margin: 0 0 6px; font-size: 13px; color: rgba(27, 26, 24, .7); font-weight: 500; }
footer span { margin: 0 6px; opacity: .5; }
@media (max-width: 760px) { .mark { width: 21px; height: 27px; margin-right: 6px; } }
@media (prefers-reduced-motion: reduce) { .unit.playing .mark { animation: none; } }

/* accessibility */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.skip-link:focus { top: 12px; }
.nojs { padding: 24px; font: 16px sans-serif; }
footer { margin: 34px auto 0; width: fit-content; max-width: 100%; padding: 12px 22px !important; border-radius: 16px; background: rgba(251, 250, 247, .88); }
footer p { color: #3A3733 !important; }
.textlink { color: #3A3733 !important; }
.cell.off { color: #7A766E; }
.screen .tiny, .time span, .ask, .screen-note { color: #A8A49B; }
.step { color: #8C887F; }
@media (forced-colors: active) { .cell.off { text-decoration: line-through; } .cell.yes { outline: 2px solid; } }
