/* v03 Arcade Cabinet: the screens (attract mode, stage cards, stage clear, high score entry, the result). */
.ui { position: absolute; inset: 0; z-index: 20; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; display: none; overscroll-behavior: contain; }
.ui.is-on { display: block; }
.ui.is-sheet { pointer-events: none; overflow: hidden; }
.scr { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px;
  padding: calc(var(--top) + 62px) 18px calc(var(--bot) + 22px); width: 100%; max-width: 560px; margin: 0 auto; animation: boot .35s steps(5) both; }
@keyframes boot { 0% { clip-path: inset(50% 0 50% 0); filter: brightness(3); } 60% { clip-path: inset(10% 0 10% 0); } 100% { clip-path: inset(0 0 0 0); filter: none; } }
.px { font-family: var(--px); }
.lbl { font: 10px/1.6 var(--px); color: var(--mute); letter-spacing: .5px; }
.copy { font: 28px/1.08 var(--vt); color: #efe6ff; margin: 0; max-width: 30ch; text-wrap: balance; }
.copy b { color: var(--yellow); font-weight: 400; }
.blink { animation: blink 1s steps(1) infinite; }

/* the arcade button */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 60px; width: min(100%, 340px);
  padding: 16px 18px 14px; border: 0; cursor: pointer; font: 15px/1.3 var(--px); color: var(--ink); background: var(--yellow);
  box-shadow: 0 0 0 4px var(--ink), 0 0 0 7px #fff, 0 10px 0 7px #000, 0 0 40px 8px rgba(255, 230, 0, .35);
  transition: transform .06s, box-shadow .06s; margin-bottom: 10px; }
.btn:active, .btn.is-press { transform: translateY(6px); box-shadow: 0 0 0 4px var(--ink), 0 0 0 7px #fff, 0 4px 0 7px #000, 0 0 30px 6px rgba(255, 230, 0, .5); }
.btn:focus-visible { outline: 3px dashed var(--cyan); outline-offset: 10px; }
.btn[disabled] { background: #4b3d77; color: #c9bff0; cursor: wait; box-shadow: 0 0 0 4px var(--ink), 0 0 0 7px #6e5fa3, 0 10px 0 7px #000; }
.btn.is-arming[disabled] { background: var(--yellow); color: var(--ink); opacity: .55; cursor: default; box-shadow: 0 0 0 4px var(--ink), 0 0 0 7px #fff, 0 10px 0 7px #000; }
.btn { transition: transform .06s, box-shadow .06s, opacity .2s steps(2); }
.btn--green { background: var(--green); box-shadow: 0 0 0 4px var(--ink), 0 0 0 7px #fff, 0 10px 0 7px #000, 0 0 44px 10px rgba(57, 255, 106, .4); }
.btn .arr { animation: nudge .6s steps(2) infinite; }
@keyframes nudge { 50% { transform: translateX(4px); } }
.dots::after { content: ''; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ---------- landing: attract mode ---------- */
.s-land { justify-content: space-between; gap: 12px; padding-bottom: calc(var(--bot) + 70px); max-width: none; }   /* full width: the ticker spans the whole screen */
.land__top { display: grid; gap: 14px; justify-items: center; margin-top: 2vh; }
.logo { display: grid; justify-items: center; line-height: 1; animation: logo 3s steps(1) infinite; }
.logo span { font: clamp(46px, 15vw, 76px)/1 var(--px); color: var(--yellow); text-shadow: 5px 5px 0 var(--pink), 10px 10px 0 #000, var(--glow-y); }
.logo span + span { color: var(--cyan); text-shadow: 5px 5px 0 #6a1fb0, 10px 10px 0 #000, var(--glow-c); margin-top: 10px; }
@keyframes logo { 92% { transform: none; } 93% { transform: translateX(3px) skewX(-6deg); filter: hue-rotate(90deg); } 94% { transform: none; filter: none; } }
.tagline { font: 13px/1.6 var(--px); color: var(--pink); text-shadow: 2px 2px 0 #000, var(--glow-p); margin: 0; }
.land__mid { display: grid; gap: 18px; justify-items: center; width: 100%; }
.coin { display: inline-block; }
.coin .spr { display: block; }
.btn--coin { background: var(--ink); color: var(--yellow); box-shadow: 0 0 0 4px var(--yellow), 0 0 0 8px var(--ink), 0 10px 0 8px #000, 0 0 50px 10px rgba(255, 230, 0, .3); }
.btn--coin .txt { animation: dim 1.1s steps(1) infinite; }
@keyframes dim { 50% { opacity: .55; } }
.btn--coin[disabled] .txt { animation: none; }
.btn--coin[disabled] { color: var(--mute); background: var(--ink); box-shadow: 0 0 0 4px #4b3d77, 0 0 0 8px var(--ink), 0 10px 0 8px #000; }
.btn--coin.is-drop .coin { animation: coindrop .7s steps(7) forwards; }
@keyframes coindrop { 0% { transform: none; } 30% { transform: translateY(-26px) scaleX(.2); } 60% { transform: translateY(0) scaleX(1); } 100% { transform: translateY(90px) scaleX(.3); opacity: 0; } }
.credit { font: 11px/1 var(--px); color: var(--orange); min-height: 12px; }
.ticker { position: absolute; left: 0; right: 0; bottom: calc(var(--bot) + 14px); overflow: hidden; background: rgba(10, 6, 20, .7); box-shadow: 0 -2px 0 var(--line), 0 2px 0 var(--line); padding: 10px 0; }
.ticker__in { display: inline-flex; gap: 34px; white-space: nowrap; padding-left: 100%; animation: tick 22s linear infinite; font: 11px/1 var(--px); color: #fff; }
.ticker__in em { font-style: normal; color: var(--cyan); }
.ticker__in b { color: var(--yellow); font-weight: 400; }
@keyframes tick { to { transform: translateX(-100%); } }
.oops { display: grid; gap: 14px; justify-items: center; padding: 22px 18px; background: rgba(10, 6, 20, .92); box-shadow: 0 0 0 3px var(--red); max-width: 340px; }
.oops b { font: 16px/1.4 var(--px); color: var(--red); }

/* ---------- stage card ---------- */
.s-intro { gap: 14px; }
.stg__n { display: flex; align-items: baseline; gap: 10px; justify-content: center; }
.stg__n b { font: clamp(34px, 10vw, 46px)/1 var(--px); color: var(--yellow); text-shadow: 4px 4px 0 var(--pink), 8px 8px 0 #000; font-weight: 400; }
.stg__n small { font: 12px/1 var(--px); color: var(--mute); }
.stg__spr { animation: bob 1s steps(2) infinite; filter: drop-shadow(0 0 14px rgba(34, 232, 255, .5)); }
.stg__name { font: 16px/1.4 var(--px); color: var(--cyan); text-shadow: 2px 2px 0 #000, var(--glow-c); margin: 0; }
.stg__how { background: rgba(10, 6, 20, .85); padding: 12px 14px; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink); max-width: 360px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { font: 10px/1 var(--px); padding: 7px 8px; color: var(--ink); background: var(--cyan); box-shadow: 3px 3px 0 #000; }
.chip--p { background: var(--pink); color: #fff; } .chip--y { background: var(--yellow); }
.rate { display: grid; gap: 10px; width: min(100%, 360px); }
.rate__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rate__grid button { height: 48px; border: 0; cursor: pointer; font: 14px/1 var(--px); color: #fff; background: var(--ink3); box-shadow: 0 0 0 2px var(--line), 0 4px 0 2px #000; transition: transform .06s; }
.rate__grid button:active { transform: translateY(3px); }
.rate__grid button.is-arming { opacity: .6; }
.rate__grid button.is-lit { background: var(--pink); box-shadow: 0 0 0 2px #fff, 0 4px 0 2px #000, 0 0 16px var(--pink); }
.rate__grid button.is-pick { background: var(--yellow); color: var(--ink); animation: win .3s steps(3) 2; }

/* ---------- reveal sheet (over the real clip) ---------- */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: auto; padding: 14px 14px calc(var(--bot) + 14px); display: grid; gap: 10px; justify-items: center;
  background: linear-gradient(180deg, transparent, rgba(10, 6, 20, .92) 22%); animation: up .3s steps(4) both; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.replay { position: absolute; top: calc(var(--top) + 62px); left: 12px; font: 10px/1 var(--px); color: #fff; background: var(--red); padding: 7px 8px; box-shadow: 3px 3px 0 #000; }
.replay::before { content: '● '; animation: blink 1s steps(1) infinite; }
.replay.is-done { background: var(--line); }
.replay.is-done::before { content: '■ '; animation: none; }
.sheet .btn.is-ready { animation: win .6s steps(2) infinite; }
.sheet__card { width: min(100%, 460px); background: var(--ink2); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink); padding: 14px; display: grid; gap: 10px; text-align: left; }
.sheet__v { font: 14px/1.4 var(--px); }
.sheet__v.is-good { color: var(--green); } .sheet__v.is-bad { color: var(--orange); }
.sheet__saw { font: 24px/1.05 var(--vt); color: #e8ddff; margin: 0; }
.race { display: grid; gap: 6px; }
.race__row { display: grid; grid-template-columns: 9ch 1fr 6ch; align-items: center; gap: 8px; font: 9px/1 var(--px); }
.race__row i { height: 12px; background: #1b1233; position: relative; overflow: hidden; }
.race__row i::after { content: ''; position: absolute; inset: 0; width: var(--w); background: var(--c, var(--cyan)); animation: grow .7s steps(7) both .2s; }
.race__row b { font-weight: 400; text-align: right; color: #fff; }
@keyframes grow { from { width: 0; } }

/* ---------- stage clear ---------- */
.s-between { gap: 14px; }
.rainbow { font: clamp(20px, 6.4vw, 30px)/1.3 var(--px); margin: 0; animation: rainbow .6s steps(1) infinite; text-shadow: 3px 3px 0 #000; }
@keyframes rainbow { 0% { color: var(--yellow); } 25% { color: var(--cyan); } 50% { color: var(--pink); } 75% { color: var(--green); } }
.tally { width: min(100%, 380px); background: rgba(10, 6, 20, .88); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink); padding: 12px 14px; display: grid; gap: 10px; }
.tally__row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; font: 10px/1.3 var(--px); text-align: left; opacity: 0; animation: pop .3s steps(3) both; }
.tally__row .v { font-size: 9px; padding: 4px 5px; color: var(--ink); background: var(--green); }
.tally__row .v.is-bad { background: var(--orange); }
.tally__row b { color: var(--yellow); font-weight: 400; min-width: 5ch; text-align: right; }
.tally__tot { border-top: 2px dashed var(--line); padding-top: 10px; font-size: 12px; }
.tally__tot b { font-size: 14px; }
.map { display: flex; align-items: center; justify-content: center; gap: 0; width: min(100%, 380px); }
.map__n { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font: 12px/1 var(--px); color: var(--mute); background: var(--ink2); box-shadow: 0 0 0 3px var(--line); }
.map__n.is-done { background: var(--green); color: var(--ink); box-shadow: 0 0 0 3px #fff; }
.map__n.is-next { background: var(--yellow); color: var(--ink); box-shadow: 0 0 0 3px #fff, 0 0 18px var(--yellow); animation: win .6s steps(2) infinite; }
.map__n.is-rank { background: var(--ink); color: var(--pink); box-shadow: 0 0 0 3px var(--pink); }
.map__l { flex: 1; height: 6px; background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 14px); }
.map__l.is-done { background: repeating-linear-gradient(90deg, var(--green) 0 8px, transparent 8px 14px); }
.next { display: flex; gap: 14px; align-items: center; text-align: left; width: min(100%, 380px); background: rgba(10, 6, 20, .8); padding: 12px; box-shadow: 0 0 0 2px var(--cyan); }
.next .copy { font-size: 22px; }
.next .lbl { color: var(--cyan); }

/* ---------- high score entry (the gate) ---------- */
.s-gate { gap: 14px; }
.big-score { font: clamp(28px, 9vw, 44px)/1 var(--px); color: #fff; text-shadow: 4px 4px 0 var(--pink), 0 0 20px rgba(255, 255, 255, .4); }
.locked { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: rgba(10, 6, 20, .85); box-shadow: 0 0 0 3px var(--yellow); text-align: left; }
.locked__blur { font: 26px/1 var(--px); color: var(--yellow); filter: blur(6px); user-select: none; }
.form { width: min(100%, 360px); display: grid; gap: 6px; text-align: left; }
.form label { font: 10px/1.6 var(--px); color: var(--cyan); margin-top: 6px; }
.field { display: flex; align-items: center; background: #000; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink); }
.field:focus-within { box-shadow: 0 0 0 3px var(--yellow), 0 0 0 6px var(--ink), 0 0 20px rgba(255, 230, 0, .4); }
.field.is-err { box-shadow: 0 0 0 3px var(--red), 0 0 0 6px var(--ink); animation: shake .3s steps(4); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.field span { font: 16px/1 var(--px); color: var(--yellow); padding-left: 12px; }
.field input { flex: 1; min-width: 0; height: 54px; border: 0; outline: 0; background: transparent; color: #fff; caret-color: var(--yellow);
  font: 30px/1 var(--vt); padding: 0 12px; }
.field input::placeholder { color: #5d4f8c; }
.err { font: 24px/1 var(--vt); color: var(--red); min-height: 0; margin: 2px 0 0; }
.err:empty { display: none; }
.err:not(:empty) { background: rgba(10, 6, 20, .9); padding: 4px 8px; box-shadow: -3px 0 0 var(--red); }
.s-gate:has(.err:not(:empty)) .note { display: none; }   /* the error words take the space of the small print */
.note { font: 23px/1.1 var(--vt); color: var(--mute); margin: 0; max-width: 34ch; }

/* ---------- the result ---------- */
.s-res { justify-content: flex-start; gap: 22px; padding-top: calc(var(--top) + 26px); padding-bottom: calc(var(--bot) + 40px); }
.res__head { display: grid; gap: 10px; justify-items: center; }
.res__ten { display: flex; align-items: baseline; justify-content: center; gap: 4px; font: clamp(64px, 20vw, 92px)/1 var(--px); color: var(--yellow); text-shadow: 6px 6px 0 var(--pink), 12px 12px 0 #000, var(--glow-y); }
.res__ten small { font-size: .38em; color: #fff; text-shadow: 3px 3px 0 #000; }
.res__tags { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tag { font: 13px/1 var(--px); padding: 9px 10px 8px; box-shadow: 4px 4px 0 #000; }
.tag--tier { background: var(--cyan); color: var(--ink); }
.tag--gap { background: var(--pink); color: #fff; }
.tag--gap.is-pro { background: var(--green); color: var(--ink); }
.board { width: min(100%, 420px); background: rgba(10, 6, 20, .9); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink); padding: 12px 12px 8px; }
.board h3, .panel h3 { margin: 0 0 10px; font: 11px/1.4 var(--px); color: var(--pink); text-align: center; }
.board__row { display: grid; grid-template-columns: 4.5ch 1fr auto; gap: 10px; align-items: center; padding: 9px 8px; font: 11px/1.2 var(--px); text-align: left; color: var(--mute); }
.board__row + .board__row { border-top: 2px dashed #241846; }
.board__row .r { color: #fff; } .board__row .who { font-size: 9px; color: var(--mute); text-align: right; }
.board__row.is-pro .t { color: var(--green); }
.board__row.is-you { background: var(--yellow); color: var(--ink); animation: you .9s steps(1) 3; box-shadow: 0 0 20px rgba(255, 230, 0, .5); }
.board__row.is-you .r, .board__row.is-you .who { color: var(--ink); }
@keyframes you { 50% { background: var(--pink); color: #fff; } }
.boss { width: min(100%, 420px); display: grid; gap: 10px; text-align: left; padding: 14px; background: linear-gradient(135deg, #3a0c2a, #170a2e); box-shadow: 0 0 0 3px var(--red), 0 0 0 6px var(--ink), 0 0 30px rgba(255, 59, 92, .3); }
.boss .lbl { color: var(--red); }
.boss__top { display: flex; gap: 14px; align-items: center; }
.boss h2 { margin: 6px 0 0; font: 14px/1.45 var(--px); color: #fff; }
.boss .copy { font-size: 23px; }
.said { margin-top: 8px; font: 10px/1.6 var(--px); color: var(--yellow); }
.res__top, .res__a, .res__b, .res__ev { width: 100%; display: grid; gap: 22px; justify-items: center; }
.cont { width: min(100%, 520px); display: grid; gap: 14px; justify-items: center; padding-top: 6px; }
.cont__l, .cont__cta { display: grid; gap: 14px; justify-items: center; width: 100%; }
.cont__t { font: clamp(22px, 7vw, 32px)/1 var(--px); color: var(--cyan); text-shadow: 3px 3px 0 #000, var(--glow-c); }
.cont__t b { display: inline-block; min-width: 1.2ch; color: var(--yellow); font-weight: 400; }
.cont__t b.is-tick { animation: pop .3s steps(3); }
.tv { width: 100%; padding: 14px 14px 30px; background: linear-gradient(180deg, #2b2440, #17122a); border-radius: 18px; box-shadow: 0 0 0 3px #0c0620, 0 10px 0 3px #000; position: relative; }
.tv::after { content: 'COACH TV'; position: absolute; bottom: 9px; left: 18px; font: 8px/1 var(--px); color: var(--mute); }
.tv::before { content: ''; position: absolute; bottom: 9px; right: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
/* the shared placeholder inherits the font: a plain mono at its true size keeps the small print readable */
.tv .vsl { font-family: Menlo, "SF Mono", Consolas, "Roboto Mono", monospace; border-radius: 26px / 30px; overflow: hidden; box-shadow: inset 0 0 40px rgba(0, 0, 0, .8); }
.tv .vsl::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: repeating-linear-gradient(180deg, rgba(0, 0, 0, .2) 0 1px, transparent 1px 3px), radial-gradient(120% 100% at 50% 40%, transparent 60%, rgba(0, 0, 0, .5)); }
.booked { font: 11px/1.6 var(--px); color: var(--green); min-height: 0; }
.panel { width: min(100%, 460px); background: rgba(10, 6, 20, .9); box-shadow: 0 0 0 3px var(--line); padding: 14px 12px; }
.lvl { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 4px; text-align: left; }
.lvl + .lvl { border-top: 2px dashed #241846; }
.lvl__n { font: 10px/1.4 var(--px); color: #fff; }
.lvl__bar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; margin-top: 6px; }
.lvl__bar i { height: 9px; background: #241846; }
.lvl__bar i.on { background: var(--cyan); }
.lvl.is-weak .lvl__bar i.on { background: var(--red); }
.lvl__s { font: 16px/1 var(--px); color: var(--yellow); }
.lvl__said { font: 18px/1 var(--vt); color: var(--mute); margin-top: 5px; }
.mom { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 2px; text-align: left; align-items: center; }
.mom + .mom { border-top: 2px dashed #241846; }
.mom canvas { width: 92px; height: 52px; image-rendering: pixelated; background: #1b1233; box-shadow: 0 0 0 2px #fff; opacity: 0; transition: opacity .3s steps(3); }
.mom canvas.is-on { opacity: 1; }
.mom__t { font: 10px/1.5 var(--px); color: #fff; }
.mom__m { font: 18px/1 var(--vt); color: var(--mute); margin: 2px 0 6px; }
.mom .v { font: 8px/1 var(--px); padding: 3px 4px; color: var(--ink); background: var(--green); margin-left: 6px; vertical-align: 1px; }
.mom .v.is-bad { background: var(--orange); }
.times { font: 9px/1.5 var(--px); color: var(--cyan); }
.times b { color: var(--yellow); font-weight: 400; }
.fast .board__row { grid-template-columns: 3.5ch 1fr auto; }
.foot { font: 18px/1.1 var(--vt); color: var(--mute); max-width: 36ch; margin: 0; }

@media (min-width: 960px) and (min-height: 660px) {
  .scr { padding-top: 64px; padding-bottom: 26px; }
  .s-res { padding-top: 70px; }
  .logo span { font-size: 64px; }
  .copy, .boss .copy { font-size: 30px; }
  .note, .err { font-size: 26px; }
  .s-gate { gap: 8px; padding-top: 34px; }
  .s-gate .rainbow { font-size: 24px; }
  .s-gate .big-score { font-size: 32px; }
  .s-gate .locked { padding: 8px 14px; }
  .s-land { padding-bottom: 84px; }                /* the ticker sits under the credit line, never on it */
  .s-intro { gap: 10px; padding-top: 52px; padding-bottom: 34px; }
  .s-intro .stg__spr .spr { width: 64px; height: auto; }
  .s-res { max-width: 860px; padding-left: 28px; padding-right: 28px; }
  .res__top { grid-template-columns: 1fr 1fr; align-items: center; gap: 26px; }
  .res__top .board, .res__top .boss { width: 100%; }
  .res__ten { font-size: 76px; }
  .s-res { padding-top: 44px; }
  .cont__t { font-size: 24px; }
  .cont { width: 100%; grid-template-columns: 1fr 1.25fr; grid-template-areas: 'l tv' 'c tv'; align-items: center; column-gap: 26px; }
  .cont__l { grid-area: l; align-self: end; } .tv { grid-area: tv; } .cont__cta { grid-area: c; align-self: start; }
  .res__ev { grid-template-columns: 1fr 1fr; align-items: start; }
  .res__ev .panel { width: 100%; }
  .s-res > .panel { width: 100%; }
  .s-res > .panel .mom { display: inline-grid; width: calc(50% - 8px); vertical-align: top; }
  .s-res > .panel .mom + .mom { border-top: 0; }
}
/* phone: the book button rides along at the bottom from the first frame, then settles under the coach TV */
@media (max-width: 959px), (max-height: 659px) {
  .cont__cta { position: sticky; bottom: 0; z-index: 5; gap: 6px; padding: 18px 0 calc(var(--bot) + 4px);
    background: linear-gradient(180deg, transparent, rgba(10, 6, 20, .94) 34%); }
  .cont__cta .btn { margin-bottom: 12px; }
}
@media (max-height: 700px) {
  .scr { gap: 10px; }
  .stg__spr .spr { width: 52px; height: auto; }
}
.map__n.is-done, .map__n.is-rank { font: 22px/1 system-ui, sans-serif; font-weight: 900; }
