@font-face {
  font-family: "Verimots Tiles";
  src: url("fonts/verimots-tiles.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #141e19;
  --bg2: #1d2922;
  --felt: #24372b;
  --ink: #f4efe4;
  --muted: #b7c4b8;
  --dim: #9baa9e;
  --line: rgba(244, 239, 228, 0.1);
  --tile: #f3e5c2;
  --tile-ink: #1c1408;
  --tile-edge: #c9b27a;
  --gold: #e8c56b;
  --feedback: #4aa3b8;
  --ok: #3dce8a;
  --ok-bg: rgba(61, 206, 138, 0.14);
  --no: #f07171;
  --no-bg: rgba(240, 113, 113, 0.14);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --foot: calc(76px + var(--safe-b));
  --fab-size: 52px;
  --fab-right: 14px;
  --fab-rail: 14px;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: var(--sans);
  --tile-font: "Verimots Tiles", Arial, sans-serif;
  /* surfaces */
  --felt-hi: #26452f;
  --card: var(--bg2);
  --card-line: rgba(244, 239, 228, 0.09);
  --rim: rgba(255, 255, 255, 0.06);
  --rim-gold: rgba(232, 197, 107, 0.3);
  --shadow-1: 0 2px 6px rgba(0, 0, 0, 0.28);
  --shadow-2: 0 18px 40px -22px rgba(0, 0, 0, 0.78);
  /* tile relief */
  --tile-hi: #fffaea;
  --tile-lo: #e7d3a6;
  --tile-deep: #a3853f;
  /* desktop side rail */
  --rail: 330px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--bg);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.legal { padding-bottom: 32px; }
body.legal .legal-kicker {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
body {
  min-height: 100dvh;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  --page: 100%;
  padding: calc(10px + var(--safe-t)) 16px calc(var(--foot) + 16px);
  overflow: visible;
  overscroll-behavior-x: none;
}
body.advanced:not(.view-game):not(.view-board) {
  --foot: calc(104px + var(--safe-b));
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}
.skip:focus {
  left: 16px;
  z-index: 20;
  background: var(--gold);
  color: #1c1408;
  padding: 8px 12px;
  border-radius: 8px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
  min-width: 0;
  flex-wrap: nowrap;
}
.brand {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  flex: 0 1 auto;
}
.brand-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.brand-home:hover h1,
.brand-home:focus-visible h1 {
  color: var(--gold);
}
.brand-home:focus-visible { outline: 2px solid var(--muted); outline-offset: 5px; border-radius: 6px; }
.mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: block;
  object-fit: contain;
}
.brand h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
}
.brand h1 a {
  color: inherit;
  text-decoration: none;
}
.brand h1 a:hover,
.brand h1 a:focus-visible {
  color: var(--gold);
}
.dict-wrap {
  position: relative;
  flex: 0 0 auto;
}
.dict-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  min-height: 28px;
  max-width: 7.2em;
  padding: 0 8px;
  border: 1px solid rgba(232, 197, 107, 0.45);
  border-radius: 999px;
  background: var(--felt);
  color: var(--gold);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.dict-chip::after {
  content: "";
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.75;
  transition: transform 0.15s ease;
}
.dict-chip.is-open::after {
  transform: rotate(180deg);
}
.dict-chip:hover,
.dict-chip:focus-visible,
.dict-chip.is-open {
  color: var(--tile);
  border-color: var(--gold);
}
.dict-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: max-content;
  min-width: 148px;
  max-width: min(360px, calc(100vw - 24px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #16241b;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.dict-pop[hidden] { display: none; }
.dict-pop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.dict-pop-item:hover,
.dict-pop-item:focus-visible {
  background: rgba(232, 197, 107, 0.12);
}
.dict-pop-item.is-on {
  background: rgba(232, 197, 107, 0.18);
  color: var(--gold);
}
.dict-pop-lang {
  flex: 0 0 auto;
  min-width: 1.6em;
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.dict-pop-item > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-tools {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  min-width: 0;
}
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg2);
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 26px;
  height: 24px;
  padding: 0 8px 0 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--gold);
  font: 700 10px/24px var(--sans);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.lang-btn .flag { width: 15px; height: 10px; opacity: 0.55; transition: opacity 0.16s ease; }
.lang-btn:hover .flag, .lang-btn[aria-pressed="true"] .flag { opacity: 1; }
.lang-btn[aria-pressed="true"] {
  background: var(--gold);
  color: #1c1408;
}
/* Inline SVG flags (flags.js): a 3:2 rectangle with a hairline rim so light
   fields (French white, Catalan yellow) still read on the dark cards. */
.flag {
  display: inline-block;
  width: 20px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(244, 239, 228, 0.14);
  vertical-align: middle;
  overflow: hidden;
}
.flag-any { box-shadow: none; border-radius: 0; color: var(--gold); }
.hist-btn {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg2);
  color: var(--gold);
  display: grid;
  place-items: center;
}
.hist-btn svg { width: 18px; height: 18px; }
.hist-btn[aria-expanded="true"] {
  border-color: rgba(232, 197, 107, 0.45);
  background: var(--felt);
}
.hist-count {
  position: absolute;
  top: -6px;
  right: -6px;
  box-shadow: 0 0 0 2px var(--bg);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--gold);
  color: #1c1408;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
}
.hist-count[hidden] { display: none; }
.hist-sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 14, 10, 0.62);
  padding: 12px 12px calc(12px + var(--safe-b));
}
@media (min-width: 720px) {
  .hist-sheet { align-items: center; }
}
.hist-sheet[hidden] { display: none !important; }
.hist-card {
  width: min(440px, 100%);
  max-height: min(80dvh, 720px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--bg2);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
}
.hist-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  flex: 0 0 auto;
}
.hist-heading { min-width: 0; }
.hist-bar h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  font-family: var(--display);
}
.hist-sub {
  margin: 4px 0 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.hist-sub[hidden] { display: none; }
.hist-clear {
  flex: 0 0 auto;
  margin: 0 16px 14px;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  min-height: 40px;
  border-radius: 12px;
}
.hist-clear[hidden] { display: none; }
.hist-close {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  background: rgba(244, 239, 228, 0.06);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}
.hist-out {
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 12px 8px;
  min-height: 0;
  scrollbar-width: none;
  scrollbar-color: #2f5b40 transparent;
}
.hist-out::-webkit-scrollbar { width: 6px; }
.hist-out::-webkit-scrollbar-track { background: transparent; }
.hist-out::-webkit-scrollbar-thumb {
  background: #2f5b40;
  border-radius: 999px;
}
.hist-out::-webkit-scrollbar-thumb:hover { background: #3a7050; }
.hist-out .empty {
  margin: 28px 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
}
.hist-day {
  margin: 14px 4px 8px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hist-day:first-child { margin-top: 2px; }
.hist-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  margin: 0 0 4px;
}
.hist-row-main {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(244, 239, 228, 0.04);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.hist-row-main:hover,
.hist-row-main:focus-visible {
  background: rgba(232, 197, 107, 0.1);
}
.fav-btn {
  flex: 0 0 auto;
  min-width: 34px;
  min-height: 34px;
  padding: 0 4px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.16s ease;
}
.fav-btn:hover { color: var(--gold); }
.fav-btn.is-on { color: var(--gold); }
.fav-btn[hidden] { display: none !important; }
.game-def-panel { position: relative; }
.game-def-panel .fav-btn {
  position: absolute;
  top: 4px;
  right: 6px;
  margin: 0;
}
.game-def-panel .game-def-body > .pos:first-child,
.game-def-panel .game-def-body > .sense:first-child > .pos { padding-right: 40px; }
.study-def-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.study-def-head .study-def-word { margin: 0; }
.hist-row-word {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-row-pts {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}
.hist-row-meta {
  color: var(--dim);
  font-size: 12px;
  white-space: nowrap;
}
.about-hist,
.info-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #f6dc94, #e2ba5c);
  color: var(--tile-ink);
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 0 #a9822f;
  transition: filter 0.16s ease;
}
.about-hist:hover,
.info-action:hover { filter: brightness(1.05); }
/* one primary, one quiet: two solid gold bars competed for the eye */
.info-actions {
  display: flex;
  gap: 8px;
  margin: 0 0 2px;
}
.info-actions .info-action { flex: 1 1 0; min-width: 0; }
.info-actions #info-feedback {
  background: none;
  border: 1px solid var(--card-line);
  box-shadow: none;
  color: var(--muted);
}
.info-actions #info-feedback:hover {
  filter: none;
  color: var(--gold);
  border-color: var(--rim-gold);
}
.info-legal {
  margin: 14px 0 0;
  text-align: center;
}
.info-action-ghost {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
}
.info-action-ghost:hover {
  color: var(--ink);
  border-color: rgba(232, 197, 107, 0.45);
}

main { min-width: 0; }
.search { margin: 14px 0 14px; }
body.view-check .search { margin-top: 18px; }
#search[hidden] { display: none !important; }
.field {
  position: relative;
}
#q {
  width: 100%;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg2);
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 48px 0 16px;
  outline: none;
  caret-color: var(--gold);
}
body.view-rack #q { padding-right: 96px; }
#q:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 197, 107, 0.18);
}
#q::placeholder {
  color: #5d6f61;
  letter-spacing: 0;
  font-weight: 500;
  text-transform: none;
  font-size: 17px;
}
.joker-key {
  position: absolute;
  right: 50px;
  top: 9px;
  width: 40px;
  height: 40px;
  border: 1px solid #c9b27a;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffdf6, #efe4c4);
  color: #1c1408;
  font-size: 22px;
  font-weight: 800;
  box-shadow: inset 0 -2px 0 #c9b27a;
}
.joker-key:disabled { opacity: 0.35; }
/* Catalan ela geminada key. It sits where the joker key is on the check
   tab, and shifts left when the joker key is also on screen (rack tab). */
.gem-key {
  width: 52px;
  font-size: 15px;
  letter-spacing: 0.01em;
}
#q-joker:not([hidden]) ~ .gem-key { right: 96px; }
.clear {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
}

.find-tools, .list-switch, .len-chips {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.find-tools { flex-wrap: wrap; }
.find-tools button, .list-switch button, .len-chips button {
  flex: 1;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.len-chips button { min-width: 0; padding: 0 4px; }
.find-tools button[aria-pressed="true"],
.list-switch button[aria-selected="true"],
.len-chips button[aria-pressed="true"] {
  background: var(--felt);
  color: var(--gold);
  border-color: rgba(232, 197, 107, 0.35);
}
.hint {
  margin: 8px 2px 12px;
  color: var(--dim);
  font-size: 13px;
}
.find-multi {
  margin: 10px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg2);
}
.find-multi[hidden] { display: none !important; }
.find-multi-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 92px;
  gap: 6px;
}
.find-multi input,
.find-multi select {
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--felt);
  color: var(--ink);
  padding: 0 10px;
  font: 600 13px var(--sans);
}
.find-multi-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}
.find-multi-checks label { display: inline-flex; align-items: center; gap: 4px; }
.find-multi-checks button {
  margin-left: auto;
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: var(--gold);
  color: var(--tile-ink);
  padding: 0 12px;
  font-weight: 700;
}
@media (max-width: 560px) {
  .find-multi-fields { grid-template-columns: 1fr 1fr; }
}

.verdict {
  border-radius: 18px;
  padding: 16px;
  background: var(--bg2);
  border: 1px solid var(--line);
}
.verdict.ok { background: var(--ok-bg); border-color: rgba(61, 206, 138, 0.3); }
.verdict.no { background: var(--no-bg); border-color: rgba(240, 113, 113, 0.3); }
.verdict .status {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.verdict.ok .status { color: var(--ok); }
.verdict.no .status { color: var(--no); }
.verdict .word {
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
  word-break: break-all;
}
.verdict-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: -4px -6px 6px 0;
}
.verdict-head .status { margin: 4px 0 0; }
.verdict-head .fav-btn { margin: -6px 0 0; font-size: 20px; }
.meta-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.wa-mini {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1f6b46;
  color: #e8f6ee;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.24);
  transition: filter 0.16s ease, transform 0.12s ease;
}
.wa-mini svg { width: 14px; height: 14px; fill: currentColor; }
.wa-mini:hover { filter: brightness(1.1); }
.wa-mini:active { transform: translateY(1px); }
.verdict-head .wa-mini { margin-top: -4px; }
.hint[hidden] { display: none !important; }
.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tile {
  width: 38px;
  height: 42px;
  display: grid;
  place-items: center;
  position: relative;
  border: 0;
  padding: 0;
  background: linear-gradient(158deg, var(--tile-hi) 0%, var(--tile) 58%, var(--tile-lo) 100%);
  color: var(--tile-ink);
  border-radius: 7px;
  font-weight: 400;
  font-size: 18px;
  font-family: var(--tile-font);
  font-synthesis: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -2px 0 var(--tile-edge),
    0 2px 0 var(--tile-deep),
    0 5px 12px -7px rgba(0, 0, 0, 0.72);
}
.tile small {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font-size: 9px;
  font-weight: 400;
  opacity: 0.62;
}
.tile.blank {
  background: linear-gradient(180deg, #fffef8, #e8d9b0);
  color: #1c1408;
  font-size: 22px;
  border: 1px dashed #8d7640;
  box-shadow: none;
}
.tile.add-blank {
  background: transparent;
  color: var(--gold);
  border: 2px dashed rgba(232, 197, 107, 0.7);
  box-shadow: none;
}
.tile.add-blank:disabled { opacity: 0.3; }
.meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}
.meta-line a {
  color: var(--gold);
  text-decoration: none;
}

.share-row {
  margin-top: 14px;
}
.wa-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #1f6b46;
  color: #e8f6ee;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.share-row .wa-share { width: 100%; min-height: 44px; border-radius: 12px; font-size: 15px; }
.wa-share svg { width: 18px; height: 18px; fill: currentColor; }
.wa-share:active { filter: brightness(1.08); }

.defs {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.defs h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.lemma {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}
.sense { margin-bottom: 10px; }
.pos {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}
.sense ol {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
.sense li { margin: 0 0 6px; }
.defs-src {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--dim);
}
.defs-src a { color: inherit; text-underline-offset: 3px; }

.rack-preview {
  margin-top: 10px;
  min-height: 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
/* Author display rules defeat the UA's [hidden]; guard explicitly. */
.rack-preview[hidden] { display: none !important; }
.results[hidden] { display: none !important; }
.rack-preview .tiles { display: contents; }
.preview-empty, .preview-cap {
  margin: 8px 0 0;
  color: var(--dim);
  font-size: 13px;
}
.rack-help {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
}
.rack-help h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 20px;
}
.rack-help p, .rack-help li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
.rack-help ol { margin: 8px 0 0; padding-left: 1.2rem; }
.rack-help li { margin: 0 0 6px; }
.text-ex {
  display: inline;
  border: 0;
  padding: 0;
  background: none;
  color: var(--gold);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.rack-bar { margin-bottom: 12px; }
.joker-btn {
  width: 100%;
  min-height: 44px;
  border: 1px dashed rgba(232, 197, 107, 0.45);
  border-radius: 12px;
  background: rgba(232, 197, 107, 0.08);
  color: var(--gold);
  font-size: 15px;
  font-weight: 700;
}
.joker-btn:disabled {
  opacity: 0.4;
}
.len-chips { margin-top: 8px; }
.result-sum {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.results { display: grid; gap: 14px; }
.group h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--gold);
  font-weight: 700;
}
.words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  appearance: none;
  border: 0;
  background: var(--bg2);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  letter-spacing: 0.06em;
  font-weight: 650;
  font-family: inherit;
}
.chip .pts {
  color: var(--dim);
  font-size: 11px;
  margin-left: 4px;
  letter-spacing: 0;
  font-weight: 600;
}
.chip .jk {
  color: #1c1408;
  background: #efe4c4;
  border: 1px dashed #8d7640;
  border-radius: 4px;
  padding: 0 4px;
  margin: 0 1px;
  font-weight: 800;
}
.empty, .pending {
  color: var(--dim);
  font-size: 14px;
  padding: 8px 2px;
}

.grid2, .grid3 {
  display: grid;
  gap: 6px;
}
.grid2 { grid-template-columns: repeat(6, 1fr); }
.grid3 { grid-template-columns: repeat(4, 1fr); }
.grid2 .chip, .grid3 .chip {
  text-align: center;
  padding: 10px 4px;
}

.values {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.val {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}
.info {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 18px 16px;
  overflow: visible;
  box-shadow: var(--shadow-2);
}
.info-head {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
  min-width: 0;
}
.info-lex {
  margin: 0;
  flex: 0 0 auto;
  min-width: 0;
  padding: 6px 12px;
  border: 1px solid var(--rim-gold);
  border-radius: 999px;
  background: rgba(232, 197, 107, 0.08);
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.info-lex strong {
  color: var(--gold);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.info h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-family: var(--display);
}
.info h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.1;
}
.info-lead {
  margin: 0 0 8px;
  font-size: 14px !important;
  line-height: 1.45 !important;
}
.info-note { margin: 0 0 8px !important; color: var(--dim) !important; }
.info p, .info li {
  color: var(--muted);
  line-height: 1.4;
  font-size: 14px;
}
.info ul { padding-left: 18px; }
.info a { color: var(--gold); }
.fine { font-size: 12px !important; }
.info-actions { margin: 14px 0 0; }
.settings-card,
.study-card {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.settings-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--gold);
  font: 700 11px var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.settings-card h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--rim-gold), transparent); }
#settings-card .info-action-ghost { margin-top: 12px; }
/* A–Z option as a switch row */
.opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: rgba(31, 58, 43, 0.3);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}
.opt-row span { order: -1; }
.opt-row input {
  appearance: none;
  -webkit-appearance: none;
  width: 38px;
  height: 22px;
  margin: 0;
  flex: 0 0 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(9, 15, 11, 0.55);
  position: relative;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.opt-row input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s ease, background 0.18s ease;
}
.opt-row input:checked { background: rgba(232, 197, 107, 0.25); border-color: var(--rim-gold); }
.opt-row input:checked::after { transform: translateX(16px); background: var(--gold); }
.opt-row input:focus-visible { outline: 2px solid var(--rim-gold); outline-offset: 2px; }
.settings-label {
  margin: 0 0 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim) !important;
  font-size: 11px !important;
  font-weight: 700;
}
.dict-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 10px 0 4px;
}
@media (min-width: 560px) {
  .dict-list { grid-template-columns: 1fr 1fr; }
}
.dict-opt {
  display: block;
  width: 100%;
  min-width: 0;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: rgba(9, 15, 11, 0.35);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.dict-opt:hover { border-color: rgba(232, 197, 107, 0.3); }
.dict-opt[aria-pressed="true"] {
  border-color: rgba(232, 197, 107, 0.5);
  background: linear-gradient(180deg, rgba(232, 197, 107, 0.12), rgba(31, 58, 43, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.dict-opt-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dict-lang {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 18px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(232, 197, 107, 0.14);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold);
}
.dict-opt[aria-pressed="true"] .dict-lang { background: var(--gold); color: #1c1408; }
.dict-name {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
}
.dict-opt[aria-pressed="true"] .dict-opt-head::after {
  content: "✓";
  margin-left: auto;
  color: var(--gold);
  font-weight: 800;
  font-size: 13px;
}
.dict-blurb {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}
.dict-meta {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.study-when,
.study-label {
  margin: 0 0 6px;
  font-size: 13px !important;
}
.study-when {
  color: var(--gold) !important;
  font-weight: 700;
}
.study-def-text { text-align: left; }
.study-def {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(232, 197, 107, 0.08);
}
.study-def[hidden] { display: none; }
.study-def-word {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.study-def-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.study-tile.is-on {
  box-shadow: 0 0 0 2px var(--gold);
}
.study-label {
  margin-top: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold) !important;
  font-size: 11px !important;
  font-weight: 700;
}
.study-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 4px;
}
.study-tile {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 8px 10px 6px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffdf6, #efe4c4);
  color: #1c1408;
  box-shadow: inset 0 -2px 0 #c9b27a;
  cursor: pointer;
}
.study-tile-hot {
  box-shadow: inset 0 -2px 0 #c9b27a, 0 0 0 1px rgba(232, 197, 107, 0.55);
}
.study-tile:hover,
.study-tile:focus-visible {
  filter: brightness(1.06);
}
.study-tile-word {
  font-family: var(--tile-font);
  font-synthesis: none;
  font-weight: 400;
  letter-spacing: 0.08em;
  font-size: 16px;
  line-height: 1.1;
}
.study-tile-pts {
  font-family: var(--tile-font);
  margin-top: 2px;
  font-size: 10px;
  font-weight: 400;
  color: #6b5a32;
}
.study-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.study-share {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(31, 107, 70, 0.4);
  color: #d7f0e2;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.study-share[hidden] { display: none; }
.study-share svg { width: 14px; height: 14px; fill: currentColor; }
.study-challenge-row {
  display: flex;
  justify-content: center;
  margin: 18px 0 4px;
}
.study-challenge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #f6dc94, #e2ba5c);
  color: var(--tile-ink);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 0 #a9822f, 0 10px 20px -12px rgba(0, 0, 0, 0.85);
  transition: filter 0.16s ease, transform 0.12s ease, box-shadow 0.12s ease;
}
.study-challenge svg { width: 18px; height: 18px; }
.study-challenge:hover { filter: brightness(1.05); }
.study-challenge:active { transform: translateY(2px); box-shadow: 0 0 0 #a9822f; }
.list-share { margin: 12px 0 4px; }

.chrome-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  width: 100%;
  padding-bottom: var(--safe-b);
  background: rgba(16, 26, 20, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-height: 64px;
  max-width: 560px;
  margin-inline: auto;
  padding: 4px 8px 6px;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 6px 2px 4px;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}
.tab svg { width: 20px; height: 20px; }
.tab span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tab[aria-current="page"] {
  color: var(--gold);
  background: rgba(232, 197, 107, 0.13);
  box-shadow: inset 0 0 0 1px var(--rim-gold);
}
.tab:not([aria-current="page"]):hover { color: var(--muted); }
@media (max-width: 360px) {
  .tab { font-size: 9.5px; }
  .brand h1 { font-size: 18px; }
}
.adv-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  min-width: 0;
  max-width: 560px;
  margin-inline: auto;
  padding: 8px 12px 0;
}
.adv-nav button {
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 0;
}
.adv-nav button[aria-current="page"] {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.play-link,
.legal-link {
  color: #5d6f61;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  background: none;
  padding: 4px 0;
  font-family: inherit;
}
.play-link:hover,
.legal-link:hover { color: var(--dim); }
.play-link[hidden],
.legal-link[hidden] { display: none; }
body.in-app .play-link { display: none; }
.adv-toggle {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--felt);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 10px 14px;
  white-space: nowrap;
}
.adv-toggle:hover { color: var(--ink); }

.fabs { display: none; }
.fab {
  position: relative;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(232, 197, 107, 0.35);
  border-radius: 50%;
  background: var(--felt);
  color: var(--gold);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}
.fab-q {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #efe4c4;
  color: #1c1408;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
}
.fab svg { width: 22px; height: 22px; }
.fab[aria-current="page"] {
  background: var(--gold);
  color: #1c1408;
  border-color: var(--gold);
}
.fab-feedback {
  background: var(--feedback);
  color: #f4efe4;
  border-color: #6ec4d4;
}
.fab-feedback[aria-expanded="true"] {
  background: #3b8ea3;
  color: #f4efe4;
}
.feedback-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 14px 16px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.feedback-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.feedback-body textarea,
.feedback-body input[type="email"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--felt);
  color: var(--ink);
  font: inherit;
  padding: 12px;
}
.feedback-body textarea {
  min-height: 120px;
  resize: vertical;
}
.feedback-body input[type="email"] {
  height: 44px;
}
.feedback-body .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.feedback-send {
  align-self: flex-end;
  border: 0;
  border-radius: 12px;
  background: var(--gold);
  color: #1c1408;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
}
.feedback-send:disabled { opacity: 0.55; }
.feedback-status {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}
.feedback-status.ok { color: var(--ok); }
.feedback-status.bad { color: var(--no); }

body.view-game,
body.view-board {
  --fab-size: 44px;
}
body.view-game,
body.view-board {
  /* clear the fixed chart dock (bottom: foot+6, height 44) with real margin */
  padding-bottom: calc(var(--foot) + 68px);
}
body.view-game:not(.has-chart),
body.view-board:not(.has-chart) {
  padding-bottom: calc(var(--foot) + 12px);
}
.panel[hidden],
#game-play[hidden] { display: none !important; }
#game-play {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}
body.view-game .top { margin-bottom: 16px; }
@media (min-width: 720px) {
  body.view-game {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body.view-game .top { flex: 0 0 auto; }
  body.view-game main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  body.view-game #panel-game {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* single-column desktop: the rack stays pinned to the top of the view */
  body.view-game:not(.game-split) #game-play > .play-main { margin-block: 0; }
}
body.view-game .fab,
body.view-board .fab { width: var(--fab-size); height: var(--fab-size); }
body.view-game .fab svg,
body.view-board .fab svg { width: 20px; height: 20px; }
body.game-closed .game-form,
body.game-closed .game-live,
body.game-closed .game-live-row { display: none !important; }
/* flex-grow keeps the rack's width definite in the closed row — with
   shrink-to-fit the %-based tile grid collapsed to ~16px tiles under 20px
   letters, the score digits landing on top of them. */
body.game-closed .game-rack { min-height: 0; margin: 0; flex: 1 1 auto; min-width: 0; --tile-max: 40px; }
body.game-closed .game-rack .tiles { width: min(92%, calc(var(--n) * var(--tile-max) + (var(--n) - 1) * 8px)); }
/* closed round: tiles and the next arrow share one line */
body.game-closed .play-table {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
}
body.game-closed .game-next {
  flex: 0 0 auto;
  width: 42px;
  height: 40px;
  border-radius: 13px;
}
body.game-closed .game-next svg { width: 22px; height: 22px; }
body.game-closed .game-rack .tile { font-size: clamp(12px, 3.2vw, 18px); }
body.game-closed .game-rack .tile small { font-size: clamp(6px, 1.6vw, 9px); }
.game-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 14px;
  flex: 0 0 auto;
}
/* Back button always top-right; the kicker + its rule line fill the left */
.game-head .menu-back { flex: 0 0 auto; order: 3; }
.game-head .game-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  order: 1;
}
.game-head .game-meta {
  flex: 0 1 auto;
  margin-left: auto;
  order: 2;
}
.game-head .game-meta[hidden] { display: none; }

/* ---- Challenge menu (game picker + level toggle) ---- */
.game-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  flex: 0 0 auto;
}
.game-menu[hidden] { display: none !important; }
.game-menu-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 2px;
}
.game-menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(78px, auto);
  gap: 10px;
  flex: 0 0 auto;
  align-content: start;
}
.game-menu-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 3px;
  align-items: center;
  min-height: 0;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--card-line);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.16s ease, background 0.16s ease,
    box-shadow 0.16s ease;
}
.game-menu-item svg {
  grid-row: 1 / span 2;
  align-self: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 9px;
  border-radius: 12px;
  background: linear-gradient(158deg, var(--tile-hi) 0%, var(--tile) 58%, var(--tile-lo) 100%);
  color: #3c2c0d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 0 var(--tile-deep);
}
.game-menu-item strong {
  width: 100%;
  align-self: end;
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-menu-sub {
  display: -webkit-box;
  align-self: start;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.35;
}
.game-menu-item:hover,
.game-menu-item:focus-visible {
  border-color: var(--rim-gold);
  background: rgba(31, 58, 43, 0.6);
  box-shadow: var(--shadow-2);
}
.game-menu-item:active { transform: translateY(1px); }
@media (min-width: 720px) {
  .game-menu-grid { gap: 12px; }
}
.level-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 12px;
  margin-top: 8px;
  padding: 6px 0 2px;
}
.level-label {
  flex: 0 0 auto;
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.level-toggle {
  display: flex;
  flex: 0 1 260px;
  min-width: 0;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 15, 11, 0.45);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}
.level-toggle button {
  flex: 1 1 0;
  min-width: 0;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 700 12px/30px var(--sans);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}
.level-toggle button:hover { color: var(--gold); }
.level-toggle button[aria-pressed="true"] {
  background: linear-gradient(180deg, #f6dc94, #e2ba5c);
  color: #1c1408;
  box-shadow: 0 1px 0 #a9822f;
}
.study-top {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  flex: 0 0 auto;
}
.study-top {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 2px 0 6px;
  background: var(--bg);
}
.menu-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 10px 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg2);
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.menu-back svg { width: 16px; height: 16px; }
.game-study {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.game-study .study-card {
  margin-top: 0;
  padding: 16px 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(244, 239, 228, 0.04);
}
.study-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.game-study .study-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
}
.study-when {
  margin: 0;
  color: var(--gold);
  font-size: 12px !important;
  font-weight: 700;
  white-space: nowrap;
}
.game-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.game-dock {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--foot) + 8px);
  width: min(calc(100% - 32px), calc(var(--page) - 32px));
  margin-inline: auto;
  align-items: center;
  gap: 10px;
  height: 44px;
  z-index: 12;
  pointer-events: none;
}
.play-rail { min-width: 0; }
.play-main { min-width: 0; }
body.view-game .game-dock,
body.view-board .game-dock { display: flex; }
body.view-game:has(#game-play[hidden]) .game-dock { display: none !important; }
body.view-game:has(#game-play[hidden]) {
  padding-bottom: calc(var(--foot) + 12px);
}
.game-dock[hidden] { display: none !important; }
.game-wa-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1f6b46;
  color: #e8f6ee;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
  pointer-events: auto;
}
.game-wa-icon svg { width: 15px; height: 15px; fill: currentColor; }
.game-wa-icon.is-off {
  visibility: hidden;
  pointer-events: none;
}
.game-chart {
  flex: 1;
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--card-line);
  border-radius: 16px;
  background: rgba(16, 26, 20, 0.82);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-1);
  pointer-events: auto;
}
.game-chart svg.score-chart {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 34px;
  display: block;
}
.score-chart .axis {
  stroke: rgba(244, 239, 228, 0.1);
  stroke-width: 1;
}
.score-chart .bar { fill: rgba(232, 197, 107, 0.52); }
.score-chart .bar.last { fill: #f8e3a4; }
.score-chart .avg {
  stroke: rgba(244, 239, 228, 0.45);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.game-chart-avg,
.game-chart-last {
  flex: 0 0 auto;
  color: var(--gold);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}
.game-chart-avg {
  text-align: right;
  white-space: nowrap;
}
/* "70,3 moy." and "100/100" read as one line — no stacked unit under the number */
.game-chart-avg small {
  display: inline;
  margin-left: 3px;
  color: var(--dim);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
/* Ranked: points on top, "#4 · semaine" underneath — the board's own numbers */
.game-chart-avg.is-ranked {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.game-chart-avg .game-chart-pts small { margin-left: 3px; }
.game-chart-avg .game-chart-rank {
  display: block;
  margin: 0;
  color: var(--dim);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.game-chart-last { white-space: nowrap; }
.game-chart-last small {
  display: inline;
  margin-left: 2px;
  color: var(--dim);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.game-chart-last.dim { color: var(--dim); }
.game-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-meta {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
  text-align: right;
}
.game-rack {
  --n: 7;
  --tile-max: 52px;
  min-height: 48px;
  margin: 0;
  flex: 0 0 auto;
  min-width: 0;
  overflow: visible;
}
.game-rack[data-n="2"] { --n: 2; --tile-max: 58px; }
.game-rack[data-n="3"] { --n: 3; --tile-max: 56px; }
.game-rack[data-n="4"] { --n: 4; --tile-max: 54px; }
.game-rack[data-n="5"] { --n: 5; --tile-max: 52px; }
.game-rack[data-n="6"] { --n: 6; --tile-max: 50px; }
.game-rack[data-n="7"] { --n: 7; --tile-max: 46px; }
.game-rack[data-n="8"] { --n: 8; --tile-max: 36px; }
.game-rack[data-n="9"] { --n: 9; --tile-max: 32px; }
.game-rack .tiles {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  justify-content: center;
  gap: clamp(3px, 1.4vw, 8px);
  width: min(100%, calc(var(--n) * var(--tile-max) + (var(--n) - 1) * 8px));
  max-width: 100%;
  margin: 0 auto;
  flex-wrap: nowrap;
}
.game-rack .tile {
  width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 11 / 12;
  font-family: var(--tile-font);
  font-size: clamp(16px, 5.8vw, 27px);
  font-weight: 400;
  line-height: 1;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.2s ease, opacity 0.2s ease;
}
.game-rack .tile small {
  font-family: var(--tile-font);
  font-size: clamp(7px, 2vw, 10px);
}
@media (hover: hover) {
  .game-rack .tile:not(.used):hover {
    transform: translateY(-2px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      inset 0 -2px 0 var(--tile-edge),
      0 4px 0 var(--tile-deep),
      0 12px 20px -10px rgba(0, 0, 0, 0.8);
  }
}
.game-rack .tile:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 var(--tile-edge),
    0 0 0 var(--tile-deep),
    0 3px 8px -6px rgba(0, 0, 0, 0.7);
}
.game-rack .tile.used {
  opacity: 0.66;
  filter: saturate(0.35);
  background: linear-gradient(158deg, #6f7a6d 0%, #5b6459 60%, #4d554c 100%);
  color: #dfe6da;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -2px 0 #3c443b,
    0 1px 0 #2b322a;
}
.game-rack .tile.used small {
  opacity: 0.45;
}
.game-rack.dealt .tile {
  animation: tile-deal 0.36s cubic-bezier(0.2, 0.85, 0.3, 1) backwards;
}
.game-rack.dealt .tile:nth-child(1) { animation-delay: 0ms; }
.game-rack.dealt .tile:nth-child(2) { animation-delay: 45ms; }
.game-rack.dealt .tile:nth-child(3) { animation-delay: 90ms; }
.game-rack.dealt .tile:nth-child(4) { animation-delay: 135ms; }
.game-rack.dealt .tile:nth-child(5) { animation-delay: 180ms; }
.game-rack.dealt .tile:nth-child(6) { animation-delay: 225ms; }
.game-rack.dealt .tile:nth-child(7) { animation-delay: 270ms; }
.game-rack.dealt .tile:nth-child(8) { animation-delay: 315ms; }
.game-rack.dealt .tile:nth-child(9) { animation-delay: 360ms; }
@keyframes tile-deal {
  from { opacity: 0; transform: translateY(-12px) rotate(-3deg); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .game-rack.dealt .tile { animation: none; }
}
.game-rack-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  flex: 0 0 auto;
}
.rack-tool {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(244, 239, 228, 0.12);
  border-radius: 999px;
  background: rgba(9, 15, 11, 0.35);
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.rack-tool:hover { color: var(--gold); border-color: var(--rim-gold); }
.rack-tool[aria-pressed="true"] {
  background: rgba(232, 197, 107, 0.14);
  border-color: var(--rim-gold);
  color: var(--gold);
}
.rack-tool[hidden] { display: none !important; }
/* The optional A–Z sorter stays discreet when enabled. */
.rack-tool-quiet {
  min-height: 24px;
  padding: 0 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.75;
}
body.game-closed .game-rack-tools { display: none; }
.game-rack .tile.training-extra {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.game-rack.shake { animation: shake 0.35s ease; }
@keyframes shake {
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
/* ---- the felt table: rack + entry live on one raised surface ---- */
.play-table {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 16px;
  padding: 14px 16px 16px;
  border: 1px solid var(--card-line);
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.055), transparent 62%),
    linear-gradient(180deg, var(--felt-hi) 0%, #1c3325 58%, #172a1e 100%);
  box-shadow: inset 0 1px 0 var(--rim), var(--shadow-2);
  flex: 0 0 auto;
  min-width: 0;
}
.play-table::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28), inset 0 -18px 30px -24px rgba(0, 0, 0, 0.9);
}
.play-table > * { position: relative; }
.play-table .game-rack-tools { order: -1; justify-content: flex-end; }
body.game-closed .play-table { gap: 12px; }

.game-form {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
  width: min(100%, 23rem);
  align-self: center;
}
.game-field {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
}
.game-form .game-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  flex: none;
  box-shadow: none;
  border: 0;
  border-radius: 10px;
  background: rgba(244, 239, 228, 0.06);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}
.game-form .game-clear:hover { color: var(--gold); background: rgba(232, 197, 107, 0.12); filter: none; }
.game-form .game-clear:active { transform: none; box-shadow: none; }
.game-form .game-clear[hidden] { display: none !important; }
.game-form .game-field input { padding-right: 46px; padding-left: 46px; }
.game-form input {
  flex: 1;
  min-width: 0;
  height: 54px;
  border: 1px solid rgba(244, 239, 228, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(8, 14, 10, 0.66), rgba(16, 26, 20, 0.48));
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
  color: var(--ink);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-align: center;
  text-indent: 0.2em;
  text-transform: uppercase;
  padding: 0 12px;
  caret-color: var(--gold);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.game-form input::placeholder {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--dim);
}
.game-form input:focus {
  outline: none;
  border-color: var(--rim-gold);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(232, 197, 107, 0.16);
}
.game-form button {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #f6dc94, #e2ba5c);
  color: #1c1408;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 3px 0 #a9822f, 0 10px 20px -12px rgba(0, 0, 0, 0.85);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.16s ease;
}
.game-form button:hover { filter: brightness(1.04); }
.game-form button:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #a9822f, 0 4px 10px -8px rgba(0, 0, 0, 0.8);
}
.game-live-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 0;
  margin: 0;
  flex: 0 0 auto;
}
.game-live:empty { display: none; }
.game-live-row:has(> .game-live:empty):has(> .game-hint[hidden]) { display: none; }
.game-live {
  min-width: 0;
  min-height: 1.25em;
  margin: 0;
  padding: 0;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  color: var(--dim);
  flex: 0 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.16s ease, background 0.16s ease;
}
.game-live.ok,
.game-live.bad {
  padding: 4px 12px;
  border-radius: 999px;
}
/* Find-a-word helpers under the nudge */
.find-tools-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 0;
  flex: 0 0 auto;
}
.find-tools-row[hidden] { display: none !important; }
.find-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(232, 197, 107, 0.3);
  border-radius: 999px;
  background: transparent;
  color: var(--gold);
  font: 650 11.5px var(--sans);
  cursor: pointer;
  outline: none;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.find-tool:focus-visible { box-shadow: 0 0 0 2px rgba(232, 197, 107, 0.45); }
.find-tool:hover:not(:disabled) { background: rgba(232, 197, 107, 0.1); border-color: rgba(232, 197, 107, 0.55); }
.find-tool:disabled { opacity: 0.4; cursor: default; }
.find-tool.is-shown { background: rgba(232, 197, 107, 0.14); }
.find-tool-icon { width: 15px; height: 15px; flex: 0 0 auto; opacity: 0.85; }
.find-tool-label { white-space: nowrap; }
.find-tool-sub {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(244, 239, 228, 0.07);
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.find-tool-quiet { color: var(--dim); border-color: var(--line); }
.find-tool-quiet:hover:not(:disabled) { color: var(--no); border-color: rgba(240, 113, 113, 0.4); background: transparent; }
.find-tool.is-pass { color: var(--muted); border-color: var(--line); }
.find-tool.is-pass:hover:not(:disabled) { color: var(--no); border-color: rgba(240, 113, 113, 0.45); background: rgba(240, 113, 113, 0.08); }
.find-tool.is-pass:hover:not(:disabled) .find-tool-sub { color: var(--no); background: rgba(240, 113, 113, 0.12); }
/* Bingo hint: a solid gold pill while idle, then the countdown chip takes
   over — a conic ring drains with --p (1 → 0) beside the seconds left. */
.find-tools-row.is-bingo .find-tool:not(.is-pass):not(.is-shown) {
  background: linear-gradient(180deg, #f4d98c, #d8ac48);
  border-color: transparent;
  color: #26200c;
  box-shadow: 0 2px 0 rgba(120, 84, 20, 0.55), 0 8px 16px -12px rgba(0, 0, 0, 0.8);
}
.find-tools-row.is-bingo .find-tool:not(.is-pass):not(.is-shown):hover:not(:disabled) { filter: brightness(1.05); }
.find-tools-row.is-bingo .find-tool:not(.is-pass):not(.is-shown) .find-tool-icon { opacity: 1; }
.find-tool.is-timing { cursor: default; }
.find-tool-timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 2px;
  padding: 1px 7px 1px 4px;
  border-radius: 999px;
  background: rgba(232, 197, 107, 0.16);
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}
.find-tool-timer::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #1c2a20 0 3px, transparent 3.5px),
    conic-gradient(var(--gold) calc(var(--p, 1) * 100%), rgba(232, 197, 107, 0.22) 0);
}
@keyframes find-tool-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 113, 113, 0); }
  50% { box-shadow: 0 0 0 3px rgba(240, 113, 113, 0.28); }
}
.find-tool.is-timing:has(.find-tool-timer[style*="--p:0.0"]),
.find-tool.is-timing:has(.find-tool-timer[style*="--p:0.1"]),
.find-tool.is-timing:has(.find-tool-timer[style*="--p:0.2"]) { animation: find-tool-pulse 0.8s ease-in-out infinite; border-color: rgba(240, 113, 113, 0.5); }
.find-tool.is-timing:has(.find-tool-timer[style*="--p:0.0"]) .find-tool-timer,
.find-tool.is-timing:has(.find-tool-timer[style*="--p:0.1"]) .find-tool-timer,
.find-tool.is-timing:has(.find-tool-timer[style*="--p:0.2"]) .find-tool-timer { color: var(--no); background: rgba(240, 113, 113, 0.14); }
.game-live.ok { color: var(--ok); background: var(--ok-bg); }
.game-live.bad { color: var(--no); background: var(--no-bg); }
/* valid but beatable: amber nudge, with a hairline gold rim */
.game-live.meh {
  padding: 5px 14px;
  border-radius: 999px;
  color: var(--gold);
  background: rgba(232, 197, 107, 0.1);
  box-shadow: inset 0 0 0 1px rgba(232, 197, 107, 0.28);
}
.game-next {
  align-self: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(232, 197, 107, 0.45);
  border-radius: 16px;
  background: linear-gradient(180deg, #35664a, #234832);
  color: #f4efe4;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 3px 0 #10231a, 0 10px 20px -12px rgba(0, 0, 0, 0.85);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.16s ease;
}
.game-next svg { width: 26px; height: 26px; }
.game-next:hover { filter: brightness(1.1); color: var(--gold); }
.game-next:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #10231a, 0 4px 10px -8px rgba(0, 0, 0, 0.8);
}
.game-next[hidden] { display: none !important; }
.game-result {
  margin-top: 18px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}
.game-result[hidden] { display: none !important; }
.game-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 16px;
  flex: 0 0 auto;
  margin-bottom: 12px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 18px;
  box-shadow: var(--shadow-2);
}
.game-result.hot .game-score {
  border-color: var(--rim-gold);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(232, 197, 107, 0.14), transparent 60%),
    var(--card);
}
.game-result.hot .game-pct { color: var(--gold); }
.game-pct {
  order: 2;
  justify-self: end;
  font-family: var(--display);
  font-size: 34px;
  line-height: 0.9;
  color: var(--gold);
}
.game-pct small { font-size: 16px; }
.game-score-words { order: 1; text-align: left; min-width: 0; }
.game-score-words p { margin: 0; color: var(--muted); font-size: 14px; }
.game-break {
  font-size: 20px !important;
  font-family: var(--display);
  letter-spacing: 0.06em;
  color: var(--ink) !important;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.game-vs { font-size: 11px !important; font-style: italic; opacity: 0.85; margin-top: 2px !important; }
.game-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
  flex: 0 0 auto;
  margin: 0 0 12px;
  border-top: 1px solid var(--line);
}
.game-top button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: 600 13px/1.25 var(--sans);
  letter-spacing: .02em;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}
.game-top button:hover { background: rgba(244, 239, 228, .04); color: var(--ink); }
.game-top button[aria-selected="true"] { background: rgba(232, 197, 107, .06); color: var(--ink); }
.game-top button[aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px; background: var(--gold); }
.game-top button.is-mine:not([aria-selected="true"]) { color: var(--ok); }
.game-top-word { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-top-pts { flex: 0 0 auto; font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--gold); font-variant-numeric: tabular-nums; }
.game-def-panel {
  flex: 1 1 auto;
  min-height: 6rem;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: left;
  padding: 10px 16px 14px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 10px;
}
@media (max-width: 719px) {
  body.view-game main,
  body.view-game #panel-game,
  #game-play,
  .game-result,
  .game-def-panel,
  .game-study {
    flex: none;
    min-height: 0;
    overflow: visible;
  }
  .game-def-panel { min-height: 0; }
  /* the rack always sits at the top of the screen, never vertically centered */
  body.view-game #game-play {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - var(--safe-t) - var(--foot) - 132px);
  }
  body.view-game #game-play > .play-main { margin-block: 0; }
}
.game-def-body { overflow-wrap: anywhere; word-break: break-word; }
.game-def-body .pending,
.game-def-body .empty { margin: 0; color: var(--dim); font-size: 14px; }
.game-def-body .pos { margin-bottom: 2px; }
.game-def-body ol {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
}
.game-def-body .defs-src { margin-top: 10px; }
.form-of-line {
  margin: 0 0 8px !important;
  color: var(--muted);
  font-size: 14px;
}
.def-back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 10px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.def-back svg { width: 16px; height: 16px; }
/* Dictionary words remain ordinary readable text and keyboard-accessible links. */
button.form-of {
  border: 0;
  border-bottom: 1px dotted rgba(183, 196, 184, 0.32);
  background: none;
  color: inherit;
  font: inherit;
  padding: 0;
  text-decoration: none;
  cursor: pointer;
}
button.form-of:hover,
button.form-of:focus-visible {
  border-bottom-style: solid;
  border-bottom-color: currentColor;
}
.form-of-line button.form-of,
.lemma button.form-of { border-bottom-style: solid; }
.game-again {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 32px;
  min-width: 0;
  margin: 0 0 10px;
  padding: 0 12px;
  border: 1px solid rgba(232, 197, 107, 0.4);
  border-radius: 999px;
  background: var(--felt);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: none;
}
.game-again svg { width: 14px; height: 14px; }
.game-again:active { transform: translateY(1px); box-shadow: none; }

body.simple .adv-only,
body.simple #adv-nav,
body.view-game #adv-nav,
body.view-board #adv-nav { display: none !important; }
body.advanced .find-tools.adv-only { display: flex !important; }

button { font-family: inherit; }
button:active { transform: translateY(1px); }

.game-mode-switch {
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
  padding: 3px;
  background: var(--bg2);
  border-radius: 8px;
}
/* Filters sit on one line: mode · min · ⓘ · progress ······ hint · reveal · timer · answers */
.training-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  margin: -8px 0 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg2);
}
.training-tools[hidden] { display: none !important; }
.training-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}
.training-mode-label {
  color: var(--dim);
  font: 700 11px var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.training-progress {
  margin-left: auto;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.training-tool {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 650 11px var(--sans);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.training-tool:hover:not(:disabled) { color: var(--gold); border-color: var(--rim-gold); }
.training-tool:disabled { opacity: 0.4; cursor: default; }
#training-hint { color: #f0b35c; border-color: rgba(240, 179, 92, 0.32); }
#training-hint:hover:not(:disabled) { color: #ffc774; border-color: rgba(240, 179, 92, 0.6); }
#training-reveal-word { color: var(--no); border-color: rgba(240, 113, 113, 0.32); }
#training-reveal-word:hover:not(:disabled) { color: #ff8c8c; border-color: rgba(240, 113, 113, 0.6); }
.training-hint-box {
  align-self: center;
  width: min(100%, 30rem);
  padding: 10px 14px;
  border: 1px solid rgba(240, 179, 92, 0.3);
  border-radius: 14px;
  background: rgba(240, 179, 92, 0.08);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.45;
  text-align: left;
}
.training-hint-box[hidden] { display: none !important; }
.training-hint-box p { margin: 0; }
.training-hint-box .pending { color: var(--dim); }
.training-hint-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  color: #f0b35c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.training-hint-head span { color: var(--dim); letter-spacing: 0.02em; text-transform: none; }
.training-select-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 1 auto;
  min-width: 130px;
}
.training-select-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 1.5px solid var(--gold);
  border-bottom: 1.5px solid var(--gold);
  transform: rotate(45deg);
  pointer-events: none;
}
.training-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 34px;
  padding: 0 30px 0 12px;
  border: 1px solid rgba(232, 197, 107, 0.4);
  border-radius: 999px;
  background: var(--felt);
  color: var(--gold);
  font: 700 12px var(--sans);
  letter-spacing: 0.03em;
  cursor: pointer;
}
.training-select-wrap select:focus-visible {
  outline: 2px solid var(--rim-gold);
  outline-offset: 1px;
}
.training-min {
  min-height: 26px;
  min-width: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font: 700 11px var(--sans);
  letter-spacing: 0.03em;
  cursor: pointer;
}
.training-min:hover { color: var(--gold); border-color: var(--rim-gold); }
.training-min[hidden] { display: none !important; }
/* Skip reads as quiet text, not a button card */
#game-skip {
  border: none;
  background: transparent;
  color: var(--dim);
  font: 650 12px var(--sans);
  padding: 6px 8px;
  cursor: pointer;
}
#game-skip:hover { color: var(--gold); }
/* Found-so-far chips inside the combinations round */
.training-found {
  margin-top: 2px;
  justify-content: center;
}
.training-found[hidden] { display: none !important; }
.training-status select {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}
.training-info {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg2);
  color: var(--gold);
  font: italic 700 13px/1 var(--display);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}
.training-info:hover { border-color: var(--rim-gold); }
#training-help .hist-card { width: min(560px, 100%); }
.training-help-body {
  padding: 0 16px 18px;
  overflow-y: auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.training-help-body p { margin: 0 0 10px; }
.training-help-body ul { margin: 0 0 10px; padding-left: 18px; }
.training-help-body li { margin: 0 0 6px; }
.training-help-body .fine { color: var(--dim); }
.training-status {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 0;
  flex: 0 0 auto;
}
.training-status[hidden] { display: none !important; }
#training-reveal { color: var(--gold); border-color: rgba(232, 197, 107, 0.3); }
.training-summary {
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 18px;
}
.training-answers {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  margin-bottom: 12px;
}
.training-answer {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.training-answer.is-found {
  border-color: rgba(61, 206, 138, 0.4);
  background: var(--ok-bg);
  color: var(--ok);
}
/* found after a definition hint */
.training-answer.is-hinted {
  border-color: rgba(240, 179, 92, 0.45);
  background: rgba(240, 179, 92, 0.13);
  color: #f0b35c;
}
/* handed over by "Dévoiler un mot" */
.training-answer.is-revealed {
  border-color: rgba(240, 113, 113, 0.45);
  background: var(--no-bg);
  color: var(--no);
}
.training-answer small { color: var(--dim); font-size: 10px; letter-spacing: 0; }
button.training-answer { background: transparent; cursor: pointer; font-family: inherit; transition: border-color 0.16s ease, background 0.16s ease; }
button.training-answer:hover { border-color: var(--rim-gold); }
.training-answer.is-open { box-shadow: 0 0 0 2px rgba(232, 197, 107, 0.35); }
.training-def-box {
  align-self: center;
  width: min(100%, 30rem);
  text-align: left;
}
.training-def-box[hidden] { display: none !important; }
.training-def-box .game-def-panel { margin: 0; }
.mode-btn {
  flex: 1;
  padding: 8px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.mode-btn[aria-pressed="true"] {
  background: var(--felt);
  color: var(--gold);
}
.game-hint {
  display: block;
  width: max-content;
  flex: 0 0 auto;
  margin: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.game-hint[hidden] { display: none !important; }
.game-hint:disabled { opacity: 0.45; }
body.kids .game-form { margin-bottom: 0; }
body.kids .game-live { margin-top: 0; }
body.kids .game-rack[data-n="4"],
body.kids .game-rack[data-n="5"] { --tile-max: 64px; }
body.kids .game-rack[data-n="6"] { --tile-max: 52px; }
body.kids .game-rack[data-n="7"] { --tile-max: 46px; }
.kids-bravo {
  font-size: 28px !important;
  letter-spacing: 0;
}
.kids-also {
  margin: 8px 0 6px;
  color: var(--dim);
  font-size: 13px;
}
.kids-result .game-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kids-result .game-top-word {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--felt);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.game-auth {
  margin: 0 0 12px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 16px;
  text-align: center;
}
.google-signin-area {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.auth-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.game-user {
  margin: 0 0 12px;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 14px;
}
.user-pic { box-shadow: 0 0 0 2px rgba(232, 197, 107, 0.35); }
.user-pic {
  border-radius: 50%;
  width: 32px;
  height: 32px;
}
.user-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.user-name {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.user-info {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg2);
  color: var(--gold);
  font: italic 700 13px/1 var(--display);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.user-info:hover,
.user-info[aria-expanded="true"] { border-color: var(--rim-gold); background: var(--felt); }
.user-sheet-card { width: min(420px, 100%); }
.user-sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -6px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: rgba(31, 58, 43, 0.35);
}
.user-sheet-pic {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(232, 197, 107, 0.4);
  object-fit: cover;
}
.user-sheet-pic-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #f6dc94, #e2ba5c);
  color: #1c1408;
  font: 700 20px var(--display);
}
.user-sheet-who { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.user-sheet-who strong { color: var(--ink); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-sheet-who small { color: var(--dim); font-size: 11px; }
.user-sheet-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 8px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.user-sheet-section::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--rim-gold), transparent); }
.user-sheet-line { margin: 8px 2px 0; color: var(--muted); font-size: 13px; }
.user-sheet-line strong { color: var(--ink); letter-spacing: 0.06em; }
.user-sheet-line span { color: var(--dim); font-size: 12px; }
.user-stat.is-rank .user-stat-value small { font-size: 14px; margin-right: 1px; }
.user-sheet-body {
  padding: 0 16px 18px;
}
.user-sheet-body .empty {
  margin: 8px 0 6px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.user-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.user-stats-grid.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.user-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px 12px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: rgba(31, 58, 43, 0.42);
  text-align: center;
}
.user-stat-label {
  color: var(--dim);
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.user-stat-value {
  color: var(--gold);
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.user-stat-value small { font-size: 13px; margin-left: 1px; }
.user-signin {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-signin .fine { margin: 0; }
.logout-btn {
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--felt);
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.panel-board {
  min-width: 0;
}
.game-board {
  margin: 0 0 12px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 18px;
  box-shadow: var(--shadow-2);
}
body.view-board .game-board {
  margin: 0;
}
body.view-board .fab-board { display: grid; }
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}
.board-head .board-title { margin: 0; flex: 1 1 auto; min-width: 0; }
.board-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 7px;
}
.board-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 15, 11, 0.45);
}
.board-tabs button {
  min-height: 22px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font: 700 10.5px var(--sans);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}
.board-tabs button:hover { color: var(--gold); }
.board-tabs button[aria-pressed="true"] { background: var(--gold); color: #1c1408; }
.board-more {
  align-self: center;
  margin-top: 2px;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 650 11px var(--sans);
  cursor: pointer;
}
.board-more:hover { color: var(--gold); border-color: var(--rim-gold); }
a.board-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.board-rules {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(9, 15, 11, 0.45);
  color: var(--gold);
  font: italic 700 12px/1 var(--display);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.board-rules:hover { border-color: var(--rim-gold); background: rgba(232, 197, 107, 0.1); }
#board-help .hist-card { width: min(560px, 100%); }
.board-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.board-title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--rim-gold), rgba(232, 197, 107, 0));
}
.board-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.board-row {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 12px;
  background: rgba(31, 58, 43, 0.42);
  border: 1px solid rgba(244, 239, 228, 0.05);
  border-radius: 12px;
  font-size: 13.5px;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.board-row:hover { background: rgba(31, 58, 43, 0.62); }
.board-list.is-any .board-row {
  grid-template-columns: 24px 28px minmax(0, 1fr) auto;
}
/* Points relative to the leader, as a hairline along the bottom edge */
.board-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(244, 239, 228, 0.05);
}
.board-bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 0%);
  border-radius: 0 2px 2px 0;
  background: linear-gradient(90deg, rgba(232, 197, 107, 0.85), rgba(232, 197, 107, 0.3));
}
.board-row.is-me .board-bar::after { background: linear-gradient(90deg, #f4d98c, rgba(232, 197, 107, 0.5)); }
.board-flag {
  display: grid;
  place-items: center;
  width: 28px;
  font-size: 17px;
  line-height: 1;
}
.board-flag .flag { width: 22px; height: 15px; }
.board-row.is-me {
  background: linear-gradient(90deg, rgba(232, 197, 107, 0.16), rgba(232, 197, 107, 0.07));
  border-color: rgba(232, 197, 107, 0.42);
}
.board-row.is-me .board-name { color: var(--gold); font-weight: 700; }
.board-rank {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  min-width: 0;
  border-radius: 50%;
  background: rgba(244, 239, 228, 0.07);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
}
.board-list > .board-row:nth-child(1) .board-rank {
  background: linear-gradient(180deg, #f4d98c, #d8ac48);
  color: #26200c;
}
.board-list > .board-row:nth-child(2) .board-rank {
  background: linear-gradient(180deg, #e2e7df, #a8b2a7);
  color: #20261f;
}
.board-list > .board-row:nth-child(3) .board-rank {
  background: linear-gradient(180deg, #ddaa82, #ae7d51);
  color: #241608;
}
.board-name {
  min-width: 0;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-percent {
  font-weight: 700;
  font-size: 15px;
  color: var(--gold);
  text-align: right;
  line-height: 1.15;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.board-percent em {
  font-style: normal;
  margin-left: 3px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.board-percent small {
  display: block;
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.board-rule {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.board-empty {
  margin: 0;
  padding: 10px 8px 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 559px) {
  .board-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .board-controls {
    width: 100%;
    justify-content: space-between;
  }
  .board-list.is-any .board-row {
    grid-template-columns: 22px 24px minmax(0, 1fr) auto;
    gap: 8px;
  }
  .board-flag { width: 24px; font-size: 16px; }
}


@media (min-width: 720px) {
  body { --page: 560px; max-width: 560px; margin: 0 auto; }
  .grid2 { grid-template-columns: repeat(9, 1fr); }
  .grid3 { grid-template-columns: repeat(6, 1fr); }
}

@media (min-width: 900px) {
  /* One constant app width for every view — the frame never jumps when
     switching between Vérifier, Jouer and Infos. Single-column views keep
     their comfortable reading width centered inside it. */
  body {
    --page: 1040px;
    max-width: 1040px;
    width: 100%;
  }
  main > .search,
  main > .panel:not(#panel-game) {
    max-width: 640px;
    margin-inline: auto;
    width: 100%;
  }
  body.view-game #game-menu {
    max-width: 640px;
    margin-inline: auto;
    width: 100%;
  }
  body.view-game:not(.game-split) #game-play {
    max-width: 640px;
    margin-inline: auto;
    width: 100%;
  }
  body.view-game .game-study {
    max-width: 720px;
    margin-inline: auto;
    width: 100%;
  }
  /* play column on the left, standings + score trail on a side rail */
  body.view-game.game-split #game-play {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(272px, var(--rail));
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 100%;
    align-content: start;
    gap: 0 28px;
  }
  body.view-game.game-split #game-play > * { grid-column: 1; }
  body.view-game.game-split #game-play > .game-head {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  body.view-game.game-split #game-play > .play-main {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
    padding-bottom: 8px;
  }
  body.view-game.game-split .play-main > * {
    max-width: 600px;
    margin-inline: auto;
    width: 100%;
  }
  body.view-game.game-split #game-play > .play-rail {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    max-height: calc(100dvh - var(--safe-t) - var(--foot) - 84px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    scrollbar-color: rgba(232, 197, 107, 0.28) transparent;
  }
  body.view-game.game-split .game-dock {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
  }
  body.view-game.game-split .game-chart { height: 60px; padding: 0 14px; }
  body.view-game.game-split .game-chart svg.score-chart { height: 44px; }
  /* the result column hugs its content instead of stretching down the page */
  body.view-game.game-split .play-main > #game-result { flex: 0 0 auto; }
  body.view-game.game-split .game-def-panel { flex: 0 1 auto; max-height: 42vh; }
  body.view-game.game-split .game-wa-icon { flex: 0 0 34px; width: 34px; height: 34px; }
  .fab-board { display: none !important; }
}

/* roomier tiles once there is desk space */
@media (min-width: 900px) {
  .game-rack[data-n="2"] { --tile-max: 74px; }
  .game-rack[data-n="3"] { --tile-max: 70px; }
  .game-rack[data-n="4"] { --tile-max: 68px; }
  .game-rack[data-n="5"] { --tile-max: 66px; }
  .game-rack[data-n="6"] { --tile-max: 62px; }
  .game-rack[data-n="7"] { --tile-max: 66px; }
  .game-rack[data-n="8"] { --tile-max: 56px; }
  .game-rack[data-n="9"] { --tile-max: 48px; }
  .game-rack .tile { font-size: clamp(22px, 2.6vw, 34px); }
  .game-rack .tile small { font-size: 11px; }
  .play-table { padding: 20px 22px 22px; gap: 18px; }
  .game-form { width: min(100%, 25rem); }
  body.game-closed .game-rack { --tile-max: 54px; }
  body.game-closed .play-table { padding: 14px 16px; gap: 16px; }
  body.game-closed .game-next { width: 52px; height: 50px; }
}

#consent {
  position: fixed;
  bottom: var(--foot);
  left: 0;
  right: 0;
  background: var(--bg2);
  border-top: 1px solid var(--line);
  padding: 16px;
  z-index: 100;
  animation: slideUp 0.3s ease-out;
}
#consent[hidden] { display: none; }
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.consent-text {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}
.consent-text a { color: var(--gold); text-decoration: underline; }
.consent-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.consent-btn {
  flex: 1;
  min-width: 120px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.consent-btn[data-consent="granted"] { background: var(--gold); color: #1c1408; }
.consent-btn[data-consent="denied"] {
  background: var(--felt);
  color: var(--ink);
  border: 1px solid var(--line);
}
.legal-link[data-cookies] { cursor: pointer; }
@media (min-width: 720px) {
  #consent {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: 560px;
    border-radius: 12px 12px 0 0;
  }
}

/* Roadmap page */
.roadmap ol { padding-left: 20px; }
.roadmap ol li, .roadmap ul li { margin: 0 0 8px; }
.roadmap h3 { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.roadmap-when {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--rim-gold);
  border-radius: 999px;
  color: var(--gold);
  font: 700 10.5px var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---- Word of the day (check page, empty input) ---- */
.daily {
  position: relative;
  margin: 0 0 14px;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg2);
  box-shadow: none;
}
.daily[hidden] { display: none !important; }
.daily-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
}
.daily-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.daily-date { margin: 0; color: var(--dim); font-size: 12px; font-weight: 600; white-space: nowrap; }
.daily-word {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.daily-word .tiles { gap: 6px; }
.daily-meta { color: var(--muted); font-size: 13px; }
.daily-meta strong { color: var(--gold); }
.daily-tap { margin-left: auto; color: var(--dim); font-size: 12px; }
.daily .game-def-body { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.daily .pending { color: var(--dim); margin: 12px 0 0; font-size: 13px; }

/* ---- Bingo sign-in gate: full panel, nothing else on screen ---- */
body.auth-gate #game-play > .play-main,
body.auth-gate #game-play > .play-rail,
body.auth-gate .game-dock { display: none !important; }
#game-auth[hidden] { display: none !important; }
.game-auth {
  margin: 8px 0 12px;
  padding: 0;
  background: none;
  border: 0;
  display: flex;
  justify-content: center;
}
.auth-gate-card {
  width: min(100%, 26rem);
  padding: 28px 22px 22px;
  border: 1px solid var(--card-line);
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(232, 197, 107, 0.1), transparent 60%),
    linear-gradient(180deg, var(--felt-hi) 0%, #1c3325 58%, #172a1e 100%);
  box-shadow: inset 0 1px 0 var(--rim), var(--shadow-2);
  text-align: center;
}
.auth-gate-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(180deg, #f6dc94, #e2ba5c);
  color: #1c1408;
  box-shadow: 0 3px 0 #a9822f;
}
.auth-gate-mark svg { width: 30px; height: 30px; }
.auth-gate-card h2 { margin: 0 0 8px; font-family: var(--display); font-size: 22px; }
.auth-gate-card p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.auth-gate-card .google-signin-area { margin: 0 0 12px; }
.auth-gate-card .auth-help { margin: 0; color: var(--dim); }

/* Account card lives on the Infos page now */
#panel-info .game-user { margin: 16px 0 0; }
#panel-info .game-user .settings-label { margin: 0 0 6px; }
#panel-info .user-card { padding: 10px 12px; }

/* Mobile: the score dock flows in the rail instead of floating over the board */
@media (max-width: 719px) {
  body.view-game .game-dock {
    position: static;
    width: auto;
    height: auto;
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid var(--card-line);
    border-radius: 16px;
    background: var(--card);
    pointer-events: auto;
    z-index: auto;
  }
  body.view-game .game-dock .game-chart { height: 52px; padding: 0; }
  body.view-game,
  body.view-board,
  body.view-game:not(.has-chart),
  body.view-board:not(.has-chart) { padding-bottom: calc(var(--foot) + 12px); }
  body.view-game .play-rail { display: flex; flex-direction: column; }
  body.view-game .play-rail .game-dock { order: -1; }
}

/* ---- Leaderboard tab (mobile keeps the game screen clean) ---- */
.board-page { max-width: 560px; margin: 0 auto; }
.board-page .game-board { margin: 8px 0 0; }
@media (max-width: 719px) {
  body.view-game .play-rail #game-board { display: none !important; }
}
/* WhatsApp share pinned to the card's bottom-right corner */
.verdict { position: relative; }
.verdict.ok { padding-bottom: 54px; }
.verdict.ok .meta-actions .wa-mini { position: absolute; right: 14px; bottom: 14px; width: 34px; height: 34px; }
.verdict.ok .meta-actions .wa-mini svg { width: 17px; height: 17px; }
/* "Another word" shuffle on the discover card */
.daily-side { display: inline-flex; align-items: center; gap: 8px; }
.daily-next {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.16s ease, transform 0.2s ease;
}
.daily-next svg { width: 16px; height: 16px; }
.daily-next:hover { background: var(--felt); }
.daily-next:active { transform: scale(.95); }
/* Mode avancé as a switch row (matches the A–Z option) */
.adv-row { width: 100%; margin-top: 10px; font: inherit; text-align: left; }
.adv-row-text { display: flex; flex-direction: column; gap: 2px; order: -1; min-width: 0; }
.adv-row-text small { color: var(--dim); font-size: 12px; }
.adv-switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(9, 15, 11, 0.55);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.adv-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s ease, background 0.18s ease;
}
.adv-row[aria-pressed="true"] .adv-switch { background: rgba(232, 197, 107, 0.25); border-color: var(--rim-gold); }
.adv-row[aria-pressed="true"] .adv-switch::after { transform: translateX(16px); background: var(--gold); }
#settings-card .adv-row { margin-top: 10px; }

@media (max-width: 479px) {
  .daily-kicker::after { display: none; }
  .daily-kicker { white-space: nowrap; }
}

/* Spanish digraph tiles (CH, LL, RR): two letters on one tile. */
.tile.tile-digraph { font-size: 13px; letter-spacing: -0.02em; }
.game-rack .tile.tile-digraph { font-size: clamp(11px, 3.2vw, 16px); letter-spacing: -0.02em; }
body.game-closed .game-rack .tile.tile-digraph { font-size: clamp(10px, 2.8vw, 14px); }

/* Spanish tile-set picker (Réglages) */
.es-edition { margin-top: 12px; }
.es-edition-opts { display: flex; gap: 8px; margin: 6px 0 8px; }
.es-edition-opt { flex: 1; min-width: 0; }

/* Edition rows in the quick dict menu stay on one line. */
.dict-pop-item { white-space: nowrap; }

/* Shared polish: predictable keyboard focus, readable icons and touch targets. */
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:where(button, a, input, select, textarea):focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
svg.ui-icon, .tab svg.ui-icon { fill: none; }
.ui-icon { width: 24px; height: 24px; flex-shrink: 0; }
.hist-close, .game-clear, #clear { display: grid; place-items: center; }
.hist-close .ui-icon, .game-clear .ui-icon, #clear .ui-icon { width: 20px; height: 20px; }
.hist-close { border-radius: 50%; width: 44px; height: 44px; }
.hist-card { min-width: 0; }
.hist-sheet { overscroll-behavior: contain; }
body.has-dialog { overflow: hidden; }
.lang-btn { min-height: 36px; min-width: 42px; }
.dict-chip { min-height: 36px; }
.hist-btn { width: 40px; height: 40px; flex-shrink: 0; }
.board-head, .board-controls, .training-pick { flex-wrap: wrap; }
.board-controls { max-width: 100%; }
.board-tabs { flex-wrap: wrap; max-width: 100%; border-radius: 18px; }
.board-tabs button { min-height: 36px; color: var(--muted); }
.board-rules, .training-info { width: 40px; height: 40px; flex: 0 0 40px; }
.training-mode-label { white-space: normal; }
.training-progress { margin-left: auto; }
.daily-head, .daily-side { flex-wrap: wrap; }
.daily-next { width: 40px; height: 40px; flex-shrink: 0; }
.game-live { white-space: normal; overflow: visible; text-overflow: clip; }
.board-more { min-height: 40px; }
.board-categories-link { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0; padding: 12px; color: var(--gold); border: 1px solid var(--rim-gold); border-radius: 14px; text-decoration: none; font-size: 13px; font-weight: 650; }
.board-categories-link:hover { background: rgba(232,197,107,.1); }
@media (max-width: 599px) {
  body:not(.legal) .top { display: grid; grid-template-columns: 1fr; gap: 14px; }
  body:not(.legal) .brand { justify-content: center; }
  body:not(.legal) .top-tools { justify-content: center; gap: 6px; width: 100%; }
  .lang-toggle { gap: 0; padding: 2px; }
  .lang-btn { padding: 0 6px; min-width: 40px; min-height: 44px; gap: 4px; }
  .lang-btn .flag { width: 14px; height: 10px; }
  .dict-chip { min-height: 44px; max-width: 6.6em; padding: 0 7px; }
  .hist-btn { width: 44px; height: 44px; }
  .rack-tool, .find-tool, .training-tool, .menu-back, .level-toggle button { min-height: 44px; }
  .game-head { flex-wrap: wrap; }
  .daily-date { white-space: normal; }
  .daily-side { margin-left: auto; justify-content: flex-end; }
  .training-select-wrap { min-width: 0; flex: 1 1 130px; }
  .training-mode-label { flex-basis: 100%; }
  .training-pick { gap: 8px; }
  .board-head .board-title { flex-basis: 100%; }
  .board-controls { justify-content: flex-start; }
}
@media (max-width: 359px) {
  body:not(.legal) .top-tools { gap: 4px; }
  .lang-btn { min-width: 34px; padding-inline: 5px; }
  .lang-btn .flag { display: none; }
  .daily-head { align-items: flex-start; }
  .daily-side { width: 100%; justify-content: space-between; }
  body.legal .brand { flex-wrap: wrap; }
  body.legal .legal-kicker { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 359px) {
  .game-head .game-kicker { flex-basis: 100%; max-width: none; white-space: normal; overflow: visible; order: 3; margin-top: 6px; }
}

/* No scrollbar chrome on any screen, while wheel, touch and keyboard scrolling
   remain available for long definitions, histories and small viewports. */
*, *::before, *::after { scrollbar-width: none !important; }
*::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
.top { width: 100%; max-width: 640px; margin-inline: auto; }
.game-split .top { max-width: none; }
.tabs { max-width: 640px; }
body.view-game:has(#game-menu:not([hidden])) { padding-bottom: calc(var(--foot) + 12px); }
body.view-game:has(#game-menu:not([hidden])) #panel-game { flex: 0 1 auto; }
.game-menu-grid { align-content: start; }
@media (max-height: 680px) and (max-width: 599px) {
  .game-menu { gap: 6px; }
  .game-menu-grid { gap: 8px; grid-auto-rows: minmax(66px, auto); }
  .game-menu-item { padding: 10px 12px; }
  .game-menu-item strong { font-size: 16px; }
  .game-menu-bar { margin-bottom: 0; }
  .level-row { margin-top: 4px; }
}

/* One shared edge for the leaderboard header, filters, rows and footer. */
body.leaderboard-page { --page: 960px; width: 100%; max-width: 960px; margin-inline: auto; }
.leaderboard-page .top, .leaderboard-page main { width: 100%; max-width: none; margin-inline: 0; }
.leaderboard-page .info { padding: 20px; }
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.lb-head h2 { margin: 0; min-width: 0; }
.lb-refresh, #lb-retry { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; flex-shrink: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--gold); background: var(--bg2); cursor: pointer; font: 600 13px var(--sans); }
.lb-refresh > span:first-child { font-size: 22px; line-height: 1; }
.lb-controls { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; margin-bottom: 14px; }
.leaderboard-page .board-tabs { flex: 0 1 auto; border-radius: 14px; }
.leaderboard-page .board-tabs button { min-height: 38px; padding: 0 10px; }
.leaderboard-page .board-tabs button.lb-lang { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.lb-lang .flag { width: 16px; height: 11px; }
.lb-lang .flag-any { width: 14px; height: 14px; }
.leaderboard-page #lb-rule { margin: 0 0 12px; font-size: 12px; line-height: 1.4; }
.lb-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; margin: 0 0 10px; color: var(--muted); font-size: 12px !important; }
.lb-summary .flag { width: 18px; height: 12px; }
.lb-summary .flag-any { width: 16px; height: 16px; color: var(--gold); }
.lb-summary b { color: var(--ink); }
.lb-summary > span { white-space: nowrap; }
.lb-summary .lb-dot { color: var(--dim); }
.leaderboard-page .board-list { display: grid; gap: 6px; }
.leaderboard-page .board-row { min-height: 58px; padding: 10px 12px; gap: 10px; grid-template-columns: 26px minmax(0,1fr) 124px; }
.leaderboard-page .board-list.is-any .board-row { grid-template-columns: 26px 26px minmax(0,1fr) 124px; }
.leaderboard-page .board-flag { width: 26px; }
.leaderboard-page .board-name { min-width: 0; }
.lb-player { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.lb-breakdown { color: var(--dim); font-size: 11px; line-height: 1.35; }
.leaderboard-page .board-percent { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 3px; font-size: 18px; line-height: 1.2; min-width: 0; }
.leaderboard-page .board-percent .lb-score { display: inline-flex; gap: 5px; align-items: baseline; }
.leaderboard-page .board-percent em { margin: 0; letter-spacing: 0; font-size: 11px; }
.leaderboard-page .board-percent small { margin: 0; font-size: 10px; letter-spacing: 0; }
.lb-me { margin: 12px 0 0; font-size: 12px !important; }
.lb-me b { color: var(--gold); }
.lb-empty { display: grid; justify-items: center; gap: 12px; padding: 20px 16px; margin-top: 8px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }
.lb-empty p { margin: 0; }
.lb-empty > .ui-icon { color: var(--gold); width: 28px; height: 28px; }
.lb-play-link { display: inline-flex; min-height: 40px; align-items: center; }
.lb-loading { padding: 20px 0; }
.lb-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 16px 0 0; }
.lb-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 12px 0 0; }
.lb-pagination button { min-height: 40px; min-width: 40px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--gold); font-size: 18px; cursor: pointer; }
.lb-pagination button:disabled { opacity: .35; cursor: default; }
.lb-pagination span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 479px) {
  .leaderboard-page .info { padding: 14px 12px; }
  .leaderboard-page .top .brand { flex-wrap: wrap; gap: 4px 8px; }
  .leaderboard-page .top .legal-kicker { font-size: 12px; }
  .lb-head { gap: 8px; margin-bottom: 12px; }
  .lb-head h2 { font-size: 19px; }
  .lb-refresh { width: 40px; min-height: 40px; padding: 0; }
  #lb-refresh-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .lb-controls { gap: 8px; margin-bottom: 12px; }
  .leaderboard-page .board-tabs button { padding: 0 7px; }
  .leaderboard-page .board-row { grid-template-columns: 22px minmax(0,1fr) 96px; gap: 6px; padding: 9px 8px; }
  .leaderboard-page .board-list.is-any .board-row { grid-template-columns: 22px 20px minmax(0,1fr) 96px; }
  .leaderboard-page .board-flag { width: 20px; }
  .leaderboard-page .board-flag .flag { width: 18px; height: 12px; }
  .leaderboard-page .board-percent { font-size: 17px; }
  .leaderboard-page .board-percent em { font-size: 10px; }
  .lb-breakdown { font-size: 10px; }
}
/* Ranks keep their medal colour across pages; combined details share the row. */
.leaderboard-page .board-list .board-row .board-rank { background: rgba(244,239,228,.07); color: var(--muted); }
.leaderboard-page .board-row[data-rank="1"] .board-rank { background: linear-gradient(#f4d98c,#d8ac48); color: #26200c; }
.leaderboard-page .board-row[data-rank="2"] .board-rank { background: linear-gradient(#e2e7df,#a8b2a7); color: #20261f; }
.leaderboard-page .board-row[data-rank="3"] .board-rank { background: linear-gradient(#ddaa82,#ae7d51); color: #241608; }
.lb-breakdown { grid-column: 2 / -1; overflow-wrap: anywhere; }
.board-list.is-any .lb-breakdown { grid-column: 3 / -1; }

/* Game chrome: one navigation, with auxiliary actions at the thumb's edge. */
body:not(.legal) .top {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  grid-template-areas: "brand preferences";
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
body:not(.legal) .top > .brand { grid-area: brand; justify-content: flex-start; }
body:not(.legal) .top > .dict-wrap { grid-area: dictionary; justify-self: end; }
body:not(.legal) .top > .top-tools { grid-area: preferences; width: auto; justify-content: flex-end; gap: 12px; }
body:not(.legal) .dict-chip { height: 48px; min-height: 48px; padding-inline: 12px; border-color: var(--line); border-radius: 14px; }
body:not(.legal) .hist-btn { width: 48px; height: 48px; border-radius: 14px; }
body:not(.legal) .lang-btn { min-width: 44px; min-height: 42px; }
body:not(.legal) .lang-toggle { border-radius: 16px; }
body:not(.legal) .lang-btn { border-radius: 12px; }
body.view-game .play-rail #game-board { display: none !important; }
body.view-game .game-head { margin-bottom: 20px; gap: 16px; }
body.view-game .play-table { gap: 20px; padding: 22px 20px; border-radius: 18px; }
body.game-closed .play-table { padding: 18px 20px; }
body.game-closed .game-rack { flex: none; width: 100%; --tile-max: 54px; }
body.game-closed .game-rack .tiles { width: min(100%, calc(var(--n) * var(--tile-max) + (var(--n) - 1) * 8px)); }
.game-live-row:has(> .game-live:empty) { display: none; }
.game-assist-status { margin: 0; color: var(--gold); font: 600 13px/1.5 var(--sans); text-align: center; }
.game-assist-status[hidden] { display: none; }
body.view-game:has(#game-play:not([hidden])) { padding-bottom: calc(var(--foot) + 92px); }
body.view-game .game-dock {
  position: fixed;
  bottom: calc(var(--foot) + 12px);
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: auto;
  max-width: 640px;
  height: 64px;
  margin: 0 auto;
  padding: 8px;
  gap: 12px;
  border: 1px solid var(--card-line);
  border-radius: 18px;
  background: #18271e;
  box-shadow: 0 8px 28px rgba(0,0,0,.2);
  pointer-events: auto;
  z-index: 16;
}
body.view-game .game-dock .game-chart {
  height: 46px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  gap: 8px;
}
.game-dock .game-chart[hidden] { display: none; }
body.view-game .game-dock:has(.game-chart[hidden]) { border: 0; background: transparent; box-shadow: none; padding-inline: 0; }
.game-actions { position: relative; flex: 0 0 48px; }
.game-options, body.game-closed .game-next, .game-dock .game-next {
  width: 48px;
  height: 48px;
  min-height: 48px;
  flex: 0 0 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #122018;
  color: var(--gold);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: none;
}
.game-options svg, .game-dock .game-next svg { width: 24px; height: 24px; }
.game-options:hover, .game-options[aria-expanded="true"] { background: #2b3b29; border-color: var(--rim-gold); }
.game-dock .game-next, body.game-closed .game-dock .game-next { background: var(--gold); color: #211b0f; border-color: transparent; }
.game-dock .game-next:active { transform: translateY(1px); box-shadow: none; }
.game-actions-panel {
  position: fixed;
  right: max(16px, calc((100vw - 640px) / 2));
  bottom: calc(var(--foot) + 88px);
  width: min(304px, calc(100vw - 32px));
  max-height: calc(100dvh - var(--foot) - 116px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #1b2b20;
  box-shadow: 0 12px 40px rgba(0,0,0,.38);
}
.game-actions-panel[hidden] { display: none; }
.game-actions-title { margin: 6px 12px 8px; font: 700 11px/1.4 var(--sans); color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.game-actions-panel .game-rack-tools,
.game-actions-panel .find-tools-row,
.game-actions-panel .training-status { display: contents; }
.game-actions-panel :is(.game-rack-tools,.find-tools-row,.training-status)[hidden],
.game-actions-panel [hidden], .game-actions-panel .game-wa-icon.is-off { display: none !important; }
.game-actions-panel :is(button, a),
.game-actions-panel .find-tools-row.is-bingo .find-tool {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  min-height: 48px;
  height: auto;
  margin: 0;
  padding: 12px;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font: 500 14px/1.4 var(--sans);
  text-align: start;
  text-decoration: none;
  letter-spacing: 0;
  white-space: normal;
  opacity: 1;
}
.game-actions-panel .find-tool-label { white-space: normal; }
.game-actions-panel .find-tool-icon, .game-actions-panel .game-wa-icon svg { width: 20px; height: 20px; flex: 0 0 20px; }
.game-actions-panel button:disabled { opacity: .4; }
.game-actions-panel :is(button,a):hover:not(:disabled) { background: rgba(232,197,107,.08); }
.game-actions-panel :is(button,a):focus-visible { outline-offset: -2px; }
.game-actions-panel :is(.is-pass,#game-skip,#find-giveup,#training-reveal) { color: #dabd84; }
.game-actions-panel .find-tool-sub { margin-left: auto; flex-shrink: 0; }
.game-actions-panel #training-info { color: var(--muted); }
body:not(.training) #game-actions-panel #training-info { display: none; }
@media (max-width: 599px) {
  body:not(.legal) .top { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "brand preferences"; gap: 12px 16px; }
  body:not(.legal) .top > .top-tools { width: 100%; justify-content: flex-end; }
  body:not(.legal) .lang-btn { min-width: 44px; min-height: 44px; }
  body.view-game .play-table { padding: 20px 12px; }
  body.view-game .game-head { gap: 12px; }
  body.game-closed .game-rack .tile { font-size: clamp(17px,5vw,23px); }
  body.game-closed .game-rack .tile small { font-size: 8px; }
  body.view-game #game-play { min-height: 0; }
}
@media (max-width: 359px) {
  body:not(.legal) .top { column-gap: 10px; }
  body:not(.legal) .top > .top-tools { gap: 12px; }
  .game-dock .game-chart-avg { font-size: 20px; }
  .game-dock .game-chart-last { font-size: 20px; }
  .game-dock .game-chart svg.score-chart { min-width: 32px; }
}
.board-page { max-width: 928px; }
.game-actions[hidden], .game-options[hidden] { display: none; }
.game-actions-panel .find-tools-row.is-bingo .find-tool:not(.is-pass):not(.is-shown) { background: transparent; color: var(--ink); box-shadow: none; }
.game-actions-panel .find-tools-row.is-bingo .find-tool:not(.is-pass):not(.is-shown):hover:not(:disabled) { background: rgba(232,197,107,.08); }
#game-actions-panel :is(#training-hint,#training-reveal-word) { color: var(--ink); }
@media (max-width: 599px) {
  body.view-game .game-head { display: grid; grid-template-columns: minmax(0,1fr) auto; row-gap: 8px; }
  .game-head .game-kicker { grid-column: 1; grid-row: 1; margin: 0; max-width: none; white-space: normal; overflow: visible; }
  .game-head .menu-back { grid-column: 2; grid-row: 1; }
  .game-head .game-meta { grid-column: 1 / -1; grid-row: 2; justify-self: start; margin: 0; }
}
/* A clear account invitation becomes the normal Info tab once linked. */
.tab.tab-login { color: var(--gold); }
.tab.tab-login:not([aria-current="page"]) { background: rgba(232,197,107,.055); }
.tab.tab-login span { white-space: normal; line-height: 1.15; }
.login-card { max-width: 640px; margin: 0 auto 20px; padding: 24px; border: 1px solid var(--rim-gold); border-radius: 20px; background: linear-gradient(145deg, #263b28, #18271e); }
.login-card[hidden] { display: none; }
.login-card .login-kicker { margin: 0 0 12px; color: var(--gold); font: 700 11px/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.login-card h2 { margin: 0 0 12px; font: 700 28px/1.2 var(--display); }
.login-card > p:not(.login-kicker) { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.login-card .google-signin-area { display: flex; justify-content: flex-start; width: 100%; min-height: 44px; }
.login-card #login-retry { min-height: 44px; padding: 0 16px; border: 1px solid var(--rim-gold); border-radius: 12px; color: var(--gold); background: transparent; font: 600 14px var(--sans); cursor: pointer; }
.login-card .login-error { margin: 12px 0 !important; }
@media (max-width: 599px) {
  .login-card { padding: 20px 16px; }
  .login-card h2 { font-size: 25px; }
}


/* Web workspace: one canvas, with navigation beside the work on desktop. */
.search-help { display: none; }
.info-overview { min-width: 0; }
.info, .login-card, .play-table, .auth-gate-card {
  background: var(--bg2);
  box-shadow: none;
}
.info-note { color: var(--muted) !important; }
.dict-opt, .opt-row, .user-card { background: transparent; }
.dict-opt[aria-pressed="true"] {
  background: rgba(232,197,107,.08);
  box-shadow: none;
}
#q::placeholder { color: var(--dim); }
.chrome-bar { background: var(--bg); backdrop-filter: none; }

@media (min-width: 1000px) {
  body:not(.legal) {
    --page: 1240px;
    --foot: 0px;
    width: 100%;
    max-width: var(--page);
    min-height: 100dvh;
    height: auto;
    max-height: none;
    margin: 0 auto;
    padding: 24px 32px 48px;
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 32px;
    row-gap: 28px;
    align-content: start;
    overflow: visible;
  }
  body:not(.legal) .top {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    max-width: none;
    margin: 0;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
    gap: 16px;
  }
  body:not(.legal) .brand h1 { font-size: 25px; }
  body:not(.legal) .mark { width: 48px; height: 48px; flex-basis: 48px; }
  body:not(.legal) .dict-chip { height: 40px; min-height: 40px; border-radius: 10px; }
  body:not(.legal) .hist-btn { width: 40px; height: 40px; border-radius: 10px; }
  body:not(.legal) .lang-btn { min-height: 34px; border-radius: 8px; }
  body:not(.legal) .lang-toggle { border-radius: 11px; }
  body:not(.legal) > .chrome-bar {
    position: sticky;
    top: 24px;
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0;
    border: 0;
    z-index: 12;
  }
  body:not(.legal) .tabs {
    order: -1;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    gap: 8px;
  }
  body:not(.legal) .tab {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    min-height: 48px;
    padding: 12px 14px;
    gap: 12px;
    border-radius: 10px;
    font-size: 13px;
    text-align: left;
  }
  body:not(.legal) .tab svg { flex: 0 0 20px; }
  body:not(.legal) .tab-login:not([aria-current="page"]) { background: transparent; }
  body:not(.legal) .adv-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-top: 20px;
    padding: 16px 8px 0;
    border-top: 1px solid var(--line);
  }
  body:not(.legal) .adv-nav[hidden] { display: none; }
  body:not(.legal) .adv-nav button { text-align: left; padding: 10px 6px; }
  body:not(.legal) > main {
    grid-column: 2;
    grid-row: 2;
    display: block;
    min-width: 0;
    width: 100%;
  }
  body:not(.legal) main > .search,
  body:not(.legal) main > .panel,
  body:not(.legal) main > .panel:not(#panel-game),
  body.view-game #game-menu,
  body.view-game:not(.game-split) #game-play,
  body.view-game .game-study {
    width: 100%;
    max-width: none;
    margin-inline: 0;
  }
  body:not(.legal) main > .panel { overflow: visible; }
  body:not(.legal) .board-page { max-width: none; }
  body.view-check > main {
    display: grid;
    grid-template-columns: minmax(240px, .8fr) minmax(0, 1.6fr);
    align-items: start;
    gap: 24px;
  }
  body.view-check #search { grid-column: 1; margin: 0; position: sticky; top: 24px; }
  body.view-check #panel-check { grid-column: 2; }
  body:not(.legal) #q-label {
    position: static;
    display: block;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    margin-bottom: 18px;
    font: 700 27px/1.2 var(--display);
  }
  body.view-check .search-help {
    display: block;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
  }
  body.view-check #q { font-size: 20px; letter-spacing: .06em; }
  body.view-check .daily { padding: 24px; border-color: var(--line); border-radius: 16px; }
  body.view-check .daily .game-def-body { margin-top: 20px; padding-top: 20px; }
  .about-layout {
    display: grid;
    grid-template-columns: minmax(240px, .85fr) minmax(0, 1.4fr);
    gap: 28px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .about-layout .info-head { align-items: flex-start; gap: 16px; margin-bottom: 20px; }
  .about-layout h2 { font-size: 28px; }
  .about-layout .info-lead { line-height: 1.6 !important; }
  .about-layout .info-note { margin-top: 16px !important; line-height: 1.6; }
  .about-layout .info-actions { flex-wrap: wrap; gap: 8px; margin-top: 24px; }
  .about-layout .info-action {
    flex: 1 1 auto;
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
    background: transparent;
    color: var(--gold);
    font-size: 13px;
  }
  .about-layout #game-user { margin-top: 24px; }
  .about-layout .user-card { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .about-layout .user-who { flex: 1 1 120px; }
  .about-layout .user-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .about-layout .settings-card {
    margin: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--bg2);
  }
  .about-layout .settings-card > h3 { margin-bottom: 18px; }
  .about-layout .dict-list { gap: 10px; }
  .about-layout .dict-opt { padding: 12px; border-radius: 10px; }
  .about-layout .dict-name { font-size: 17px; }
  .about-layout .dict-blurb { font-size: 12px; line-height: 1.5; }
  .about-layout .info-legal { grid-column: 1 / -1; margin: 0; padding-top: 16px; border-top: 1px solid var(--line); text-align: left; }
  #panel-info .login-card { max-width: none; margin-bottom: 28px; }
  body.view-game #panel-game { display: block; }
  .game-menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .game-menu-item { min-height: 132px; padding: 24px; border-radius: 16px; }
  .game-menu-item strong { font-size: 22px; white-space: normal; }
  .game-menu-sub { font-size: 14px; line-height: 1.5; }
  .game-menu .level-row { justify-content: flex-end; margin-top: 12px; }
  body.view-game #game-play { display: flex; min-height: 0; }
  body.view-game .game-head { margin-top: 0; }
  body.view-game .play-table { padding: 32px 24px; min-height: 250px; }
  body.view-game .play-rail { width: 100%; margin-top: 20px; }
  body.view-game .game-dock {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: none;
    margin: 0;
    background: var(--bg2);
    box-shadow: none;
    border-radius: 12px;
  }
  body.view-game .game-actions-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    max-height: min(420px, calc(100dvh - 160px));
    background: var(--bg2);
  }
  body.view-game .game-result { flex: none; }
  body.view-game .game-def-panel { max-height: none; overflow: visible; }
  body.view-game .game-dock .game-chart { max-width: none; }
  body:not(.legal) #consent { bottom: 24px; border: 1px solid var(--line); border-radius: 14px; }
}

@media (min-width: 1000px) {
  body:not(.legal).has-dialog { overflow: hidden; }
  body.advanced:not(.view-game):not(.view-board) { --foot: 0px; }
  body.view-game:has(#game-play:not([hidden])),
  body.view-game:has(#game-menu:not([hidden])),
  body.view-game:not(.has-chart),
  body.view-board:not(.has-chart) { padding-bottom: 48px; }
}

/* Mobile app finish: system type, quiet chrome, one clear continuation action.
   Keep the cream letter tiles and gold accent as the game's identity. */
:root { color-scheme: dark; }
.game-dock .game-next,
body.game-closed .game-dock .game-next {
  display: flex;
  width: auto;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font: 650 14px/1.2 var(--sans);
}
.game-dock .game-next[hidden] { display: none; }
.game-next > span { max-width: 10em; }
.game-next > svg { flex: 0 0 20px; }
.game-next:disabled { opacity: .55; cursor: wait; }
.game-assist-status { overflow-wrap: anywhere; }
/* A saved-local score notice remains visible on the completed-round screen. */
body.game-closed .game-live-row:has(> .game-live:not(:empty)) { display: flex !important; }
body.game-closed .game-live:not(:empty) { display: block !important; }

@media (max-width: 999px) {
  body:not(.legal) {
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --foot: calc(68px + var(--safe-b));
    padding-inline: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  body:not(.legal) .brand h1 {
    font-family: var(--sans);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.035em;
  }
  body:not(.legal) .mark { width: 40px; height: 40px; flex-basis: 40px; }
  body:not(.legal) .dict-chip,
  body:not(.legal) .hist-btn {
    height: 44px;
    min-height: 44px;
    border-color: transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
  }
  body:not(.legal) .hist-btn { width: 44px; flex-basis: 44px; }
  body:not(.legal) .hist-btn svg { width: 22px; height: 22px; }
  body:not(.legal) .lang-toggle { border: 0; padding: 2px; border-radius: 12px; }
  body:not(.legal) .lang-btn {
    justify-content: center;
    min-height: 44px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0;
  }
  body:not(.legal) .lang-btn[aria-pressed="true"] {
    background: rgba(244,239,228,.1);
    color: var(--ink);
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
  }
  body:not(.legal) .chrome-bar { background: var(--bg); }
  body:not(.legal) .tabs { min-height: 68px; padding: 4px 8px; gap: 4px; }
  body:not(.legal) .tab {
    min-height: 56px;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
  }
  body:not(.legal) .tab svg { width: 23px; height: 23px; }
  /* 5.0: the phone dock keeps the desktop/APK active pill. */
  body:not(.legal) .tab { border-radius: 12px; }
  body:not(.legal) .tab[aria-current="page"] {
    background: rgba(232, 197, 107, 0.13);
    box-shadow: inset 0 0 0 1px var(--rim-gold);
    color: var(--gold);
    font-weight: 700;
  }
  body:not(.legal) .tab:active { background: rgba(244,239,228,.05); }
  body.view-game .game-head { margin-bottom: 14px; gap: 8px 12px; }
  .game-head .menu-back {
    border: 0;
    background: transparent;
    padding-inline: 8px;
    color: var(--muted);
    font-weight: 500;
  }
  .game-head .game-kicker { color: var(--muted); font-size: 12px; letter-spacing: 0; }
  body.view-game .play-table {
    padding: 20px 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    gap: 16px;
    background: var(--bg2);
  }
  .play-table::after { display: none; }
  body.game-closed .play-table { padding: 12px; }
  .game-result { margin-top: 14px; gap: 4px; }
  .game-score { padding: 16px; border-radius: 14px; box-shadow: none; }
  .game-pct { font-family: var(--sans); font-size: 32px; font-weight: 700; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
  .game-break { font-family: var(--sans); font-size: 18px !important; font-weight: 650; letter-spacing: .02em; }
  .game-vs { font-style: normal; line-height: 1.5; }
  .game-def-panel { padding: 16px; border-radius: 14px; }
  .game-def-body ol { line-height: 1.55; }
  .game-def-panel .fav-btn { width: 44px; height: 44px; }
  .game-menu-grid { gap: 10px; }
  .game-menu-item { min-height: 88px; border-radius: 14px; padding: 16px; }
  .game-menu-item strong { font: 650 16px/1.35 var(--sans); letter-spacing: -.015em; white-space: normal; }
  /* 5.0: the cream tile icon is the same on desktop, phone and in the APK. */
  .game-menu-sub { color: var(--muted); font-size: 13px; line-height: 1.45; }
  .game-menu-item:hover { box-shadow: none; }
  body.view-game .game-dock {
    height: 64px;
    bottom: calc(var(--foot) + 8px);
    padding: 8px;
    gap: 8px;
    border-radius: 16px;
    background: var(--bg2);
    box-shadow: 0 4px 20px rgba(0,0,0,.16);
  }
  body.view-game .game-dock .game-chart { gap: 6px; }
  .game-dock .game-chart-avg, .game-dock .game-chart-last { font: 650 16px/1.15 var(--sans); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
  .game-dock .game-chart-avg small, .game-dock .game-chart-last small { font-size: 9px; letter-spacing: 0; }
  .game-dock .game-chart:has(.game-chart-avg) .game-chart-last { display: none; }
  .game-options { border: 0; background: transparent; color: var(--muted); border-radius: 12px; }
  .game-dock .game-next { border-radius: 12px; }
  .game-actions-panel { bottom: calc(var(--foot) + 80px); border-radius: 16px; background: var(--bg2); }
  .about-layout, .login-card { padding: 20px 16px; border-radius: 16px; }
  .info h2, .hist-bar h2, .login-card h2 { font: 650 21px/1.3 var(--sans); letter-spacing: -.025em; }
  .info p { line-height: 1.55; }
  .info-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .info-action { min-height: 44px; border-radius: 10px; box-shadow: none; }
  .user-card { flex-wrap: wrap; padding: 12px; gap: 8px; border-radius: 12px; }
  .user-who { flex: 1 1 110px; }
  .user-name { width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .user-info { width: 44px; height: 44px; flex-basis: 44px; border: 0; }
  .logout-btn { min-height: 44px; }
  .dict-opt { padding: 14px 12px; border-radius: 12px; }
  .dict-name { font-family: var(--sans); font-size: 15px; }
  .opt-row { min-height: 52px; border-radius: 12px; }
  .hist-bar { align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .hist-close { background: transparent; }
}
@media (max-width: 599px) {
  body:not(.legal) .top {
    grid-template-columns: minmax(0,1fr) 44px;
    grid-template-areas: "brand history";
    gap: 8px;
    margin-bottom: 20px;
  }
  body:not(.legal) .top > .top-tools { display: contents; }
  body:not(.legal) .top .hist-btn { grid-area: history; }
  body:not(.legal) .hist-sheet { padding: 0; }
  body:not(.legal) .hist-card {
    width: 100%;
    max-height: calc(100dvh - var(--safe-t) - 24px);
    padding-bottom: var(--safe-b);
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
  }
  body:not(.legal) .hist-card::before { content: ""; width: 32px; height: 4px; flex: 0 0 4px; border-radius: 4px; background: var(--dim); opacity: .4; margin: 8px auto 0; }
}
@media (max-width: 359px) {
  .game-dock .game-next, body.game-closed .game-dock .game-next { gap: 4px; padding-inline: 10px; font-size: 12px; }
  .game-dock .game-chart-avg { font-size: 14px; }
  body.view-game .game-dock { gap: 4px; }
}

/* Options own language and dictionary; the game header stays on one line. */
.settings-dictionary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.settings-dictionary-row .settings-label { margin: 0; }
#settings-card > .lang-toggle { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; margin-top: 8px; }
#settings-card .lang-btn { justify-content: center; min-height: 44px; }
#settings-card .dict-chip { max-width: none; min-width: 104px; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; background: transparent; }
#settings-card .dict-pop { max-width: min(360px, calc(100vw - 64px)); }
#settings-card .dict-pop-item { min-height: 44px; white-space: normal; }
#settings-card .dict-pop-item > span:last-child { min-width: 0; white-space: normal; }
#panel-info .login-card { margin-top: 16px; }
.leaderboard-page .lb-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 12px; }
.lb-filter { display: flex; flex-direction: column; gap: 5px; min-width: 0; color: var(--muted); font: 500 11px/1.25 var(--sans); }
.lb-filter select { width: 100%; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg2); color: var(--ink); font: 600 13px/1.25 var(--sans); text-overflow: ellipsis; cursor: pointer; }
/* 5.0: on a phone, category gets its own line and language + period share the
   next one (the APK dialog uses the same grid); three columns truncated all three. */
@media (max-width: 599px) {
  .leaderboard-page .lb-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 8px; }
  .leaderboard-page .lb-filter-category { grid-column: 1 / -1; }
  .leaderboard-page .lb-filter select { padding: 0 6px 0 10px; font-size: 12.5px; }
}
.leaderboard-page .lb-head { margin-bottom: 12px; }
.leaderboard-page .board-list { gap: 0; border-top: 1px solid var(--line); }
.leaderboard-page .board-list .board-row { min-height: 54px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.leaderboard-page .board-list .board-row.is-me { background: rgba(232, 197, 107, .06); }
.leaderboard-page .board-bar { display: none; }
@media (max-width: 999px) {
  .about-layout .settings-card { margin: 0; padding: 0 0 20px; border: 0; border-bottom: 1px solid var(--line); }
  .about-layout .settings-card > h3 { font-size: 18px; color: var(--ink); letter-spacing: -.02em; text-transform: none; }
  .about-layout .settings-card > h3::after { display: none; }
  .about-layout .info-overview { margin-top: 20px; }
}
@media (max-width: 359px) {
  .game-top { column-gap: 12px; }
  .game-top button { gap: 6px; padding-inline: 6px; font-size: 12px; }
  .leaderboard-page .lb-filters { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lb-filter select { padding-inline: 8px; font-size: 12px; }
}

/* Status bar (site-status.js): this site's visitors, same shape as games.pfa87.cc.
   Desktop: fixed along the bottom edge. Phone/tablet: only on the Options tab,
   sitting on the tab bar, so it never takes room from a game. */
.site-status { display: none; }
.site-status-inner { display: flex; align-items: center; gap: 14px; max-width: 1400px; min-height: 40px; margin: auto; padding: 5px 32px; color: var(--dim); font-size: 11.5px; }
.site-status-brand { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 700; letter-spacing: -0.1px; }
.site-status-brand img { border-radius: 4px; }
.site-status-periods { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); }
.site-status-periods button { min-width: 38px; min-height: 24px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--dim); font: inherit; font-size: 10.5px; font-weight: 650; letter-spacing: 0.2px; cursor: pointer; }
.site-status-periods button:hover { color: var(--ink); }
.site-status-periods button[aria-pressed="true"] { background: var(--felt-hi); color: var(--gold); box-shadow: inset 0 0 0 1px var(--rim-gold); }
.site-status-periods button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.site-status-counts { display: flex; align-items: center; gap: 4px 14px; margin: 0; }
.site-status-counts strong { color: var(--ink); font-weight: 750; font-variant-numeric: tabular-nums; }
.site-status-note { margin-left: auto; font-size: 10.5px; white-space: nowrap; }
@media (min-width: 1000px) {
  body:not(.legal) .site-status { display: block; position: fixed; inset: auto 0 0; z-index: 25; background: rgba(20, 30, 25, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
  body:not(.legal) { padding-bottom: 52px; }
  body:not(.legal) #consent { bottom: 64px; }
}
@media (max-width: 999.98px) {
  body.view-info .site-status { display: block; position: fixed; left: 0; right: 0; bottom: var(--foot); z-index: 11; background: var(--bg2); border-top: 1px solid var(--line); }
  body.view-info .site-status-inner { gap: 10px; min-height: 38px; padding: 4px 16px; }
  body.view-info .site-status-brand, body.view-info .site-status-note { display: none; }
  body.view-info .site-status-counts { gap: 2px 10px; }
  body.view-info #panel-info { padding-bottom: 48px; }
}
/* Unique players lead the counts: gold, the one figure that is unique across APK and web. */
.site-status-players strong { color: var(--gold); }
.site-status-counts > span[title] { cursor: help; }
@media (max-width: 420px) { body.view-info .site-status-counts > span:has([data-count="views"]) { display: none; } }
/* Header account button (#acct-btn): the history button's circle, a person
   glyph signed out, the Google photo signed in. */
.acct-btn { padding: 0; overflow: hidden; }
.acct-btn svg { width: 19px; height: 19px; }
.acct-btn .acct-pic { width: 30px; height: 30px; object-fit: cover; border-radius: 50%; }
.acct-btn.is-linked { border-color: var(--rim-gold); }
.acct-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 599px) {
  body:not(.legal) .top { grid-template-columns: minmax(0,1fr) 44px 44px; grid-template-areas: "brand history account"; gap: 4px; }
  body:not(.legal) .top .acct-btn { grid-area: account; }
  body:not(.legal) .acct-btn svg { width: 22px; height: 22px; }
}
/* Desktop, closed round: the rack is only a reminder of the draw, so the card
   shrinks to the tiles instead of keeping the 250px it needs for the answer field. */
@media (min-width: 1000px) {
  body.view-game.game-closed .play-table { min-height: 0; padding: 16px 24px; gap: 10px; margin-bottom: 12px; }
}
/* Phone, closed round: the screen fits the viewport instead of scrolling.
   Body becomes a 100dvh column, the chain down to the result flexes, and the
   definition card takes whatever is left, scrolling inside itself only when
   the definition is long. A result taller than the space left (a long
   Combinaisons answer list) scrolls inside the result, never under the dock. */
@media (max-width: 719px) {
  body.view-game.game-closed:not(.legal) {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0;
    padding-bottom: calc(var(--foot) + 80px);
  }
  body.view-game.game-closed:not(.legal) .top { margin-bottom: 8px; flex: 0 0 auto; }
  body.view-game.game-closed main,
  body.view-game.game-closed #panel-game,
  body.view-game.game-closed #game-play,
  body.view-game.game-closed #game-play > .play-main,
  body.view-game.game-closed .game-result {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }
  body.view-game.game-closed #game-play > .play-rail { flex: 0 0 auto; margin: 0; }
  body.view-game.game-closed:not(.training) .game-head { margin-bottom: 6px; }
  body.view-game.game-closed .play-table { padding: 10px 12px; margin-bottom: 8px; }
  body.view-game.game-closed .game-result { margin-top: 0; gap: 0; overflow-y: auto; overscroll-behavior: contain; }
  body.view-game.game-closed .game-score { padding: 10px 14px; margin-bottom: 8px; }
  body.view-game.game-closed .game-pct { font-size: 28px; }
  body.view-game.game-closed .game-top { margin-bottom: 8px; }
  body.view-game.game-closed .game-top button { min-height: 40px; }
  body.view-game.game-closed .game-top button[aria-selected="true"]::before { top: 11px; bottom: 11px; }
  body.view-game.game-closed .game-def-panel {
    flex: 1 1 auto;
    min-height: 96px;
    padding: 12px 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* ---- Révisions (review.js): missed draws on a spaced schedule ------------ */
.game-menu-review { position: relative; grid-column: 1 / -1; }
.review-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--gold);
  color: #211b0f;
  font: 800 12px/24px var(--sans);
  text-align: center;
}
.review-badge[hidden] { display: none; }
.rev-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}
.rev-stat {
  padding: 10px 6px 9px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: rgba(31, 58, 43, 0.3);
  text-align: center;
}
.rev-stat strong { display: block; color: var(--ink); font: 800 22px/1.15 var(--display); }
.rev-stat span { display: block; color: var(--dim); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.rev-stat-due strong { color: var(--gold); }
.rev-stat-mastered strong { color: var(--ok); }
.rev-start,
.rev-next {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: var(--gold);
  color: #211b0f;
  font: 800 15px var(--sans);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--tile-deep);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.16s ease;
}
.rev-start { width: 100%; margin: 0 0 6px; }
.rev-start:hover,
.rev-next:hover { filter: brightness(1.06); }
.rev-start:active,
.rev-next:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--tile-deep); }
.rev-start[hidden],
.rev-next[hidden] { display: none; }
.rev-next { align-self: center; margin: 14px auto 4px; }
.rev-next svg { width: 20px; height: 20px; }
.rev-banner {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 13.5px;
  font-weight: 650;
}
.rev-banner.is-neutral { background: rgba(232, 197, 107, 0.1); color: var(--gold); }
.rev-quiet { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.rev-sync { margin: -2px 0 0; color: var(--dim); }
.rev-undo {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.rev-how-box { margin: 8px 0 2px; }
.rev-how-box summary { color: var(--muted); font-size: 13px; font-weight: 650; cursor: pointer; }
.rev-how { margin: 6px 0 4px; color: var(--dim); line-height: 1.5; }
.rev-group { margin-top: 12px; }
.rev-group summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  color: var(--gold);
  font: 700 11px var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
}
.rev-group summary::-webkit-details-marker { display: none; }
.rev-group summary::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--rim-gold), transparent); }
.rev-group summary small { color: var(--dim); font-size: 11px; letter-spacing: 0.04em; }
.rev-group ul { display: grid; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.rev-row {
  padding: 10px 12px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: rgba(31, 58, 43, 0.3);
}
.rev-row.is-mastered { opacity: 0.82; }
.rev-row-rack .tiles { gap: 4px; }
.rev-row-rack .tile { width: 28px; height: 31px; border-radius: 6px; font-size: 15px; }
.rev-row-rack .tile.tile-digraph { font-size: 11px; }
.rev-row-rack .tile small { right: 2px; bottom: 1px; font-size: 7px; }
.rev-row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rev-row-rack { min-width: 0; }
.rev-row-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.rev-row-meta { display: grid; gap: 4px; min-width: 0; }
.rev-row-meta strong { color: var(--ink); font-size: 14px; }
.rev-row-meta strong span { color: var(--muted); font-size: 13px; font-weight: 500; }
.rev-row-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--dim); font-size: 12.5px; }
.rev-dots { display: inline-flex; gap: 3px; }
.rev-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(244, 239, 228, 0.18); }
.rev-dots i.on { background: var(--ok); }
.rev-play-btn {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--rim-gold);
  border-radius: 999px;
  background: transparent;
  color: var(--gold);
  font: 700 13px var(--sans);
  white-space: nowrap;
  cursor: pointer;
}
.rev-play-btn:hover { background: rgba(232, 197, 107, 0.1); }
.rev-del-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}
.rev-del-btn svg { width: 16px; height: 16px; }
.rev-del-btn:hover { color: var(--no); border-color: rgba(240, 113, 113, 0.5); }
.rev-others { margin-top: 12px; color: var(--dim); }
.review-play { display: flex; flex-direction: column; }
.review-play[hidden] { display: none; }
.review-play .play-table { gap: 12px; }
.review-kicker {
  margin: 0;
  color: var(--gold);
  font: 700 11px var(--sans);
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}
.review-goal { margin: -4px 0 0; color: var(--ink); font: 700 17px var(--display); text-align: center; }
.rev-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; }
.rev-slot { display: inline-flex; align-items: center; gap: 6px; }
.rev-cells { display: inline-flex; gap: 3px; }
.rev-cell {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 26px;
  padding: 0 2px;
  border: 1px solid rgba(244, 239, 228, 0.16);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
  font: 400 14px var(--tile-font);
}
.rev-cell.is-hint { border-color: rgba(240, 179, 92, 0.55); background: rgba(240, 179, 92, 0.16); color: #ffc774; }
.rev-slot.is-found .rev-cell { border-color: var(--tile-edge); background: var(--tile); color: var(--tile-ink); }
.rev-slot.is-shown .rev-cell { border-color: rgba(240, 113, 113, 0.45); background: var(--no-bg); color: var(--no); }
.rev-slot-pts { color: var(--dim); font: 700 12px var(--sans); }
.rev-slots.is-many { gap: 8px 12px; }
.rev-slots.is-many .rev-cells { gap: 2px; }
.rev-slots.is-many .rev-cell { min-width: 17px; height: 21px; border-radius: 4px; font-size: 11px; }
.rev-slots.is-many .rev-slot-pts { font-size: 11px; }
.rev-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.rev-tools[hidden] { display: none; }
#review-hint { border-color: rgba(240, 179, 92, 0.32); color: #f0b35c; }
#review-hint:hover:not(:disabled) { border-color: rgba(240, 179, 92, 0.6); color: #ffc774; }
#review-show { border-color: rgba(240, 113, 113, 0.32); color: var(--no); }
#review-show:hover:not(:disabled) { border-color: rgba(240, 113, 113, 0.6); color: #ff8c8c; }
.review-result { margin-top: 2px; flex: none; overflow: visible; }
.rev-status { margin: 0 0 6px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.rev-status strong { color: var(--ink); }
.review-result.hot .rev-status strong { color: var(--ok); }
.rev-played { margin: 0 0 10px; color: var(--dim); font-size: 13px; }
.review-result .training-answer { cursor: pointer; }
.review-result .training-answer.is-open { box-shadow: 0 0 0 2px var(--gold); }
.rev-def { padding: 12px; border-radius: 12px; background: rgba(232, 197, 107, 0.08); }
.rev-def[hidden] { display: none; }
.review-saved { margin: 6px 0 0; }
.review-saved button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font: 650 12.5px var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.review-saved button::before { content: "↻"; display: inline-block; text-decoration: none; }
.training-summary .review-saved { margin: 4px 0 0; }
@media (min-width: 1000px) {
  .game-menu-review { min-height: 96px; }
}
@media (max-width: 599px) {
  .rev-play-btn, .rev-del-btn { min-height: 44px; }
  .rev-del-btn { width: 44px; height: 44px; }
}

/* Account card (13 Oct 2026): what an account keeps, each led by its own
   letter as a rack tile, beside Google's button. That button is a light-scheme
   iframe; on this dark page Chrome paints an opaque white canvas behind it
   unless the iframe itself asks for the light scheme. */
.google-signin-area iframe { color-scheme: light; }
#login-prompt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  max-width: none;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg2);
}
#login-prompt[hidden] { display: none; }
#login-prompt .login-kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; color: var(--gold); font: 700 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; }
#login-prompt .login-kicker::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--rim-gold), transparent); }
#login-prompt h2 { margin: 0 0 16px; font: 650 22px/1.25 var(--sans); letter-spacing: -.02em; }
.login-perks { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.login-perks li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.login-perks strong { color: var(--ink); font-weight: 650; }
.tile.login-tile { flex: none; width: 30px; height: 33px; border-radius: 6px; font-size: 17px; }
.tile.login-tile small { right: 3px; bottom: 1px; font-size: 8px; }
.login-action { display: grid; justify-items: start; gap: 10px; width: 352px; margin-left: 40px; padding-left: 32px; border-left: 1px solid var(--line); }
#login-prompt .login-note { margin: 0; color: var(--dim); font-size: 12.5px; line-height: 1.45; }
#login-prompt .login-error { margin: 0 !important; }
@media (max-width: 719px) {
  #login-prompt { grid-template-columns: 1fr; padding: 20px 16px; }
  .login-action { width: auto; margin: 16px 0 0; padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
