/* Wordfray
   The classic word-grid look: a white (or near-black) page, one clean typeface, square tiles.
   Colour only carries meaning on the tiles and keys:
   green = right letter, right spot; yellow = right letter, wrong spot; grey = not in the word. */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/hanken-grotesk-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Accented letters, for names such as "Zoë" or "Łukasz". Only fetched when one is on the page. */
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/hanken-grotesk-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --page: #ffffff;         /* background */
  --panel: #f4f5f6;        /* quiet blocks: list rows, the highlighted table row */
  --hover: #e9ebee;
  --ink: #1b1c1e;          /* text */
  --ink-soft: #686c73;     /* secondary text */
  --line: #d6d9dd;         /* dividers, empty tiles */
  --line-strong: #878b90;  /* tiles with a letter typed in, text boxes */

  --green: #579a52;        /* right letter, right spot */
  --yellow: #ae9227;       /* right letter, wrong spot */
  --grey: #787c80;         /* letter is not in the word */
  --on-green: #ffffff;
  --on-yellow: #ffffff;
  --on-grey: #ffffff;
  --green-text: #3c7a38;   /* green that is dark enough for small text and thin outlines */

  --key: #d5d8dc;          /* keyboard keys not used yet */
  --key-hover: #c5c9ce;
  --key-ink: #1b1c1e;
  --btn: #1b1c1e;          /* main buttons */
  --btn-hover: #3d4044;
  --on-btn: #ffffff;
  --violet: #7a5bd1;       /* Oddball */
  --violet-text: #5b3fb0;
  --accent: var(--green);  /* each game's own colour, set by data-game below */
  --on-accent: #ffffff;
  --red: #c9372c;          /* errors, removing, leaving */
  --on-red: #ffffff;
  --veil: rgba(18, 18, 20, 0.5);   /* behind dialogs */
  --shadow: 0 6px 28px rgba(0, 0, 0, 0.16);

  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --top-h: 3.5rem;
  --pad: clamp(1rem, 3vw, 1.5rem);
  --col: 31.25rem;         /* width of the board-and-keyboard column */
}

/* Dark colours. theme.js puts data-theme on <html> before the page is drawn: the saved
   choice if there is one, otherwise whatever the device is set to. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #121214;
  --panel: #1d1e20;
  --hover: #2a2b2e;
  --ink: #f5f5f6;
  --ink-soft: #a3a7ad;
  --line: #3a3b3f;
  --line-strong: #63666c;
  --green: #4e9149;
  --yellow: #a98d24;
  --grey: #3a3b3f;
  --green-text: #7fcf78;
  --key: #777a7f;
  --key-hover: #868a8f;
  --key-ink: #ffffff;
  --btn: #f5f5f6;
  --btn-hover: #d6d8db;
  --on-btn: #1b1c1e;
  --red: #ff8272;
  --on-red: #1b1c1e;
  --violet: #8f73e6;
  --violet-text: #b9a6f5;
  --veil: rgba(0, 0, 0, 0.65);
  --shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
}

/* Colour-blind colours (Settings): blue for the right spot, orange for the wrong spot. */
:root[data-contrast="high"] {
  --green: #0b6fc2;
  --yellow: #e8862b;
  --on-yellow: #1b1c1e;
  --green-text: #0b6fc2;
}
:root[data-contrast="high"][data-theme="dark"] {
  --green: #1f77c9;
  --green-text: #77b8f2;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--page);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; }

h1, h2, h3 { font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1rem; }

.soft { color: var(--ink-soft); }
.small { font-size: 0.875rem; }
.num { font-weight: 700; font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 0.5rem; top: -4rem; z-index: 50;
  padding: 0.5rem 0.875rem; background: var(--btn); color: var(--on-btn); border-radius: 999px;
}
.skip:focus { top: 0.5rem; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
#app:focus { outline: none; }
.noscript { padding: 2rem var(--pad); }

/* ------------------------------------------------------------------ top bar */

.top {
  height: var(--top-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 0.5rem;
  border-bottom: 1px solid var(--line);
}
.top-side { display: flex; align-items: center; gap: 0.125rem; min-width: 0; }
.top-side.end { justify-content: flex-end; }
.brand {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.5rem; border-radius: 10px;
  font-size: 1.5rem; font-weight: 800; line-height: 1; letter-spacing: -0.035em;
  text-decoration: none; white-space: nowrap;
}
.brand .logo-mark { width: 1.6em; height: 1.6em; margin: -0.3em 0.1em -0.3em -0.2em; }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0.5rem 1.25rem;
  border: 1.5px solid var(--btn); border-radius: 999px;
  background: var(--btn); color: var(--on-btn);
  font-weight: 600; font-size: 1rem; line-height: 1.1;
  text-decoration: none; cursor: pointer;
  touch-action: manipulation;
}
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; background: var(--btn); border-color: var(--btn); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink); background: var(--panel); }
.btn.ghost[disabled] { background: transparent; border-color: var(--line-strong); }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red); color: var(--on-red); }
.btn.sm { min-height: 2.25rem; padding: 0.25rem 0.875rem; font-size: 0.875rem; }
.btn.big { min-height: 3.25rem; padding: 0.75rem 1.75rem; font-size: 1.0625rem; }
.btn svg { width: 1.125rem; height: 1.125rem; flex: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; flex: none;
  background: none; border: 0; border-radius: 50%; cursor: pointer; color: var(--ink);
}
.icon-btn:hover { background: var(--hover); }
.icon-btn svg { width: 1.5rem; height: 1.5rem; }

.linkish { background: none; border: 0; padding: 0; color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.linkish:hover { color: var(--ink-soft); }

.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; flex: none; }

/* -------------------------------------------------------------------- forms */

.field { display: grid; gap: 0.375rem; margin-bottom: 1.125rem; align-content: start; justify-items: start; }
.field > label, .field > .label { font-size: 0.875rem; font-weight: 600; }
.field .hint { font-size: 0.875rem; color: var(--ink-soft); }
.field .err, .err { font-size: 0.875rem; color: var(--red); }
.err:empty { display: none; }

.input {
  width: 100%; min-height: 2.75rem; padding: 0.5rem 0.75rem;
  background: var(--page); color: var(--ink);
  border: 1.5px solid var(--line-strong); border-radius: 8px;
}
.input::placeholder { color: var(--ink-soft); opacity: 0.8; }
.input:hover { border-color: var(--ink-soft); }
.input:focus-visible { border-color: var(--ink); outline: 1.5px solid var(--ink); outline-offset: 0; }

/* the word-length drop-down */
.select {
  appearance: none; -webkit-appearance: none;
  min-height: 2.5rem; padding: 0.25rem 2.25rem 0.25rem 1rem;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23808489' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.75rem center / 1rem;
  color: var(--ink); font-weight: 600; font-size: 0.9375rem;
}
.select:hover { background-color: var(--hover); }

/* one-of-several choices, drawn as a row of pills */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; max-width: 100%; background: var(--panel); border-radius: 1.375rem; }
.seg label { position: relative; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span {
  display: block; min-width: 2.375rem; padding: 0.4375rem 0.75rem; text-align: center;
  border-radius: 999px;
  font-weight: 600; font-size: 0.9375rem; line-height: 1.25;
}
.seg input:hover + span { background: var(--hover); }
.seg input:checked + span { background: var(--btn); color: var(--on-btn); }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* settings rows: a label on the left, a button or an on/off switch on the right */
.setting, .switch {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center;
  padding: 0.875rem 0; border-bottom: 1px solid var(--line);
}
.switch { position: relative; cursor: pointer; }
.switch-text { display: grid; gap: 0.125rem; min-width: 0; }
.switch-text b { font-weight: 600; }
.switch-text small { font-size: 0.875rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.track { position: relative; width: 2.75rem; height: 1.5rem; border-radius: 999px; background: var(--line-strong); transition: background 0.15s; }
.track::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 1.25rem; height: 1.25rem;
  border-radius: 50%; background: #ffffff; transition: transform 0.15s;
}
.switch input:checked ~ .track { background: var(--green); }
.switch input:checked ~ .track::after { transform: translateX(1.25rem); }
.switch input:focus-visible ~ .track { outline: 2px solid var(--ink); outline-offset: 2px; }
.switch + p, .setting + p { margin-top: 1rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.form-row .field { justify-items: stretch; }
.actions { display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: center; }
.actions.end { justify-content: flex-end; }
.actions.center { justify-content: center; }

/* ------------------------------------------------------------------ dialogs */

.dlg {
  width: min(32rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem);
  padding: 0; border: 1px solid var(--line); border-radius: 14px;
  background: var(--page); color: var(--ink);
  box-shadow: var(--shadow);
  overflow: auto;
}
.dlg[open] { animation: dlg-in 0.18s ease-out; }
.dlg::backdrop { background: var(--veil); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(0.75rem); } }
.dlg-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.875rem 0.75rem 0.5rem 1.5rem;
  background: var(--page);
}
.dlg-head h2 { font-size: 1.25rem; }
.dlg-body { padding: 0.5rem 1.5rem 1.5rem; }
.dlg-body > p + p { margin-top: 0.75rem; }
.dlg-body .actions { margin-top: 1.25rem; }
.dlg-body h3 { margin: 1.5rem 0 0.5rem; }
.dlg-body h3:first-child { margin-top: 0; }

.toasts {
  position: fixed; left: 50%; top: calc(var(--top-h) + 0.75rem); transform: translateX(-50%);
  z-index: 100; display: grid; gap: 0.5rem; justify-items: center; pointer-events: none;
  width: max-content; max-width: calc(100vw - 2rem);
}
/* While a board is on screen, dom.js moves the stack to sit just above the board. */
.toast {
  padding: 0.625rem 0.875rem; border-radius: 6px;
  background: var(--ink); color: var(--page); font-weight: 700; font-size: 0.9375rem; line-height: 1.25; text-align: center;
  animation: toast-in 0.16s ease-out;
}
.toast.bad { background: var(--red); color: var(--on-red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

/* --------------------------------------------------------------------- tiles
   .tiles carries the sizing: --len letters wide, --th tall, --fs letter size.
   .on = a letter typed in   .c = right spot   .p = wrong spot   .a = not in the word */

.tiles { display: grid; gap: var(--gap, 5px); width: var(--bw, 100%); margin-inline: auto; align-content: start; position: relative; }
.row { display: grid; grid-template-columns: repeat(var(--len), minmax(0, 1fr)); gap: var(--gap, 5px); position: relative; }

.tile {
  height: var(--th, 3.875rem);
  display: grid; place-items: center;
  border: 2px solid var(--line);
  color: var(--ink);
  font-weight: 700; font-size: var(--fs, 2rem); line-height: 1;
  text-transform: uppercase;
  user-select: none;
}
.tile.on { border-color: var(--line-strong); }
/* a square left blank on purpose (Space): a dash, to be filled in later */
.tile.blank { border-color: var(--line-strong); color: var(--ink-soft); font-weight: 400; }
/* where the next letter will go, once there are blanks or the cursor has been moved */
.tile.cursor { border-style: dashed; border-color: var(--ink); }
.tile.c { background: var(--green); border-color: var(--green); color: var(--on-green); }
.tile.p { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }
.tile.a { background: var(--grey); border-color: var(--grey); color: var(--on-grey); }
.tile.pop { animation: pop 0.1s ease-out; }
.tile.flip { animation: flip 0.4s ease-in-out; }
.row.shake { animation: shake 0.45s linear; }
.row.wait .tile { border-style: dashed; }
.row.win .tile { animation: jump 0.9s ease both; animation-delay: calc(var(--i) * 90ms); }

@keyframes pop { from { transform: scale(0.88); } 60% { transform: scale(1.06); } }
@keyframes flip { 0%, 100% { transform: rotateX(0); } 50% { transform: rotateX(-90deg); } }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); }
}
@keyframes jump {
  0%, 20% { transform: translateY(0); } 40% { transform: translateY(-32%); } 50% { transform: translateY(6%); }
  60% { transform: translateY(-14%); } 80% { transform: translateY(3%); } 100% { transform: translateY(0); }
}

/* small read-only boards: colours only (other players), or with letters (results, recaps) */
.mini { display: grid; gap: 2px; width: max-content; }
.mini .mrow { display: grid; grid-template-columns: repeat(var(--len), var(--cell, 0.5rem)); gap: 2px; }
.mini i { height: var(--cell, 0.5rem); border-radius: 1.5px; box-shadow: inset 0 0 0 1px var(--line); }
.mini i.c, .mini i.p, .mini i.a { box-shadow: none; }
.mini i.c { background: var(--green); }
.mini i.p { background: var(--yellow); }
.mini i.a { background: var(--grey); }

.tiles.sm { --gap: 3px; --th: 1.625rem; --fs: 0.875rem; }
.tiles.sm .tile { border-width: 1px; }
.tiles.md { --gap: 4px; --th: 2.25rem; --fs: 1.125rem; }
.tiles.eg { --gap: 4px; --th: 2.5rem; --fs: 1.25rem; margin: 0; }
.tiles.answer { --gap: 4px; --th: 3rem; --fs: 1.5rem; margin: 0.375rem 0 0; }
/* Read-only boards have square tiles too; where a long word does not fit, the tiles get narrower instead. */
.tiles.sm, .tiles.md, .tiles.eg, .tiles.answer { width: min(100%, calc(var(--len) * var(--th) + (var(--len) - 1) * var(--gap))); }

/* ------------------------------------------------------------------ keyboard */

.kb { display: grid; gap: 8px; width: min(100%, var(--col)); margin-inline: auto; touch-action: manipulation; }
.kb-row { display: flex; gap: 6px; justify-content: center; }
.key {
  flex: 1 1 0; min-width: 0; height: 3.625rem; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 4px; cursor: pointer;
  background: var(--key); color: var(--key-ink);
  font-weight: 700; font-size: 1.25rem; line-height: 1; text-transform: uppercase;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.key:hover { background: var(--key-hover); }
.key:active { transform: translateY(1px); }
.key.wide { flex: 1.5 1 0; font-size: 0.75rem; letter-spacing: 0.01em; }
.key.wide svg { width: 1.5rem; height: 1.5rem; }
.key.c { background: var(--green); color: var(--on-green); }
.key.p { background: var(--yellow); color: var(--on-yellow); }
.key.a { background: var(--grey); color: var(--on-grey); }
.kb-half { flex: 0.5 1 0; }
.kb[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* --------------------------------------------------------------------- home */

.home { width: min(100%, 66rem); margin-inline: auto; padding: 0 var(--pad) 3rem; }
.home > .card { width: min(100%, 44rem); margin: 2.5rem auto 0; }

.mark { --len: 8; --gap: 5px; --th: clamp(2.125rem, 10.2vw, 3.25rem); width: min(100%, calc(8 * var(--th) + 7 * var(--gap))); }
.mark.intro .tile { animation: flip-in 0.5s ease-in-out backwards; animation-delay: calc(var(--i) * 110ms + 150ms); }
@keyframes flip-in {
  0% { transform: rotateX(0); background: transparent; border-color: var(--line-strong); color: var(--ink); }
  49.9% { background: transparent; border-color: var(--line-strong); color: var(--ink); }
  50% { transform: rotateX(-90deg); }
  100% { transform: rotateX(0); }
}
.lede { margin-top: 1.5rem; font-size: clamp(1.25rem, 4.2vw, 1.625rem); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.lede + .soft { margin-top: 0.375rem; }

.card { margin-top: 1rem; padding: 1.25rem 1.25rem 1.375rem; border: 1px solid var(--line); border-radius: 14px; }
.card > h2, .card-head { margin-bottom: 0.5rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; flex-wrap: wrap; }
.card > p + .field, .card > p + .actions { margin-top: 1.125rem; }
.card h3 { margin: 1.5rem 0 0.625rem; }

.fx { display: grid; gap: 0.5rem; }
.fx a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.125rem 1rem; align-items: center;
  padding: 0.75rem 0.875rem; border-radius: 10px; background: var(--panel); text-decoration: none;
}
.fx a:hover { background: var(--hover); }
.fx-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-name .ico { margin-right: 0.375rem; color: var(--ink-soft); }
.fx-sub { grid-column: 1; color: var(--ink-soft); font-size: 0.875rem; }
.fx-sub b { color: var(--ink); font-weight: 600; }
.fx-go { grid-column: 2; grid-row: 1 / span 2; }
.fx-go.btn { pointer-events: none; }
.fx:not(:empty) { margin-bottom: 0.75rem; }
.empty { padding: 1rem; border-radius: 10px; background: var(--panel); color: var(--ink-soft); margin-bottom: 0.75rem; }
.live-dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--green); margin-right: 0.375rem; vertical-align: 0.05em; }
.live-dot.off { background: var(--red); }
.who-line { margin-top: 1rem; padding-top: 0.875rem; border-top: 1px solid var(--line); }
.who-line b { color: var(--ink); }

/* how to play */
.examples { display: grid; gap: 1rem; margin: 1.125rem 0; }
.examples li { display: grid; gap: 0.375rem; }
.rules { display: grid; gap: 0.5rem; padding-left: 1.125rem; list-style: disc; }
.rules li::marker { color: var(--ink-soft); }

/* ---------------------------------------------------------- game screen frame */

.game { height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); display: grid; grid-template-rows: auto minmax(0, 1fr); }
.gamebar .seg span { padding-block: 0.3125rem; }
.bar {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.5rem var(--pad); border-bottom: 1px solid var(--line);
}
.bar-title { margin-right: auto; min-width: 0; display: flex; align-items: baseline; gap: 0.625rem; flex-wrap: wrap; }
.bar-title h1 { font-size: 1.125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.bar-title .ico { color: var(--ink-soft); margin-right: 0.25rem; }
.notice { padding: 0.375rem var(--pad); background: var(--panel); color: var(--ink); border-bottom: 1px solid var(--line); font-size: 0.875rem; font-weight: 600; text-align: center; }
.notice.bad { background: var(--red); color: var(--on-red); border-color: var(--red); }

.body { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 19rem; }
.body.solo { grid-template-columns: minmax(0, 1fr); }
.stage { container: stage / inline-size; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 0.625rem; padding: 0.75rem var(--pad) max(0.75rem, env(safe-area-inset-bottom)); }
.stage.scroll { overflow: auto; }
.side { min-height: 0; overflow: auto; border-left: 1px solid var(--line); padding: 1rem 1rem 1.5rem; }
.side h2 { font-size: 0.875rem; font-weight: 600; letter-spacing: 0; color: var(--ink-soft); margin-bottom: 0.5rem; }

.status { display: flex; align-items: center; justify-content: center; gap: 0.375rem 0.875rem; flex-wrap: wrap; min-height: 2rem; text-align: center; }
.status .num { font-size: 1.0625rem; }
.status:empty, .under:empty { display: none; }
.clock { padding: 0.1875rem 0.625rem; border-radius: 999px; background: var(--panel); font-weight: 700; font-size: 1.0625rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.clock.low { background: var(--red); color: var(--on-red); }
.board-wrap { flex: 1 1 0; min-height: 0; display: grid; place-items: center; }
.under { display: grid; gap: 0.625rem; justify-items: center; text-align: center; }
.under .kb { justify-self: stretch; }
.under h2 { font-size: 1.375rem; }
.finish { display: grid; gap: 0.875rem; justify-items: center; padding: 0.25rem 0 0.75rem; }

.panel { width: min(100%, 34rem); margin: auto; padding: 1.25rem 0; display: grid; gap: 1rem; justify-items: start; }
.panel.center { justify-items: center; text-align: center; }
.panel h2 { font-size: clamp(1.5rem, 4.5vw, 1.875rem); font-weight: 800; letter-spacing: -0.02em; }
.panel p { max-width: 34rem; }
.panel form { width: min(100%, 22rem); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; text-align: left; padding: 0.875rem 1rem; border-radius: 10px; background: var(--panel); width: 100%; }
.facts dt { color: var(--ink-soft); }
.count { font-size: clamp(4rem, 16vw, 6.5rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- players list */

.plist { display: grid; }
.pl { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr) auto auto; gap: 0.25rem 0.5rem; align-items: center; padding: 0.625rem 0; border-top: 1px solid var(--line); position: relative; }
.pl.away .pl-name, .pl.away .pl-score { opacity: 0.5; }
.pl-rank { color: var(--ink-soft); font-size: 0.875rem; font-weight: 600; }
.pl-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-name .ico { color: var(--ink-soft); margin-left: 0.25rem; }
.pl-score { font-weight: 700; font-size: 1.125rem; line-height: 1; font-variant-numeric: tabular-nums; }
.pl-sub { grid-column: 2 / -1; display: flex; align-items: center; gap: 0.625rem; color: var(--ink-soft); font-size: 0.875rem; min-height: 1.25rem; flex-wrap: wrap; }
.tag { display: inline-block; white-space: nowrap; padding: 0 0.4375rem; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 0.75rem; font-weight: 600; line-height: 1.5; color: var(--ink-soft); vertical-align: 0.1em; margin-left: 0.375rem; }
.pl-sub > .tag { margin-left: 0; }
.tag.hit { border-color: var(--green); color: var(--green-text); }
.tag.strong { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.pl-menu { position: static; min-width: 0; }
.pl-menu:empty { display: none; }
.pl-menu > summary { list-style: none; cursor: pointer; display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; }
.pl-menu > summary::-webkit-details-marker { display: none; }
.pl-menu > summary:hover { background: var(--hover); }
.pl-menu > summary svg { width: 1.125rem; height: 1.125rem; }
.pl-menu[open] > div { position: absolute; right: 0; top: 100%; z-index: 5; display: grid; gap: 0.375rem; padding: 0.5rem; background: var(--page); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 11rem; }

/* ------------------------------------------------------------ round results */

.answer-box { width: 100%; }
.panel.center .tiles.answer, .under .tiles.answer, .finish .tiles.answer { margin-inline: auto; }
.rank { width: 100%; border-collapse: collapse; text-align: left; }
.rank th { font-weight: 600; color: var(--ink-soft); font-size: 0.875rem; padding: 0 0.625rem 0.375rem; }
.rank td { padding: 0.5625rem 0.625rem; border-top: 1px solid var(--line); }
.rank td:last-child, .rank th:last-child { text-align: right; }
.rank .me td { background: var(--panel); }
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 1.25rem 1rem; width: 100%; }
.boards figure { display: grid; gap: 0.375rem; justify-items: start; align-content: start; }
.boards figcaption { font-size: 0.875rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boards .tiles { margin: 0; }

/* -------------------------------------------------------------- tournament */

.duel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1rem; align-items: center; width: min(100%, var(--col)); margin-inline: auto; }
.duel-vs { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.duel-note { grid-column: 1 / -1; text-align: left; font-size: 0.875rem; color: var(--ink-soft); min-height: 1.3rem; }
.duel-note.hot { color: var(--ink); font-weight: 700; }
.duel .mini { --cell: 0.375rem; }

.recap { display: grid; grid-template-columns: repeat(2, minmax(0, 12rem)); gap: 1rem 1.5rem; justify-content: center; width: 100%; }
.recap figure { display: grid; gap: 0.375rem; justify-items: start; align-content: start; min-width: 0; }
.recap figcaption { font-weight: 600; font-size: 0.875rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap .tiles { margin: 0; }
.tabs { display: flex; gap: 0.375rem; flex-wrap: wrap; justify-content: center; }
.tabs .btn[aria-pressed="true"] { background: var(--btn); color: var(--on-btn); border-color: var(--btn); }

.bk-wrap { width: 100%; border-top: 1px solid var(--line); padding-top: 1rem; }
.bk-wrap > h2 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.bk-scroll { overflow: auto; padding: 2px 2px 0.5rem; max-width: 100%; }
.bk-heads, .bk { display: grid; grid-auto-flow: column; grid-auto-columns: 11.5rem; width: max-content; }
.bk-heads { margin-bottom: 0.375rem; }
.bk-heads span { font-size: 0.875rem; font-weight: 600; color: var(--ink-soft); padding-left: 1.625rem; }
.bk-heads span:first-child { padding-left: 0; }
.bk { grid-template-rows: repeat(var(--rows), 4.5rem); }
.bk-cell { grid-row: var(--at) / span var(--span); position: relative; display: flex; align-items: center; padding-left: 1.625rem; min-width: 0; }
.bk-cell.first { padding-left: 0; }
.bk-cell:not(.first)::before {
  content: ""; position: absolute; left: 0; top: 25%; height: 50%; width: 0.8125rem;
  border: 1.5px solid var(--line-strong); border-left: 0; border-radius: 0 6px 6px 0;
}
.bk-cell:not(.first)::after {
  content: ""; position: absolute; left: 0.8125rem; top: 50%; width: 0.8125rem; margin-top: -0.75px;
  border-top: 1.5px solid var(--line-strong);
}
.bk-match {
  width: 100%; min-width: 0; display: grid; padding: 0; text-align: left; cursor: pointer; overflow: hidden;
  background: var(--page); color: var(--ink); border: 1.5px solid var(--line-strong); border-radius: 8px;
}
.bk-match:hover { border-color: var(--ink-soft); background: var(--panel); }
.bk-match.live { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.bk-match.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); background: var(--panel); }
.bk-p { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; align-items: center; height: 1.75rem; padding: 0 0.625rem; font-size: 0.875rem; }
.bk-p + .bk-p { border-top: 1px solid var(--line); }
.bk-p span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-p.won { font-weight: 700; }
.bk-p.lost { color: var(--ink-soft); }
.bk-p.me span:first-child { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 2px; }
.bk-p .num { font-size: 0.875rem; }
.bk-p .ico { color: var(--green-text); }
.bk-p.tbd { color: var(--ink-soft); font-style: italic; }
.bk-note { position: absolute; right: 0.25rem; top: calc(50% + 1.9rem); font-size: 0.6875rem; line-height: 1.2; color: var(--ink-soft); white-space: nowrap; }
.bk-note.live { color: var(--green-text); font-weight: 700; }

.champ { display: grid; gap: 0.625rem; justify-items: center; text-align: center; }
.champ svg { width: 2.75rem; height: 2.75rem; color: var(--ink); }
.champ h2 { font-size: clamp(1.625rem, 5.5vw, 2.25rem); font-weight: 800; letter-spacing: -0.02em; }

.tour-head { width: 100%; padding: 0.25rem 0 1.25rem; }
.tour-head .panel { padding: 0; }
.tour-bracket { width: 100%; }
.only-narrow { display: none; }

/* --------------------------------------------------------------- statistics */

.stats-body { display: grid; gap: 1rem; }
.stats-body h3 { margin: 0.25rem 0 -0.375rem; }
.stats-lead { display: grid; gap: 0.25rem; }
.pickers { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; text-align: center; }
.stats div { display: grid; justify-items: center; align-content: start; gap: 0.125rem; }
.stats b { font-size: 2.125rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { font-size: 0.75rem; line-height: 1.25; color: var(--ink-soft); }
.dist { display: grid; gap: 4px; }
.dist div { display: grid; grid-template-columns: 0.75rem 1fr; gap: 0.5rem; align-items: center; font-size: 0.875rem; font-weight: 700; }
.dist i { display: block; min-width: 1.75rem; padding: 0.0625rem 0.5rem; background: var(--grey); color: var(--on-grey); text-align: right; font-style: normal; }
.dist .now i { background: var(--green); color: var(--on-green); }
.stats-foot { display: grid; gap: 0.75rem; justify-items: center; padding-top: 0.25rem; }
.stats-foot .actions { margin-top: 0; }
.next-daily { display: grid; justify-items: center; }
.next-daily b { font-size: 1.75rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- word notes
   A little (i) button after each guess opens facts about that word. When the page is wide
   enough the notes also sit open in a card beside the board. */

.info {
  position: absolute; top: 0; bottom: 0; left: calc(100% + 2px); width: 1.75rem;
  display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--ink-soft); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.info[hidden] { display: none; }
.info svg { width: 1.25rem; height: 1.25rem; }
.info:hover, .info.on { color: var(--ink); }
.info:hover svg, .info.on svg { background: var(--panel); border-radius: 50%; }

.notes { display: none; position: absolute; top: 0; left: calc(100% + 2.75rem); width: 15.5rem; max-height: 100%; overflow: auto; text-align: left; }
@container stage (min-width: 58rem) {
  .notes { display: block; }
  .row .info { display: none; } /* the notes are already showing beside the board */
  .row:has(.tile.c, .tile.p, .tile.a) { cursor: pointer; }
}
@media (min-width: 64rem) { .gamebar .to-defs { display: none; } }

.note { border: 1px solid var(--line); border-radius: 10px; padding: 0.75rem 0.875rem 0.875rem; background: var(--page); }
.dlg-body .note { border: 0; padding: 0; }
.note-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.625rem; }
.note-word { font-size: 1.25rem; font-weight: 800; letter-spacing: 0.1em; }
.note-tier { font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
.note-row + .note-row { margin-top: 0.75rem; }
.note-key { display: block; font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
.note-row p { margin-top: 0.25rem; font-size: 0.875rem; line-height: 1.4; overflow-wrap: anywhere; }
.note-row p.soft { color: var(--ink-soft); }
.note-row em { font-style: italic; color: var(--ink-soft); }
.meter { height: 6px; margin-top: 0.375rem; border-radius: 3px; background: var(--hover); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--ink-soft); }
.notes > .soft { padding: 0.25rem 0; }

/* the space bar and arrow keys under the letters */
.kb-space .key { height: 2.5rem; font-size: 0.8125rem; text-transform: none; letter-spacing: 0; font-weight: 600; }
.kb-space .key.small { flex: 1 1 0; }
.kb-space .key.bar { flex: 4 1 0; }
.kb-space .key svg { width: 1.25rem; height: 1.25rem; }

.check { display: flex; align-items: center; gap: 0.5rem; margin: 0.125rem 0 0.75rem; font-size: 0.875rem; color: var(--ink-soft); cursor: pointer; }
.check input { width: 1rem; height: 1rem; accent-color: var(--ink); }
.setting-btns { display: flex; gap: 0.5rem; flex: none; }
.acct-badge { display: inline-grid; vertical-align: -0.15em; margin-left: 0.25rem; color: var(--green-text); }
.acct-badge svg { width: 0.9375rem; height: 0.9375rem; }

/* --------------------------------------------------------------- responsive */

@media (max-width: 56rem) {
  .body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .body.solo { grid-template-rows: minmax(0, 1fr); }
  .body > .side { grid-row: 1; }
  .body > .stage { grid-row: 2; }
  .body.solo > .stage { grid-row: 1; }
  /* the player list becomes a strip that scrolls sideways */
  .side { border-left: 0; border-bottom: 1px solid var(--line); padding: 0.375rem var(--pad); overflow: auto hidden; }
  .side h2 { display: none; }
  .plist { display: flex; gap: 0; }
  .pl { flex: none; grid-template-columns: auto auto; gap: 0 0.5rem; border: 0; border-right: 1px solid var(--line); padding: 0.125rem 0.75rem 0.125rem 0; margin-right: 0.75rem; max-width: 12rem; }
  .pl:last-child { border: 0; margin-right: 0; }
  .pl-rank, .pl-menu { display: none; }
  .pl-sub { grid-column: 1 / -1; flex-wrap: nowrap; }
  .pl-sub .long { display: none; }
  .pl .mini { --cell: 0.3125rem; }
  .only-narrow { display: inline-flex; }
  /* ...or, opened with the list button, the full list */
  .side.tall { overflow: auto; max-height: 38dvh; }
  .side.tall .plist { display: grid; }
  .side.tall .pl { grid-template-columns: 1.25rem minmax(0, 1fr) auto auto; max-width: none; border: 0; border-top: 1px solid var(--line); margin: 0; padding: 0.5rem 0; }
  .side.tall .pl-rank, .side.tall .pl-menu { display: block; }
  .side.tall .pl-sub { grid-column: 2 / -1; }
  .side.tall .pl-sub .long { display: inline; }
  .side.tall .pl .mini { --cell: 0.4375rem; }
  .side.tall h2 { display: block; }
}

@media (max-width: 36rem) {
  :root { --top-h: 3.125rem; }
  .brand { font-size: 1.5rem; }
  .seg span { min-width: 2.125rem; padding-inline: 0.5rem; }
  .form-row { grid-template-columns: 1fr; }
  .kb { gap: 7px; }
  .kb-row { gap: 5px; }
  .key { height: 3.375rem; font-size: 1.125rem; }
  .key.wide { font-size: 0.6875rem; }
  .bar { flex-wrap: nowrap; }
  .bar .btn { padding-inline: 0.625rem; }
  .bar .btn .long { display: none; }
  .bar-title { flex: 1 1 auto; }
  .bar-title .soft { display: none; }
  .pl-sub { min-height: 0; }
  .dlg-head { padding-left: 1.125rem; }
  .dlg-body { padding: 0.5rem 1.125rem 1.25rem; }
  .card { padding: 1.125rem 1rem 1.25rem; }
  .stats b { font-size: 1.875rem; }
}

@media (max-width: 22.5rem) {
  .seg span { min-width: 1.75rem; padding-inline: 0.3125rem; }
  .brand { font-size: 1.375rem; }
}

@media (max-height: 40rem) {
  .key { height: 2.875rem; }
  .kb-space .key { height: 2.125rem; }
  .kb { gap: 6px; }
}
@media (max-height: 34rem) {
  .key { height: 2.375rem; }
  .kb-space .key { height: 1.875rem; }
  .kb { gap: 4px; }
  .gamebar { padding-block: 0.375rem; }
}
/* a phone on its side: shrink the bars so the board and all three key rows still fit */
@media (max-height: 26rem) {
  :root { --top-h: 2.75rem; }
  .brand { font-size: 1.25rem; }
  .icon-btn { width: 2.25rem; height: 2.25rem; }
  .gamebar { padding-block: 0.25rem; }
  .gamebar .seg span { padding-block: 0.125rem; }
  .gamebar h1 { font-size: 1rem; }
  .select { min-height: 1.875rem; }
  .bar { padding-block: 0.25rem; }
  .stage { padding-block: 0.375rem; gap: 0.375rem; }
  .status { min-height: 1.5rem; }
  .key { height: 2.125rem; font-size: 1rem; }
  .kb-space .key { height: 1.625rem; }
}

:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation: none !important; transition: none !important; }

/* ---------------------------------------------------------- front page extras */

.ty-sample { font-family: var(--mono); font-size: 1.125rem; color: var(--ink-soft); white-space: nowrap; }
.ty-sample .ok { color: var(--ink); }
.ty-sample .bad { color: var(--red); }
.ty-sample i { display: inline-block; width: 2px; height: 1.1em; vertical-align: -0.2em; background: var(--accent); margin: 0 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* -------------------------------------------------------- meanings (solo) */

.gamebar .to-defs { white-space: nowrap; }
.defs-sec { width: min(100% - 2 * var(--pad), 40rem); margin: 0 auto; padding: 1.5rem 0 3rem; border-top: 1px solid var(--line); }
.defs-sec > h2 { font-size: 1.125rem; margin-bottom: 0.25rem; }
.defs { list-style: none; display: grid; }
.def { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.25rem 1rem; padding: 0.875rem 0; border-bottom: 1px solid var(--line); }
.def-word b { font-size: 1.0625rem; letter-spacing: 0.06em; }
.def-word .tag { margin: 0.25rem 0 0; display: block; width: max-content; }
.def-text { display: grid; gap: 0.25rem; }
.def-text em { color: var(--ink-soft); }
@media (max-width: 36rem) {
  .def { grid-template-columns: 1fr; }
  .def-word .tag { display: inline-block; margin: 0 0 0 0.5rem; }
}

/* ------------------------------------------------------------- typing test */

:root { --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace; }
.typing-page { width: min(100%, 60rem); margin-inline: auto; padding: 1rem var(--pad) 3rem; display: grid; gap: 1.25rem; }
.ty-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.375rem; padding: 0.375rem; background: var(--panel); border-radius: 12px; width: max-content; max-width: 100%; margin-inline: auto; transition: opacity 0.2s; }
.ty-group { display: flex; flex-wrap: wrap; gap: 0.125rem; padding-inline: 0.375rem; }
.ty-group + .ty-group { border-left: 2px solid var(--line); }
.ty-chip { border: 0; background: none; color: var(--ink-soft); font: inherit; font-size: 0.875rem; font-weight: 600; padding: 0.3125rem 0.5rem; border-radius: 8px; cursor: pointer; }
.ty-chip:hover { color: var(--ink); background: var(--hover); }
.ty-chip.on { color: var(--ink); background: var(--page); box-shadow: 0 0 0 1px var(--line); }
.ty-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.typing-page.focus .ty-bar, .typing-page.focus .typing-more, .typing-page.focus .ty-hint { opacity: 0; pointer-events: none; }
.typing-page.focus .ty-bar { transition: opacity 0.4s; }

.ty-stage { display: grid; gap: 0.75rem; min-height: 15rem; align-content: start; }
.ty-live { display: flex; gap: 1.25rem; align-items: baseline; min-height: 2rem; font-size: 1.625rem; font-weight: 700; color: var(--accent); padding-inline: 0.25rem; }
.ty-wpm { color: var(--ink-soft); font-size: 1.125rem; }
.ty-restart { justify-self: center; color: var(--ink-soft); }
.ty-hint { text-align: center; }
kbd { font: 600 0.75rem var(--mono); padding: 0.0625rem 0.375rem; border-radius: 4px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); }

.typer { position: relative; --ty-size: clamp(1.25rem, 3.2vw, 1.75rem); }
.ty-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; padding: 0; font-size: 16px; cursor: default; z-index: 2; caret-color: transparent; color: transparent; background: transparent; }
.ty-words { position: relative; overflow: hidden; height: calc(var(--ty-size) * 1.6 * 3); font-family: var(--mono); font-size: var(--ty-size); line-height: 1.6; user-select: none; }
.ty-inner { display: flex; flex-wrap: wrap; align-content: flex-start; transition: transform 0.12s ease-out; }
.ty-words .w { margin-right: 0.6em; color: var(--ink-soft); opacity: 0.75; border-bottom: 2px solid transparent; line-height: 1.35; margin-block: 0.125em; }
.ty-words .w .t-ok { color: var(--ink); }
.ty-words .w .t-ok, .ty-words .w .t-bad, .ty-words .w .t-extra { opacity: 1; }
.ty-words .w:has(.t-ok, .t-bad, .t-extra) { opacity: 1; }
.ty-words .w .t-bad { color: var(--red); }
.ty-words .w .t-extra { color: var(--red); opacity: 0.65 !important; }
.ty-words .w.w-err { border-bottom-color: var(--red); }
.ty-caret { position: absolute; left: 0; top: 0; width: 2px; background: var(--accent); border-radius: 1px; transition: transform 0.08s linear; margin-top: 0.125em; }
.ty-caret.idle { animation: blink 1s steps(1) infinite; }
.ty-veil { position: absolute; inset: 0; display: none; place-items: center; text-align: center; font-weight: 600; color: var(--ink); backdrop-filter: blur(4px); background: color-mix(in srgb, var(--page) 55%, transparent); border-radius: 10px; pointer-events: none; }
.typer.blurred .ty-veil { display: grid; }
.typer.blurred .ty-caret { opacity: 0; }

.ty-result { display: grid; gap: 1.25rem; }
.ty-head { display: flex; gap: 2.5rem; justify-content: center; flex-wrap: wrap; }
.ty-big { display: grid; justify-items: center; }
.ty-big > span { font-size: 1.125rem; font-weight: 600; }
.ty-big b { font-size: clamp(3.25rem, 10vw, 4.5rem); line-height: 1; color: var(--accent); font-weight: 800; }
.ty-big small { margin-top: 0.25rem; }
.ty-smalls { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem 2rem; }
.ty-small { display: grid; justify-items: center; text-align: center; }
.ty-small > span { font-size: 0.8125rem; }
.ty-small b { font-size: 1.375rem; }
.ty-chart { margin: 0; }
.typing-more .card { margin-top: 1.5rem; }

/* charts */
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--ink-soft); font: 500 12px var(--font); }
.chart .ln { stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln.wpm, .chart .pt.wpm { stroke: var(--accent); fill: var(--accent); }
.chart .ln.wpm { fill: none; }
.chart .ln.raw { stroke: var(--ink-soft); stroke-width: 1.5; opacity: 0.6; }
.chart .ln.acc { stroke: var(--green); }
.chart .err { fill: var(--red); }
.chart .bar { fill: var(--line-strong); }
.chart .bar.now { fill: var(--accent); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; margin-top: 0.375rem; }
.legend .lg::before { content: ""; display: inline-block; width: 0.875rem; height: 3px; border-radius: 2px; vertical-align: 0.25em; margin-right: 0.375rem; background: var(--ink-soft); }
.legend .lg.wpm::before { background: var(--accent); }
.legend .lg.acc::before { background: var(--green); }
.legend .lg.err::before { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--red); vertical-align: 0.05em; }

/* races in rooms */
.race-wrap { width: min(100%, 52rem); margin: 0.5rem auto 0; }
.go-in { font-weight: 700; color: var(--accent); }
.go-in .num { font-size: 1.25rem; }
.racetrack { list-style: none; display: grid; gap: 0.5rem; width: min(100%, 40rem); margin-inline: auto; text-align: left; }
.racetrack li { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) 4.5rem; gap: 0.75rem; align-items: center; }
.track-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-bar { height: 0.625rem; border-radius: 999px; background: var(--panel); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.track-bar i { display: block; height: 100%; background: var(--line-strong); border-radius: inherit; transition: width 0.3s ease-out; }
.racetrack .me .track-bar i { background: var(--accent); }
.track-wpm { text-align: right; font-weight: 700; color: var(--ink-soft); font-size: 0.875rem; }
.race-done { font-size: 1.0625rem; }

/* ---------------------------------------------------------- statistics page */

.stats-page { width: min(100%, 56rem); margin-inline: auto; padding: 1.25rem var(--pad) 3rem; display: grid; gap: 0.75rem; }
.st-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.st-top h1 { font-size: clamp(1.625rem, 5vw, 2.125rem); font-weight: 800; letter-spacing: -0.02em; }
.stats-page .pickers { margin: 0.5rem 0 0.25rem; }
.st-tiles + .soft { margin-top: 0.75rem; }
.st-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.625rem; margin-top: 0.5rem; }
.st-tile { display: grid; gap: 0.125rem; padding: 0.875rem 1rem; border-radius: 12px; background: var(--panel); }
.st-tile b { font-size: 1.75rem; line-height: 1.1; font-weight: 800; }
.st-tile span { font-size: 0.875rem; font-weight: 600; }
.st-tile small { font-size: 0.75rem; }
.st-sec { margin-top: 1.25rem; display: grid; gap: 0.625rem; }
.st-sec > h2 { font-size: 1.125rem; }
.st-sec .dist .lost i { background: var(--red); color: var(--on-red); }
.st-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.st-table th { text-align: left; font-weight: 600; color: var(--ink-soft); font-size: 0.8125rem; padding: 0 0.5rem 0.375rem; }
.st-table td { padding: 0.5rem; border-top: 1px solid var(--line); }
.st-table .caps { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.st-table .good { color: var(--green-text); font-weight: 700; }
.st-table .bad { color: var(--red); font-weight: 700; }
.st-table .strong { font-weight: 800; }
.st-scroll { overflow-x: auto; }
.pbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.625rem; }
.pb { display: grid; gap: 0.125rem; padding: 0.75rem 0.875rem; border: 1px solid var(--line); border-radius: 12px; }
.pb b { font-size: 1.625rem; font-weight: 800; color: var(--accent); line-height: 1.15; }
.pb small { font-size: 0.75rem; }
@media (max-width: 36rem) { .pbs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.heat { display: grid; gap: 0.3125rem; justify-content: center; }
.heat-row { display: flex; gap: 0.3125rem; justify-content: center; }
.heat-row:nth-child(3) { margin-left: 1.25rem; }
.heat-row:nth-child(4) { margin-left: 2.5rem; }
.hk { display: inline-grid; place-items: center; width: clamp(1.75rem, 7vw, 2.625rem); aspect-ratio: 1; border-radius: 7px; font: 700 0.9375rem var(--mono); text-transform: uppercase; background: var(--panel); color: var(--ink-soft); }
.hk.l0 { background: color-mix(in srgb, var(--green) 35%, var(--panel)); color: var(--ink); }
.hk.l1 { background: color-mix(in srgb, var(--yellow) 30%, var(--panel)); color: var(--ink); }
.hk.l2 { background: color-mix(in srgb, var(--yellow) 65%, var(--panel)); color: var(--ink); }
.hk.l3 { background: color-mix(in srgb, var(--red) 55%, var(--panel)); color: var(--ink); }
.hk.l4 { background: var(--red); color: var(--on-red); }
.hk-scale { display: inline-flex; align-items: center; gap: 0.25rem; }
.hk-scale .hk { width: 1rem; height: 1rem; border-radius: 3px; }
.missed { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.missed li { display: inline-flex; gap: 0.375rem; align-items: baseline; padding: 0.25rem 0.625rem; border-radius: 999px; background: var(--panel); font-family: var(--mono); }

.ty-result > p { text-align: center; }
.typing-page > * { min-width: 0; }
.ty-stage { grid-template-columns: minmax(0, 1fr); }
.typing-page { grid-template-columns: minmax(0, 1fr); }


/* ============================================================ Wordfray: the three games
   Each game has its own colour (--accent), set by data-game on anything that belongs to it:
   Five green (its tiles), Keys mustard (its caret), Oddball violet. */

[data-game="five"] { --accent: var(--green); --accent-text: var(--green-text); }
[data-game="keys"] { --accent: var(--yellow); --accent-text: var(--yellow); }
[data-game="oddball"] { --accent: var(--violet); --accent-text: var(--violet-text); }

/* a game's square tile: its letter on its colour */
.gtile {
  --s: 1.75rem;
  display: inline-grid; place-items: center; flex: none;
  width: var(--s); height: var(--s); border-radius: calc(var(--s) * 0.16);
  background: var(--accent); color: var(--on-accent);
  font-weight: 800; font-size: calc(var(--s) * 0.58); line-height: 1; letter-spacing: 0;
}
.gtile.xs { --s: 1.125rem; border-radius: 3px; font-size: 0; }
.gtile.lg { --s: 2.75rem; }
.gtile.xl { --s: clamp(3.75rem, 15vw, 5.5rem); }

/* the bar at the top of each game page */
.gamebar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap;
  width: min(100%, 60rem); margin-inline: auto; padding: 0.625rem var(--pad);
}
.gb-title { display: flex; align-items: center; gap: 0.625rem; }
.gb-title h1 { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; }
.gb-controls { display: flex; align-items: center; gap: 0.5rem 0.75rem; flex-wrap: wrap; }
.game > .gamebar { width: min(100%, calc(var(--col) + 2 * var(--pad))); }
.typing-page > .gamebar, .odd-page > .gamebar { padding-inline: 0; }
[data-game] .seg input:checked + span { background: var(--accent); color: var(--on-accent); }
@media (max-width: 26rem) { .gb-title h1 { font-size: 1.125rem; } .gtile:not(.xs):not(.lg):not(.xl) { --s: 1.5rem; } }

/* ------------------------------------------------------------------ home */
.ty-sample { font-family: var(--mono); font-size: 1.125rem; color: var(--ink-soft); white-space: nowrap; margin: 0; }
.ty-sample .ok { color: var(--ink); }
.ty-sample .bad { color: var(--red); }
.odd-glimpse { display: grid; gap: 0.375rem; justify-items: start; font-size: 0.9375rem; }
.odd-glimpse > span:first-child { font-weight: 700; color: var(--ink); }
.odd-glimpse .otier { vertical-align: -0.125em; }

/* ---------------------------------------------------------------- Oddball */
.odd-page { width: min(100%, 44rem); margin-inline: auto; padding: 0.25rem var(--pad) 3rem; }
.odd-stage { display: grid; }
.odd-card { display: grid; gap: 1rem; padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid var(--line); border-radius: 16px; margin-top: 0.75rem; }
.odd-topic { margin: 0; }
.odd-q { font-size: clamp(1.625rem, 5.5vw, 2.375rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; text-wrap: balance; }
.odd-clock { display: flex; align-items: center; gap: 0.75rem; }
.odd-time { flex: 1; height: 0.5rem; border-radius: 999px; background: var(--panel); overflow: hidden; }
.odd-time i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: inherit; transition: width 0.2s linear; }
.odd-time.low i { background: var(--red); }
.odd-secs { min-width: 1.75rem; text-align: right; font-size: 1.125rem; }
.odd-form { display: flex; gap: 0.5rem; }
.odd-input {
  flex: 1; min-width: 0; min-height: 3.25rem; padding: 0.5rem 1rem;
  border: 2px solid var(--line-strong); border-radius: 12px; background: var(--page);
  font-size: 1.25rem; font-weight: 600;
}
.odd-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.odd-form .btn { min-height: 3.25rem; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.odd-say { min-height: 1.5rem; margin: 0; font-weight: 600; }
.odd-say.bad { color: var(--red); }
.odd-head { display: grid; gap: 0.75rem; }
.odd-topic { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.625rem; }
.odd-progress { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; }
.odd-dots { display: inline-flex; gap: 4px; }
.odd-dots.big { gap: 6px; }
.odd-dots.big .otier { width: 2.25rem; height: 2.25rem; border-radius: 6px; }

/* rarity tiers, common to oddball */
.otier { display: inline-block; width: 1rem; height: 1rem; border-radius: 3px; background: var(--t); vertical-align: middle; }
.otier.big { flex: none; width: 4rem; height: 4rem; border-radius: 10px; }
.otier.blank { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.otier.blank.now { box-shadow: inset 0 0 0 2px var(--accent); }
/* the ten rarity tiers, Common to Oddball */
.t0 { --t: #a4a9b0; } .t1 { --t: #8b9bb0; } .t2 { --t: #4a8fd9; } .t3 { --t: #3f9a8a; } .t4 { --t: #5c9e3e; }
.t5 { --t: #c9a01f; } .t6 { --t: #e0822a; } .t7 { --t: #d9483b; } .t8 { --t: #c03b86; } .t9 { --t: var(--violet); } .tx { --t: #3a3b3f; }
:root[data-theme="dark"] .t0 { --t: #6d7177; } :root[data-theme="dark"] .t1 { --t: #74859c; } :root[data-theme="dark"] .tx { --t: #2a2b2e; }
.tier-name { color: color-mix(in srgb, var(--t) 80%, var(--ink)); font-weight: 800; }
.odd-hit { display: flex; gap: 1rem; align-items: center; }
.odd-hit p { margin: 0; }

.odd-rank { display: flex; align-items: baseline; gap: 0.625rem; margin: 0.125rem 0 0.375rem !important; }
.odd-rank .tier-name { font-size: 1.25rem; }
.odd-rank .num:last-child { margin-left: auto; font-size: 1.125rem; }
.odd-meter { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; align-items: end; height: 1rem; max-width: 20rem; margin-bottom: 0.375rem; }
.odd-meter i { height: 0.375rem; border-radius: 2px; background: var(--line); }
.odd-meter i.on { background: var(--t); }
.odd-meter i.here { height: 1rem; box-shadow: 0 0 0 2px var(--page), 0 0 0 3.5px var(--t); }
.odd-hit.peak .tier-name { text-shadow: 0 0 18px color-mix(in srgb, var(--violet) 55%, transparent); }

/* the launch: the answer goes up on a rocket, shown like a launch broadcast */
.lz {
  position: fixed; inset: 0; z-index: 200; overflow: hidden; background: #c6dfec; color: #fff;
  opacity: 0; transition: opacity 0.25s;
  font-feature-settings: "tnum";
}
.lz.on { opacity: 1; }
.lz-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lz-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: max(0.75rem, env(safe-area-inset-top)) 1rem 2rem;
  background: linear-gradient(rgb(0 0 0 / 0.4), transparent);
}
.lz-q { margin: 0; font-weight: 600; font-size: 0.875rem; opacity: 0.92; }
.lz-skip {
  flex: none; padding: 0.3125rem 0.75rem; border-radius: 6px; border: 1px solid rgb(255 255 255 / 0.55);
  background: rgb(0 0 0 / 0.25); color: #fff; font: inherit; font-weight: 600; font-size: 0.8125rem; cursor: pointer;
}
.lz-skip:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lz-event {
  position: absolute; left: 1rem; top: calc(max(0.75rem, env(safe-area-inset-top)) + 2.25rem); margin: 0;
  padding: 0.25rem 0.625rem 0.25rem 0.5rem; border-left: 3px solid #fff; background: rgb(0 0 0 / 0.35);
  font-weight: 700; font-size: 0.9375rem; opacity: 0; transform: translateX(-0.5rem); transition: opacity 0.25s, transform 0.25s;
}
.lz-event.show { opacity: 1; transform: none; }
/* flight readouts along the bottom */
.lz-tele {
  position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: auto auto auto auto minmax(0, 1fr); gap: 0 1.25rem;
  padding: 0.75rem 1rem max(0.875rem, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgb(0 0 0 / 0.55) 40%);
}
.lz-tele div { display: grid; gap: 0.125rem; min-width: 0; }
.lz-tele span { font-size: 0.6875rem; font-weight: 600; opacity: 0.7; }
.lz-tele b { font-size: clamp(0.9375rem, 3.8vw, 1.25rem); font-weight: 700; white-space: nowrap; }
.lz-payload b { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 30rem) {
  .lz-tele { grid-template-columns: repeat(3, auto); gap: 0.375rem 1rem; }
  .lz-payload { grid-column: 1 / -1; order: -1; }
  .lz-tele > div:nth-child(2) { display: none; } /* mission time: no room */
}
.lz.landed .lz-tele { opacity: 0; transition: opacity 0.3s; }
.lz-live { color: var(--t); filter: brightness(1.25); transition: color 0.2s; }

/* the result: the rarity ladder */
.lz.landed::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgb(0 0 0 / 0.1), rgb(0 0 0 / 0.55)); pointer-events: none; animation: lz-dim 0.4s ease-out both; }
.lzr {
  position: absolute; z-index: 1; left: 50%; bottom: max(0.75rem, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(25rem, calc(100% - 1.5rem)); max-height: calc(100% - 4.5rem); overflow-y: auto;
  display: grid; gap: 0.75rem; padding: 1.125rem 1.125rem 1.25rem; border-radius: 14px;
  background: rgb(9 11 22 / 0.9); border: 1px solid rgb(255 255 255 / 0.12); box-shadow: 0 20px 60px rgb(0 0 0 / 0.5);
  animation: lz-up 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.lzr[hidden] { display: none; }
.lzr p { margin: 0; }
.lzr-head { display: grid; gap: 0.125rem; }
.lzr-word { font-size: 0.9375rem; font-weight: 600; opacity: 0.75; overflow-wrap: anywhere; }
.lzr-score { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.lzr-tier { font-size: clamp(2rem, 9vw, 2.75rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1; color: #fff; opacity: 0.35; transition: color 0.3s, opacity 0.3s; }
.lzr.done .lzr-tier { color: var(--t); opacity: 1; filter: brightness(1.25); animation: lzr-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
.lzr-plus { font-size: 1.5rem; font-weight: 800; }
.lzr-ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.lzr-rung {
  display: grid; grid-template-columns: 0.375rem 1fr auto; align-items: center; gap: 0.625rem;
  padding: 0.3125rem 0.625rem 0.3125rem 0.375rem; border-radius: 6px; font-size: 0.875rem; font-weight: 700;
  background: rgb(255 255 255 / 0.04); color: rgb(255 255 255 / 0.4); transition: background-color 0.25s, color 0.25s;
}
.lzr-chip { width: 0.375rem; align-self: stretch; border-radius: 3px; background: var(--t); opacity: 0.35; transition: opacity 0.25s; }
.lzr-pts { font-weight: 600; font-size: 0.8125rem; }
.lzr-rung.lit { background: color-mix(in srgb, var(--t) 22%, transparent); color: rgb(255 255 255 / 0.9); }
.lzr-rung.lit .lzr-chip { opacity: 1; }
.lzr-say { display: none; }
.lzr.done .lzr-rung.mine {
  grid-template-columns: 0.375rem 1fr auto; grid-template-rows: auto auto; padding: 0.625rem 0.75rem 0.625rem 0.375rem;
  background: var(--t); color: #fff; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.4), 0 0 24px color-mix(in srgb, var(--t) 70%, transparent);
  animation: lzr-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.lzr.done .lzr-rung.mine .lzr-chip { grid-row: 1 / 3; background: #fff; }
.lzr.done .lzr-rung.mine .lzr-name { font-size: 1.125rem; font-weight: 900; }
.lzr.done .lzr-rung.mine .lzr-say { display: block; grid-column: 2; grid-row: 2; font-size: 0.8125rem; font-weight: 600; opacity: 0.9; }
.lzr.done .lzr-rung.mine .lzr-pts { grid-column: 3; grid-row: 1 / 3; font-size: 1.125rem; font-weight: 800; }
.lzr.t0.done .lzr-rung.mine, .lzr.t1.done .lzr-rung.mine, .lzr.t5.done .lzr-rung.mine { color: #15161a; }
.lzr.t0.done .lzr-rung.mine .lzr-chip, .lzr.t1.done .lzr-rung.mine .lzr-chip, .lzr.t5.done .lzr-rung.mine .lzr-chip { background: #15161a; }
.lzr.peak.done .lzr-rung.mine { background: linear-gradient(100deg, var(--t) 30%, #b79cff 50%, var(--t) 70%); background-size: 250% 100%; animation: lzr-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1), lzr-shine 2.4s linear 0.5s infinite; }
.lzr-note { font-size: 0.8125rem; opacity: 0.75; }
.lzr .btn { justify-self: stretch; background: #fff; color: #111; border-color: #fff; }
@keyframes lz-up { from { transform: translate(-50%, 1.5rem); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes lz-dim { from { opacity: 0; } to { opacity: 1; } }
@keyframes lzr-pop { 0% { transform: scale(0.92); } 60% { transform: scale(1.04); } 100% { transform: none; } }
@keyframes lzr-shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@media (max-height: 40rem) { .lzr-rung { padding-block: 0.1875rem; font-size: 0.8125rem; } }
.lz .t0 { --t: #d5d8dd; } .lz .t1 { --t: #a9b7c9; } .lz .t9 { --t: #a88ff4; }

.odd-answer { font-size: clamp(1.375rem, 4.5vw, 1.875rem); font-weight: 800; letter-spacing: -0.02em; }
.odd-hit.miss .odd-answer { color: var(--ink-soft); }
.odd-learn { display: grid; grid-template-columns: auto 1fr; gap: 0.375rem 1rem; margin: 0; padding: 0.875rem 1rem; border-radius: 10px; background: var(--panel); font-size: 0.9375rem; }
.odd-learn dt { font-weight: 700; }
.odd-learn dd { margin: 0; }
@media (max-width: 32rem) { .odd-learn { grid-template-columns: 1fr; } .odd-learn dd + dt { margin-top: 0.375rem; } }
.odd-rules { display: grid; gap: 0.5rem; padding-left: 1.25rem; list-style: disc; }
.odd-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.625rem 0.5rem; }
.odd-scale > span { display: grid; justify-items: center; gap: 0.25rem; text-align: center; font-size: 0.8125rem; }
.odd-scale .otier { width: 2rem; height: 2rem; border-radius: 6px; }
@media (max-width: 30rem) { .odd-scale > span { font-size: 0.6875rem; } .odd-scale .otier { width: 1.625rem; height: 1.625rem; } }
.result-big { display: flex; align-items: baseline; gap: 0.625rem; }
.result-big b { font-size: clamp(3.5rem, 13vw, 5rem); line-height: 1; font-weight: 900; letter-spacing: -0.04em; color: var(--accent-text, var(--accent)); }
.odd-list { display: grid; gap: 0; }
.odd-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 3rem; gap: 0.75rem; align-items: baseline; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.odd-list li > :last-child { text-align: right; }
@media (max-width: 32rem) { .odd-list li { grid-template-columns: minmax(0, 1fr) 3rem; } .odd-list li > :first-child { grid-column: 1 / -1; } }
.dist.tiers div { grid-template-columns: 6.5rem 1fr; }
.dist.tiers i { background: var(--t); color: #fff; }
.finds li { font-family: var(--font); }

/* stats page follows the game on show */
.stats-page [data-game] .chart .ln.wpm { stroke: var(--accent); }
.odd-glimpse-tiers { display: grid; grid-template-columns: repeat(10, minmax(0, 1.5rem)); gap: clamp(0.1875rem, 1.2vw, 0.5rem); }
.odd-glimpse-tiers > span { display: grid; justify-items: center; gap: 0.125rem; min-width: 0; }
.odd-glimpse-tiers .otier { width: 100%; aspect-ratio: 1; height: auto; border-radius: 4px; }
.odd-glimpse-tiers small { font-size: 0.6875rem; }

/* ------------------------------------------------------------------ motion
   The games' animations. All of them stop when "Reduce motion" is on in Settings. */
@keyframes rise-in { from { opacity: 0; transform: translateY(0.75rem); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nudge { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes glow-ok { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
@keyframes draw { from { stroke-dashoffset: var(--len, 1200); } to { stroke-dashoffset: 0; } }
@keyframes letter-in { from { opacity: 0; transform: translateY(-0.35em); } to { opacity: 1; transform: none; } }

/* Five: tiles flip over one by one (in board.js), letters pop in as they are typed, keys take
   their colour with a fade, the meanings list slides in, a win makes the row jump */
.tiles .row { perspective: 600px; }
.key { transition: background-color 0.35s ease, color 0.35s ease, transform 0.08s; }
.key:active { transform: scale(0.94); }
.defs .def { animation: rise-in 0.35s ease-out both; }
.defs .def:nth-child(2) { animation-delay: 0.06s; } .defs .def:nth-child(3) { animation-delay: 0.12s; }
.defs .def:nth-child(n + 4) { animation-delay: 0.18s; }
.notes .note { animation: fade-in 0.25s ease-out; }

/* Keys: wrong letters jolt, finished words settle, the result rises in and the chart draws */
.ty-words .w .t-bad { display: inline-block; animation: nudge 0.2s ease-out; }
.ty-words .w .t-ok { transition: color 0.08s; }
.ty-words .w.w-err { transition: border-color 0.2s; }
.ty-inner { animation: fade-in 0.3s ease-out; }
.ty-result > * { animation: rise-in 0.45s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.ty-result > :nth-child(2) { animation-delay: 0.08s; } .ty-result > :nth-child(3) { animation-delay: 0.16s; }
.ty-result > :nth-child(n + 4) { animation-delay: 0.24s; }
.ty-chart polyline.ln { stroke-dasharray: 1200; animation: draw 1.1s ease-out 0.2s both; }
.ty-chart circle { animation: fade-in 0.3s ease-out 1s both; }
.ty-live .ty-count { display: inline-block; }

/* Oddball: each question card rises in, a wrong answer shakes the box, a right one flashes green */
.odd-card { animation: rise-in 0.4s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.odd-card .odd-q { animation: rise-in 0.45s cubic-bezier(0.2, 0.8, 0.3, 1) 0.06s both; }
.odd-form.wrong { animation: nudge 0.35s ease-out; }
.odd-form.right .odd-input { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 30%, transparent); animation: glow-ok 0.4s ease-out; }
.odd-say.bad { animation: fade-in 0.2s ease-out; }

/* pages and dialogs */
#app > * { animation: fade-in 0.2s ease-out; }
dialog[open] { animation: rise-in 0.25s ease-out; }

/* -------------------------------------------------------------------- logo
   Three game tiles tossed into a fan: Oddball at the back, then Keys, then Five with the W. */
.logo { display: inline-flex; align-items: center; gap: 0.25em; }
.logo-mark { display: block; flex: none; width: 2em; height: 2em; overflow: visible; }
.logo-mark .lm-tile rect { fill: var(--accent); }
.logo-mark .lm-five rect { stroke: var(--page); stroke-width: 1.5; }
.logo-mark .lm-w { fill: none; stroke: var(--on-accent); stroke-width: 4.6; stroke-linecap: round; stroke-linejoin: miter; stroke-miterlimit: 3; }
.logo-mark .lm-tile { transform-box: fill-box; transform-origin: 50% 100%; }

/* On the home page the tiles start stacked and fan out, then the W tile lands: the page's one entrance */
@keyframes lm-fan-back { from { transform: translate(-30%, 12%) rotate(-24deg); } }
@keyframes lm-fan-mid { from { transform: translate(-18%, 10%) rotate(-12deg); } }
@keyframes lm-land { 0% { transform: translateY(-28%) scale(1.12) rotate(8deg); opacity: 0; } 55% { opacity: 1; } 100% { transform: none; } }
.logo-mark.intro .lm-oddball { animation: lm-fan-back 0.7s cubic-bezier(0.2, 0.9, 0.25, 1.15) 0.15s both; }
.logo-mark.intro .lm-keys { animation: lm-fan-mid 0.7s cubic-bezier(0.2, 0.9, 0.25, 1.15) 0.15s both; }
.logo-mark.intro .lm-five { animation: lm-land 0.5s cubic-bezier(0.3, 0.8, 0.3, 1.1) both; }
.brand:hover .lm-oddball { transform: rotate(6deg); }
.brand:hover .lm-keys { transform: rotate(3deg); }
.brand .lm-tile { transition: transform 0.25s cubic-bezier(0.3, 0.8, 0.3, 1.3); }

/* ------------------------------------------------------------------- home */
.home { width: min(100%, 70rem); }
.hero { padding: clamp(2.25rem, 8vw, 4.5rem) 0 clamp(1.75rem, 5vw, 3rem); text-align: center; }
.hero-logo {
  display: inline-flex; align-items: center; gap: 0.12em; margin: 0;
  font-size: clamp(3.25rem, 13vw, 6rem); font-weight: 900; letter-spacing: -0.06em; line-height: 0.9;
}
.hero-logo .logo-mark { width: 1.15em; height: 1.15em; margin-right: 0.04em; }
.hero-logo span { padding-bottom: 0.08em; }
.hero .lede { max-width: 32rem; margin: 1.25rem auto 0; text-wrap: balance; }
.today { margin: 0.875rem auto 0; max-width: 34rem; color: var(--ink-soft); text-wrap: balance; }
.today b { display: block; color: var(--ink); font-weight: 700; }

.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1.25rem; }
.gcard {
  display: grid; grid-template-rows: auto 1fr; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px; background: var(--page);
  transition: border-color 0.2s;
}
.gcard:hover, .gcard:focus-within { border-color: var(--accent); }
.gcard-glimpse {
  display: grid; place-items: center; min-height: 8.5rem; padding: 1.25rem 1rem;
  background: color-mix(in srgb, var(--accent) 13%, var(--page));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 22%, var(--page));
}
.gcard-glimpse .tiles { --th: 2rem; --fs: 1rem; }
.gcard-body { display: grid; grid-template-rows: auto 1fr auto auto; gap: 0.625rem; padding: 1.125rem 1.25rem 1.25rem; }
.gcard-head { display: flex; align-items: center; gap: 0.625rem; }
.gcard-head h2 { font-size: 1.625rem; font-weight: 850; letter-spacing: -0.03em; line-height: 1; }
.gcard-head h2 a { text-decoration: none; }
.gcard-head h2 a::after { content: ""; position: absolute; inset: 0; }
.gcard { position: relative; }
.gcard .actions { position: relative; z-index: 1; margin: 0.25rem 0 0; }
.gcard-line { margin: 0; }
.gcard-status { margin: 0; color: var(--ink-soft); display: flex; align-items: baseline; gap: 0.5rem; }
.gcard-status::before { content: ""; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); transform: translateY(-0.0625rem); }
.gcard { --accent-btn: color-mix(in srgb, var(--accent) 80%, #000); }
.gcard .actions .btn:first-child { background: var(--accent-btn); border-color: var(--accent-btn); color: #fff; }
.gcard .actions .btn:first-child:hover { filter: brightness(1.1); }
.ty-sample { font-size: 1.25rem; }

.record { margin-top: 1.25rem; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.75rem 1.5rem; padding: 1rem 1.25rem; border-radius: 18px; background: var(--panel); }
.record h2 { font-size: 1rem; font-weight: 800; }
.rec-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
.rec { display: flex; align-items: baseline; gap: 0.4375rem; text-decoration: none; color: var(--ink-soft); }
.rec b { font-size: 1.625rem; font-weight: 850; letter-spacing: -0.03em; color: var(--accent-text, var(--accent)); line-height: 1; }
.rec:hover span { text-decoration: underline; }
.rec-all { display: inline-flex; align-items: center; gap: 0.375rem; font-weight: 600; text-decoration: none; }
.rec-all:hover { text-decoration: underline; }
.rec-all svg { width: 1.125rem; height: 1.125rem; }
@media (max-width: 48rem) { .record { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------- footer */
:root:has(.foot:not([hidden])) body { display: flex; flex-direction: column; }
:root:has(.foot:not([hidden])) #app { flex: 1 0 auto; padding-bottom: 3rem; }
.foot { flex: none; border-top: 1px solid var(--line); background: var(--panel); }
.foot[hidden] { display: none; }
.foot-in { width: min(100%, 70rem); margin-inline: auto; padding: 2rem var(--pad) 2.5rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem 3rem; }
.foot-brand { display: flex; gap: 0.875rem; align-items: flex-start; }
.foot-brand .logo-mark { width: 2.75rem; height: 2.75rem; }
.foot-brand p { margin: 0; line-height: 1.45; }
.foot nav { display: flex; gap: 1rem 3rem; flex-wrap: wrap; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; align-content: start; }
.foot a, .foot .linkish { color: var(--ink); text-decoration: none; font-weight: 500; }
.foot a:hover, .foot .linkish:hover { text-decoration: underline; }
@media (max-width: 36rem) {
  .top { grid-template-columns: auto minmax(0, 1fr) auto; }
  .top .brand { justify-self: start; font-size: 1.3125rem; padding-inline: 0.25rem; }
}
@media (max-width: 22.5rem) { .top .brand { font-size: 1.125rem; } }
@media (max-width: 44rem) { .foot-in { grid-template-columns: 1fr; } .foot nav { gap: 1rem 2.5rem; } }

/* ---------------------------------------------------------- about, privacy */
.page { width: min(100%, 42rem); margin-inline: auto; padding: clamp(1.75rem, 6vw, 3rem) var(--pad) 1rem; }
.prose h1 { font-size: clamp(2.25rem, 8vw, 3rem); font-weight: 900; letter-spacing: -0.045em; line-height: 1; }
.prose h2 { margin-top: 2.25rem; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; }
.prose h3 { margin-top: 1rem; font-size: 1.0625rem; font-weight: 800; }
.prose p, .prose li { line-height: 1.6; }
.prose p { margin: 0.75rem 0 0; }
.prose .lede-s { margin-top: 1rem; font-size: 1.25rem; line-height: 1.45; font-weight: 600; }
.prose a { text-underline-offset: 2px; }
.about-game { display: grid; grid-template-columns: auto 1fr; gap: 1rem; margin-top: 1.25rem; }
.about-game h3 { margin: 0.25rem 0 0; font-size: 1.25rem; }
.about-game p { margin-top: 0.25rem; }
.about-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-weight: 600; }
.about-links a, .rec b { color: color-mix(in srgb, var(--accent) 72%, #000); }
:root[data-theme="dark"] .about-links a, :root[data-theme="dark"] .rec b { color: var(--accent); }
.changes h3 { margin-top: 0.75rem; }
.lost { text-align: center; padding-top: clamp(3rem, 12vw, 6rem); }
.lost .lost-mark { width: 6rem; height: 6rem; margin: 0 auto 1.5rem; transform: rotate(-8deg); }
.lost p { margin-top: 0.5rem; }
.lost h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); font-weight: 900; letter-spacing: -0.035em; }
.lost .actions { margin-top: 1.5rem; }

/* ---------------------------------------------------------- play with friends */
.with-friends svg { width: 1.0625rem; height: 1.0625rem; }
@media (max-width: 36rem) { .with-friends .long { display: none; } .with-friends { padding-inline: 0.625rem; } }
.game-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 1rem; }
.game-pick label { position: relative; cursor: pointer; }
.game-pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.game-pick label > span {
  display: flex; flex-direction: column; align-items: center; gap: 0.375rem;
  padding: 0.75rem 0.5rem; border: 1.5px solid var(--line); border-radius: 12px;
  font-weight: 700; transition: border-color 0.15s, background-color 0.15s;
}
.game-pick label:hover > span { border-color: var(--line-strong); }
.game-pick input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--page)); }
.game-pick input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.odd-ready { text-align: center; padding-block: 2rem; }
.odd-count { font-size: clamp(4rem, 16vw, 6rem); font-weight: 900; line-height: 1; color: var(--violet); margin: 0.5rem 0; }
.odd-cell { display: inline-flex; align-items: center; gap: 0.5rem; }
.odd-cell .otier { width: 1rem; height: 1rem; border-radius: 4px; flex: none; }
.panel .odd-q { margin: 0.25rem 0 0.5rem; }

/* ------------------------------------------------------------------ streaks
   A flame with the number of days in a row. Grey when there is no streak, the game's colour
   once there is one, and a soft pulse of the ring while today's game still has to be played. */
.streak {
  --fl: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 0.25rem; flex: none;
  padding: 0.1875rem 0.5625rem 0.1875rem 0.375rem; border-radius: 999px;
  background: var(--panel); color: var(--ink-soft); font-size: 0.9375rem; line-height: 1;
}
.streak svg { width: 1.125rem; height: 1.125rem; fill: var(--fl); stroke: none; }
.streak svg path + path { fill: var(--page); opacity: 0.55; }
.streak b { font-weight: 800; }
.streak.on { --fl: #e8602c; color: var(--ink); background: color-mix(in srgb, #e8602c 14%, var(--page)); }
.streak.risk { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #e8602c 55%, transparent); animation: streak-ask 2.4s ease-in-out infinite; }
@keyframes streak-ask { 50% { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #e8602c 15%, transparent); } }
.gb-title .streak { margin-left: 0.25rem; }
.gcard-head .streak { margin-left: auto; }
.streak.wide { display: grid; grid-template-columns: auto auto 1fr; grid-template-rows: auto auto; column-gap: 0.375rem; row-gap: 0.125rem; padding: 0; background: none; box-shadow: none; animation: none; text-align: left; }
.streak.wide svg { grid-row: 1 / 3; width: 2.125rem; height: 2.125rem; align-self: center; }
.streak.wide b { font-size: 1.75rem; letter-spacing: -0.03em; }
.streak.wide .streak-label { align-self: end; padding-bottom: 0.1875rem; font-weight: 600; }
.streak.wide .streak-hint { grid-column: 2 / -1; color: var(--ink-soft); font-size: 0.8125rem; line-height: 1.25; }

.streak-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; max-width: 54rem; margin: 1.75rem auto 0; }
.streak-card {
  display: grid; gap: 0.625rem; padding: 0.875rem 1rem 1rem; border-radius: 16px;
  border: 1px solid var(--line); text-decoration: none; color: inherit; text-align: left;
  transition: border-color 0.2s;
}
.streak-card:hover { border-color: var(--accent); }
.sc-game { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.9375rem; }
.sc-game .gtile { --s: 1.375rem; }
@media (max-width: 40rem) {
  .streak-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .streak-card { grid-template-columns: 7rem 1fr; align-items: center; padding: 0.75rem 0.875rem; }
  .streak.wide b { font-size: 1.5rem; }
  .streak.wide svg { width: 1.75rem; height: 1.75rem; }
}

/* ----------------------------------------------------- per-game statistics */
.stats-page { width: min(100%, 60rem); gap: 1rem; }
.st-title { display: flex; align-items: center; gap: 0.875rem; }
.st-title p { margin: 0; }
.st-title h1 { line-height: 1; }
.st-tabs { display: flex; gap: 0.25rem; padding: 0.25rem; border-radius: 999px; background: var(--panel); }
.st-tabs a { display: inline-flex; align-items: center; gap: 0.4375rem; padding: 0.4375rem 0.875rem; border-radius: 999px; text-decoration: none; font-weight: 600; color: var(--ink-soft); }
.st-tabs a:hover { color: var(--ink); }
.st-tabs a.on { background: var(--page); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.st-where { margin: 0; }
.st-play { justify-content: center; margin-top: 1rem; }
.stats-page .st-play .btn { background: color-mix(in srgb, var(--accent) 80%, #000); border-color: color-mix(in srgb, var(--accent) 80%, #000); color: #fff; }

.st-streak {
  display: grid; grid-template-columns: auto 1fr; gap: 1.25rem 2rem; align-items: center;
  padding: 1.25rem 1.5rem; border-radius: 18px; border: 1px solid var(--line);
}
.st-streak.on { background: linear-gradient(135deg, color-mix(in srgb, #e8602c 10%, var(--page)), var(--page) 60%); }
.sk-now { display: flex; align-items: center; gap: 0.875rem; }
.sk-flame svg { width: 3.5rem; height: 3.5rem; fill: var(--line-strong); stroke: none; }
.sk-flame svg path + path { fill: var(--page); opacity: 0.55; }
.st-streak.on .sk-flame svg { fill: #e8602c; }
.sk-big { margin: 0; font-size: 1.25rem; font-weight: 700; }
.sk-big b { font-size: 3rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1; }
.sk-now .soft { margin: 0.125rem 0 0; }
.sk-facts { display: flex; gap: 2rem; margin: 0; justify-self: end; }
.sk-facts div { display: grid; gap: 0.125rem; }
.sk-facts dt { font-size: 0.8125rem; color: var(--ink-soft); }
.sk-facts dd { margin: 0; font-size: 1.375rem; font-weight: 800; }
.cal { --cell: 0.9375rem; grid-column: 1 / -1; padding: 3px; display: grid; gap: 0.25rem; overflow-x: auto; justify-content: start; }
.cal-months { display: grid; grid-template-columns: repeat(var(--weeks), var(--cell)); column-gap: 3px; margin-left: 2.25rem; font-size: 0.75rem; color: var(--ink-soft); }
.cal-months span { white-space: nowrap; overflow: visible; width: 0; }
.cal-body { display: flex; gap: 0.5rem; }
.cal-wd { display: grid; grid-template-rows: repeat(7, var(--cell)); row-gap: 3px; width: 1.75rem; font-size: 0.6875rem; color: var(--ink-soft); }
.cal-wd span { display: flex; align-items: center; }
.cal-grid { display: grid; grid-template-rows: repeat(7, var(--cell)); grid-auto-flow: column; grid-auto-columns: var(--cell); gap: 3px; }
.cal-d { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--panel); }
.cal-d.l1 { background: var(--line-strong); }
.cal-d.l2 { background: color-mix(in srgb, var(--accent) 40%, var(--page)); }
.cal-d.l3 { background: color-mix(in srgb, var(--accent) 70%, var(--page)); }
.cal-d.l4 { background: var(--accent); }
.cal-d.is-today { outline: 2px solid var(--ink); outline-offset: 1px; }
.cal-d.future { background: transparent; }
.cal-key { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-start; gap: 3px; margin: 0.25rem 0 0; }
.cal-key .cal-d { width: 0.75rem; }
.cal-key > span { display: inline-flex; align-items: center; gap: 0.3125rem; margin-right: 0.875rem; }
@media (max-width: 40rem) { .cal { --cell: 0.625rem; } .cal-months, .cal-grid, .cal-wd { gap: 2px; } }
@media (max-width: 40rem) {
  .st-streak { grid-template-columns: 1fr; padding: 1rem; }
  .sk-facts { justify-self: start; gap: 1.5rem; }
  .sk-big b { font-size: 2.5rem; }
  .st-tabs { width: 100%; }
  .st-tabs a { flex: 1; justify-content: center; padding-inline: 0.5rem; }
}
.btn.icon-only { padding-inline: 0.625rem; }
.btn.icon-only svg { width: 1.0625rem; height: 1.0625rem; }

/* --------------------------------------------------------- Oddball run bar
   Above each question: which one of seven, the answers so far as rarity squares, the score. */
.odd-run { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.or-label { display: block; font-size: 0.75rem; color: var(--ink-soft); }
.or-q b, .or-score b { font-size: 1.75rem; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.or-q small { font-size: 1rem; font-weight: 700; color: var(--ink-soft); }
.or-score { position: relative; text-align: right; }
.or-gain { position: absolute; right: 0; top: -0.25rem; font-weight: 800; font-size: 0.875rem; color: var(--green-text); animation: gain-up 1.1s ease-out both; }
@keyframes gain-up { 0% { opacity: 0; transform: translateY(0.75rem); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-0.75rem); } }
.or-track { display: flex; justify-content: center; gap: 0.375rem; margin: 0; padding: 0; list-style: none; }
.or-track li { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 7px; }
.or-track .otier { width: 100%; height: 100%; border-radius: 6px; }
.or-track .otier.blank { background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--line); }
.or-track li.now .otier.blank { box-shadow: inset 0 0 0 2px var(--violet); background: color-mix(in srgb, var(--violet) 10%, var(--page)); }
.or-track li.did:last-of-type .otier, .or-track li.did:has(+ li.now) .otier { animation: pop 0.35s cubic-bezier(0.3, 0.8, 0.3, 1.4); }
@keyframes pop { 0% { transform: scale(0.5); } 100% { transform: none; } }
.odd-run.endless { grid-template-columns: auto 1fr auto; }
.or-mid { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.or-best.top { color: var(--green-text); font-weight: 700; }
@media (max-width: 30rem) {
  .odd-run { grid-template-columns: auto auto; }
  .or-track, .or-mid { grid-column: 1 / -1; grid-row: 2; }
  .or-track li { width: 1.5rem; height: 1.5rem; }
}

/* the clock: the bar drains, and the last few seconds pulse red */
.odd-time.low i { animation: low-pulse 0.5s ease-in-out infinite alternate; }
.odd-clock:has(.odd-time.low) .odd-secs { color: var(--red); animation: low-pulse 0.5s ease-in-out infinite alternate; }
@keyframes low-pulse { from { opacity: 1; } to { opacity: 0.55; } }

/* ----------------------------------------------------- Oddball launch results */
.or-done { position: relative; display: grid; gap: 0.5rem; justify-items: start; }
.odd-pb { margin: 0; }
.odd-result.best .odd-pb b { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 999px; background: var(--violet); color: #fff; animation: pb-in 0.6s cubic-bezier(0.3, 0.8, 0.3, 1.4) 0.9s both; }
@keyframes pb-in { from { transform: scale(0.6); opacity: 0; } }
.odd-result.best .result-big b { background: linear-gradient(90deg, #4a8fe0, #2e9b8f, #5aa43a, #d7a521, #e47b2a, #d9473a, #c23f8c, #7a5bd1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.or-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; margin-top: 0.5rem; }
.or-facts dl { display: flex; gap: 1.5rem; margin: 0; }
.or-facts dl div { display: grid; gap: 0.125rem; }
.or-facts dt { font-size: 0.75rem; color: var(--ink-soft); }
.or-facts dd { margin: 0; font-weight: 800; font-size: 1.125rem; }
.odd-burst { position: absolute; left: 6rem; top: 3.5rem; width: 0; height: 0; pointer-events: none; }
.odd-burst i { position: absolute; width: 0.625rem; height: 0.625rem; border-radius: 2px; background: var(--t); opacity: 0; animation: burst 1.3s cubic-bezier(0.15, 0.7, 0.3, 1) calc(0.9s + var(--d)) forwards; }
@keyframes burst { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 60px)) rotate(var(--r)); } }
.odd-result .odd-list li { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto 3rem; animation: rise-in 0.35s ease-out both; animation-delay: calc(0.3s + var(--k) * 70ms); }
.odd-pill { display: inline-block; padding: 0.125rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; color: #fff; background: var(--t); white-space: nowrap; }
.odd-pill.tx { background: var(--panel); color: var(--ink-soft); }
@media (max-width: 32rem) {
  .odd-result .odd-list li { grid-template-columns: minmax(0, 1fr) auto 3rem; }
  .odd-result .odd-list li > :first-child { grid-column: 1 / -1; }
}
.odd-pill.t0, .odd-pill.t1 { color: #1b1c1e; }

/* ------------------------------------------------------------- the flight
   One rocket for the whole game. The question cards float over the sky at the height it has
   reached; while it climbs, the cards make way for the flight readouts. */
.lz.fl { background: #bcd9ea; }
.fl-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: max(0.625rem, env(safe-area-inset-top)) 1rem 1.75rem; background: linear-gradient(rgb(0 0 0 / 0.42), transparent);
}
.fl-title { display: flex; align-items: center; gap: 0.5rem; font-size: 1rem; text-shadow: 0 1px 6px rgb(0 0 0 / 0.4); }
.fl-title .gtile { --s: 1.5rem; }
.fl-exit {
  display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.75rem 0.375rem 0.5rem; border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.5); background: rgb(0 0 0 / 0.28); color: #fff; font: inherit; font-weight: 600; font-size: 0.875rem; cursor: pointer;
}
.fl-exit svg { width: 1rem; height: 1rem; }
.fl-exit:hover { background: rgb(0 0 0 / 0.45); }
.fl-q { margin: 0; font-weight: 600; font-size: 0.875rem; }
.fl .lz-event { top: calc(max(0.625rem, env(safe-area-inset-top)) + 3rem); z-index: 2; }
.fl-skip { position: absolute; right: 1rem; top: calc(max(0.625rem, env(safe-area-inset-top)) + 3rem); z-index: 2; display: none; }
.fl.flying:not(.landed) .fl-skip { display: block; }
.fl-slot {
  position: absolute; z-index: 1; left: 50%; top: calc(max(0.625rem, env(safe-area-inset-top)) + 3.25rem); transform: translateX(-50%);
  width: min(40rem, calc(100% - 1.5rem)); max-height: calc(100% - 5rem); overflow-y: auto; overscroll-behavior: contain;
  color: var(--ink); transition: opacity 0.35s, transform 0.45s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.fl.flying .fl-slot { opacity: 0; transform: translate(-50%, -1.5rem); pointer-events: none; }
.fl-slot .odd-card { margin-top: 0; background: var(--page); border-color: transparent; box-shadow: 0 18px 50px rgb(0 0 0 / 0.28), 0 2px 8px rgb(0 0 0 / 0.12); }
.fl-slot .odd-result { max-height: none; }
.fl .lz-tele { opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.fl.flying:not(.landed) .lz-tele { opacity: 1; }
.fl-place {
  position: absolute; z-index: 1; left: 1rem; bottom: max(1rem, env(safe-area-inset-bottom)); margin: 0;
  display: grid; gap: 0.0625rem; max-width: min(19rem, calc(100% - 2rem)); padding: 0.5rem 0.75rem 0.5625rem 0.75rem;
  border-left: 3px solid #fff; background: rgb(0 0 0 / 0.38); backdrop-filter: blur(6px);
  transition: opacity 0.3s;
}
.fl-place b { font-size: 0.9375rem; }
.fl-place span { font-size: 0.8125rem; opacity: 0.85; }
.fl-place small { font-size: 0.75rem; opacity: 0.7; }
.fl.flying .fl-place { opacity: 0; }
.fl-panel .lzr { z-index: 3; }
.fl .lzr-note b { color: #fff; }
.fl.solo-climb .fl-place { display: none; }
@media (max-width: 36rem) {
  .fl-place { left: 0.5rem; bottom: 0.5rem; }
  .fl-exit span { display: none; }
  .fl-exit { padding: 0.4375rem; }
}
/* on short screens with the keyboard up, the place card would sit under the question */
@media (max-height: 34rem) { .fl-place { display: none; } }
.or-reached { margin: 0; }
.odd-card { grid-template-columns: minmax(0, 1fr); }
.odd-input { width: 100%; }
.fl-slot { overflow-x: hidden; }
.odd-final { padding: 1rem 1.125rem; margin-bottom: 1rem; border-radius: 14px; background: color-mix(in srgb, var(--violet) 10%, var(--page)); }
.odd-final h2 { margin: 0 0 0.5rem; }
.odd-standings { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.odd-standings li { display: grid; grid-template-columns: 1.5rem 1fr auto; gap: 0.5rem; align-items: baseline; }
.odd-standings li.me b { color: var(--violet); }
