/* play.css — styles for the SnackPack web arcade.
   Loaded after site.css; reuses the cream design tokens. */

/* ── Arcade hub grid ─────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.daily-challenge-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.daily-challenge-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: end;
  justify-content: space-between;
}

.daily-challenge-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  letter-spacing: -0.02em;
}

.daily-challenge-date {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.daily-challenge-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.daily-challenge-card {
  min-height: 128px;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.74);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.daily-challenge-card:hover,
.daily-challenge-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 12px 22px rgba(32, 23, 19, 0.1);
}

.daily-challenge-card strong {
  font-family: var(--serif);
  font-size: 1.16rem;
}

.daily-challenge-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}

.daily-challenge-seed {
  margin-top: auto;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.game-tile {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  padding: 26px 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.game-tile:hover,
.game-tile:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(31, 143, 119, 0.4);
  box-shadow: 0 30px 64px rgba(32, 23, 19, 0.14);
}

.game-tile .game-emoji {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 14px;
}

.game-tile h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.game-tile p {
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.6;
  font-size: 0.96rem;
}

.game-tile .game-play {
  margin-top: auto;
  font-weight: 700;
  color: var(--accent);
}

.game-tile--soon {
  opacity: 0.7;
  cursor: default;
}

.game-tile--soon:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: var(--shadow);
}

/* ── Game stage (board + controls) ───────────────── */
.game-stage {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  max-width: 640px;
  margin: 0 auto;
}

.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.game-readout {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.readout-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(32, 23, 19, 0.05);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.readout-chip span {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.game-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn-game {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.85);
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-game:hover,
.btn-game:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.btn-game--primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.seg {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(32, 23, 19, 0.05);
  gap: 4px;
}

.seg button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.seg button[aria-pressed="true"] {
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(32, 23, 19, 0.1);
}

.game-status {
  margin: 0 0 16px;
  min-height: 24px;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}

.game-status--lose {
  color: var(--brand-deep);
  animation: c4-status-nudge 0.42s ease;
}

.game-status--win {
  color: var(--accent);
  animation: c4-status-win 0.72s ease;
}

.game-board-wrap {
  display: flex;
  justify-content: center;
}

.game-hint {
  margin: 16px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Minesweeper ─────────────────────────────────── */
.ms-grid {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(32, 23, 19, 0.06);
  touch-action: manipulation;
}

.ms-cell {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #fffdf8, #f1e7d8);
  box-shadow: inset 0 -2px 0 rgba(32, 23, 19, 0.08);
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  user-select: none;
  padding: 0;
}

.ms-cell:hover:not(.is-open) {
  background: linear-gradient(180deg, #fff, #f6eee0);
}

.ms-cell.is-open {
  background: rgba(32, 23, 19, 0.045);
  box-shadow: none;
  cursor: default;
}

.ms-cell.is-mine {
  background: rgba(185, 72, 30, 0.16);
}

.ms-cell.is-flag {
  color: var(--brand-deep);
}

.ms-cell[data-n="1"] { color: #2f6fd6; }
.ms-cell[data-n="2"] { color: #1f8f77; }
.ms-cell[data-n="3"] { color: #d8483a; }
.ms-cell[data-n="4"] { color: #5b3fb0; }
.ms-cell[data-n="5"] { color: #b9481e; }
.ms-cell[data-n="6"] { color: #138a8a; }
.ms-cell[data-n="7"] { color: #6a5b52; }
.ms-cell[data-n="8"] { color: #201713; }

/* ── 2048 ────────────────────────────────────────── */
.g2048-board {
  position: relative;
  width: 320px;
  height: 320px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(32, 23, 19, 0.08);
  touch-action: none;
}

.g2048-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  height: 100%;
}

.g2048-cell {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
}

.g2048-tiles {
  position: absolute;
  inset: 10px;
}

.g2048-tile {
  position: absolute;
  width: calc((100% - 30px) / 4);
  height: calc((100% - 30px) / 4);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: 0 6px 16px rgba(32, 23, 19, 0.1);
  transition: transform 0.12s ease;
}

.g2048-tile[data-v="2"]    { background: #fbf3e6; }
.g2048-tile[data-v="4"]    { background: #f7ebd4; }
.g2048-tile[data-v="8"]    { background: #efb54d; color: #2b1d08; }
.g2048-tile[data-v="16"]   { background: #e89a3c; color: #fff; }
.g2048-tile[data-v="32"]   { background: #de6a38; color: #fff; }
.g2048-tile[data-v="64"]   { background: #b9481e; color: #fff; }
.g2048-tile[data-v="128"]  { background: #1f8f77; color: #fff; font-size: 1.5rem; }
.g2048-tile[data-v="256"]  { background: #19806a; color: #fff; font-size: 1.5rem; }
.g2048-tile[data-v="512"]  { background: #14705c; color: #fff; font-size: 1.5rem; }
.g2048-tile[data-v="1024"] { background: #0f5f4e; color: #fff; font-size: 1.2rem; }
.g2048-tile[data-v="2048"] { background: #201713; color: #efb54d; font-size: 1.2rem; }

/* ── Connect 4 ───────────────────────────────────── */
.c4-board {
  display: grid;
  grid-template-columns: repeat(7, 44px);
  gap: 6px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #2f6fd6, #2456ad);
  box-shadow: var(--shadow);
  cursor: pointer;
  touch-action: manipulation;
}

.c4-cell {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--bg-soft);
  box-shadow: inset 0 2px 5px rgba(32, 23, 19, 0.18);
  position: relative;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  will-change: transform;
}

.c4-cell.is-p1 { background: radial-gradient(circle at 35% 30%, var(--c4-p1-light, #ef8a5a), var(--c4-p1-dark, #b9481e)); }
.c4-cell.is-p2 { background: radial-gradient(circle at 35% 30%, var(--c4-p2-light, #f3cf6a), var(--c4-p2-dark, #d99b1f)); }
.c4-cell.is-drop {
  animation: c4-drop 0.34s cubic-bezier(0.2, 0.88, 0.28, 1.12);
}
.c4-cell.is-win-line {
  animation: c4-win-pop 0.78s ease-in-out 2;
  box-shadow: inset 0 2px 5px rgba(32, 23, 19, 0.18), 0 0 0 4px rgba(255,255,255,0.7), 0 0 24px rgba(239,181,77,0.72);
}
.c4-board.is-win {
  animation: c4-board-win 0.85s ease;
}
.c4-board.is-loss {
  animation: c4-board-loss 0.46s ease;
}
.c4-board.is-busy {
  cursor: wait;
}

.c4-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: center;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}
.c4-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.c4-key::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  box-shadow: inset 0 2px 4px rgba(32, 23, 19, 0.18);
}
.c4-key--you::before { background: radial-gradient(circle at 35% 30%, var(--c4-p1-light, #ef8a5a), var(--c4-p1-dark, #b9481e)); }
.c4-key--cpu::before { background: radial-gradient(circle at 35% 30%, var(--c4-p2-light, #f3cf6a), var(--c4-p2-dark, #d99b1f)); }
.c4-board-hint {
  margin-top: -6px;
  margin-bottom: 12px;
}
.c4-board-hint + .game-board-wrap + .game-hint {
  display: none;
}

@keyframes c4-drop {
  0% { transform: translateY(calc(var(--drop-distance, 6) * -50px)) scale(0.86); }
  74% { transform: translateY(4px) scale(1.04); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes c4-win-pop {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.16); }
}
@keyframes c4-board-win {
  0%, 100% { transform: scale(1); }
  42% { transform: scale(1.025); }
}
@keyframes c4-board-loss {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
@keyframes c4-status-win {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.08); }
}
@keyframes c4-status-nudge {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-5px); }
  60% { transform: translateX(5px); }
}

.c4-col-btns {
  display: grid;
  grid-template-columns: repeat(7, 44px);
  gap: 6px;
  padding: 0 12px;
  margin-bottom: 6px;
}

.c4-col-btn {
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(31, 143, 119, 0.12);
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease;
}

.c4-col-btn:hover:not(:disabled) { background: rgba(31, 143, 119, 0.24); }
.c4-col-btn:disabled { opacity: 0.35; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .c4-cell.is-drop,
  .c4-cell.is-win-line,
  .c4-board.is-win,
  .c4-board.is-loss,
  .game-status--win,
  .game-status--lose {
    animation: none;
  }
}

/* ── Memory Match ────────────────────────────────── */
.mem-board {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: 10px;
  width: 100%;
  max-width: calc(var(--cols, 4) * 78px);
}

.mem-card {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 600px;
  -webkit-tap-highlight-color: transparent;
}

.mem-card-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.36s cubic-bezier(0.2, 0.78, 0.3, 1.02);
}

.mem-card.is-flipped .mem-card-inner,
.mem-card.is-matched .mem-card-inner {
  transform: rotateY(180deg);
}

.mem-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-size: clamp(1.3rem, 6vw, 2rem);
  line-height: 1;
  user-select: none;
}

.mem-face--cover {
  background: linear-gradient(155deg, #efb54d, #de6a38);
  box-shadow: inset 0 -3px 0 rgba(32, 23, 19, 0.16);
  filter: saturate(0.92);
  opacity: 0.94;
}

.mem-face--symbol {
  background: linear-gradient(180deg, #fffdf8, #f3ead9);
  box-shadow: inset 0 0 0 1px var(--line);
  transform: rotateY(180deg);
}

.mem-card:hover:not(.is-flipped):not(.is-matched) .mem-face--cover {
  filter: saturate(1.05) brightness(1.04);
}

.mem-card.is-matched {
  cursor: default;
  animation: mem-pop 0.5s ease;
}

.mem-card.is-matched .mem-face--symbol {
  box-shadow: inset 0 0 0 2px var(--accent);
}

@keyframes mem-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .mem-card-inner { transition: none; }
  .mem-card.is-matched { animation: none; }
}

/* ── Thirteen (Tien Len) ─────────────────────────── */
.th-opponents {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
}

.th-opp {
  flex: 1 1 0;
  min-width: 92px;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  text-align: center;
}

.th-opp strong { font-family: var(--serif); font-size: 1rem; }
.th-opp span { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.th-opp.is-turn { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(31, 143, 119, 0.18); }
.th-opp.is-passed { opacity: 0.55; }

.th-table {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-height: 116px;
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: rgba(31, 143, 119, 0.08);
}

.th-table-label { font-weight: 700; color: var(--muted); font-size: 0.84rem; text-transform: uppercase; letter-spacing: 0.05em; }
.th-table-by { color: var(--muted); font-size: 0.82rem; }
.th-table-cards { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 64px; align-items: center; }

.th-card {
  width: 44px;
  height: 62px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #fffdf8, #f5ecdd);
  color: #1a1a2e;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  box-shadow: 0 2px 5px rgba(32, 23, 19, 0.1);
}

.th-card--red { color: #c0392b; }
.th-rank { font-size: 1.05rem; }
.th-suit { font-size: 1rem; }

.th-hand-wrap { display: flex; justify-content: center; }
.th-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 14px;
}

button.th-card { cursor: pointer; transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease; }
button.th-card:hover { transform: translateY(-3px); border-color: var(--accent); }
button.th-card.is-selected {
  transform: translateY(-10px);
  border-color: var(--accent);
  box-shadow: 0 8px 16px rgba(31, 143, 119, 0.28);
}

.th-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  button.th-card { transition: none; }
}

/* ── Picross (Nonogram) ──────────────────────────── */
.pc-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
}

.pc-corner { grid-column: 1; grid-row: 1; display: flex; align-items: flex-end; justify-content: flex-end; padding: 2px; }
.pc-marktoggle { padding: 3px; }
.pc-marktoggle button { min-height: 30px; padding: 0 10px; font-size: 1rem; }

.pc-colclues {
  grid-column: 2; grid-row: 1;
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell));
  gap: 2px;
  align-items: end;
}

.pc-rowclues {
  grid-column: 1; grid-row: 2;
  display: grid;
  grid-template-rows: repeat(var(--rows), var(--cell));
  gap: 2px;
  justify-items: end;
}

.pc-cc {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 1px; min-height: 28px;
  font-weight: 800; font-variant-numeric: tabular-nums;
  font-size: calc(var(--cell) * 0.42);
  color: var(--ink);
  line-height: 1.05;
}

.pc-rc {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 5px; padding-right: 6px; min-width: 30px;
  font-weight: 800; font-variant-numeric: tabular-nums;
  font-size: calc(var(--cell) * 0.42);
  color: var(--ink);
}

.pc-grid {
  grid-column: 2; grid-row: 2;
  display: grid;
  gap: 2px;
}

.pc-cell {
  width: var(--cell); height: var(--cell);
  border: 0; padding: 0;
  border-radius: 4px;
  background: linear-gradient(180deg, #fffdf8, #f1e7d8);
  box-shadow: inset 0 0 0 1px rgba(32, 23, 19, 0.06);
  cursor: pointer;
  display: grid; place-items: center;
  -webkit-tap-highlight-color: transparent;
}

.pc-cell.is-fill { background: var(--ink); box-shadow: none; }
.pc-cell.is-cross::after { content: "✕"; color: var(--muted); font-size: calc(var(--cell) * 0.5); font-weight: 700; line-height: 1; }
.pc-cell.pc-edge-l { margin-left: 2px; }
.pc-cell.pc-edge-t { margin-top: 2px; }

.pc-grid.is-solved .pc-cell.is-fill { background: var(--accent); transition: background 0.3s ease; }

@media (prefers-reduced-motion: reduce) {
  .pc-grid.is-solved .pc-cell.is-fill { transition: none; }
}

/* ── Snakes & Ladders ────────────────────────────── */
.sl-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
  justify-content: center;
}

.sl-board-wrap {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 1;
  flex: 1 1 320px;
  max-width: 440px;
}

.sl-board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  width: 100%; height: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.sl-sq {
  position: relative;
  background: #fdf6ea;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 2px 0 0 3px;
}
.sl-sq--alt { background: #f4e7d2; }
.sl-num { font-size: clamp(0.5rem, 1.6vw, 0.72rem); font-weight: 700; color: var(--muted); line-height: 1; }
.sl-mark { position: absolute; right: 1px; bottom: 0; font-size: clamp(0.7rem, 2.2vw, 1rem); line-height: 1; }

.sl-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sl-ladder { stroke: #b9772e; opacity: 0.55; }
.sl-snake { stroke: #3a9d54; opacity: 0.6; }
.sl-snake-head { fill: #2f8043; opacity: 0.8; }

.sl-tokens { position: absolute; inset: 0; pointer-events: none; }
.sl-token {
  position: absolute;
  width: 8%; height: 8%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  display: grid; place-items: center;
  color: #fff;
  font-size: clamp(0.6rem, 1.8vw, 0.85rem);
  box-shadow: 0 2px 6px rgba(32, 23, 19, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  transition: left 0.09s linear, top 0.09s linear;
}

.sl-side {
  flex: 1 1 200px;
  max-width: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sl-dice {
  width: 74px; height: 74px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.9);
  font-size: 2.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease;
}
.sl-dice:hover:not(:disabled) { transform: translateY(-2px); }
.sl-dice:disabled { opacity: 0.55; cursor: default; }

.sl-players { display: grid; gap: 8px; width: 100%; }
.sl-pchip {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  font-size: 0.9rem;
}
.sl-pchip.is-turn { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(31, 143, 119, 0.16); }
.sl-pdot { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; color: #fff; font-size: 0.85rem; flex: none; }
.sl-ppos { color: var(--muted); font-size: 0.8rem; }

@media (prefers-reduced-motion: reduce) {
  .sl-token { transition: none; }
  .sl-dice { transition: none; }
}

/* ── Kakuro ──────────────────────────────────────── */
.kk-grid {
  display: grid;
  gap: 2px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(32, 23, 19, 0.18);
  max-width: 100%;
  overflow-x: auto;
}

.kk-cell {
  width: var(--cell); height: var(--cell);
  border: 0; padding: 0; margin: 0;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: calc(var(--cell) * 0.46);
  font-variant-numeric: tabular-nums;
}

.kk-block { background: #2b2018; }
.kk-clue {
  position: relative;
  background: #4a382c;
  color: #f4e7d2;
  overflow: hidden;
}
.kk-slash { position: absolute; inset: 0; background: linear-gradient(to top right, transparent calc(50% - 0.6px), rgba(244, 231, 210, 0.4) 50%, transparent calc(50% + 0.6px)); }
.kk-across { position: absolute; top: 2px; right: 4px; font-size: calc(var(--cell) * 0.32); line-height: 1; }
.kk-down { position: absolute; bottom: 2px; left: 4px; font-size: calc(var(--cell) * 0.32); line-height: 1; }

.kk-fill {
  background: linear-gradient(180deg, #fffdf8, #f3ead9);
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.kk-fill:hover:not(.is-locked) { background: #fff; }
.kk-fill.is-locked { color: var(--muted); cursor: default; background: #efe6d4; }
.kk-fill.is-selected { box-shadow: inset 0 0 0 3px var(--accent); background: #fff; }
.kk-fill.is-wrong { color: #c0392b; background: rgba(192, 57, 43, 0.12); }

.kk-pad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 340px;
  margin: 18px auto 0;
}
.kk-pad button {
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  font: inherit; font-weight: 700; font-size: 1.1rem;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.kk-pad button:hover { transform: translateY(-2px); border-color: var(--accent); }
.kk-pad .kk-erase { color: var(--brand-deep); }

@media (prefers-reduced-motion: reduce) {
  .kk-fill, .kk-pad button { transition: none; }
}

/* ── Crossword ───────────────────────────────────── */
.cw-stage { max-width: 560px; }

.cw-cluebar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(31, 143, 119, 0.1);
}
.cw-cluetext { flex: 1; font-weight: 600; font-size: 0.95rem; min-height: 1.2em; }
.cw-navbtn {
  width: 36px; height: 36px; flex: none;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: rgba(255, 255, 255, 0.85); font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--ink);
}
.cw-navbtn:hover { border-color: var(--accent); }

.cw-board-wrap { display: flex; justify-content: center; }
.cw-grid { display: grid; gap: 2px; width: 100%; margin: 0 auto; }

.cw-cell {
  position: relative;
  aspect-ratio: 1;
  border: 0; padding: 0; margin: 0;
  border-radius: 3px;
  background: #fffdf8;
  box-shadow: inset 0 0 0 1px rgba(32, 23, 19, 0.14);
  cursor: pointer;
  display: grid; place-items: center;
  -webkit-tap-highlight-color: transparent;
}
.cw-black { background: #2b2018; box-shadow: none; cursor: default; }
.cw-cnum { position: absolute; top: 1px; left: 2px; font-size: clamp(0.42rem, 1.5vw, 0.6rem); font-weight: 700; color: var(--muted); line-height: 1; }
.cw-clet { font-weight: 800; font-size: clamp(0.8rem, 3vw, 1.2rem); text-transform: uppercase; color: var(--ink); }
.cw-cell.is-active { background: #d8efe8; }
.cw-cell.is-selected { background: #efb54d; box-shadow: inset 0 0 0 2px var(--brand-deep); }
.cw-cell.is-correct .cw-clet { color: #1f8f77; }
.cw-cell.is-wrong .cw-clet { color: #c0392b; }

.cw-keys { display: grid; gap: 5px; margin-top: 16px; }
.cw-keyrow { display: flex; gap: 5px; justify-content: center; }
.cw-key {
  flex: 1 1 0; max-width: 42px; min-height: 42px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  font: inherit; font-weight: 700; color: var(--ink); cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease;
}
.cw-key:hover { transform: translateY(-1px); background: #fff; }
.cw-key--del { max-width: 56px; color: var(--brand-deep); }

.cw-cluelists {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  margin-top: 20px; text-align: left;
}
.cw-cluelists h3 { font-family: var(--serif); font-size: 1.05rem; margin: 0 0 8px; }
.cw-cluelists ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 3px; max-height: 220px; overflow-y: auto; }
.cw-cluelists li { padding: 5px 7px; border-radius: 7px; font-size: 0.86rem; color: var(--muted); cursor: pointer; line-height: 1.35; }
.cw-cluelists li b { color: var(--ink); margin-right: 3px; }
.cw-cluelists li:hover { background: rgba(32, 23, 19, 0.05); }
.cw-cluelists li.is-active { background: rgba(31, 143, 119, 0.16); color: var(--ink); }

@media (prefers-reduced-motion: reduce) { .cw-key { transition: none; } }
@media (max-width: 520px) { .cw-cluelists { grid-template-columns: 1fr; } }

/* ── Mahjong Solitaire ───────────────────────────── */
.mj-board-wrap {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  padding: 4px;
}

.mj-board {
  position: relative;
  margin: 0 auto;
  flex: none;
}

.mj-tile {
  position: absolute;
  border: 0;
  padding: 0;
  border-radius: 6px;
  background: linear-gradient(160deg, #fffdf8, #efe3cf);
  box-shadow:
    0 2px 0 rgba(32, 23, 19, 0.32),
    1px 2px 4px rgba(32, 23, 19, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 0;
  cursor: pointer;
  color: var(--suit, var(--ink));
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.mj-glyph { font-size: 0.95rem; line-height: 1; margin-top: 3px; }
.mj-label { font-size: 0.8rem; font-weight: 900; line-height: 1; margin-bottom: 3px; color: var(--suit, var(--ink)); }

.mj-tile.is-blocked { filter: brightness(0.9) saturate(0.85); cursor: default; }
.mj-tile.is-open:hover { transform: translateY(-1px); }
.mj-tile.is-selected {
  background: linear-gradient(160deg, #fff7e6, #f4d68a);
  box-shadow: 0 2px 0 rgba(32, 23, 19, 0.32), 0 0 0 2px var(--accent), 1px 2px 6px rgba(31, 143, 119, 0.4);
}
.mj-tile.is-hint { animation: mj-hint 0.55s ease 2; }

@keyframes mj-hint {
  0%, 100% { box-shadow: 0 2px 0 rgba(32, 23, 19, 0.32), 1px 2px 4px rgba(32, 23, 19, 0.28); }
  50% { box-shadow: 0 2px 0 rgba(32, 23, 19, 0.32), 0 0 0 3px var(--brand-deep); }
}

@media (prefers-reduced-motion: reduce) {
  .mj-tile { transition: none; }
  .mj-tile.is-hint { animation: none; }
}

/* ── Table Tennis ────────────────────────────────── */
.tt-colors { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.tt-colors-label { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.tt-swatch {
  width: 26px; height: 26px; border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: var(--sw);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(32, 23, 19, 0.25);
}
.tt-swatch.is-on { outline: 2px solid var(--ink); outline-offset: 2px; }

.tt-board-wrap { position: relative; display: flex; justify-content: center; }
#tt-canvas, #as-canvas {
  width: auto;
  height: min(62vh, 540px);
  max-width: 100%;
  aspect-ratio: 390 / 680;
  border-radius: 14px;
  box-shadow: var(--shadow);
  touch-action: none;
  cursor: pointer;
}
.tt-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  min-height: 48px;
  padding: 0 30px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit; font-weight: 700; font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(32, 23, 19, 0.35);
}
.tt-overlay:hover { transform: translate(-50%, -50%) translateY(-2px); }

@media (prefers-reduced-motion: reduce) { .tt-overlay:hover { transform: translate(-50%, -50%); } }

/* ── Asteroid Destroyer controls ─────────────────── */
.as-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.as-btn {
  min-width: 56px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: transform 0.08s ease, background 0.08s ease;
}
.as-btn:active { transform: scale(0.95); background: var(--accent); color: #fff; }
.as-btn--fire {
  background: var(--brand-deep);
  color: #fff;
  border-color: var(--brand-deep);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  padding: 0 22px;
}
.as-btn--fire:active { background: var(--accent); }

@media (prefers-reduced-motion: reduce) { .as-btn { transition: none; } }

/* ── Reusable colour / colour-blind picker ───────── */
.color-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
  align-items: center;
  margin-bottom: 14px;
}
.cp-group { display: flex; align-items: center; gap: 7px; }
.cp-label { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.cp-swatch {
  width: 24px; height: 24px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: var(--sw);
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 4px rgba(32, 23, 19, 0.25);
  transition: transform 0.1s ease;
}
.cp-swatch:hover { transform: scale(1.1); }
.cp-swatch.is-on { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) { .cp-swatch { transition: none; } }

/* ── App-download funnel card ────────────────────── */
.funnel-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 26px 28px;
  margin: 0 auto;
  max-width: 760px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(circle at top right, rgba(31, 143, 119, 0.12), transparent 40%),
    linear-gradient(140deg, rgba(255, 253, 248, 0.97), rgba(247, 237, 222, 0.97));
  box-shadow: var(--shadow);
}

.funnel-card h2 {
  font-family: var(--serif);
  letter-spacing: -0.02em;
  font-size: 1.5rem;
  margin: 6px 0 8px;
}

.funnel-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.funnel-card .funnel-points {
  list-style: none;
  padding: 0;
  margin: 0 0 4px;
  display: grid;
  gap: 6px;
}

.funnel-card .funnel-points li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.funnel-card .funnel-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.funnel-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.funnel-aside img.funnel-qr {
  width: 110px;
  height: 110px;
  border-radius: 12px;
  background: #fff;
  padding: 6px;
  border: 1px solid var(--line);
}

@media (max-width: 720px) {
  .game-grid { grid-template-columns: 1fr; }
  .daily-challenge-grid { grid-template-columns: 1fr; }
  .funnel-card { grid-template-columns: 1fr; text-align: center; }
  .funnel-card .funnel-points { text-align: left; max-width: 320px; margin: 0 auto; }
  .funnel-aside { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}

/* ── Donation milestone modal ────────────────────── */
.sp-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(32, 23, 19, 0.42);
  backdrop-filter: blur(3px);
}

.sp-modal-backdrop.is-open {
  display: flex;
}

.sp-modal {
  position: relative;
  width: min(440px, 100%);
  padding: 30px 28px 26px;
  border-radius: calc(var(--radius) + 2px);
  background:
    radial-gradient(circle at top right, rgba(239, 181, 77, 0.18), transparent 42%),
    linear-gradient(150deg, rgba(255, 253, 248, 0.99), rgba(248, 238, 224, 0.99));
  border: 1px solid var(--line);
  box-shadow: 0 40px 90px rgba(32, 23, 19, 0.3);
  text-align: center;
  animation: sp-pop 0.22s ease;
}

@keyframes sp-pop {
  from { transform: translateY(14px) scale(0.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.sp-modal .sp-emoji { font-size: 2.6rem; line-height: 1; }

.sp-modal h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  margin: 12px 0 8px;
}

.sp-modal p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 20px;
}

.sp-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sp-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(32, 23, 19, 0.06);
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.sp-modal-close:hover { background: rgba(32, 23, 19, 0.12); }

.sp-dismiss-link {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}

/* ── SEO prose blocks ────────────────────────────── */
.seo-prose {
  max-width: 760px;
  margin: 0 auto;
}

.seo-prose h2 {
  font-family: var(--serif);
  letter-spacing: -0.02em;
  font-size: 1.7rem;
  margin: 0 0 12px;
}

.seo-prose h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  margin: 22px 0 8px;
}

.seo-prose p,
.seo-prose li {
  color: var(--muted);
  line-height: 1.74;
}

.seo-prose ul,
.seo-prose ol {
  padding-left: 20px;
  display: grid;
  gap: 8px;
}
