/* Sudoku
   Same family as the other games: navy dotted table, cream tiles, chunky buttons, round font.
   Dark-first, with a light version.  */

:root{
  --bg: #e3ebf3;
  --bg-dot: #cfdbe7;
  --surface: #ffffff;
  --surface-edge: #cbd8e5;
  --ink: #152230;
  --muted: #5b6f84;
  --tile: #f4e9cf;
  --tile-ink: #3a2f17;
  --tile-edge: #cbb98f;
  --accent: #3e6fe0;
  --accent-edge: #2a52b3;
  --good: #2fae6c;
  --bad: #e2604f;
  /* the logo colours, from the family's neon set */
  --p0: #ffb000; --p0e: #b87d00;
  --p1: #00e5ff; --p1e: #00a3b8;
  --p2: #b6ff1a; --p2e: #7fb30e;
  --font: "Outfit", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
:root[data-theme="dark"]{
  --bg: #111c26;
  --bg-dot: #1a2835;
  --surface: #182633;
  --surface-edge: #24384a;
  --ink: #eef3f8;
  --muted: #8ea2b6;
  --accent: #5b86f0;
  --accent-edge: #3b63c7;
  --good: #4fc28c;
  --bad: #ee6f5f;
}

*{ box-sizing: border-box; }
html, body{ margin: 0; height: 100%; overflow: hidden; }
body{
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dot) 1.2px, transparent 1.3px);
  background-size: 18px 18px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

/* ---- type ---- */
.title{ font-size: clamp(1.8rem, 6vh, 2.5rem); line-height: 1; margin: clamp(8px, 1.6vh, 14px) 0 0; font-weight: 900; letter-spacing: -0.03em; text-align: center; }
.heading{ font-size: 1.6rem; margin: 0; font-weight: 900; letter-spacing: -0.01em; text-align: center; }
.lede{ margin: 0; font-size: 1.05rem; color: var(--muted); text-align: center; }
.small{ font-size: 0.9rem; }

/* ---- buttons ---- */
button{ font: inherit; color: inherit; cursor: pointer; }
button:focus-visible{ outline-color: var(--p1); }
.big{
  appearance: none; border: 0; width: 100%;
  border-radius: 16px;
  background: var(--accent);
  box-shadow: 0 5px 0 var(--accent-edge);
  color: #fff;
  font-size: clamp(1.05rem, 2.6vh, 1.25rem); font-weight: 900;
  padding: clamp(11px, 2vh, 16px) 20px;
  margin-bottom: 5px;
  transition: transform 0.06s, box-shadow 0.06s;
}
.big:active:not(:disabled){ transform: translateY(4px); box-shadow: 0 1px 0 var(--accent-edge); }
.big:disabled{ opacity: 0.45; }
.big.secondary{ background: var(--surface); color: var(--ink); border: 1.5px solid var(--surface-edge); box-shadow: 0 5px 0 var(--surface-edge); }
.big.secondary:active:not(:disabled){ box-shadow: 0 1px 0 var(--surface-edge); }
.soft:active:not(:disabled){ transform: translateY(3px); box-shadow: 0 1px 0 var(--surface-edge); }
.soft:disabled{ opacity: 0.5; }
.soft[hidden], .big[hidden], .lede[hidden]{ display: none; }   /* the space is kept, so the line appearing never moves the screen */
.link{ appearance: none; border: 0; background: none; color: var(--muted); font-weight: 700; padding: 8px; }

/* ---- the name: two tiles and a light ---- */
.logo{ display: flex; gap: 5px; justify-content: center; align-items: center; }
.logo i{
  width: clamp(24px, 4.2vh, 34px); height: clamp(26px, 4.6vh, 37px); border-radius: 7px;
  background: var(--c); color: #111c26; box-shadow: 0 3px 0 var(--e);
  display: grid; place-items: center;
  font-style: normal; font-weight: 500; font-size: clamp(0.95rem, 2.4vh, 1.25rem);
}
.logo i.c0{ --c: #ffb000; --e: #b87d00; font-weight: 800; font-size: clamp(1.2rem, 3.2vh, 1.65rem); }
.logo i.c1{ --c: #f3e8d0; --e: #cdbd9b; color: #3a2a10; font-weight: 800; font-size: clamp(1.2rem, 3.2vh, 1.65rem); }
.logo b{ width: clamp(10px, 1.8vh, 14px); height: clamp(10px, 1.8vh, 14px); border-radius: 50%; background: var(--p2); box-shadow: 0 0 10px var(--p2); margin-left: 3px; }
.big-logo{ gap: 7px; }
.big-logo i{ width: clamp(48px, 13vw, 62px); height: clamp(52px, 14vw, 67px); font-size: clamp(1.6rem, 4.6vh, 2.1rem); border-radius: 12px; box-shadow: 0 5px 0 var(--e); }
.big-logo b{ width: 16px; height: 16px; margin-left: 4px; }
.logo-spin i{ animation: hop 1.2s ease-in-out infinite; }
.logo-spin i:nth-child(2){ animation-delay: 0.15s; }
.logo-spin i:nth-child(3){ animation-delay: 0.3s; }
.logo-spin i:nth-child(4){ animation-delay: 0.45s; }
.logo-spin b{ animation: blink 1.2s ease-in-out infinite 0.6s; }
@keyframes hop{ 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes blink{ 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ---- letter tag ---- */
.letter-tag{ display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--tile, #f4e9cf); color: #3a2f17; font-weight: 900; font-size: 0.85rem; letter-spacing: 0.02em; }

/* ---- menu: the layout (the screen column, today card, button rows) is shared: shared/public/base.css and menu-layout.css ---- */

/* the puzzle: the letter and where it goes */
.pattern{ display: flex; gap: 6px; justify-content: center; align-items: center; }
.slot{ width: clamp(30px, 8vw, 38px); height: clamp(34px, 9vw, 42px); border-radius: 9px; display: grid; place-items: center; font-style: normal; color: var(--muted); font-weight: 500; }
.slot.on{
  border: 0; background: var(--tile); color: var(--tile-ink); box-shadow: 0 4px 0 var(--tile-edge);
  font-size: clamp(1.4rem, 4vh, 1.9rem); width: clamp(42px, 11vw, 52px); height: clamp(48px, 12.5vw, 58px); border-radius: 12px; text-transform: uppercase;
}
.rule{ margin: 0; text-align: center; font-weight: 800; }

/* ---- the game ---- */
.game{ justify-content: flex-start; gap: clamp(6px, 1.2vh, 10px); }
.hud{ display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; flex: none; }
.timer{ text-align: center; font-weight: 900; font-size: clamp(1.5rem, 4.4vh, 2rem); line-height: 1; font-variant-numeric: tabular-nums; }
.game .pattern{ flex: none; margin-top: 2px; }
.game .rule{ flex: none; font-size: 0.9rem; color: var(--muted); }
.typed{
  flex: none; min-height: clamp(46px, 8vh, 60px); display: grid; place-items: center;
  border-radius: 14px; background: var(--surface); border: 1.5px solid var(--surface-edge);
  font-weight: 500; font-size: clamp(1.6rem, 4.6vh, 2.1rem); text-transform: uppercase; padding: 0 12px; overflow: hidden;
}
.typed .w{ display: inline-block; white-space: nowrap; letter-spacing: 0.06em; }
.typed .w::after{ content: ""; display: inline-block; width: 3px; height: 1.05em; margin-left: 3px; vertical-align: -0.15em; background: var(--accent); animation: blink 1s steps(2) infinite; }
.typed.empty .w::after{ margin-left: 0; }
.typed.shake{ animation: shake 0.4s; }
@keyframes shake{ 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.found{
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; align-content: flex-start;
  display: flex; flex-wrap: wrap; gap: 6px; scrollbar-width: thin; scrollbar-color: var(--surface-edge) transparent;
}
.chip{ padding: 3px 10px; border-radius: 10px; background: var(--surface); border: 1.5px solid var(--surface-edge); font-weight: 800; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.03em; animation: pop 0.18s ease-out; }
.chip.pending{ opacity: 0.5; }
.chip.new{ border-color: var(--good); }
@keyframes pop{ from { transform: scale(0.7); opacity: 0; } }
#toast{
  position: absolute; top: 4px; left: 50%; transform: translate(-50%, -6px); z-index: 3; pointer-events: none; opacity: 0;
  background: var(--ink); color: var(--bg); font-weight: 800; font-size: 0.95rem; padding: 7px 14px; border-radius: 12px;
  white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.35); transition: opacity 0.15s, transform 0.15s;
}
#toast.show{ opacity: 1; transform: translate(-50%, 0); }

/* ---- results ---- */
.done-head{ text-align: center; display: grid; gap: clamp(3px, 0.8vh, 6px); justify-items: center; flex: none; }
.done-head .k{ margin: 0; color: var(--muted); font-weight: 800; }
.final{ margin: 0; font-size: min(18vw, clamp(2.6rem, 10vh, 4.6rem)); font-weight: 900; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.done .found{ justify-content: center; }
.card-note{ margin: 0; text-align: center; color: var(--muted); font-weight: 700; font-size: 0.9rem; min-height: 1.3em; flex: none; }
.done-buttons{ display: grid; gap: 8px; flex: none; }

/* ---- panels fill the whole screen ---- */
@keyframes slide-in{ from { transform: translateX(30px); opacity: 0; } }

.rules-list{ list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(8px, 1.6vh, 14px); }
.rules-list li{ display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: clamp(0.9rem, 2.1vh, 1rem); line-height: 1.3; }
.rules-list b{ color: var(--ink); }
.ri{
  flex: none; width: 38px; height: 38px; border-radius: 11px;
  background: var(--tile); color: var(--tile-ink); box-shadow: 0 4px 0 var(--tile-edge);
  display: grid; place-items: center; font-weight: 900; font-size: 1rem;
}
.ri svg{ width: 22px; height: 22px; fill: none; stroke: var(--tile-ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---- leaderboard ---- */

/* ---- pop-ups: Other games ---- */
.other-games{ display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; justify-items: center; }
.other-games button{ display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--ink); font-weight: 800; font-size: 0.85rem; }
.other-games img{ width: clamp(64px, 22vw, 84px); height: auto; aspect-ratio: 1; border-radius: 22%; display: block; box-shadow: 0 3px 0 rgba(0,0,0,0.25); }
.other-games button:active{ transform: translateY(2px); }

/* ---- testing mode and practice: a strip along the bottom ---- */
.test-banner{
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  padding: 5px 12px calc(env(safe-area-inset-bottom) + 5px);
  background: repeating-linear-gradient(-45deg, #f2b23a 0 14px, #f5c25c 14px 28px);
  color: #2b1d00; font-weight: 900; font-size: 13px; letter-spacing: .04em;
  text-align: center; text-transform: uppercase; box-shadow: 0 -2px 0 #c98a14;
}
.test-banner[hidden]{ display: none; }
body.testing #app{ padding-bottom: calc(env(safe-area-inset-bottom) + 36px); }

/* Discord on phones covers the top of the game with its own bar: keep clear of it */

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation: none !important; transition: none !important; }
}

/* Surrender: a quiet red link under the rule while playing, and the red "Surrendered" on the menu, board and results */
.surrender{ flex: none; align-self: center; background: none; border: 0; padding: 2px 12px; font: inherit; font-size: 0.85rem; font-weight: 700; color: var(--bad); cursor: pointer; }
.surrender.sure{ font-weight: 900; }
.surrender[hidden]{ display: none; }

/* Your stats (same look as the other games) */

/* leaderboard pictures */

/* Colour-blind mode: blue and orange in place of green and red */
:root[data-cb="1"]{ --good: #0072b2; --bad: #d55e00; }
:root[data-cb="1"] .chip.new{ border-style: dashed; }

/* result screen: "Game complete", the player's own words, and 10 more they could have entered */
.done-head .complete{ margin: 0; font-size: 1.05rem; font-weight: 900; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.could{ display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip.mine{ border-color: var(--good); background: var(--surface); }
.chip.sug{ background: transparent; border: 1.5px dashed var(--surface-edge); color: var(--muted); font-weight: 700; animation: none; }

/* Other games on a short screen (a phone on its side): three across, so all the games and Close fit without scrolling */
@media (max-height: 520px){
  .other-games{ grid-template-columns: repeat(3, 1fr); gap: 8px 12px; }
  .other-games img{ width: clamp(40px, 15vh, 64px); }
  .other-games button{ gap: 4px; }
}

/* a phone on its side: the menu and result screens scroll from the top, and the game screen gets a shorter keyboard (it was cut off top and bottom) */
@media (max-height: 520px){
  .screen.menu, .screen.done{ overflow-y: auto; overscroll-behavior: contain; justify-content: flex-start; padding-bottom: 8px; }
  .game{ gap: 4px; }
  .game .pattern{ display: none; }
  .typed{ min-height: 34px; height: 34px; }
}

/* After surrendering, every game says SURRENDERED in red. */

/* Phones and tablets: their own keyboard instead of the on-screen one. A see-through text box covers the word; tapping the word raises the keyboard. */
#typed{ position: relative; }
#native{ position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; font-size: 16px; }   /* 16px: iPhones zoom in on anything smaller */

/* the leaderboard rows look the same as in the other games */

/* the splash that shows today's rule before the daily puzzle */
.splash{ gap: clamp(10px, 2vh, 18px); }
.splash-k{ margin: 0; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.splash .rule{ font-size: 1.15rem; }
.splash-buttons{ width: 100%; display: grid; gap: 10px; margin-top: clamp(8px, 2vh, 20px); }
.splash .pattern{ transform: scale(1.8); margin: 18px 0; }

/* ---- Sudoku: the sum, the tiles, the buttons ---- */
.how{ flex: none; margin: 2px 0 0; text-align: center; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.toast-wrap{ position: relative; height: 0; flex: none; }
.toast-wrap #toast{ top: 6px; }
.tray{ flex: none; display: flex; gap: clamp(6px, 1.6vw, 10px); justify-content: center; margin-top: clamp(8px, 2vh, 20px); }
.tray.ops{ margin-top: clamp(2px, 0.8vh, 8px); }
.tile{
  appearance: none; flex: 1 1 0; min-width: 0; max-width: 84px; height: clamp(54px, 10vh, 74px); border-radius: 14px; border: 0; padding: 0;
  font-weight: 800; font-size: clamp(1.4rem, 7vw, 2rem); font-variant-numeric: tabular-nums;
  background: var(--tile); color: var(--tile-ink); box-shadow: 0 5px 0 var(--tile-edge);
  transition: transform 0.06s, box-shadow 0.06s, opacity 0.15s;
}
.tile.op{ background: var(--p0); color: #111c26; box-shadow: 0 5px 0 var(--p0e); max-width: 96px; }
.tile:active:not(:disabled){ transform: translateY(4px); box-shadow: 0 1px 0 var(--tile-edge); }
.tile.op:active:not(:disabled){ box-shadow: 0 1px 0 var(--p0e); }
.tile.used{ opacity: 0.18; box-shadow: none; transform: translateY(3px); }
.play-buttons{ flex: none; display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.play-buttons .soft{ flex: 1 1 0; margin-bottom: 5px; }
.play-buttons .big{ flex: 1.6 1 0; }
.play-buttons .big{ flex: 2 1 0; width: auto; }
.splash-tiles{ display: flex; gap: 8px; justify-content: center; margin: 4px 0 10px; }
.splash-tiles i{ font-style: normal; width: 46px; height: 54px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 1.7rem; background: var(--tile); color: var(--tile-ink); box-shadow: 0 5px 0 var(--tile-edge); }
.splash-tiles i.o{ background: var(--p0); color: #111c26; box-shadow: 0 5px 0 var(--p0e); width: 38px; }

/* ---- results: a clean recap ---- */
.chips{ display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 2px; }
.chip{ text-transform: none; margin: 0; padding: 5px 12px; border-radius: 999px; background: var(--surface, #1a2735); border: 1px solid var(--surface-edge, #26384a); font-size: 0.9rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[hidden]{ display: none; }
.recap{ flex: none; margin: clamp(8px, 2vh, 18px) 0 0; padding: 14px 14px 12px; border-radius: 18px; background: var(--surface, #1a2735); border: 1px solid var(--surface-edge, #26384a); display: grid; gap: 14px; }
.recap[hidden], .recap-row[hidden]{ display: none; }
.recap-row + .recap-row{ padding-top: 14px; border-top: 1px solid var(--surface-edge, #26384a); }
.recap-top{ display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.recap-top .k{ color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.recap-top b{ font-size: 1.15rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.recap-row.best .recap-top b{ color: var(--muted); }
.mini{ display: flex; gap: 3px; }
.mini i{ font-style: normal; flex: 3 1 0; min-width: 0; height: 36px; display: grid; place-items: center; border-radius: 8px; font-weight: 800; font-size: 0.95rem; font-variant-numeric: tabular-nums; background: var(--tile); color: var(--tile-ink); box-shadow: 0 2px 0 var(--tile-edge); }
.mini i.o{ flex: 2 1 0; background: var(--p0); color: #111c26; box-shadow: 0 2px 0 var(--p0e); }
.recap-row.best .mini{ opacity: 0.7; }
.recap.perfect{ border-color: #00e5ff; box-shadow: 0 0 0 1px #00e5ff inset; }
.recap.perfect .recap-top .k::after{ content: " · no mistakes"; color: #00e5ff; letter-spacing: 0.06em; }
.done-row{ display: grid; gap: 8px; }
.done-row[hidden]{ display: none; }
.done-row .soft{ width: 100%; }
.card-note{ margin: 8px 0 0; font-size: 0.82rem; }

/* ---- splash: tidy ---- */
.splash{ gap: 0; }
.splash-k{ font-size: 0.8rem; letter-spacing: 0.16em; }
.splash-tiles{ margin: 14px 0 18px; }
.splash-title{ margin: 0; font-size: clamp(1.5rem, 7vw, 2rem); font-weight: 900; line-height: 1.1; text-align: center; text-wrap: balance; }
.splash-sub{ margin: 6px 0 0; color: var(--muted); font-weight: 700; }
.splash-facts{ display: flex; gap: 8px; width: 100%; margin: 22px 0 12px; }
.splash-facts div{ flex: 1 1 0; min-width: 0; padding: 12px 6px 10px; border-radius: 16px; background: var(--surface, #1a2735); border: 1px solid var(--surface-edge, #26384a); display: grid; justify-items: center; gap: 2px; }
.splash-facts b{ font-size: 1.9rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.splash-facts span{ color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.splash .quiet.small{ margin: 0; }
.splash-buttons{ margin-top: clamp(14px, 3vh, 28px); }
.big-logo i.c0, .big-logo i.c1{ font-size: clamp(1.9rem, 5.4vh, 2.5rem); }

/* the logo: a 3x3 Sudoku box (gold = given, cream = filled in), each centred in its tile */
.logo{ display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: 4px; }
.logo i svg{ width: 58%; height: 58%; display: block; }
.big-logo{ gap: 5px; }
.big-logo{ --t: clamp(30px, min(11vw, 5.6vh), 46px); }
.big-logo i, .big-logo i.c0, .big-logo i.c1{ width: var(--t); height: var(--t); font-size: calc(var(--t) * 0.7); line-height: 1; padding-bottom: calc(var(--t) * 0.04); }
.logo-spin i:nth-child(3){ animation-delay: 0.15s; }
.logo-spin i:nth-child(4){ animation-delay: 0.3s; }
.logo-spin i:nth-child(5){ animation-delay: 0.45s; }
.logo-spin i:nth-child(6){ animation-delay: 0.6s; }
.logo-spin i:nth-child(7){ animation-delay: 0.75s; }
.logo-spin i:nth-child(8){ animation-delay: 0.9s; }
.logo-spin i:nth-child(9){ animation-delay: 1.05s; }
.logo i.c0{ color: #111c26; }
@media (max-height: 700px){ .big-logo{ --t: 28px; gap: 4px; } }

/* ---- the puzzle screen, tidied: sum card up top, tiles in thumb reach, one row of buttons ---- */
.game{ gap: 0; }
.hud{ grid-template-columns: 1fr auto 1fr; }
.hud-end{ justify-self: end; }
.sum-card{ flex: none; margin-block: auto; padding: 16px 12px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--surface-edge); display: grid; gap: 12px; }
.sum-live{ margin: 0; text-align: center; min-height: 2.4rem; display: grid; place-items: center; font-size: 1.1rem; font-weight: 800; color: var(--muted); }
.sum-live.ready{ color: var(--accent, #5b86f0); }
.toast-wrap{ margin-top: 4px; }
.trays{ flex: none; margin-top: 0; display: grid; gap: 6px; padding-top: 12px; }
.trays .tray{ margin: 0 0 8px; gap: clamp(6px, 2vw, 12px); }
.trays .tile{ height: clamp(58px, 10.5vh, 80px); max-width: none; font-size: clamp(1.6rem, 8vw, 2.2rem); border-radius: 16px; }
.play-buttons{ margin-top: 6px; padding-top: 0; }
.trays{ padding-bottom: 10px; }
.game > .surrender{ margin: 6px 0 2px; font-size: 0.85rem; }
@media (max-height: 700px){ .trays .tile{ height: 52px; } .sum-card{ padding: 12px 10px; gap: 8px; } }

.gave-note{ color: var(--muted); font-size: 0.85rem; font-weight: 700; }

/* ---- Sudoku: the grid, the number pad and the answer recap ---- */
/* the grid: nine 3x3 boxes, each its own rounded plate, so the boxes are obvious at a glance */
.grid{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; width: min(100%, 480px, 56vh); margin: 0 auto; }
.grid.shake{ animation: shake 0.4s; }
.box{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 4px; border-radius: 12px; background: var(--surface-edge); }
.sq{ appearance: none; border: 0; padding: 0; aspect-ratio: 1; min-width: 0; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: clamp(1.1rem, 5.4vw, 2rem); line-height: 1; font-variant-numeric: tabular-nums; color: var(--tile-ink); position: relative; transition: background 0.12s, transform 0.08s; }
.sq.given{ background: var(--tile); box-shadow: 0 2px 0 var(--tile-edge); }
.sq.empty{ background: var(--bg); }
.sq.filled{ background: color-mix(in srgb, var(--surface) 88%, var(--accent)); color: color-mix(in srgb, var(--accent) 45%, var(--ink)); box-shadow: 0 2px 0 color-mix(in srgb, var(--bg) 60%, var(--surface-edge)); }
.sq.pop{ animation: pop 0.18s ease-out; }
.sq.same{ box-shadow: inset 0 0 0 2.5px var(--p0, #ffb000); }
.sq.sel{ background: color-mix(in srgb, var(--p0, #ffb000) 26%, var(--surface)); color: var(--ink); outline: 3px solid var(--p0, #ffb000); outline-offset: -1px; z-index: 1; }
.sq.sel.given{ background: var(--tile); color: var(--tile-ink); }
.sq.dup{ color: #ff5a5a; box-shadow: inset 0 0 0 2px #ff5a5a; }
.pad{ display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(6px, 2vw, 10px); }
.key{ appearance: none; border: 0; padding: 0; height: clamp(50px, 8.5vh, 68px); border-radius: 14px; font-weight: 800; font-size: clamp(1.4rem, 7vw, 2rem); font-variant-numeric: tabular-nums; background: var(--tile); color: var(--tile-ink); box-shadow: 0 5px 0 var(--tile-edge); transition: transform 0.06s, box-shadow 0.06s, opacity 0.15s; }
.key.del{ background: var(--p0); color: #111c26; box-shadow: 0 5px 0 var(--p0e); }
.key:active:not(:disabled){ transform: translateY(4px); box-shadow: 0 1px 0 var(--tile-edge); }
.key:disabled{ opacity: 0.35; }
.mg{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; width: min(100%, 270px); margin: 4px auto 0; }
.mgb{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: 8px; background: var(--surface-edge, #26384a); }
.mg i{ font-style: normal; aspect-ratio: 1; display: grid; place-items: center; border-radius: 4px; font-weight: 800; font-size: 0.85rem; font-variant-numeric: tabular-nums; background: var(--bg); color: color-mix(in srgb, var(--accent) 45%, var(--ink)); }
.mg i.g{ background: var(--tile); color: var(--tile-ink); box-shadow: 0 2px 0 var(--tile-edge); }
.recap-row.best .mini, .recap-row.best .mg{ opacity: 1; }
.mini .mg{ flex: 1 1 auto; }
.mini .mg i{ flex: none; height: auto; border-radius: 4px; font-size: 0.85rem; }
@media (max-height: 700px){ .key{ height: 42px; } .grid{ width: min(100%, 318px, 56vh); gap: 5px; } .sum-card{ padding: 8px 8px; gap: 4px; } .sum-live{ min-height: 1.6rem; font-size: 1rem; } .trays{ padding-top: 6px; } }
.play-buttons .soft, .play-buttons .big{ white-space: nowrap; font-size: clamp(0.9rem, 4.2vw, 1.1rem); padding-inline: 8px; }

/* ---- pause and hint ---- */
.pause-badge{ --pause-bg: var(--p0, #ffb000); --pause-edge: var(--p0e, #b87d00); --pause-ink: #111c26; }   /* the rest of the Paused screen: pause.css (shared) */
.sq.hint{ background: var(--surface); color: var(--p0, #ffb000); box-shadow: inset 0 0 0 2px var(--p0, #ffb000); }
@keyframes pop{ 0%{ transform: scale(0.8); } 60%{ transform: scale(1.1); } 100%{ transform: scale(1); } }
.mini .mg i:not(.g){ box-shadow: 0 2px 0 color-mix(in srgb, var(--bg) 70%, var(--surface-edge)); }
.sum-live:empty{ display: none; } .sum-card{ padding-block: 14px; }
/* pencil marks: tiny numbers in the top right of a square */
.sq .nt{ position: absolute; top: 3px; right: 4px; left: 4px; text-align: right; font-size: clamp(0.5rem, 2.1vw, 0.72rem); font-weight: 800; line-height: 1.05; letter-spacing: 0.02em; color: color-mix(in srgb, var(--ink) 70%, var(--bg)); pointer-events: none; word-spacing: 0; }
#notes.on{ background: var(--p0, #ffb000); color: #1b1300; }
/* the grey card is the same width of padding on every side; dots in that margin show the picked square's row (left, right) and column (top, bottom) */
.sum-card{ padding: 24px; width: fit-content; max-width: 100%; margin-inline: auto; }
.grid{ position: relative; width: min(480px, 56vh, calc(100vw - 80px)); }
.rd{ position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--p0, #ffb000); transform: translate(-50%, -50%); pointer-events: none; }
@media (max-height: 700px){ .sum-card{ padding: 18px; } .grid{ width: min(318px, 56vh, calc(100vw - 68px)); } }
/* results: the recap grid keeps a sensible size (it used to stretch to the full card width and push the buttons off screen) */
.mini .mg{ flex: 0 1 auto; width: min(100%, 300px, 30vh); margin: 4px auto 0; }
.mini{ justify-content: center; }
.card-note:empty{ display: none; }

/* the difficulty pill (the same three colours in every game) */
.level{ display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: 0.8rem; color: #fff; letter-spacing: 0.02em; }
.level.easy{ background: #2e9b63; } .level.medium{ background: #5b86f0; } .level.hard{ background: #e2604f; }
.today-line .level{ margin: 0 8px 0 0; font-size: 0.85em; }

/* ---- the board runs edge to edge: no grey card, a smaller number pad, and three equal buttons (Undo, Notes, Check) ---- */
.game{ max-width: 640px; }
.sum-card{ background: none; border: 0; border-radius: 0; padding: 0; gap: 0; width: auto; max-width: none; margin-inline: -6px; }
.grid{ width: min(100%, calc(100dvh - 310px)); }
.rd{ width: 8px; height: 8px; }
.pad{ gap: 6px; }
.key{ height: clamp(38px, 6.4vh, 52px); border-radius: 12px; font-size: clamp(1.2rem, 5.6vw, 1.7rem); box-shadow: 0 4px 0 var(--tile-edge); }
.key.del{ box-shadow: 0 4px 0 var(--p0e); }
.trays{ padding-top: 8px; padding-bottom: 6px; }
.play-buttons{ gap: 8px; }
.trays, .play-buttons{ margin-inline: -6px; }
.play-buttons > button, .play-buttons > .big, .play-buttons > .soft{ flex: 1 1 0; width: auto; height: 54px; padding: 0 8px; margin-bottom: 5px; display: grid; place-items: center; font-size: clamp(1rem, 4.4vw, 1.2rem); }
.play-buttons > .soft{ box-shadow: 0 4px 0 var(--surface-edge); }
#undo:disabled{ opacity: 0.4; }
@media (max-height: 700px){ .sum-card{ padding: 0; } .grid{ width: min(100%, calc(100dvh - 290px)); } .key{ height: 36px; } .play-buttons > button{ height: 48px; } }
.play-buttons > [hidden]{ display: none; }

/* ---- no tiles: the board is just numbers on a ruled grid (thin lines between squares, heavier lines round each 3x3 box) ---- */
.grid{ --line1: color-mix(in srgb, var(--ink) 22%, var(--bg)); --line2: color-mix(in srgb, var(--ink) 70%, var(--bg)); container-type: inline-size; gap: 0; border: 2px solid var(--line2); border-radius: 4px; overflow: visible; }
.box{ position: relative; gap: 0; padding: 0; border-radius: 0; background: none; }
.box::after{ content: ""; position: absolute; inset: 0; border: 1px solid var(--line2); pointer-events: none; z-index: 2; }
.sq{ border-radius: 0; background: none; box-shadow: inset 0 0 0 0.5px var(--line1); font-size: 6.8cqw; color: var(--ink); }
.sq.given{ background: none; box-shadow: inset 0 0 0 0.5px var(--line1); color: var(--ink); font-weight: 900; }
.sq.empty{ background: none; }
.sq.filled{ background: none; box-shadow: inset 0 0 0 0.5px var(--line1); color: var(--accent, #6aa8ff); }
.sq.sel, .sq.sel.given{ background: color-mix(in srgb, var(--p0, #ffb000) 24%, var(--bg)); color: var(--ink); outline: 0; box-shadow: inset 0 0 0 2.5px var(--p0, #ffb000); z-index: 1; }
.sq.same{ box-shadow: inset 0 0 0 2.5px var(--p0, #ffb000); }
.sq.dup{ color: #ff5a5a; box-shadow: inset 0 0 0 2px #ff5a5a; }
.sq .nt{ font-size: 2.4cqw; top: 2px; right: 3px; left: 3px; }
.rd{ width: 6px; height: 6px; }
.sum-card{ margin-inline: -10px; }
.trays, .play-buttons{ margin-inline: -10px; }

/* the answer grid on the results screen: the same ruled, tile-free look */
.mg{ --line1: color-mix(in srgb, var(--ink) 22%, var(--bg)); --line2: color-mix(in srgb, var(--ink) 70%, var(--bg)); container-type: inline-size; gap: 0; border: 2px solid var(--line2); border-radius: 3px; }
.mgb{ position: relative; gap: 0; padding: 0; border-radius: 0; background: none; }
.mgb::after{ content: ""; position: absolute; inset: 0; border: 1px solid var(--line2); pointer-events: none; }
.mg i, .mg i.g, .mini .mg i:not(.g){ border-radius: 0; background: none; box-shadow: inset 0 0 0 0.5px var(--line1); font-size: 6.4cqw; color: var(--accent, #6aa8ff); }
.mg i.g{ color: var(--ink); font-weight: 900; }

/* results: on a short screen the content used to be centred and cut off at the top; now it scrolls instead, and the answer grid gives up a little height first */
#done{ justify-content: safe center; overflow-y: auto; }
@media (max-height: 820px){ .mini .mg{ width: min(100%, 300px, 25vh); } }

/* the picked square's whole row and column: a light hue of the gold (no dots) */
.rd{ display: none; }
.sq.peer{ background: color-mix(in srgb, var(--p0, #ffb000) 13%, var(--bg)); }

/* rings sit in front of the grid lines */
.sq.sel, .sq.same, .sq.dup{ z-index: 3; }

/* rings are drawn as an outline that reaches 1px outside the square, so on a box edge they cover the whole width of the heavy white line, not just half of it */
.sq.sel, .sq.sel.given, .sq.same{ box-shadow: none; outline: 3px solid var(--p0, #ffb000); outline-offset: -2px; z-index: 4; }
.sq.dup{ box-shadow: none; outline: 3px solid #ff5a5a; outline-offset: -2px; z-index: 4; }

/* the same lettering as the Speed Word Search grid: Outfit, weight 500 */
.sq, .sq.given, .mg i, .mg i.g{ font-family: var(--font); font-weight: 500; }
.sq .nt{ font-weight: 600; }

/* drag and tap (shared/client/dragtap.js) */
.key{ touch-action: none; cursor: grab; }
.key.armed{ transform: translateY(-5px); outline: 3px solid var(--accent, var(--p0)); outline-offset: 2px; }
.sq.drop{ outline: 3px solid var(--accent, var(--p0)); outline-offset: -3px; z-index: 6; }
.key.dt-ghost{ z-index: 9999; }

/* number keys: square, the same size as a grid square and lined up under the grid columns */
.trays{ width: min(100%, calc(100dvh - 310px)); margin-inline: auto; padding-inline: 2px; box-sizing: content-box; }
@media (max-height: 700px){ .trays{ width: min(100%, calc(100dvh - 290px)); } }
.pad{ grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 0; container-type: inline-size; }
.pad .key{ height: auto; aspect-ratio: 1; margin: 2px; border-radius: 8px; font-size: 6.4cqw; box-shadow: 0 3px 0 var(--tile-edge); }
.play-buttons .key.del{ flex: 1 1 0; background: var(--p0); color: #111c26; box-shadow: 0 4px 0 var(--p0e); font-size: 1.5rem; }
