@import url("/tokens.css");

/* The cabinet (public-arcade ticket 09). Three stacked parts with distinct
   radii and shadows because they are distinct objects: the marquee (title,
   rank, XP bar), the screen (whatever is being played or shown), and the
   control deck of round arcade buttons, the one bold element. Everything
   else is quiet. Colour comes only from tokens. Motion answers the learner
   (tile flip, tally roll-up, bar fill) and nothing animates on load. */

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--t0);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Flat buttons: keys, chips, in-screen actions --- */

button,
.flat-btn {
  font: 600 var(--t0) var(--sans);
  color: inherit;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.6em 1.2em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 var(--bevel-light),
    inset 0 -3px 0 var(--bevel-dark),
    0 3px 0 var(--bevel-dark);
  transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.08s ease;
}

button:hover:not(:disabled) {
  border-color: var(--accent-bright);
}

button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 var(--bevel-light),
    inset 0 -1px 0 var(--bevel-dark);
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

button:disabled.correct,
button:disabled.incorrect {
  opacity: 0.85;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent-bright);
  outline-offset: 2px;
}

.play-again-btn,
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--surface);
}

/* --- The cabinet --- */

.cabinet {
  width: 100%;
  max-width: 42rem;
  margin: 1.25rem 0 3rem;
  padding: 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.marquee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 14px 14px 6px 6px;
  box-shadow:
    inset 0 2px 0 var(--bevel-light),
    inset 0 -4px 0 var(--bevel-dark),
    0 4px 0 var(--bevel-dark);
}

.marquee-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--t3);
  line-height: 1;
  color: var(--accent);
  letter-spacing: 0.02em;
  text-shadow: 0 2px 0 var(--bevel-dark);
}

.marquee-title small {
  display: block;
  font-family: var(--mono);
  font-size: var(--t-1);
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-top: 0.35rem;
}

.rank {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas: "title streak" "bar bar" "xp xp";
  gap: 0.2rem 0.75rem;
  align-items: center;
  font-family: var(--mono);
  font-size: var(--t-1);
  color: var(--text-dim);
  min-width: 13rem;
}

.rank-title {
  grid-area: title;
  color: var(--text);
  font-weight: 600;
  font-size: var(--t0);
}

.rank-streak {
  grid-area: streak;
  justify-self: end;
  color: var(--accent);
  font-weight: 600;
}

.xp-bar {
  grid-area: bar;
  height: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
}

.xp-bar > span {
  display: block;
  height: 100%;
  width: var(--fill, 0%);
  background: var(--accent);
}

/* The bar moves only after the first render has settled; never on load. */
.xp-bar.settled > span {
  transition: width 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.xp-num {
  grid-area: xp;
}

.marquee-controls {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.marquee-controls .flat-btn {
  font-size: var(--t-1);
  padding: 0.4em 0.8em;
}

.screen {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.25rem 1.75rem;
  min-height: 24rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow:
    inset 0 1px 0 var(--bevel-light),
    inset 0 -3px 0 var(--bevel-dark);
}

.status-message {
  color: var(--text-dim);
  text-align: center;
  margin: 0 0 1rem;
}

#game-root {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.clue {
  text-align: center;
  max-width: 32em;
  font-size: var(--t1);
  line-height: 1.45;
  margin: 0 0 1.25rem;
}

.hint-text {
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--t-1);
  text-align: center;
  max-width: 32em;
}

/* --- The deck: round arcade buttons, labels beneath --- */

.deck {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  padding: 1rem 1.25rem 1.1rem;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 6px 6px 14px 14px;
  box-shadow:
    inset 0 2px 0 var(--bevel-light),
    inset 0 -4px 0 var(--bevel-dark),
    0 6px 0 var(--bevel-dark);
}

.arcade-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  padding: 0.25rem;
  color: inherit;
  cursor: pointer;
  font: 400 var(--t-1) var(--mono);
  transition: none;
}

.arcade-btn:hover:not(:disabled),
.arcade-btn:active:not(:disabled) {
  border-color: transparent;
  transform: none;
  box-shadow: none;
}

.arcade-btn .cap {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--cap, var(--option));
  border: 3px solid color-mix(in srgb, var(--cap, var(--option)) 55%, var(--bevel-dark));
  box-shadow:
    inset 0 0.55rem 0 color-mix(in srgb, var(--cap, var(--option)) 70%, var(--bevel-light)),
    inset 0 -0.45rem 0 color-mix(in srgb, var(--cap, var(--option)) 60%, var(--bevel-dark)),
    0 5px 0 var(--bevel-dark);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.arcade-btn:active:not(:disabled) .cap {
  transform: translateY(4px);
  box-shadow:
    inset 0 0.35rem 0 color-mix(in srgb, var(--cap, var(--option)) 70%, var(--bevel-light)),
    inset 0 -0.25rem 0 color-mix(in srgb, var(--cap, var(--option)) 60%, var(--bevel-dark)),
    0 1px 0 var(--bevel-dark);
}

.arcade-btn.hint { --cap: var(--accent); }
.arcade-btn.skip { --cap: var(--option); }
.arcade-btn.cancel { --cap: var(--text-dim); }
.arcade-btn.end { --cap: var(--danger); }

.arcade-btn .lbl {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.arcade-btn kbd {
  font: 600 0.7rem var(--mono);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 0.3rem;
  line-height: 1.3;
}

.arcade-btn:disabled {
  opacity: 1;
  cursor: default;
  color: var(--text-dim);
}

/* A dead button is a flat, unlit cap: no bevel, no colour. */
.arcade-btn:disabled .cap {
  background: var(--border);
  border-color: var(--border);
  box-shadow: none;
}

/* --- Wordle grid --- */

.wordle-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 1.25rem;
}

.wordle-row {
  display: grid;
  grid-template-columns: repeat(var(--cols), 3rem);
  gap: 6px;
}

.tile {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: var(--t2);
  font-weight: 600;
  text-transform: uppercase;
  background: transparent;
}

.tile.revealed {
  animation: reveal 0.4s cubic-bezier(0.34, 1.2, 0.64, 1) both;
  border-color: transparent;
}

.tile.judged {
  border-color: transparent;
}

.tile.green { background: var(--feedback-correct); }
.tile.yellow { background: var(--feedback-present); }
.tile.black { background: var(--feedback-absent); }

@keyframes reveal {
  0% { transform: scale(1); }
  35% { transform: scale(0.85); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* --- Hangman --- */

.hangman-lives {
  display: flex;
  gap: 6px;
  margin: 0.6em 0;
}

.hangman-lives .life {
  width: 1.3em;
  height: 1.3em;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.hangman-lives .life.spent {
  background: var(--danger);
  border-color: var(--danger);
}

.hangman-mask {
  font-family: var(--mono);
  font-size: var(--t2);
  letter-spacing: 0.12em;
  white-space: pre-wrap;
  text-align: center;
  margin: 0.6em 0;
}

.wrong-count {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: var(--t-1);
  margin: 0;
}

.guessed-letters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-height: 1.8em;
  margin: 0.8em 0;
}

.guessed-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 6px;
  font-family: var(--mono);
  font-weight: 600;
  text-transform: uppercase;
}

.guessed-letter.hit { background: var(--feedback-correct); }
.guessed-letter.miss { background: var(--feedback-absent); }

.guessed-empty {
  color: var(--text-dim);
  font-size: var(--t-1);
}

/* --- Choice quiz --- */

.choice-options {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  width: 100%;
  max-width: 28em;
  margin: 1em 0;
}

.choice-option {
  display: flex;
  align-items: center;
  gap: 0.8em;
  width: 100%;
  padding: 0.8em 1em;
  text-align: left;
  font-family: var(--mono);
  font-weight: 400;
}

.choice-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8em;
  height: 1.8em;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-weight: 600;
}

.choice-text {
  flex: 1;
}

.choice-option.correct {
  background: var(--feedback-correct);
  border-color: var(--feedback-correct);
}

.choice-option.incorrect {
  background: var(--danger);
  border-color: var(--danger);
}

/* --- Match-up --- */

.mismatch-count {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: var(--t-1);
  margin: 0;
}

.matchup-columns {
  display: flex;
  gap: 1.2em;
  width: 100%;
  max-width: 32em;
  margin: 1em 0;
}

.matchup-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  min-width: 0;
}

.matchup-item {
  display: flex;
  align-items: center;
  gap: 0.6em;
  width: 100%;
  padding: 0.6em 0.7em;
  text-align: left;
  font-family: var(--mono);
  font-weight: 400;
}

.matchup-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-weight: 600;
}

.matchup-text {
  flex: 1;
  font-size: 0.9em;
  min-width: 0;
}

.matchup-item.selected {
  border-color: var(--option);
  background: color-mix(in srgb, var(--option) 15%, transparent);
}

.matchup-item.matched {
  opacity: 0.55;
  text-decoration: line-through;
  border-color: var(--feedback-correct);
  background: color-mix(in srgb, var(--feedback-correct) 12%, var(--panel));
}

/* --- Anagram --- */

.anagram-scramble {
  font-family: var(--mono);
  font-size: var(--t2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  margin: 0.6em 0;
}

.anagram-buffer {
  font-family: var(--mono);
  font-size: var(--t1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  min-height: 1.6em;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.2em;
}

.anagram-buffer-empty {
  color: var(--text-dim);
  font-style: italic;
  text-transform: none;
  letter-spacing: normal;
}

/* --- Memory --- */

.memory-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), 3.6em);
  gap: 8px;
  margin: 1em 0;
}

.memory-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3em;
  text-align: center;
  font-family: var(--mono);
}

.memory-coord {
  color: var(--text-dim);
  font-size: 0.85em;
}

.memory-text {
  font-size: 0.75em;
  line-height: 1.15;
}

.memory-cell.selected {
  border-color: var(--option);
  background: color-mix(in srgb, var(--option) 15%, transparent);
}

.memory-cell.face-up {
  background: var(--panel);
  border-color: var(--option);
}

.memory-cell.matched {
  border-color: var(--feedback-correct);
  opacity: 0.8;
}

/* --- Sequence --- */

.sequence-slots,
.sequence-pool {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  width: 100%;
  max-width: 28em;
  margin: 1em 0;
}

.sequence-slot,
.sequence-item {
  display: flex;
  align-items: center;
  gap: 0.8em;
  width: 100%;
  padding: 0.7em 1em;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--mono);
  font-weight: 400;
}

.sequence-slot-num,
.sequence-item-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8em;
  height: 1.8em;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-weight: 600;
}

.sequence-slot-text,
.sequence-item-text {
  flex: 1;
}

.sequence-slot-placeholder {
  color: var(--text-dim);
}

.sequence-slot.locked {
  border-color: var(--feedback-correct);
  background: color-mix(in srgb, var(--feedback-correct) 15%, transparent);
}

/* --- Code cloze --- */

.cloze-snippet {
  width: 100%;
  max-width: 32em;
  margin: 0.6em 0;
  padding: 1em;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow:
    inset 0 1px 0 var(--bevel-light),
    inset 0 -2px 0 var(--bevel-dark);
  font-family: var(--mono);
  font-size: var(--t0);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-x: auto;
}

.cloze-input-row {
  display: flex;
  gap: 0.6em;
  width: 100%;
  max-width: 32em;
  margin: 0.6em 0;
}

.cloze-input {
  flex: 1;
  min-width: 0;
  padding: 0.6em 0.8em;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: inherit;
  font-family: var(--mono);
}

.cloze-submit {
  padding: 0.6em 1.2em;
}

/* --- Jeopardy --- */

.jeopardy-board {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: 8px;
  width: 100%;
  max-width: 32em;
  margin: 1em 0;
}

.jeopardy-header {
  padding: 0.4em 0.3em;
  text-align: center;
  font-family: var(--mono);
  font-size: var(--t-1);
  font-weight: 600;
  color: var(--text-dim);
}

.jeopardy-cell {
  padding: 1em 0.3em;
  text-align: center;
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--t1);
  color: var(--accent);
}

/* --- Keyboard --- */

.keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 1em;
  max-width: 100%;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.key {
  min-width: 2.1em;
  padding: 0.55em 0.4em;
  font: 600 var(--t-1) var(--mono);
  text-align: center;
  border-radius: 6px;
}

.key.wide {
  min-width: 3.6em;
}

.key.green { background: var(--feedback-correct); border-color: var(--feedback-correct); }
.key.yellow { background: var(--feedback-present); border-color: var(--feedback-present); }
.key.black { background: var(--feedback-absent); border-color: var(--feedback-absent); }

/* --- Round end: the tally --- */

.round-end {
  text-align: center;
  width: 100%;
  max-width: 34em;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.round-end h2,
.tally-title {
  margin: 0.25rem 0 1rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--t4);
  line-height: 1;
  color: var(--feedback-correct);
}

.round-end.lost h2,
.round-end.cancelled h2,
.tally-title.lost {
  color: var(--text-dim);
}

.tally {
  width: 100%;
  max-width: 22rem;
  font-family: var(--mono);
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 0.35rem;
  column-gap: 1rem;
  text-align: left;
}

.tally .row {
  display: contents;
}

.tally .row > span {
  opacity: 0;
  transform: translateY(0.4rem);
  animation: rise 0.35s ease forwards;
  animation-delay: var(--d, 0s);
}

.tally .row .val {
  text-align: right;
  font-weight: 600;
}

.tally .row.dock .val { color: var(--danger); }
.tally .row.bonus .val { color: var(--feedback-correct); }

.tally .row.total > span {
  border-top: 2px solid var(--border);
  padding-top: 0.5rem;
  margin-top: 0.35rem;
  font-size: var(--t2);
  color: var(--accent);
}

.tally .row.total .val {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--t3);
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

.level-up {
  margin: 1rem 0 0;
  font-family: var(--display);
  font-weight: 400;
  color: var(--accent);
  font-size: var(--t1);
}

.streak-line {
  margin: 0.5rem 0 0;
  font-family: var(--mono);
  font-weight: 600;
}

.lesson {
  margin: 1.25rem 0 0;
  max-width: 32em;
  color: var(--text-dim);
  line-height: 1.55;
}

.return-line {
  color: var(--text-dim);
  font-size: var(--t-1);
  margin: 1rem 0 0;
}

.btn-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.round-end.celebrate-win .tally-title {
  animation: pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.round-end.celebrate-level .level-up {
  animation: level-glow 1.1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop-in {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes level-glow {
  0% { text-shadow: 0 0 0 transparent; transform: scale(0.9); opacity: 0; }
  50% { text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 65%, transparent); }
  100% { text-shadow: 0 0 0 transparent; transform: scale(1); opacity: 1; }
}

/* --- Signed out --- */

.sign-in-link {
  display: inline-block;
  text-decoration: none;
  background: var(--accent);
  color: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 0.6em 1.2em;
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 var(--bevel-light),
    inset 0 -3px 0 var(--bevel-dark),
    0 3px 0 var(--bevel-dark);
}

/* --- Start screen (attract mode) --- */

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

.attract-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--t4);
  line-height: 1;
  margin: 0.5rem 0 0.25rem;
  text-align: center;
}

.attract-sub {
  color: var(--text-dim);
  margin: 0 0 1.5rem;
  text-align: center;
  max-width: 30em;
}

.pick {
  width: 100%;
  max-width: 30rem;
  margin-bottom: 1rem;
}

.pick-label {
  font-family: var(--mono);
  font-size: var(--t-1);
  color: var(--text-dim);
  margin: 0 0 0.4rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  font: 600 var(--t-1) var(--mono);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  box-shadow: inset 0 -2px 0 var(--bevel-dark);
}

.chip[aria-pressed="true"] {
  border-color: var(--option);
  background: color-mix(in srgb, var(--option) 18%, var(--panel));
}

.start #btn-deal {
  margin-top: 0.6rem;
}

.last-session {
  font-family: var(--mono);
  font-size: var(--t-1);
  color: var(--text-dim);
  margin-top: 1.5rem;
}

/* --- Session summary --- */

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

.summary-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--t4);
  line-height: 1;
  margin: 0.25rem 0 1.5rem;
  color: var(--accent);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 0.5rem 2rem;
  font-family: var(--mono);
  margin-bottom: 1.5rem;
}

.summary-grid .n {
  font-family: var(--display);
  font-size: var(--t3);
  line-height: 1;
}

.summary-grid .l {
  font-size: var(--t-1);
  color: var(--text-dim);
}

.summary-topics {
  width: 100%;
  max-width: 26rem;
  font-family: var(--mono);
  font-size: var(--t-1);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.4rem 0.75rem;
  align-items: center;
  text-align: left;
}

.summary-topics .who {
  color: var(--text-dim);
}

.summary-topics .bar {
  height: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  overflow: hidden;
}

.summary-topics .bar > span {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  background: var(--feedback-correct);
}

.summary-topics .bar.weak > span {
  background: var(--feedback-present);
}

.next-time {
  margin: 1.25rem 0 0;
  max-width: 30em;
}

.next-time + .next-time {
  margin-top: 0.4rem;
}

.next-time code {
  font-family: var(--mono);
  color: var(--accent);
}

/* --- How-to-play overlay --- */

.overlay {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.overlay[hidden] {
  display: none;
}

.overlay-panel {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 1.5em;
  max-width: 26em;
  box-shadow:
    inset 0 1px 0 var(--bevel-light),
    inset 0 -2px 0 var(--bevel-dark),
    0 4px 0 var(--bevel-dark);
}

.overlay-panel h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--t2);
  margin-top: 0;
}

.overlay-panel ul {
  list-style: none;
  padding: 0;
}

.overlay-panel li {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin: 0.4em 0;
}

.swatch {
  display: inline-block;
  width: 1em;
  height: 1em;
  border-radius: 3px;
}

.swatch.green { background: var(--feedback-correct); }
.swatch.yellow { background: var(--feedback-present); }
.swatch.black { background: var(--feedback-absent); }

/* --- Reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  .tile.revealed,
  .round-end.celebrate-win .tally-title,
  .round-end.celebrate-level .level-up {
    animation: none;
  }

  .tally .row > span {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .xp-bar > span {
    transition: none;
  }

  button,
  .arcade-btn .cap {
    transition: none;
  }
}

/* --- Narrow screens --- */

@media (max-width: 560px) {
  .marquee {
    flex-direction: column;
    align-items: stretch;
  }

  .rank {
    min-width: 0;
  }

  .marquee-controls {
    flex-direction: row;
  }

  .deck {
    gap: 1rem 1.25rem;
  }

  .summary-grid {
    grid-template-columns: repeat(2, auto);
  }

  .wordle-row {
    grid-template-columns: repeat(var(--cols), minmax(1.6rem, 2.6rem));
  }

  .tile {
    font-size: var(--t1);
  }

  .key {
    min-width: 1.7em;
    padding: 0.5em 0.25em;
  }

  .memory-grid {
    grid-template-columns: repeat(var(--cols), minmax(2.4em, 3.2em));
  }
}
