/* Layout: a TV price game. Bright stage colours that change every round, chunky outlined cards, the item on one side and the till on the other. */
:root {
  --sun: #ffcf33;
  --pink: #ff85b5;
  --mint: #3ddcb2;
  --sky: #62c8ff;
  --tangerine: #ff9f45;
  --coral: #ff7a66;
  --ink: #14193a;
  --ink-soft: #4a4f70;
  --paper: #fffdf5;
  --ray: rgba(255, 255, 255, 0.2);
  --veil: rgba(20, 25, 58, 0.6);
  --line: 3px;
  --stage: var(--sun);
  --pop: var(--pink);
  --tint: #fff0bd;
  --display: "Bagel Fat One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --ui: "Nunito", "Segoe UI", system-ui, sans-serif;
  --mono: "Courier Prime", "Courier New", Courier, monospace;
  color-scheme: only light;
}

:root[data-round="2"] { --stage: var(--pink); --pop: var(--sun); --tint: #ffe0ec; }
:root[data-round="3"] { --stage: var(--mint); --pop: var(--pink); --tint: #d2f7ec; }
:root[data-round="4"] { --stage: var(--sky); --pop: var(--sun); --tint: #d9f1ff; }
:root[data-round="5"] { --stage: var(--tangerine); --pop: var(--mint); --tint: #ffe5cc; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--stage);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  transition: background-color 350ms;
}

/* The sun rays on the back wall of the set. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: repeating-conic-gradient(from 0deg at 50% 26%, var(--ray) 0 10deg, transparent 10deg 20deg);
}

[hidden] { display: none !important; }

h1, h2, p, dl, dd, ol, ul { margin: 0; padding: 0; }

button { font: inherit; color: inherit; cursor: pointer; }

::selection { background: var(--ink); color: var(--sun); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Big outlined lettering, like a game title. */
.wordmark, .verdict-title {
  --edge: 2px;
  color: var(--paper);
  font-family: var(--display);
  font-weight: 400;
  text-shadow:
    var(--edge) 0 0 var(--ink),
    calc(var(--edge) * -1) 0 0 var(--ink),
    0 var(--edge) 0 var(--ink),
    0 calc(var(--edge) * -1) 0 var(--ink),
    var(--edge) var(--edge) 0 var(--ink),
    calc(var(--edge) * -1) var(--edge) 0 var(--ink),
    var(--edge) calc(var(--edge) * -1) 0 var(--ink),
    calc(var(--edge) * -1) calc(var(--edge) * -1) 0 var(--ink),
    0 calc(var(--edge) * 2) 0 var(--ink);
}

/* Masthead */
.masthead {
  padding-block: 12px 4px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.masthead-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 1040px;
  margin-inline: auto;
}

.logo { color: inherit; text-decoration: none; }

.wordmark {
  display: block;
  padding: 2px 3px 5px;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: 0.01em;
}

.wordmark em { color: var(--pop); font-style: normal; transition: color 350ms; }

.nav { display: flex; gap: 5px; }

.nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 36px;
  height: 36px;
  margin-bottom: 3px;
  padding: 0 5px;
  background: var(--paper);
  color: var(--ink);
  border: var(--line) solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 800;
  font-size: 0.92rem;
  transition: background 120ms, transform 80ms, box-shadow 80ms;
}

.nav button:hover { background: var(--tint); }

.nav button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

.nav svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav span { display: none; }

#sound[aria-pressed="true"] .mute,
#sound[aria-pressed="false"] .waves { display: none; }

/* Stage */
.stage {
  display: grid;
  gap: 14px;
  max-width: 1040px;
  margin-inline: auto;
  padding-block: 10px 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.stage > * { min-width: 0; }

.shelf {
  display: grid;
  gap: 12px;
  align-content: start;
}

.shelf-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
}

.round-label { font-weight: 800; font-size: 0.9rem; }

.tally { display: flex; gap: 4px; list-style: none; }

.tally li {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  background: var(--paper);
  color: var(--ink);
  border: var(--line) solid var(--ink);
  border-radius: 9px;
  font-weight: 900;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.tally li[data-current] { background: var(--ink); color: var(--paper); }
.tally li[data-band] { font-size: 0.72rem; letter-spacing: -0.03em; }
.tally li[data-band="good"] { background: var(--mint); }
.tally li[data-band="mid"] { background: var(--sun); }
.tally li[data-band="bad"] { background: var(--coral); }

.tag {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--paper);
  border: var(--line) solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--ink);
}

.tag-text { display: grid; gap: 4px; min-width: 0; }

.prompt {
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.3;
}

#yearText {
  padding-inline: 4px;
  background: var(--stage);
  border-radius: 6px;
  transition: background-color 350ms;
}

.tag h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.65rem, 6.6vw, 2.6rem);
  line-height: 1.08;
  text-wrap: balance;
  outline: none;
}

.tag h1.long { font-size: clamp(1.35rem, 5.4vw, 2.2rem); }

.detail { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.25; }

/* The star stays inside its own box, so the card's padding always clears the outline. */
.sticker {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(92px, 25vw, 132px);
  aspect-ratio: 1;
  transform: rotate(-7deg);
}

.sticker svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: var(--pop);
  stroke: var(--ink);
  stroke-width: 3px;
  stroke-linejoin: round;
  transition: fill 350ms;
}

.sticker path { vector-effect: non-scaling-stroke; }

.sticker span {
  position: relative;
  font-weight: 900;
  font-size: clamp(1.45rem, 6.4vw, 2.1rem);
  letter-spacing: -0.02em;
}

.sticker.pop { animation: pop 340ms cubic-bezier(0.3, 1.4, 0.5, 1); }

@keyframes pop {
  from { transform: rotate(-24deg) scale(0.6); }
  to { transform: rotate(-7deg) scale(1); }
}

.clues {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.clues div {
  padding: 5px 11px 6px;
  background: var(--paper);
  border: var(--line) solid var(--ink);
  border-radius: 14px;
}

.clues dt { font-weight: 700; font-size: 0.8rem; color: var(--ink-soft); }

.clues dd {
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.clues small { color: var(--ink-soft); font-weight: 700; font-size: 0.8rem; }

/* Price sign: the bid board on the set. */
.counter { display: grid; gap: 14px; align-content: start; }

.sign-frame {
  position: relative;
  padding: 24px 12px 6px;
  background: var(--ink);
  color: var(--sun);
  border: var(--line) solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--ink);
  container-type: inline-size;
  transition: background 200ms;
}

.stage[data-phase="reveal"] .sign-frame { background: var(--paper); color: var(--ink); }
.stage[data-phase="reveal"][data-band="good"] .sign-frame { background: var(--mint); }
.stage[data-phase="reveal"][data-band="mid"] .sign-frame { background: var(--sun); }
.stage[data-phase="reveal"][data-band="bad"] .sign-frame { background: var(--coral); }

.sign-label {
  position: absolute;
  top: 8px;
  left: 14px;
  color: var(--paper);
  font-weight: 800;
  font-size: 0.85rem;
}

.stage[data-phase="reveal"] .sign-label { color: var(--ink); }

.sign {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: clamp(76px, 20vw, 88px);
  overflow: hidden;
  font-weight: 900;
  font-size: min(76px, calc(135cqw / var(--chars, 4)));
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums;
}

.sign .symbol { font-size: 0.58em; padding-top: 0.18em; padding-right: 0.04em; }

.sign .cents {
  font-size: 0.52em;
  padding-top: 0.16em;
  padding-left: 0.06em;
  border-bottom: 0.07em solid currentColor;
  height: fit-content;
  line-height: 1.1;
}

.sign .cents.pending { color: rgba(255, 253, 245, 0.45); border-bottom-color: transparent; }

.sign.bump { animation: bump 90ms ease-out; }

@keyframes bump { 50% { transform: scale(1.05); } }

/* Till */
.register { display: grid; gap: 16px; }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.key {
  height: clamp(46px, 7vh, 58px);
  background: var(--paper);
  color: var(--ink);
  border: var(--line) solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--ink);
  font-weight: 900;
  font-size: 1.65rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  touch-action: manipulation;
  user-select: none;
  transition: background 100ms, transform 70ms, box-shadow 70ms;
}

.key.small { background: var(--coral); font-size: 1rem; }

.key:hover { background: var(--tint); }
.key.small:hover { background: var(--coral); }

.key:active, .key.pressed { background: var(--pop); transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

.ring, .action {
  min-height: 56px;
  padding: 10px 20px;
  background: var(--pop);
  color: var(--ink);
  border: var(--line) solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 5px 0 var(--ink);
  font-weight: 900;
  font-size: 1.2rem;
  touch-action: manipulation;
  transition: background 200ms, transform 80ms, box-shadow 80ms;
}

.ring:hover:not(:disabled), .action:hover { transform: translateY(-1px); box-shadow: 0 6px 0 var(--ink); }

.ring:active:not(:disabled), .action:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }

.ring:disabled {
  background: var(--paper);
  color: var(--ink-soft);
  box-shadow: none;
  border-style: dashed;
  cursor: not-allowed;
}

.action.quiet {
  background: var(--paper);
  color: var(--ink);
  font-size: 1.05rem;
  min-height: 48px;
}

.stage[data-phase="reveal"] .register { display: none; }

.stage[data-phase="done"] .shelf,
.stage[data-phase="done"] .counter { display: none; }

/* Receipt. The outer box draws the outline, because a mask would cut it off the paper itself. */
.receipt {
  margin-inline: 3px;
  filter:
    drop-shadow(3px 0 0 var(--ink))
    drop-shadow(-3px 0 0 var(--ink))
    drop-shadow(0 3px 0 var(--ink))
    drop-shadow(0 -3px 0 var(--ink));
}

.receipt-paper {
  --tooth: 8px;
  padding: 14px 16px calc(16px + var(--tooth));
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.35;
  -webkit-mask:
    conic-gradient(from -45deg at bottom, transparent, #000 1deg 89deg, transparent 90deg) bottom / calc(2 * var(--tooth)) var(--tooth) repeat-x,
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) + 1px) no-repeat;
  mask:
    conic-gradient(from -45deg at bottom, transparent, #000 1deg 89deg, transparent 90deg) bottom / calc(2 * var(--tooth)) var(--tooth) repeat-x,
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) + 1px) no-repeat;
}

.receipt.printing { animation: print 620ms steps(14) both; }

@keyframes print {
  from { clip-path: inset(-5px -5px 100% -5px); }
  to { clip-path: inset(-5px -5px -5px -5px); }
}

.line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-variant-numeric: tabular-nums;
}

.line > :last-child { text-align: right; white-space: nowrap; }
.line > :first-child { min-width: 0; }
.line.strong { font-weight: 700; font-size: 1.1rem; }
.line.sub { color: var(--ink-soft); font-size: 0.9rem; }

.rule { border: 0; border-top: 2px dashed var(--ink-soft); margin: 8px 0; }

.receipt-head { text-align: center; }
.receipt-head strong { display: block; font-size: 1.15rem; letter-spacing: 0.08em; text-transform: uppercase; }

.receipt a { color: inherit; }

.source { font-size: 0.82rem; line-height: 1.3; color: var(--ink-soft); }

.receipt .action { width: 100%; margin-top: 12px; margin-bottom: 5px; font-family: var(--ui); }

.barcode {
  height: 44px;
  margin: 10px auto 2px;
  max-width: 230px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 6px, transparent 6px 8px, var(--ink) 8px 12px, transparent 12px 14px, var(--ink) 14px 15px, transparent 15px 19px);
}

.thanks { text-align: center; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; }

.thanks span { display: block; text-transform: none; font-weight: 700; }

/* Closing screen */
.closing {
  display: grid;
  gap: 18px;
  grid-column: 1 / -1;
  justify-items: center;
}

.closing-grid { display: grid; gap: 22px; width: 100%; max-width: 860px; }

.closing .receipt { width: calc(100% - 6px); }

.verdict { display: grid; gap: 12px; align-content: start; }

.verdict-title {
  --edge: 3px;
  padding-bottom: 6px;
  font-size: clamp(2.5rem, 10vw, 3.75rem);
  line-height: 1.08;
  text-wrap: balance;
  outline: none;
}

.verdict-score { font-weight: 900; font-size: 1.6rem; }

.next-up { font-size: 1rem; font-weight: 700; }

.next-up time { font-weight: 900; font-variant-numeric: tabular-nums; }

.share-status { min-height: 1.4em; font-weight: 800; }

.fallback-text {
  width: 100%;
  min-height: 112px;
  padding: 8px;
  font-family: var(--mono);
  font-size: 0.95rem;
  background: var(--paper);
  color: var(--ink);
  border: var(--line) solid var(--ink);
  border-radius: 12px;
}

/* Confetti */
.confetti {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: -20px;
  width: 11px;
  height: 15px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  animation: fall 1500ms cubic-bezier(0.3, 0.5, 0.6, 1) both;
}

@keyframes fall {
  to { transform: translate(var(--drift), calc(100vh + 40px)) rotate(var(--spin)); }
}

/* About */
.about {
  background: var(--paper);
  border-top: var(--line) solid var(--ink);
  padding-block: 32px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.about-inner { display: grid; gap: 12px; max-width: 64ch; margin-inline: auto; font-size: 1.05rem; }

.about h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 1.15;
  margin-top: 8px;
  text-wrap: balance;
}

.about h2 em {
  padding-inline: 6px;
  background: var(--stage);
  border-radius: 8px;
  font-style: normal;
  transition: background-color 350ms;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.legal { color: var(--ink-soft); font-size: 0.92rem; margin-top: 8px; }

/* Dialogs */
dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  padding: 20px;
  background: var(--paper);
  color: var(--ink);
  border: var(--line) solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 7px 0 var(--ink);
}

dialog::backdrop { background: var(--veil, rgba(20, 25, 58, 0.6)); }

dialog h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.85rem;
  line-height: 1.1;
  margin-bottom: 14px;
  padding-right: 70px;
}

dialog p { margin-top: 10px; }

.close {
  position: absolute;
  top: 16px;
  right: 14px;
  padding: 4px 11px;
  background: var(--pop);
  color: var(--ink);
  border: var(--line) solid var(--ink);
  border-radius: 11px;
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 900;
  font-size: 0.9rem;
}

.close:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

.steps { display: grid; gap: 8px; padding-left: 22px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.stat-row div {
  padding: 8px 2px;
  background: var(--sun);
  border: var(--line) solid var(--ink);
  border-radius: 14px;
  text-align: center;
}

.stat-row div:nth-child(2) { background: var(--pink); }
.stat-row div:nth-child(3) { background: var(--mint); }
.stat-row div:nth-child(4) { background: var(--sky); }

.stat-row strong {
  display: block;
  font-weight: 900;
  font-size: 1.8rem;
  line-height: 1.1;
}

.stat-row span {
  display: block;
  font-weight: 800;
  font-size: 0.78rem;
  line-height: 1.15;
}

.bars { display: grid; gap: 6px; }

.bar {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  font-size: 0.95rem;
}

.bar i {
  display: block;
  min-width: 32px;
  width: var(--share);
  padding-inline: 6px;
  background: var(--mint);
  border: var(--line) solid var(--ink);
  border-radius: 8px;
  font-style: normal;
  font-weight: 900;
  font-size: 0.85rem;
  text-align: right;
}

.note { color: var(--ink-soft); font-size: 0.92rem; }

.past-list {
  display: grid;
  gap: 6px;
  max-height: 60dvh;
  overflow-y: auto;
  padding: 2px;
  list-style: none;
}

.past-list button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: var(--line) solid var(--ink);
  border-radius: 12px;
  text-align: left;
  font-weight: 800;
}

.past-list button:hover { background: var(--tint); }

.past-list span:last-child { font-variant-numeric: tabular-nums; }

/* Leaderboard */
#board { width: min(500px, calc(100vw - 32px)); }

#board h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.3rem; line-height: 1.15; }

.board-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 12px;
}

.board-tabs button {
  padding: 6px 2px;
  background: none;
  border: var(--line) solid var(--ink);
  border-radius: 11px;
  font-weight: 800;
  font-size: 0.86rem;
}

.board-tabs button:hover { background: var(--tint); }
.board-tabs button[aria-selected="true"] { background: var(--pop); }

.board-summary { margin-top: 0; margin-bottom: 8px; color: var(--ink-soft); font-size: 0.92rem; }

.board-list {
  display: grid;
  gap: 2px;
  max-height: 42dvh;
  overflow-y: auto;
  list-style: none;
}

.board-row {
  display: grid;
  grid-template-columns: 2.6em minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 5px 10px;
  border: var(--line) solid transparent;
  border-radius: 12px;
}

.board-row.you { background: var(--tint); border-color: var(--ink); }

.board-rank { font-weight: 900; font-variant-numeric: tabular-nums; }

.board-name { min-width: 0; overflow-wrap: anywhere; font-weight: 700; }

.board-name em {
  margin-left: 4px;
  padding: 0 6px;
  background: var(--sun);
  border-radius: 6px;
  font-style: normal;
  font-weight: 800;
  font-size: 0.75rem;
}

.board-value { font-weight: 900; font-variant-numeric: tabular-nums; }

.board-footer { display: grid; gap: 8px; margin-top: 12px; font-size: 0.95rem; }

.board-footer:empty { display: none; }

.board-footer p { margin-top: 0; }

.board-you { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }

.board-you p { margin-right: auto; }

.board-error { color: #b3261e; font-weight: 800; font-size: 0.92rem; }

.board-error:empty { display: none; }

.link-button {
  padding: 2px 0;
  background: none;
  border: 0;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.join { display: grid; gap: 8px; }

.join p { margin-top: 0; }

.join-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.join-actions .action { min-height: 46px; padding: 6px 10px; font-size: 1rem; }

.league-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }

.league-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }

.league-chips button {
  padding: 3px 10px;
  background: none;
  border: var(--line) solid var(--ink);
  border-radius: 11px;
  font-weight: 800;
  font-size: 0.86rem;
}

.league-chips button[aria-pressed="true"] { background: var(--tint); }

.league-table {
  width: 100%;
  margin-bottom: 10px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.league-table th, .league-table td { padding: 5px 6px; text-align: right; font-weight: 900; }

.league-table thead th { color: var(--ink-soft); font-weight: 700; font-size: 0.82rem; }

.league-table th:first-child { width: 100%; text-align: left; overflow-wrap: anywhere; }

.league-table tbody th { font-weight: 700; }

.league-table tr.you > * { background: var(--tint); }

#board .action { width: 100%; }

.league-form { display: grid; gap: 8px; margin-bottom: 12px; }

.league-form p { margin-top: 0; }

.league-form label { display: grid; gap: 2px; font-weight: 800; font-size: 0.88rem; }

.league-form input {
  width: 100%;
  min-height: 42px;
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
  border: var(--line) solid var(--ink);
  border-radius: 11px;
  font: inherit;
  font-weight: 700;
}

.league-form .action { min-height: 42px; padding: 6px 10px; font-size: 0.95rem; }

.league-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.62fr);
  gap: 8px;
  align-items: end;
}

.league-more { margin-top: 12px; }

.league-more summary { margin-bottom: 8px; font-weight: 800; font-size: 0.92rem; cursor: pointer; }

.invite { padding-bottom: 12px; border-bottom: 2px dashed var(--ink-soft); }

/* Closing screen standing */
.standing { display: grid; gap: 10px; }

.standing-card {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  background: var(--paper);
  border: var(--line) solid var(--ink);
  border-radius: 16px;
  font-size: 0.95rem;
}

.standing-card strong {
  font-weight: 900;
  font-size: 1.45rem;
  line-height: 1.15;
}

@media (max-width: 374px) {
  .wordmark { font-size: 1.5rem; }
  .round-label { font-size: 0.82rem; }
  .tally li { width: 27px; }
}

@media (min-width: 760px) {
  .wordmark { font-size: 2rem; }
  .round-label { font-size: 0.95rem; }
  .tally li { width: 34px; }
  .tally li[data-band] { font-size: 0.8rem; }
  .nav { gap: 7px; }
  .nav button { height: 40px; padding: 0 10px; }
  .nav span { display: inline; }
}

@media (min-width: 880px) {
  .masthead { padding-block-start: 18px; }

  .stage {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    gap: 32px;
    padding-block-start: 18px;
  }

  .wordmark { --edge: 2.5px; font-size: 2.5rem; }

  .tag { padding: 22px; }
  .prompt { font-size: 1.2rem; }

  .closing-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; }
}

@media (max-height: 760px) and (max-width: 879px), (max-height: 830px) and (max-width: 374px) {
  .masthead { padding-block: 6px 0; }
  .wordmark { font-size: 1.5rem; }
  .nav button { min-width: 34px; height: 34px; padding: 0 5px; }
  .stage { gap: 10px; padding-block-start: 4px; }
  .shelf { gap: 8px; }
  .counter { gap: 10px; }
  .register { gap: 10px; }
  .round-label { font-size: 0.82rem; }
  .tally li { width: 28px; height: 24px; font-size: 0.75rem; }
  .tally li[data-band] { font-size: 0.7rem; }
  .tag { padding: 8px 12px; border-radius: 15px; box-shadow: 0 4px 0 var(--ink); }
  .sticker { width: 70px; }
  .sticker span { font-size: 1.1rem; }
  .tag h1 { font-size: 1.3rem; }
  .tag h1.long { font-size: 1.1rem; }
  .prompt { font-size: 0.88rem; }
  .detail { font-size: 0.8rem; }
  .clues { gap: 6px; }
  .clues div { padding: 2px 9px 3px; border-radius: 11px; }
  .clues dt { font-size: 0.72rem; }
  .clues dd { font-size: 0.9rem; }
  .sign-frame { padding-top: 12px; border-radius: 15px; box-shadow: 0 4px 0 var(--ink); }
  .sign-label { font-size: 0.72rem; top: 3px; left: 10px; }
  .sign { height: 50px; font-size: min(44px, calc(135cqw / var(--chars, 4))); }
  .keypad { gap: 7px; }
  .key { height: clamp(38px, 6vh, 46px); font-size: 1.35rem; box-shadow: 0 3px 0 var(--ink); }
  .key.small { font-size: 0.9rem; }
  .ring { min-height: 44px; font-size: 1.05rem; box-shadow: 0 4px 0 var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  .receipt.printing, .sign.bump, .sticker.pop { animation: none; }
  body, .ring, .action, .key, .nav button { transition: none; }
}
