/* The game center: colour per game, the dock, hub tiles, the daily run, quests, stamps, the reward card and motion.
   External stylesheet (strict CSP). Dark is the default theme; light is the opt-out. Loads after games.css. */

/* ---------- one colour per game ---------- */
.games {
  --gc: oklch(72% 0.15 310); --gc-d: oklch(46% 0.14 310); --gc-l: oklch(90% 0.07 310); --gc-ink: oklch(21% 0.05 310); --gc-text: oklch(50% 0.17 310);
}
:where(:root:not([data-theme="light"])) .games { --gc-text: oklch(79% 0.14 310); }
[data-g] {
  --gc: oklch(72% 0.15 var(--gh, 310));
  --gc-d: oklch(46% 0.14 var(--gh, 310));
  --gc-l: oklch(90% 0.07 var(--gh, 310));
  --gc-ink: oklch(21% 0.05 var(--gh, 310));
  --gc-text: oklch(50% 0.17 var(--gh, 310));
}
:where(:root:not([data-theme="light"])) [data-g] { --gc-text: oklch(79% 0.14 var(--gh, 310)); }
[data-g="linkle"] { --gh: 310; }
[data-g="quadlink"] { --gh: 272; }
[data-g="daily-five"] { --gh: 218; }
[data-g="daily-photo"] { --gh: 160; }
[data-g="daily-chess"] { --gh: 88; }
[data-g="sudoku"] { --gh: 28; }
[data-g="crossword"] { --gh: 352; }
[data-g="daily-stars"] { --gh: 248; }
[data-g="chess-puzzles"] { --gh: 62; }
[data-g="sudoku-unlimited"] { --gh: 8; }
[data-g="leaderboard"] { --gh: 140; }
[data-g="landlink"] { --gh: 125; }
[data-g="atomlink"] { --gh: 190; }
[data-g="prizelink"] { --gh: 100; }
[data-g="citylink"] { --gh: 232; }
[data-g="peaklink"] { --gh: 175; }
[data-g="codelink"] { --gh: 335; }
[data-g="thinkerlink"] { --gh: 298; }
[data-g="riverlink"] { --gh: 205; }
[data-g="wildlink"] { --gh: 40; }
[data-g="lockerlink"] { --gh: 118; }
[data-g="gridlink"] { --gh: 150; }
[data-g="under-the-cap"] { --gh: 20; }

.gl { width: 1.5em; height: 1.5em; flex: none; }
.gl-sm { width: 1em; height: 1em; }
.gl-lg { width: 2em; height: 2em; }

/* ---------- chunky buttons: a solid face on a darker edge that presses down ---------- */
.gbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 14px; background: var(--gc, var(--purple)); color: var(--gc-ink, #fff);
  font: 800 0.95rem/1 var(--font-body); text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 var(--gc-d, var(--purple-dim)); transform: translateY(0);
  transition: transform 0.09s ease-out, box-shadow 0.09s ease-out, filter 0.15s;
}
.gbtn:hover { filter: brightness(1.06); }
.gbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gc-d, var(--purple-dim)); }
.gbtn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.gbtn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--line); }
.gbtn--ghost:active { box-shadow: inset 0 0 0 2px var(--line), 0 1px 0 var(--line); }

/* ---------- the dock ---------- */
.game-dock { max-width: 980px; margin: 0 auto; padding: 14px 20px 6px; display: flex; align-items: center; gap: 12px; }
.dock-list { list-style: none; display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 2px 8px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; scroll-snap-type: x proximity; }
.dock-list::-webkit-scrollbar { display: none; }
.dock-list li { flex: none; scroll-snap-align: center; }
.dock-link {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; min-width: 44px; justify-content: center;
  padding: 0; border-radius: 22px; background: var(--gc); color: var(--gc-ink); text-decoration: none;
  font: 800 0.9rem/1 var(--font-body); box-shadow: 0 3px 0 var(--gc-d); transition: transform 0.12s ease-out, box-shadow 0.12s;
}
.dock-link .gl { width: 24px; height: 24px; }
.dock-link .dock-name { display: none; white-space: nowrap; }
.dock-link:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--gc-d); }
.dock-link:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gc-d); }
.dock-link:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.dock-link[aria-current="page"] { padding: 0 18px 0 14px; }
.dock-link[aria-current="page"] .dock-name { display: inline; }
.dock-link[data-done]:not([aria-current="page"]) { background: color-mix(in oklch, var(--gc) 38%, var(--panel)); color: var(--gc-text); box-shadow: 0 3px 0 color-mix(in oklch, var(--gc-d) 50%, var(--panel)); }
.dock-state { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: var(--bg); display: none; place-items: center; border: 2px solid var(--bg); }
.dock-link[data-done] .dock-state { display: grid; }
.dock-state .gl { width: 11px; height: 11px; }
.dock-link[data-spot]::after { content: ""; position: absolute; inset: -5px; border-radius: 26px; border: 2px dashed var(--gc); opacity: 0.8; pointer-events: none; }
.dock-all { background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 var(--line); }
.dock-all:hover { box-shadow: inset 0 0 0 2px var(--line), 0 5px 0 var(--line); }
.dock-tools { display: flex; align-items: center; gap: 8px; flex: none; padding-bottom: 4px; }
.dock-chip, .dock-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px; border-radius: 18px; border: 0; cursor: pointer;
  background: var(--panel); color: var(--ink); font: 800 0.84rem/1 var(--font-body); text-decoration: none; box-shadow: inset 0 0 0 2px var(--line);
  font-variant-numeric: tabular-nums;
}
.dock-chip[hidden] { display: none; }
.dock-chip .gl, .dock-btn .gl { color: var(--purple); }
:where(:root:not([data-theme="light"])) .dock-chip .gl, :where(:root:not([data-theme="light"])) .dock-btn .gl { color: oklch(78% 0.16 310); }
#dock-streak .gl { color: oklch(72% 0.17 50); }
#dock-streak[data-risk] { box-shadow: inset 0 0 0 2px oklch(72% 0.17 50); }
.dock-btn { padding: 0 10px; }
.dock-btn[aria-pressed="false"] .gl { color: var(--muted); }
.dock-chip:hover, .dock-btn:hover { box-shadow: inset 0 0 0 2px var(--purple); }
.dock-btn:focus-visible, .dock-chip:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
@media (min-width: 1100px) { .dock-chip-text { min-width: 1ch; } }
@media (max-width: 560px) { .game-dock { flex-wrap: wrap; } .dock-tools { margin-left: auto; } }

/* the page's own title sits on a band in the game's colour */
.game-head { align-items: center; }
.game-head h1 { display: flex; align-items: center; gap: 12px; }
.game-head h1::before {
  content: ""; width: 14px; height: 1.05em; border-radius: 4px; background: var(--gc, var(--purple)); box-shadow: 0 3px 0 var(--gc-d, var(--purple-dim));
}

/* ---------- hub ---------- */
.hub { max-width: 1040px; }
.hub-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 26px 0 4px; }
.hub-top h1 { font-family: var(--font-display); font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.hub-date { margin: 8px 0 0; color: var(--muted); font-weight: 600; min-height: 1.5em; }
.hub-chips { display: flex; gap: 8px; align-items: center; }
.hub .game-lede { margin: 14px 0 0; max-width: 74ch; font-size: 0.98rem; }

/* the daily run */
.run { margin: 22px 0 26px; display: grid; grid-template-columns: auto 1fr; gap: 24px 32px; align-items: center; padding: 24px 26px; border-radius: 22px; background: var(--panel); border: 2px solid var(--line); }
.run-ring { position: relative; width: 168px; height: 168px; flex: none; }
.run-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.run-seg { fill: none; stroke: color-mix(in oklch, var(--ink) 20%, transparent); stroke-width: 13; stroke-linecap: round; transition: stroke 0.4s, stroke-dashoffset 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.run-seg[data-done] { stroke: var(--gc); }
.run-seg[data-spot]:not([data-done]) { stroke: color-mix(in oklch, var(--gc) 55%, transparent); }
.run-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.run-count { font-family: var(--font-display); font-size: 2.9rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.run-count small { font-size: 1.3rem; color: var(--muted); font-weight: 600; }
.run-label { font-size: 0.78rem; color: var(--muted); font-weight: 700; margin-top: 4px; }
.run-side { display: grid; gap: 16px; min-width: 0; }
.run-side h2 { font-family: var(--font-display); font-size: 1.5rem; margin: 0; line-height: 1.1; }
.run-line { margin: 4px 0 0; color: var(--muted); }
.run-tiers { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; padding: 0; }
.run-tier { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: color-mix(in oklch, var(--ink) 6%, transparent); border: 2px solid transparent; transition: background 0.3s, border-color 0.3s; }
.run-tier b { font-size: 0.86rem; }
.run-tier span { font-size: 0.78rem; color: var(--muted); }
.run-tier[data-got] { background: color-mix(in oklch, var(--purple) 16%, var(--panel)); border-color: var(--purple); }
.run-tier[data-got] b::after { content: " reached"; font-weight: 600; color: var(--muted); }
.run-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }

.quests { list-style: none; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 0; padding: 18px 0 0; border-top: 2px dashed var(--line); }
.quest { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: color-mix(in oklch, var(--ink) 5%, transparent); }
.quest-mark { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--line); display: grid; place-items: center; color: transparent; transition: background 0.3s, border-color 0.3s, color 0.3s; }
.quest-mark .gl { width: 15px; height: 15px; }
.quest[data-done] .quest-mark { background: var(--purple); border-color: var(--purple); color: #fff; }
.quest-text { font-size: 0.92rem; line-height: 1.3; font-weight: 600; }
.quest[data-done] .quest-text { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.quest-meta { font-size: 0.8rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.quest[data-done] .quest-meta { color: var(--gc-text, var(--purple)); }
.quest[data-spot] { background: transparent; box-shadow: inset 0 0 0 2px var(--gc); }
.quest[data-spot] .quest-mark { border-color: var(--gc); }
.quest[data-spot][data-done] .quest-mark { background: var(--gc); border-color: var(--gc); color: var(--gc-ink); }
@media (max-width: 720px) {
  .run { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 20px 16px; }
  .run-side { justify-items: center; width: 100%; }
  .run-actions { justify-content: center; }
  .quest { text-align: left; }
}

/* the games, as colour tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(218px, 1fr)); gap: 18px; margin: 0 0 8px; }
.tile {
  --lift: 0px;
  position: relative; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: var(--panel); color: inherit; text-decoration: none;
  border: 2px solid var(--line); transform: translateY(var(--lift)); transition: transform 0.18s ease-out, border-color 0.18s, box-shadow 0.18s;
  box-shadow: 0 5px 0 var(--line);
}
.tile:hover { --lift: -4px; border-color: var(--gc); box-shadow: 0 9px 0 var(--gc-d); }
.tile:active { --lift: 2px; box-shadow: 0 2px 0 var(--gc-d); }
.tile:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.tile-art { position: relative; display: block; aspect-ratio: 10 / 7; background: var(--gc); overflow: hidden; }
.tile-art > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile-art svg .a1 { fill: var(--gc-d); }
.tile-art svg .a2 { fill: var(--gc-l); }
.tile-art svg .a3 { fill: none; stroke: var(--gc-d); stroke-width: 3; }
.tile-art svg .a4 { fill: var(--gc-ink); }
.tile-art svg .a5 { fill: oklch(99% 0.01 var(--gh)); }
.tile-art svg .ar { fill: none; stroke: var(--gc-ink); stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.tile-art svg .a6 { fill: none; stroke: var(--gc-d); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.tile-art svg text { font-family: var(--font-body); font-weight: 800; }
.tile-art svg .mv { transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); transform-box: fill-box; transform-origin: center; }
.tile:hover .tile-art svg .mv { transform: translateY(-5px) rotate(-2deg); }
.tile:hover .tile-art svg .mv2 { transform: translateY(4px) rotate(2deg); }
.tile-badge { position: absolute; left: 12px; top: 12px; display: none; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--ink); color: var(--bg); font: 800 0.74rem/1 var(--font-body); }
.tile[data-spot] .tile-badge { display: inline-flex; }
.tile-check { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--bg); display: none; place-items: center; border: 3px solid var(--gc); }
.tile[data-done] .tile-check { display: grid; }
.tile-check .gl { width: 16px; height: 16px; }
.tile[data-done] .tile-art > svg { opacity: 0.55; }
.tile-body { display: grid; gap: 4px; padding: 14px 16px 16px; flex: 1 1 auto; align-content: start; }
.tile-body h2 { font-family: var(--font-display); font-size: 1.4rem; margin: 0; line-height: 1.1; font-weight: 700; }
.tile-body p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.4; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.tile-status { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.tile[data-streak] .tile-status { color: var(--gc-text); }
.tile-go { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 16px; border-radius: 11px; background: var(--gc); color: var(--gc-ink); font: 800 0.86rem/1 var(--font-body); box-shadow: 0 3px 0 var(--gc-d); }
.tile[data-done] .tile-go { background: transparent; color: var(--gc-text); box-shadow: inset 0 0 0 2px color-mix(in oklch, var(--gc) 55%, transparent); }

/* the week */
.week { margin: 30px 0 0; }
.week h2 { font-family: var(--font-display); font-size: 1.3rem; margin: 0 0 4px; }
.week-sub { margin: 0 0 12px; color: var(--muted); font-size: 0.92rem; }
.stamps { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; max-width: 560px; margin: 0; padding: 0; }
.stamp { display: grid; justify-items: center; gap: 6px; padding: 10px 0 8px; border-radius: 14px; border: 2px solid var(--line); font-size: 0.74rem; font-weight: 800; color: var(--muted); }
.stamp-dot { width: 26px; height: 26px; border-radius: 50%; border: 2.5px dashed var(--line); display: grid; place-items: center; color: transparent; }
.stamp-dot .gl { width: 14px; height: 14px; }
.stamp[data-stamped] { border-color: var(--purple); color: var(--ink); }
.stamp[data-stamped] .stamp-dot { border: 0; background: var(--purple); color: #fff; }
.stamp[data-today] { border-color: var(--ink); }
.stamp[data-today]:not([data-stamped]) .stamp-dot { border-style: solid; border-color: var(--ink); }
.stamp[data-future] { opacity: 0.5; }

.inreach { margin: 30px 0 0; }
.inreach h2 { font-family: var(--font-display); font-size: 1.3rem; margin: 0 0 4px; }
.reach-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 12px 0 0; padding: 0; }
.reach { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 2px dashed var(--line); }
.reach .gl { color: var(--muted); }
.reach b { display: block; font-size: 0.92rem; }
.reach span { color: var(--muted); font-size: 0.84rem; line-height: 1.35; }

/* ---------- reward card after a puzzle ---------- */
.reward { max-width: 520px; margin: 18px auto 0; padding: 22px; border-radius: 22px; background: var(--panel); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--line); display: grid; gap: 16px; transform: translateY(14px); transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.reward[data-in] { transform: none; }
.reward[data-levelup] { border-color: var(--purple); box-shadow: 0 5px 0 var(--purple-dim); }
.reward-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.reward-head h2 { font-family: var(--font-display); font-size: 1.5rem; margin: 0; }
.reward-xp { margin: 0; font-weight: 800; color: var(--purple); font-size: 1.1rem; }
:where(:root:not([data-theme="light"])) .reward-xp { color: oklch(80% 0.15 310); }
.reward-xp::before { content: "+"; }
.reward-xp-n { font-family: var(--font-display); font-size: 2.2rem; font-variant-numeric: tabular-nums; }
.reward-level { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.reward-level-name { font-weight: 800; font-size: 0.92rem; }
.reward-level-num { font-size: 0.8rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.reward-bar { grid-column: 1 / -1; order: 3; height: 14px; border-radius: 7px; background: color-mix(in oklch, var(--ink) 10%, transparent); overflow: hidden; }
.reward-fill { display: block; height: 100%; width: 100%; border-radius: 7px; background: var(--purple); transform-origin: left center; transform: scaleX(var(--p, 0)); }
:where(:root:not([data-theme="light"])) .reward-fill { background: oklch(72% 0.17 310); }
.reward-lines { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.reward-line { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 0.9rem; font-weight: 600; }
.reward-line .gl { color: var(--purple); }
:where(:root:not([data-theme="light"])) .reward-line .gl { color: oklch(78% 0.16 310); }
.reward-line-xp { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.reward-prog { display: grid; gap: 8px; }
.reward-pips { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.reward-pip { height: 10px; border-radius: 5px; background: color-mix(in oklch, var(--ink) 12%, transparent); }
.reward-pip[data-done] { background: var(--gc); }
.reward-prog-text { margin: 0; color: var(--muted); font-size: 0.88rem; }
.reward-done { margin: 0; color: var(--muted); }
.next-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 16px; background: var(--gc); color: var(--gc-ink); text-decoration: none; box-shadow: 0 5px 0 var(--gc-d); transition: transform 0.09s ease-out, box-shadow 0.09s ease-out; }
.next-card:hover { filter: brightness(1.05); }
.next-card:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--gc-d); }
.next-card:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.next-card-text { display: grid; gap: 1px; }
.next-card-kicker { font-size: 0.74rem; font-weight: 800; opacity: 0.8; }
.next-card-name { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.1; }
.next-card-sub { font-size: 0.82rem; font-weight: 600; opacity: 0.85; }
.next-card-arrow { width: 26px; height: 26px; }

/* ---------- toasts, floaters ---------- */
.fx-float { position: absolute; z-index: 70; pointer-events: none; transform: translate(-50%, -100%); font: 800 1.1rem/1 var(--font-body); color: var(--ink); text-shadow: 0 1px 0 var(--bg); }

/* ---------- motion (only when the visitor has not asked for less) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .tile { animation: ui-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
  .tiles .tile:nth-child(1) { animation-delay: 0.04s; } .tiles .tile:nth-child(2) { animation-delay: 0.08s; }
  .tiles .tile:nth-child(3) { animation-delay: 0.12s; } .tiles .tile:nth-child(4) { animation-delay: 0.16s; }
  .tiles .tile:nth-child(5) { animation-delay: 0.2s; } .tiles .tile:nth-child(6) { animation-delay: 0.24s; }
  .tiles .tile:nth-child(7) { animation-delay: 0.28s; } .tiles .tile:nth-child(8) { animation-delay: 0.32s; }
  .run { animation: ui-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
  .dock-list li { animation: ui-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
  .dock-list li:nth-child(2) { animation-delay: 0.03s; } .dock-list li:nth-child(3) { animation-delay: 0.06s; } .dock-list li:nth-child(4) { animation-delay: 0.09s; }
  .dock-list li:nth-child(5) { animation-delay: 0.12s; } .dock-list li:nth-child(6) { animation-delay: 0.15s; } .dock-list li:nth-child(7) { animation-delay: 0.18s; }
  .dock-list li:nth-child(8) { animation-delay: 0.21s; } .dock-list li:nth-child(9) { animation-delay: 0.24s; }
  .dock-link[data-spot]::after { animation: ui-ring 2.4s ease-in-out infinite; }
  .tile[data-spot] .tile-badge { animation: ui-glint 3s ease-in-out infinite; }
  .tile-art svg .mv { animation: ui-bob 5s ease-in-out infinite; }
  .tile-art svg .mv2 { animation: ui-bob 6s ease-in-out -2s infinite reverse; }
  .stamp[data-today]:not([data-stamped]) .stamp-dot { animation: ui-ring 2.4s ease-in-out infinite; }
  .quest[data-done] .quest-mark { animation: ui-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
  .reward-fill { transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.25s; }
  .reward[data-in] .reward-line { animation: ui-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
  .reward[data-in] .reward-line:nth-child(1) { animation-delay: 0.5s; } .reward[data-in] .reward-line:nth-child(2) { animation-delay: 0.65s; }
  .reward[data-in] .reward-line:nth-child(3) { animation-delay: 0.8s; } .reward[data-in] .reward-line:nth-child(4) { animation-delay: 0.95s; }
  .reward[data-in] .next-card { animation: ui-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.45s backwards; }
  .reward[data-levelup] .reward-head h2 { animation: ui-pop 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.3s backwards; }
  .fx-float { animation: ui-float 1.2s ease-out forwards; }
}
@keyframes ui-rise { from { transform: translateY(14px); } }
@keyframes ui-pop { from { transform: scale(0.82); } 60% { transform: scale(1.06); } }
@keyframes ui-ring { 0%, 100% { opacity: 0.35; transform: scale(0.96); } 50% { opacity: 0.9; transform: scale(1.04); } }
@keyframes ui-glint { 0%, 100% { transform: none; } 50% { transform: translateY(-2px); } }
@keyframes ui-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes ui-float { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -48px; } }

/* ---------- game feedback: used by the games through PLFX ---------- */
@keyframes fx-flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes fx-pop { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes fx-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes fx-hop { 0%, 100% { transform: none; } 40% { transform: translateY(-14px); } 70% { transform: translateY(2px); } }
@keyframes fx-flash { 0% { filter: brightness(1.7); } 100% { filter: none; } }
@keyframes fx-glow { 0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--gc, var(--purple)) 70%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.fx-flip { animation: fx-flip 0.5s ease-in-out backwards; }
.fx-pop { animation: fx-pop 0.14s ease-out; }
.fx-shake { animation: fx-shake 0.38s ease-out; }
.fx-hop { animation: fx-hop 0.6s ease-out backwards; }
.fx-flash { animation: fx-flash 0.5s ease-out; }
.fx-glow { animation: fx-glow 0.7s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .fx-flip, .fx-pop, .fx-shake, .fx-hop, .fx-flash, .fx-glow { animation: none; }
  .reward { transform: none; transition: none; }
  .reward-fill { transition: none; }
}

/* ---------- the older game controls, brought into the same family ---------- */
.games .btn { min-height: 46px; border-radius: 14px; font-weight: 800; }
.games .btn-primary, .games .btn-primary:hover {
  background: var(--gc, var(--purple)); color: var(--gc-ink, #fff); border: 0; box-shadow: 0 4px 0 var(--gc-d, var(--purple-dim)); transform: none;
  transition: transform 0.09s ease-out, box-shadow 0.09s ease-out, filter 0.15s;
}
.games .btn-primary:hover { filter: brightness(1.06); }
.games .btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gc-d, var(--purple-dim)); }
.games .btn-ghost, .games .btn-ghost:hover { background: transparent; color: var(--ink); border: 0; box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--line); transform: none; }
.games .btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--gc, var(--purple)), 0 4px 0 var(--line); }
.games .btn-ghost:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--line), 0 1px 0 var(--line); }
.games .btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.cw-bar .btn[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--gc), 0 4px 0 var(--gc-d); background: color-mix(in oklch, var(--gc) 18%, transparent); color: var(--ink); }

.game-result { border: 2px solid var(--line); border-radius: 22px; box-shadow: 0 5px 0 var(--line); }
.game-statline b { font-family: var(--font-display); }
.wg-key { box-shadow: 0 3px 0 color-mix(in oklch, var(--g-key) 55%, black); transition: transform 0.07s, box-shadow 0.07s, background 0.25s; }
.wg-key:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in oklch, var(--g-key) 55%, black); }
.wg-tile { transition: border-color 0.1s; }
.quiz-opt { border-width: 2px; border-radius: 14px; box-shadow: 0 3px 0 var(--line); transition: transform 0.08s, box-shadow 0.08s, border-color 0.15s; }
.quiz-opt:not(:disabled):hover { border-color: var(--gc); }
.quiz-opt:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.pl-toast-item { border: 2px solid var(--purple); border-radius: 16px; box-shadow: 0 4px 0 var(--purple-dim), 0 12px 28px oklch(10% 0.04 310 / 0.4); }
.pl-toast-item strong { font-family: var(--font-display); font-size: 1.05rem; }

/* each game's own board takes that game's colour */
.dock-list { position: relative; }
.cb-board { border-color: var(--gc-d); border-radius: 10px; box-shadow: 0 5px 0 var(--gc-d); }
.cb-sq[data-shade="light"] { background: oklch(91% 0.06 var(--gh, 88)); }
.cb-sq[data-shade="dark"] { background: oklch(68% 0.12 var(--gh, 88)); }
:where(:root:not([data-theme="light"])) .cb-sq[data-shade="light"] { background: oklch(70% 0.08 var(--gh, 88)); }
:where(:root:not([data-theme="light"])) .cb-sq[data-shade="dark"] { background: oklch(46% 0.09 var(--gh, 88)); }
.cb-sq[data-rank]::before, .cb-sq[data-file]::after { color: oklch(24% 0.05 var(--gh, 88)); }
.sd-cell[data-sel] { background: var(--gc); color: var(--gc-ink); }
.sd-cell[data-peer] { background: color-mix(in oklch, var(--gc) 12%, var(--cw-cell)); }
.sd-cell[data-same] { background: color-mix(in oklch, var(--gc) 30%, var(--cw-cell)); }
.sd-cell { color: var(--gc-text); }
.sd-cell[data-given] { color: var(--ink); }
.sd-grid { border-color: var(--gc-d); border-radius: 10px; box-shadow: 0 5px 0 var(--gc-d); }
.cw-cell[data-active] { background: var(--gc); }
.cw-cell[data-active] .cw-letter { color: var(--gc-ink); }
.cw-cell[data-active][data-n]::before { color: var(--gc-ink); }
.cw-cell[data-entry] { background: color-mix(in oklch, var(--gc) 32%, var(--cw-cell)); }
@media (max-width: 720px) { .run-tier[data-got] b::after { content: none; } }

/* ---------- rated pages: rating strip, result, leaderboard ---------- */
.rate-hud { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin: 4px 0 18px; padding: 14px 20px; border-radius: 20px; background: var(--panel); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.rate-hud .gbtn { margin-left: auto; min-height: 44px; }
.rate-stat { display: grid; gap: 0; }
.rate-n { font-family: var(--font-display); font-size: 2.3rem; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gc-text); }
.rate-n--sm { font-size: 1.7rem; color: var(--ink); }
.rate-l { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.rate-result { text-align: center; }
.rate-delta { font-family: var(--font-display); font-size: 3.4rem; line-height: 1; font-weight: 700; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.rate-delta[data-up="1"] { color: var(--g-good); }
.rate-delta[data-up="0"] { color: var(--g-bad); }
.rate-line { margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.rate-line b { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); }
.rate-result .game-statline { grid-template-columns: repeat(2, 1fr); max-width: 320px; margin-left: auto; margin-right: auto; }
.rate-result .game-actions { justify-content: center; }
.rate-join { display: grid; gap: 8px; justify-items: center; margin: 12px 0; color: var(--muted); font-size: 0.92rem; }
.rate-join p { margin: 0; max-width: 46ch; }
.ad-note { margin: 22px 0 0; color: var(--muted); font-size: 0.84rem; text-align: center; }
.game-more { margin: 14px 0 0; }

.lb-controls { display: grid; gap: 10px; margin: 0 0 14px; }
.lb-label { font-weight: 800; font-size: 0.9rem; }
.lb-select { width: 100%; max-width: 360px; min-height: 46px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--panel); color: var(--ink); font: 700 1rem var(--font-body); box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 var(--line); }
.lb-select:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.lb-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.lb-gap { width: 14px; }
.lb-tab { min-height: 42px; padding: 0 18px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font: 800 0.9rem/1 var(--font-body); cursor: pointer; box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 var(--line); transition: transform 0.08s, box-shadow 0.08s; }
.lb-tab[aria-pressed="true"] { background: var(--gc, var(--purple)); color: var(--gc-ink, #fff); box-shadow: 0 3px 0 var(--gc-d, var(--purple-dim)); }
.lb-tab:active { transform: translateY(2px); }
.lb-tab:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.lb-you { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: color-mix(in oklch, var(--gc) 16%, var(--panel)); font-weight: 700; }
.lb-list { list-style: none; display: grid; gap: 8px; margin: 0 0 18px; padding: 0; }
.lb-row { display: grid; grid-template-columns: 2.4em 1fr auto auto; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--panel); border: 2px solid var(--line); }
.lb-rank { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-name { font-weight: 700; overflow-wrap: anywhere; }
.lb-n { font-size: 0.8rem; color: var(--muted); }
.lb-score { font-family: var(--font-display); font-size: 1.35rem; font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
.lb-row[data-top="1"] { border-color: oklch(78% 0.15 85); box-shadow: 0 3px 0 oklch(60% 0.13 85); }
.lb-row[data-top="2"] { border-color: oklch(78% 0.02 280); }
.lb-row[data-top="3"] { border-color: oklch(66% 0.1 55); }
.lb-row[data-top="1"] .lb-rank { color: oklch(78% 0.15 85); }
.lb-row[data-you] { background: color-mix(in oklch, var(--gc) 14%, var(--panel)); border-color: var(--gc); }
@media (max-width: 520px) { .lb-n { display: none; } .lb-row { grid-template-columns: 2em 1fr auto; } }
.dock-more:first-of-type { margin-left: 6px; padding-left: 12px; border-left: 2px solid var(--line); }
@media (prefers-reduced-motion: no-preference) {
  .lb-row { animation: ui-rise 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
  .lb-row:nth-child(2) { animation-delay: 0.03s; } .lb-row:nth-child(3) { animation-delay: 0.06s; } .lb-row:nth-child(4) { animation-delay: 0.09s; } .lb-row:nth-child(5) { animation-delay: 0.12s; }
  .rate-delta { animation: ui-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
}

.game-actions[hidden] { display: none; }

/* ---------- attribute-guess games ---------- */
.ag-form { display: flex; gap: 10px; align-items: flex-start; max-width: 560px; margin: 4px 0 6px; }
.ag-combo { position: relative; flex: 1 1 auto; min-width: 0; }
.ag-combo input { width: 100%; min-height: 48px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); font: 700 1rem/1 var(--font-body); }
.ag-combo input:focus { outline: 3px solid var(--gc, var(--purple)); outline-offset: 2px; border-color: transparent; }
.ag-combo ul { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; border-radius: 14px; background: var(--panel); border: 2px solid var(--line); box-shadow: 0 10px 28px oklch(10% 0.04 310 / 0.35); max-height: 330px; overflow-y: auto; }
.ag-combo li { padding: 10px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; }
.ag-combo li[aria-selected="true"], .ag-combo li:hover { background: color-mix(in oklch, var(--gc) 22%, transparent); }
.ag-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; min-height: 1.5em; margin: 0 0 4px; font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.ag-hint { min-height: 1.4em; margin: 0 0 10px; color: var(--ink); font-weight: 600; font-size: 0.92rem; }
.ag-scroll { overflow-x: auto; margin: 0 -20px 14px; padding: 4px 20px 10px; -webkit-overflow-scrolling: touch; }
.ag-grid { min-width: max-content; display: grid; gap: 6px; }
.ag-rows { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; }
.ag-row { display: grid; grid-template-columns: 9.5rem repeat(var(--cols, 7), 6.2rem); gap: 6px; align-items: stretch; }
#ag-root[data-cols="6"] .ag-row { --cols: 6; } #ag-root[data-cols="7"] .ag-row { --cols: 7; } #ag-root[data-cols="8"] .ag-row { --cols: 8; }
.ag-name { display: flex; align-items: center; padding: 8px 12px; border-radius: 10px; background: color-mix(in oklch, var(--ink) 8%, transparent); font-weight: 800; font-size: 0.92rem; line-height: 1.2; }
.ag-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 6px 4px; border-radius: 10px; border: 2px solid var(--g-tile-line); background: transparent; text-align: center; font-weight: 700; font-size: 0.82rem; line-height: 1.15; overflow-wrap: anywhere; }
.ag-cell[data-s="c"] { background: var(--g-correct); color: var(--g-correct-ink); border-color: transparent; }
.ag-cell[data-s="p"] { background: repeating-linear-gradient(135deg, var(--g-present) 0 6px, color-mix(in oklch, var(--g-present) 82%, var(--g-present-ink)) 6px 8px); color: var(--g-present-ink); border-color: transparent; }
.ag-cell[data-s="a"] { background: var(--g-absent); color: var(--g-absent-ink); border-color: transparent; }
.ag-arrow { font-size: 1rem; font-weight: 800; line-height: 1; }
.ag-headrow .ag-h { background: none; border: 0; min-height: 0; padding: 0 2px; font-size: 0.74rem; font-weight: 800; color: var(--muted); }
.ag-headrow .ag-name { padding-left: 12px; }
.ag-answer .ag-name { box-shadow: inset 0 0 0 2px var(--gc); }
.ag-key { display: inline-block; width: 22px; height: 22px; border-radius: 6px; vertical-align: -5px; margin-right: 6px; border: 2px solid var(--g-tile-line); }
.ag-key[data-s="c"] { background: var(--g-correct); border-color: transparent; }
.ag-key[data-s="p"] { background: repeating-linear-gradient(135deg, var(--g-present) 0 5px, color-mix(in oklch, var(--g-present) 82%, var(--g-present-ink)) 5px 7px); border-color: transparent; }
.ag-key[data-s="a"] { background: var(--g-absent); border-color: transparent; }
@media (max-width: 620px) { .ag-row { grid-template-columns: 7.4rem repeat(var(--cols, 7), 5.4rem); } .ag-cell { font-size: 0.76rem; } .ag-scroll { margin: 0 -16px 14px; padding: 4px 16px 10px; } }
@media (prefers-reduced-motion: no-preference) { .ag-rows .ag-row:first-child { animation: ui-rise 0.35s cubic-bezier(0.22, 1, 0.36, 1); } }
.ag-form[hidden], .ag-scroll[hidden], .ag-combo ul[hidden] { display: none; }

/* ---------- touch targets and small screens ---------- */
.dock-chip, .dock-btn { min-height: 44px; }
.dock-btn { min-width: 44px; justify-content: center; }
.dock-link { height: 46px; min-width: 46px; }
.house-promo-hide { min-height: 44px; min-width: 44px; }
.theme-toggle { min-height: 44px; }
.lb-tab, .gbtn { min-height: 46px; }
.ag-scroll:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; border-radius: 12px; }
.ac-table:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
@media (max-width: 420px) {
  .games-wrap { padding-left: 14px; padding-right: 14px; }
  .game-dock { padding-left: 14px; padding-right: 14px; }
  .run { padding: 18px 14px; }
  .sd-grid { --sd: min(calc((100vw - 28px) / 9), 52px); }
  .cb-board { --sq: min(calc((100vw - 28px) / 8), 64px); }
  .ac-row { grid-template-columns: minmax(96px, 1.4fr) repeat(4, minmax(58px, 1fr)); gap: 6px; font-size: 0.86rem; }
  .ac-table[data-ranked] .ac-row { grid-template-columns: minmax(84px, 1.3fr) repeat(4, minmax(46px, 1fr)) minmax(74px, 1.2fr); gap: 4px; font-size: 0.8rem; }
}
@media (pointer: coarse) { .wg-key { height: 50px; } }

/* affiliate card (hidden until a partner link is configured) */
.partner { margin: 16px 0 0; padding: 16px 18px; border-radius: 16px; border: 2px dashed var(--line); text-align: left; }
.partner[hidden] { display: none; }
.partner h3 { font-family: var(--font-display); font-size: 1.15rem; margin: 0 0 2px; }
.partner p { margin: 0 0 10px; color: var(--muted); font-size: 0.92rem; }
.partner-row { display: flex; flex-wrap: wrap; gap: 10px; }
.partner .partner-note { margin: 12px 0 0; font-size: 0.8rem; }

/* The on-screen keyboard floats: no panel behind it, only the keys, each lifted off the page with a shadow. */
.wg-keys { background: transparent; pointer-events: none; padding: 8px 0 max(12px, env(safe-area-inset-bottom)); }
.wg-keys .wg-key { pointer-events: auto; box-shadow: 0 3px 0 color-mix(in oklch, var(--g-key) 55%, black), 0 8px 18px oklch(8% 0.02 310 / 0.42); }
.wg-keys .wg-key:active { box-shadow: 0 1px 0 color-mix(in oklch, var(--g-key) 55%, black), 0 3px 8px oklch(8% 0.02 310 / 0.4); }
.wg-keys .wg-key[data-s="c"] { box-shadow: 0 3px 0 color-mix(in oklch, var(--g-correct) 60%, black), 0 8px 18px oklch(8% 0.02 310 / 0.42); }

/* ---------- sharing ---------- */
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; justify-content: center; }
.share-label { font-size: 0.82rem; font-weight: 800; color: var(--muted); margin-right: 2px; }
.share-btn { min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font: 800 0.88rem/1 var(--font-body); cursor: pointer; box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 var(--line); transition: transform 0.08s, box-shadow 0.08s; }
.share-btn:hover { box-shadow: inset 0 0 0 2px var(--gc, var(--purple)), 0 3px 0 var(--line); }
.share-btn:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px var(--line), 0 1px 0 var(--line); }
.share-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@media (max-width: 520px) {
  .share-row { display: grid; grid-template-columns: repeat(3, 1fr); }
  .share-label { grid-column: 1 / -1; text-align: center; }
  .share-btn { padding: 0 8px; }
}

.reward[hidden] { display: none; }

/* Daily Five: timer and the 50:50 lifeline */
.quiz-timer { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.quiz-timer[hidden] { display: none; }
.quiz-timer-track { flex: 1; height: 12px; border-radius: 6px; background: color-mix(in oklch, var(--ink) 12%, transparent); overflow: hidden; }
.quiz-timer-track i { display: block; height: 100%; width: 100%; border-radius: 6px; background: var(--gc, var(--purple)); transform-origin: left center; transform: scaleX(var(--p, 1)); }
.quiz-opt[data-gone] { opacity: 0.4; text-decoration: line-through; }
#qz-fifty[hidden] { display: none; }
.games [hidden] { display: none !important; }

/* Daily Photo twists: the picture is plain once you answer */
.ph-frame { overflow: hidden; border-radius: 14px; max-width: 640px; margin: 8px 0 14px; background: var(--panel); }
.ph-frame .ph-photo { margin: 0; border-radius: 0; max-width: none; width: 100%; }
.ph-photo[data-fx="blur"] { filter: blur(20px); animation: ph-sharpen 10s linear forwards; }
.ph-photo[data-fx="zoom"] { transform: scale(3.2); transform-origin: var(--ox, 50%) var(--oy, 50%); animation: ph-zoom 9s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.ph-photo[data-fx="mono"] { filter: grayscale(1) contrast(1.05); }
.ph-photo { transition: filter 0.5s, transform 0.5s; }
.ph-photo[data-open] { animation: none; filter: none; transform: none; }
@keyframes ph-sharpen { to { filter: blur(0); } }
@keyframes ph-zoom { to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .ph-photo[data-fx="blur"] { animation: none; filter: blur(8px); }
  .ph-photo[data-fx="zoom"] { animation: none; transform: scale(1.8); }
}

/* Daily Stars extras */
.stars-lucky { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
.stars-lucky > div { padding: 10px 14px; border-radius: 14px; background: color-mix(in oklch, var(--gc) 14%, transparent); }
.stars-lucky dt { font-size: 0.78rem; font-weight: 800; color: var(--muted); }
.stars-lucky dd { margin: 2px 0 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.stars-sw { width: 16px; height: 16px; border-radius: 50%; display: inline-block; border: 2px solid var(--ink); }
.stars-sw[data-c="violet"] { background: oklch(60% 0.22 300); } .stars-sw[data-c="amber"] { background: oklch(78% 0.16 80); }
.stars-sw[data-c="teal"] { background: oklch(68% 0.12 190); } .stars-sw[data-c="coral"] { background: oklch(70% 0.16 30); }
.stars-sw[data-c="indigo"] { background: oklch(48% 0.2 270); } .stars-sw[data-c="green"] { background: oklch(66% 0.16 150); }
.stars-sw[data-c="rose"] { background: oklch(72% 0.15 5); } .stars-sw[data-c="sky"] { background: oklch(75% 0.12 230); }
.stars-pair { margin: 8px 0 14px; display: grid; gap: 8px; justify-items: start; }
.stars-pair label { font-weight: 800; font-size: 0.9rem; }
.stars-pair select { min-height: 46px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); font: 700 1rem/1 var(--font-body); }
.stars-pair p { margin: 0; font-weight: 700; min-height: 1.4em; }

/* Chess Rush */
.mode-switch { display: inline-flex; gap: 6px; padding: 4px; border-radius: 16px; background: color-mix(in oklch, var(--ink) 8%, transparent); margin: 0 0 14px; }
.mode-opt { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 800; font-size: 0.92rem; text-decoration: none; color: var(--ink); }
.mode-opt[aria-current="page"] { background: var(--gc, var(--purple)); color: var(--gc-ink, #fff); box-shadow: 0 3px 0 var(--gc-d, var(--purple-dim)); }
.mode-opt:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.rush-hud { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 4px 0 14px; padding: 14px 20px; border-radius: 20px; background: var(--panel); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.rush-hud[hidden] { display: none; }

/* Sudoku: digit-first pad */
.sd-pad .wg-key[data-armed] { background: var(--gc); color: var(--gc-ink); box-shadow: 0 3px 0 var(--gc-d); transform: translateY(-2px); }

/* Crossword: pencil letters are lighter and slanted until inked */
.cw-cell[data-pencil] .cw-letter { opacity: 0.6; font-style: italic; }
.run-tier span { color: color-mix(in oklch, var(--ink) 78%, var(--panel)); }

/* ---------- sports games: Lockerlink, Gridlink, Under the Cap ---------- */
.sp-modes { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 12px; border: 2px solid var(--line); border-radius: 999px; background: var(--panel); }
.sp-mode { min-height: 40px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: 700 0.95rem/1 var(--font-body); cursor: pointer; }
.sp-mode[aria-pressed="true"] { background: var(--gc, var(--purple)); color: var(--gc-ink, #fff); }
.sp-mode:focus-visible { outline: 3px solid var(--gc, var(--purple)); outline-offset: 2px; }
.sp-practice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 14px; }
.sp-practice[hidden], .sp-form[hidden], .sp-tools[hidden], .ub-picker[hidden] { display: none; }
.sp-field { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.92rem; }
.sp-field select { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); font: 700 0.95rem/1 var(--font-body); }
.sp-form { max-width: 620px; }
.sp-msg { min-height: 1.5em; margin: 6px 0 4px; font-weight: 600; font-size: 0.94rem; }
.sp-msg.sp-bad { color: var(--bad, oklch(48% 0.18 25)); }
:where(:root:not([data-theme="light"])) .sp-msg.sp-bad { color: oklch(78% 0.14 25); }
.sp-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 10px; }
.sp-count { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0; font-weight: 700; font-size: 0.92rem; color: var(--muted); }
.sp-count b { color: var(--ink); font-size: 1.08rem; }
.sp-count .is-low b { color: oklch(62% 0.2 25); }
.sp-opt-name { font-weight: 700; }
.sp-opt-meta { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.sp .ag-combo li { display: block; }

.tl-ends { display: grid; gap: 4px; margin: 4px 0 12px; padding: 12px 16px; border-radius: 16px; background: color-mix(in oklch, var(--gc) 14%, var(--panel)); border: 2px solid color-mix(in oklch, var(--gc) 35%, var(--line)); }
.tl-ends p { margin: 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tl-end-label { min-width: 3.2em; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.tl-ends strong { font: 700 1.2rem/1.2 var(--font-display, var(--font-body)); }
.tl-chain { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 0; max-width: 620px; }
.tl-node { display: grid; gap: 2px; padding: 12px 16px; border-radius: 14px; background: var(--panel); border: 2px solid var(--line); }
.tl-node.tl-start, .tl-node.tl-target { border-color: var(--gc); background: color-mix(in oklch, var(--gc) 12%, var(--panel)); }
.tl-name { font-weight: 800; font-size: 1.05rem; }
.tl-meta { font-size: 0.82rem; font-weight: 600; color: var(--muted); line-height: 1.35; }
.tl-link { position: relative; margin: 0; padding: 7px 0 7px 38px; font-size: 0.84rem; font-weight: 700; color: var(--ink); }
.tl-link::before { content: ""; position: absolute; left: 21px; top: 0; bottom: 0; width: 3px; border-radius: 2px; background: var(--gc); }
.tl-gap { margin: 6px 0; padding: 12px 16px; border-radius: 14px; border: 2px dashed color-mix(in oklch, var(--gc) 60%, var(--line)); color: var(--muted); font-weight: 600; font-size: 0.92rem; }

.gl-grid { display: grid; grid-template-columns: minmax(64px, 0.7fr) repeat(3, minmax(0, 1fr)); gap: 6px; max-width: 640px; margin: 8px 0; }
.gl-head { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 6px 4px; border-radius: 12px; background: color-mix(in oklch, var(--gc) 18%, var(--panel)); font-weight: 800; font-size: 0.82rem; line-height: 1.15; overflow-wrap: anywhere; }
.gl-row { justify-content: flex-start; text-align: left; padding-left: 8px; }
.gl-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 84px; padding: 6px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); font: 700 0.82rem/1.2 var(--font-body); text-align: center; overflow-wrap: anywhere; cursor: pointer; }
.gl-cell:hover:not(:disabled) { border-color: var(--gc); }
.gl-cell.is-active { border-color: var(--gc); box-shadow: 0 0 0 3px color-mix(in oklch, var(--gc) 40%, transparent); }
.gl-cell.is-filled { background: var(--gc); border-color: var(--gc-d); color: var(--gc-ink); cursor: default; }
.gl-cell.is-missed { background: color-mix(in oklch, var(--ink) 6%, var(--panel)); color: var(--muted); font-weight: 600; font-size: 0.74rem; cursor: default; }
.gl-cell:disabled { opacity: 1; }
.gl-tier { font-size: 0.72rem; font-weight: 800; opacity: 0.85; }
.gl-current { min-height: 1.5em; margin: 6px 0; font-weight: 700; }
.gl-cell:focus-visible, .sp-mode:focus-visible, .ub-slot:focus-visible, .ub-opt:focus-visible { outline: 3px solid var(--gc, var(--purple)); outline-offset: 2px; }

.ub-rule { margin: 0 0 6px; padding: 8px 14px; border-radius: 10px; background: color-mix(in oklch, var(--gc) 14%, var(--panel)); font-size: 0.92rem; }
.ub-slots { list-style: none; margin: 8px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ub-slot { display: grid; gap: 1px; width: 100%; min-height: 72px; padding: 8px 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); text-align: left; font-family: var(--font-body); cursor: pointer; }
.ub-slot.is-active { border-color: var(--gc); box-shadow: 0 0 0 3px color-mix(in oklch, var(--gc) 40%, transparent); }
.ub-slot.is-filled { background: color-mix(in oklch, var(--gc) 16%, var(--panel)); }
.ub-slot.is-bench { border-style: dashed; }
.ub-slot-label { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ub-slot-name { font-weight: 800; font-size: 0.98rem; line-height: 1.2; overflow-wrap: anywhere; }
.ub-slot-meta { font-size: 0.76rem; font-weight: 600; color: var(--muted); }
.ub-picker { margin: 14px 0; max-width: 640px; }
.ub-picker h2 { font-size: 1.15rem; margin: 0 0 8px; }
.ub-search { width: 100%; min-height: 48px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); font: 700 1rem/1 var(--font-body); }
.ub-search:focus { outline: 3px solid var(--gc, var(--purple)); outline-offset: 2px; border-color: transparent; }
.ub-options { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
.ub-opt { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; width: 100%; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); text-align: left; font-family: var(--font-body); cursor: pointer; }
.ub-opt:hover:not(:disabled) { border-color: var(--gc); }
.ub-opt:disabled { opacity: 0.5; cursor: not-allowed; }
.ub-opt-name { font-weight: 800; }
.ub-opt-meta { grid-column: 1; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.ub-opt-cost { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 800; font-size: 0.82rem; padding: 4px 10px; border-radius: 999px; background: color-mix(in oklch, var(--gc) 22%, transparent); }
.ub-record { margin: 4px 0; font: 800 3.2rem/1 var(--font-display, var(--font-body)); letter-spacing: -0.02em; color: var(--gc); }
.ub-detail { margin: 6px 0 10px; padding-left: 1.1em; }
.ub-detail li { margin: 2px 0; }
@media (max-width: 520px) {
  .gl-grid { grid-template-columns: minmax(54px, 0.62fr) repeat(3, minmax(0, 1fr)); gap: 4px; }
  .gl-head { font-size: 0.72rem; min-height: 46px; }
  .gl-cell { min-height: 74px; font-size: 0.74rem; }
  .ub-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .sp * { transition: none !important; } }

.tl-week { margin: 22px 0 8px; max-width: 640px; }
.tl-week h2 { font-size: 1.15rem; margin: 0 0 6px; }
.tw-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.tw-day { padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); }
.tw-head, .tw-you { margin: 0 0 4px; font-size: 0.92rem; }
.tw-you { color: var(--muted); font-weight: 600; }
.tw-chain { margin: 6px 0 0; padding-left: 1.3em; font-weight: 700; font-size: 0.92rem; }
.tw-chain li { margin: 2px 0; }
.tw-hop { display: block; font-weight: 600; font-size: 0.8rem; color: var(--muted); }
.tl-week details { margin-top: 12px; }
.tl-week summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.gw-grid { width: 100%; border-collapse: separate; border-spacing: 4px; margin: 8px 0 2px; table-layout: fixed; }
.gw-grid th { font-size: 0.74rem; font-weight: 800; padding: 6px 4px; border-radius: 8px; background: color-mix(in oklch, var(--gc) 18%, var(--panel)); overflow-wrap: anywhere; }
.gw-grid td { font-size: 0.78rem; font-weight: 700; padding: 8px 4px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); text-align: center; vertical-align: middle; overflow-wrap: anywhere; line-height: 1.2; }
.gw-n { display: block; font-weight: 600; font-size: 0.7rem; color: var(--muted); }

/* ---------- logos of the sports games (shapes drawn in scripts/games_logos.py) ---------- */
.tile-art svg .lg-d { fill: var(--gc-d); }
.tile-art svg .lg-l { fill: var(--gc-l); }
.tile-art svg .lg-w { fill: oklch(99% 0.01 var(--gh)); }
.tile-art svg .lg-i { fill: var(--gc-ink); }
.tile-art svg .lg-ds { fill: none; stroke: var(--gc-d); stroke-linecap: round; stroke-linejoin: round; }
.tile-art svg .lg-ws { fill: none; stroke: oklch(99% 0.01 var(--gh)); stroke-linecap: round; stroke-linejoin: round; }
.game-logo { width: 44px; height: 44px; flex: none; border-radius: 11px; vertical-align: -0.3em; margin-right: 10px; }

.wg-key, .sd-cell, .cw-cell, .gbtn, .lb-tab, .dock-chip, .btn { touch-action: manipulation; }
