/* Visus – eye-chart themed word game. Mobile first. */

:root {
  --paper: #f4f1e8;
  --paper-2: #ebe6d8;
  --ink: #1d1c1a;
  --ink-soft: #5d5a52;
  --rule: #cfc8b6;
  --tile-border: #b9b19c;
  --tile-border-filled: #4a463d;
  --key-bg: #ddd7c6;
  --key-ink: #1d1c1a;
  /* The SPELA key: white on blue, 6.8:1, the same in light and dark mode. */
  --play-bg: #135f97;
  --play-ink: #ffffff;
  --focus: #0b62c4;
  --toast-bg: #1d1c1a;
  --toast-ink: #f4f1e8;
  --sheet-bg: #fbf9f3;
  --backdrop: rgba(29, 28, 26, 0.45);

  /* Default palette: green = right place, purple = wrong place,
     light grey = absent. The shapes differ too (square / circle). */
  --correct: #2a8549;
  --correct-ink: #ffffff;
  --present: #8a4fd6;
  --present-ink: #ffffff;
  --absent: #d3cdbd;
  --absent-ink: #4a463f;
  /* Borders of inputs and tabs: at least 3:1 against the background. */
  --control-border: #8a8374;

  /* Vertical nudge that centres capital letters in tiles and keys.
     Set by js/center.js from the actual font's metrics. */
  --cap-pad-top: 0em;
  --cap-pad-bottom: 0em;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Tile size: the board must fit both ways. This is the FALLBACK for
     browsers without container queries (see .board further down).
     Width: a row is two label columns + 5 tiles + 4 gaps (0.1 tile each).
     Height: the board is 6 tiles + 5 gaps = 6.5 tiles; --chrome-h is the
     height of everything else (header, keyboard, padding). */
  --label-w: 2.2rem;
  --chrome-h: 372px;
  --vh: 100vh;
  --tile: clamp(
    24px,
    min(
      calc((min(100vw, 520px) - 16px - 2 * var(--label-w)) / 5.4),
      calc((var(--vh) - var(--chrome-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom)) / 6.5)
    ),
    60px
  );
  --tile-gap: max(4px, calc(var(--tile) * 0.1));
  --radius: 9px;

  color-scheme: light dark;
}

/* Alternative: orange / blue, the easiest pair for most colour-blind players. */
/* The dynamic viewport height excludes mobile browser toolbars. */
@supports (height: 100dvh) {
  :root { --vh: 100dvh; }
}

[data-palette="contrast"] {
  --correct: #ef8a17;
  --correct-ink: #1a1206;
  --present: #2b74c9;
  --present-ink: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16181b;
    --paper-2: #1f2226;
    --ink: #ece8dd;
    --ink-soft: #a7a296;
    --rule: #3a3d42;
    --tile-border: #44474d;
    --tile-border-filled: #9b978c;
    --key-bg: #3a3d43;
    --key-ink: #ece8dd;
    --focus: #6fb0ff;
    --toast-bg: #ece8dd;
    --toast-ink: #16181b;
    --sheet-bg: #1d2024;
    --backdrop: rgba(0, 0, 0, 0.6);
    --control-border: #80838a;

    --correct: #4fb36a;
    --correct-ink: #07140b;
    --present: #a57cf0;
    --present-ink: #120a20;
    --absent: #4c4f55;
    --absent-ink: #d9d5ca;
  }
  [data-palette="contrast"] {
    --correct: #f09a33;
    --correct-ink: #1a1206;
    --present: #4a8fe0;
    --present-ink: #08121f;
  }
}

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

html, body { margin: 0; padding: 0; }

[hidden] { display: none !important; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-underline-offset: 2px; }
a:hover { color: var(--present); }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Layout ---------------------------------------------------------- */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 max(8px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
}

/* ---- Eye-chart header ------------------------------------------------- */

.chart-head {
  text-align: center;
  padding-top: max(6px, env(safe-area-inset-top));
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toolbar-group { display: flex; gap: 2px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.icon-btn:hover { background: var(--paper-2); }
.icon-btn svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.icon-btn svg .fill { fill: currentColor; stroke: none; }
.icon-btn.signed-in { color: var(--present); }

/* The title is the top line of an eye chart: very large, wide spacing.
   The top margin keeps the letters clear of the round hover area of the
   menu icons, which sit right above the outer letters on narrow screens. */
.title {
  margin: 8px 0 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(2.6rem, 13vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
  display: flex;
  justify-content: center;
  gap: 0.28em;
}
.title span { display: inline-block; }

.subtitle {
  margin: 8px auto 0;
  padding-top: 6px;
  max-width: 300px;
  border-top: 1px solid var(--rule);
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---- Board ------------------------------------------------------------ */

.play {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 8px 0;
}

/* Where container queries work, the board fills exactly the space left
   between the header and the keyboard. The --tile formula on :root, with
   its --chrome-h estimate, is the fallback for older browsers.
   Board height: 6 tiles + 5 gaps; width: 5 tiles + 4 gaps + 2 labels;
   a gap is a tenth of a tile but at least 4px. */
@supports (container-type: size) {
  .play { flex: 1 1 0; min-height: 0; container-type: size; }
  .board {
    --tile: clamp(
      24px,
      min(
        calc((100cqw - 2 * var(--label-w)) / 5.4),
        calc((100cqw - 2 * var(--label-w) - 16px) / 5),
        calc(100cqh / 6.5),
        calc((100cqh - 20px) / 6)
      ),
      60px
    );
    --tile-gap: max(4px, calc(var(--tile) * 0.1));
  }
}

.board {
  display: grid;
  gap: var(--tile-gap);
}

.row {
  display: grid;
  grid-template-columns: var(--label-w) auto var(--label-w);
  align-items: center;
}

/* Eye charts label each line; here the label is the score for a win on that row. */
.row-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.row.active .row-label { color: var(--ink); opacity: 1; }

.tiles {
  display: grid;
  grid-template-columns: repeat(5, var(--tile));
  gap: var(--tile-gap);
}

.tile {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--tile);
  height: var(--tile);
  border: 2px solid var(--tile-border);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-weight: 700;
  font-size: calc(var(--tile) * 0.52);
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  user-select: none;
  transition: border-radius 0.15s ease;
  padding: var(--cap-pad-top) 0 var(--cap-pad-bottom);
}

.tile[data-letter]:not([data-state]) {
  border-color: var(--tile-border-filled);
  animation: pop 0.1s ease-out;
}

/* Revealed states. Shape and lightness differ as well as hue, so the
   states can be told apart without colour: correct = strong square,
   present = circle, absent = faint square. */
.tile[data-state] { border-color: transparent; }

.tile[data-state="correct"] {
  background: var(--correct);
  color: var(--correct-ink);
  border-radius: 4px;
}

.tile[data-state="present"] {
  background: var(--present);
  color: var(--present-ink);
  border-radius: 50%;
}

.tile[data-state="absent"] {
  background: var(--absent);
  color: var(--absent-ink);
}

.tile.flip { animation: flip 0.5s ease-in-out; }
.row.shake { animation: shake 0.45s; }
.tile.bounce { animation: bounce 0.6s ease; }

.tile.demo {
  --tile: 34px;
  display: inline-grid;
  vertical-align: middle;
  margin-right: 8px;
  flex: none;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.09); }
  100% { transform: scale(1); }
}

@keyframes flip {
  0% { transform: rotateX(0); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

@keyframes bounce {
  0%, 20% { transform: translateY(0); }
  40% { transform: translateY(-28%); }
  50% { transform: translateY(4%); }
  60% { transform: translateY(-12%); }
  80% { transform: translateY(2%); }
  100% { transform: translateY(0); }
}

/* ---- Keyboard --------------------------------------------------------- */

/* One grid of 22 half-key columns: every key spans two, so the third row
   can start under D, and the wide keys can be 1.5 or 2 keys wide.
   The rows only group the keys in the markup (display: contents). */
.keyboard {
  display: grid;
  grid-template-columns: repeat(22, minmax(0, 1fr));
  column-gap: 5px;
  row-gap: 5px;
  padding: 2px 0 4px;
  user-select: none;
}
.kb-row { display: contents; }
.kb-row:nth-child(1) > .key { grid-row: 1; }
.kb-row:nth-child(2) > .key { grid-row: 2; }
.kb-row:nth-child(3) > .key { grid-row: 3; }
.kb-row:nth-child(4) > .key { grid-row: 4; }

.key {
  grid-column: span 2;
  min-width: 0;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--key-bg);
  color: var(--key-ink);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  touch-action: manipulation;
  transition: background-color 0.2s, color 0.2s, border-radius 0.2s;
  padding: var(--cap-pad-top) 0 var(--cap-pad-bottom);
}
.key:active { filter: brightness(0.9); }
/* The third row has fixed places: auto-placement would fill the indent. */
.key[data-key="z"] { grid-column: 5 / span 2; }
.key[data-key="x"] { grid-column: 7 / span 2; }
.key[data-key="c"] { grid-column: 9 / span 2; }
.key[data-key="v"] { grid-column: 11 / span 2; }
.key[data-key="b"] { grid-column: 13 / span 2; }
.key[data-key="n"] { grid-column: 15 / span 2; }
.key[data-key="m"] { grid-column: 17 / span 2; }
.key[data-key="backspace"] { grid-column: 20 / span 3; padding: 0; }
.key[data-key="enter"] {
  grid-column: 19 / span 4;
  padding: 0;
  background: var(--play-bg);
  color: var(--play-ink);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}
.key svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: middle;
}

.key[data-state="correct"] { background: var(--correct); color: var(--correct-ink); }
.key[data-state="present"] { background: var(--present); color: var(--present-ink); border-radius: 18px; }
/* Absent keys turn hollow: clearly "used up" even without colour. */
.key[data-state="absent"] {
  background: transparent;
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 1.5px var(--rule);
}


/* ---- Toasts ----------------------------------------------------------- */

.toasts {
  position: fixed;
  top: 112px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
  z-index: 50;
}

.toast {
  background: var(--toast-bg);
  color: var(--toast-ink);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.15s ease-out;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.out { opacity: 0; transition: opacity 0.3s; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* ---- Dialogs ---------------------------------------------------------- */

.sheet {
  width: min(480px, calc(100vw - 24px));
  max-height: min(88dvh, 760px);
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--sheet-bg);
  color: var(--ink);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}
.sheet::backdrop { background: var(--backdrop); }
.sheet[open] { animation: sheet-in 0.18s ease-out; }

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.sheet-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px 20px;
  background: var(--sheet-bg);
  border-bottom: 1px solid var(--rule);
  z-index: 1;
}
.sheet-head h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.close-btn {
  width: 38px; height: 38px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--ink);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.close-btn:hover { background: var(--paper-2); }

.sheet-body { padding: 16px 20px 22px; }

.prose p { margin: 0 0 12px; }
.legend { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.legend li { display: flex; align-items: center; }
/* Colour names in the help text follow the palette chosen in the settings. */
.pal-contrast { display: none; }
[data-palette="contrast"] .pal-standard { display: none; }
[data-palette="contrast"] .pal-contrast { display: inline; }
.muted { color: var(--ink-soft); font-size: 0.88rem; }

/* ---- Buttons and forms ------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: 600 0.95rem var(--sans);
  cursor: pointer;
}
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.danger { border-color: #b3261e; color: #b3261e; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.link { border: 0; padding: 0; min-height: 0; text-decoration: underline; font-weight: 500; }

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-size: 0.9rem; font-weight: 600; }
.form input {
  min-height: 44px;
  padding: 8px 10px;
  border: 1.5px solid var(--control-border);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: 1rem var(--sans);
}
.form input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 2px var(--focus); }
.form .hint { font-weight: 400; font-size: 0.8rem; color: var(--ink-soft); }
.form-error { color: #b3261e; font-weight: 600; margin: 0; }
.form-ok { color: var(--ink); font-weight: 600; margin: 0; }
@media (prefers-color-scheme: dark) {
  .form-error, .btn.danger { color: #ff8a80; border-color: #ff8a80; }
}
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.setting { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.setting legend { font-weight: 700; margin-bottom: 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.choice input { margin-top: 5px; }
.swatch {
  display: inline-block; width: 18px; height: 18px; margin-right: 4px; vertical-align: -3px;
  border-radius: 4px; background: var(--correct);
}
.swatch[data-state="present"] { background: var(--present); border-radius: 50%; }
.swatch.standard[data-state="correct"] { background: #2a8549; }
.swatch.standard[data-state="present"] { background: #8a4fd6; }
.swatch.contrast[data-state="correct"] { background: #ef8a17; }
.swatch.contrast[data-state="present"] { background: #2b74c9; }

.danger-zone { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 12px; }
.danger-zone summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.danger-zone[open] summary { margin-bottom: 10px; }

/* ---- Result and statistics ------------------------------------------- */

.result {
  text-align: center;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.result-word { margin: 0 0 4px; font-size: 1.05rem; }
.result-word strong {
  font-family: var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 1.3rem;
}
.result-text { margin: 0 0 12px; color: var(--ink-soft); }
.result-actions { display: flex; justify-content: center; gap: 10px; }
.countdown { margin: 12px 0 0; font-size: 0.9rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
  margin-bottom: 18px;
}
.stat-grid .num {
  display: block;
  font-family: var(--sans);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.1;
}
.stat-grid .lbl { display: block; font-size: 0.72rem; color: var(--ink-soft); line-height: 1.2; }

.section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 16px 0 8px;
  color: var(--ink-soft);
}

.dist { display: grid; gap: 4px; }
.dist-row { display: grid; grid-template-columns: 2.4rem 1fr; align-items: center; gap: 6px; font-size: 0.85rem; }
.dist-row .lbl { text-align: right; font-family: var(--sans); }
.dist-bar {
  min-width: 1.8rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--absent);
  color: var(--absent-ink);
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dist-row.today .dist-bar { background: var(--correct); color: var(--correct-ink); }
.dist-row.today.miss .dist-bar { background: var(--ink-soft); color: var(--paper); }

.placements { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 0.92rem; }
.placements li { display: flex; justify-content: space-between; border-bottom: 1px dotted var(--rule); padding: 3px 0; }

/* ---- Avatars ------------------------------------------------------------ */

.avatar { display: inline-block; flex: none; vertical-align: middle; border-radius: 50%; }
.icon-btn .avatar { width: 30px; height: 30px; }
.icon-btn.signed-in:has(.avatar) { box-shadow: 0 0 0 2px var(--present); }

.stats-who { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.avatar-editor { border-top: 1px solid var(--rule); padding-top: 4px; }
.avatar-preview { display: flex; justify-content: center; margin: 4px 0 10px; }
.avatar-preview .avatar { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); }
.avatar-groups { display: grid; gap: 10px; margin-bottom: 12px; }
.avatar-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.avatar-group legend { font-size: 0.85rem; font-weight: 700; margin-bottom: 4px; padding: 0; }
.avatar-options { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-option {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.avatar-option:hover { border-color: var(--control-border); }
.avatar-option[aria-pressed="true"] { border-color: var(--ink); }
.swatch-option { width: 38px; height: 38px; }
.swatch-dot { display: block; width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }

/* ---- Leaderboards ----------------------------------------------------- */

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tab {
  flex: 1 1 auto;
  min-height: 36px;
  border: 1.5px solid var(--control-border);
  border-radius: 18px;
  background: transparent;
  color: var(--ink);
  font: 600 0.85rem var(--sans);
  cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.board-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.board-table th {
  text-align: left; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 700; padding: 4px 6px; border-bottom: 1px solid var(--rule);
}
.board-table td { padding: 6px; border-bottom: 1px dotted var(--rule); }
.board-table .rank { width: 2.4rem; font-family: var(--sans); font-weight: 700; }
/* The name column takes the space that is left; long names get an ellipsis. */
.board-table td.name { width: 100%; max-width: 0; }
.board-table td.name .who { display: flex; align-items: center; gap: 8px; }
.board-table td.name .who span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-table th.num { text-align: right; }
.board-table tr.me td { background: var(--paper-2); font-weight: 700; }
.board-note { font-size: 0.82rem; color: var(--ink-soft); margin: 10px 0 0; }

/* ---- Static pages ----------------------------------------------------- */

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 20px 48px;
}
.page .title { font-size: clamp(2.2rem, 10vw, 3.2rem); }
.page .back { display: inline-block; margin-bottom: 10px; font-size: 0.9rem; }
.page h2 { font-family: var(--sans); font-size: 1.25rem; margin: 28px 0 8px; }
.page p, .page li { max-width: 62ch; }

/* ---- Small and short screens ----------------------------------------- */

@media (max-width: 420px) {
  :root { --label-w: 1.7rem; }
}

@media (max-height: 640px) {
  :root { --chrome-h: 330px; }
  .title { font-size: 2.2rem; }
  .subtitle { margin-top: 4px; padding-top: 3px; }
  .key { height: 40px; }
}

/* Phones on their side: as compact as possible so the board stays readable. */
@media (max-height: 500px) {
  :root { --chrome-h: 190px; }
  .toolbar .icon-btn { width: 36px; height: 36px; }
  .title { font-size: 1.6rem; margin-top: -30px; }
  .subtitle { display: none; }
  .play { padding: 4px 0; }
  .keyboard { gap: 4px; padding: 2px 0 4px; }
  .key { height: 38px; }
  .kb-row:nth-child(4) > .key[data-key="enter"] { grid-row: 3; grid-column: 1 / span 4; }
}

@media (max-width: 360px) {
  .kb-row { gap: 3px; }
  .key { font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
