:root {
  --nook-ink: #070b14;
  --nook-paper: #e8f4ff;
  --nook-leaf: #145c45;
  --nook-gold: #f0c14b;
  --nook-neon: #3cf0d0;
  --nook-hot: #ff4d9a;
  --nook-felt: #0c3b2e;
}

[data-theme="night"] {
  --p: 0.86 0.16 92;
  --pf: 0.78 0.16 92;
  --pc: 0.18 0.04 92;
  --s: 0.72 0.2 350;
  --sf: 0.64 0.2 350;
  --sc: 0.98 0.02 350;
  --a: 0.82 0.14 175;
  --af: 0.74 0.14 175;
  --ac: 0.16 0.04 175;
  --b1: 0.18 0.03 250;
  --b2: 0.15 0.028 250;
  --b3: 0.12 0.024 250;
  --bc: 0.9 0.02 250;
}

html, body {
  font-family: "Exo 2", ui-sans-serif, system-ui, sans-serif;
}

.arcade-body {
  background-color: #070b14;
  background-image:
    radial-gradient(1200px 520px at 8% -8%, rgb(240 193 75 / 0.16), transparent 58%),
    radial-gradient(900px 480px at 108% 0%, rgb(60 240 208 / 0.12), transparent 52%),
    radial-gradient(700px 400px at 50% 120%, rgb(255 77 154 / 0.1), transparent 55%),
    linear-gradient(180deg, #070b14 0%, #0b1624 42%, #071410 100%);
  color: #e8f0ff;
}

.nook-title,
.nook-brand {
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-optical-sizing: auto;
  letter-spacing: 0.04em;
}

.nook-wallet {
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  margin-right: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgb(240 193 75 / 0.45);
  background: rgb(12 20 36 / 0.7);
  color: var(--nook-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nook-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  margin-right: 0.4rem;
  border-radius: 0.45rem;
  background: linear-gradient(145deg, #f0c14b, #c4891a);
  color: #1a1204;
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  box-shadow: 0 0 16px rgb(240 193 75 / 0.45);
}

.nook-mist {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(70% 50% at 50% 0%, rgb(240 193 75 / 0.08), transparent 60%),
    radial-gradient(40% 40% at 90% 80%, rgb(60 240 208 / 0.07), transparent 70%);
  z-index: 0;
}

.arcade-scan {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.07;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgb(0 0 0 / 0.35) 2px 3px
  );
}

.arcade-nav {
  background: rgb(8 12 22 / 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgb(240 193 75 / 0.28);
  box-shadow: 0 10px 40px rgb(0 0 0 / 0.35);
}

.arcade-menu a {
  color: #d7e6ff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
}

.arcade-menu a:hover {
  color: var(--nook-gold);
  background: rgb(240 193 75 / 0.08);
}

.arcade-kicker {
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--nook-neon);
}

.arcade-panel {
  background: #10182a;
  border: 1px solid rgb(240 193 75 / 0.25);
}

.hero-nook {
  position: relative;
  overflow: hidden;
}

.hero-nook::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0%, rgb(240 193 75 / 0.05) 50%, transparent 100%),
    repeating-linear-gradient(90deg, transparent 0 46px, rgb(255 255 255 / 0.03) 46px 47px),
    repeating-linear-gradient(0deg, transparent 0 46px, rgb(255 255 255 / 0.03) 46px 47px);
  mask-image: radial-gradient(80% 70% at 50% 30%, #000 40%, transparent 80%);
  pointer-events: none;
}

.hero-card {
  background:
    linear-gradient(180deg, rgb(16 28 44 / 0.92), rgb(10 40 32 / 0.92));
  border: 1px solid rgb(240 193 75 / 0.4);
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow:
    0 0 0 1px rgb(60 240 208 / 0.12),
    0 24px 60px -28px rgb(0 0 0 / 0.85),
    inset 0 0 40px rgb(240 193 75 / 0.05);
}

.hero-card li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.hero-card li::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--nook-neon);
  box-shadow: 0 0 10px var(--nook-neon);
  flex-shrink: 0;
}

.game-card {
  display: block;
  position: relative;
  background:
    linear-gradient(165deg, rgb(18 28 48 / 0.95), rgb(10 22 28 / 0.95));
  border: 1px solid rgb(140 170 210 / 0.16);
  border-radius: 1.1rem;
  padding: 1.2rem 1.3rem 1.35rem;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.game-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--nook-gold), var(--nook-neon), var(--nook-hot));
  opacity: 0.75;
}

.game-card:hover {
  transform: translateY(-5px) scale(1.01);
  border-color: rgb(240 193 75 / 0.55);
  box-shadow:
    0 18px 40px -22px rgb(0 0 0 / 0.8),
    0 0 28px rgb(240 193 75 / 0.18);
}

.game-card .play-chip {
  display: inline-block;
  margin-top: 0.9rem;
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--nook-gold);
}

.ad-slot {
  border: 1px dashed rgb(240 193 75 / 0.28);
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 8px, rgb(255 255 255 / 0.02) 8px, rgb(255 255 255 / 0.02) 16px),
    rgb(12 18 32 / 0.85);
  border-radius: 1rem;
}

.ad-slot-banner {
  padding: 0.9rem 1.1rem;
}

.ad-slot-rail {
  padding: 0.9rem 1rem;
}

.ad-rail {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ad-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 0.35rem;
}

.ad-brand {
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.arcade-foot {
  border-top: 1px solid rgb(240 193 75 / 0.28);
  background: linear-gradient(180deg, rgb(8 14 24 / 0.95), rgb(6 18 16 / 0.98));
}

.arcade-foot-bar {
  border-top: 1px solid rgb(240 193 75 / 0.16);
}

.game-table {
  background:
    radial-gradient(120% 80% at 50% 0%, rgb(240 193 75 / 0.08), transparent 45%),
    linear-gradient(180deg, #123d2e, #0a241c) !important;
  border: 1px solid rgb(240 193 75 / 0.45) !important;
  box-shadow:
    0 0 0 1px rgb(60 240 208 / 0.1),
    0 22px 50px -28px rgb(0 0 0 / 0.85),
    inset 0 0 80px rgb(0 0 0 / 0.28) !important;
}

.game-table .card-body {
  color: #e8f4ee;
}

.house-panel {
  background: linear-gradient(180deg, rgb(16 26 44 / 0.95), rgb(10 22 28 / 0.95));
  border: 1px solid rgb(240 193 75 / 0.28);
}

.stat-value {
  color: var(--nook-gold);
}

.btn-primary {
  box-shadow: 0 0 22px rgb(240 193 75 / 0.28);
}

.ad-copy {
  font-size: 0.9rem;
  opacity: 0.72;
  margin-top: 0.2rem;
}

.ad-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ad-cta {
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0.8;
}

.ad-slot-house {
  background: color-mix(in oklab, oklch(var(--p)) 8%, oklch(var(--b1)));
}

.chess-board,
.sudoku-grid,
.ws-grid,
.tw-board,
.cw-grid,
.bingo-card,
.glyph-board {
  user-select: none;
}

.game-table .card-body {
  overflow-x: hidden;
}

.chess-board {
  --cell: 12.5%;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  width: min(100%, 30rem);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  margin-inline: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 8px solid color-mix(in oklab, oklch(var(--p)) 55%, #3a2a1c);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.08);
  box-sizing: border-box;
  touch-action: manipulation;
  container-type: size;
}

.sq {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  font-family: inherit;
  font-size: clamp(0.85rem, 8cqi, 2.4rem);
  line-height: 1;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}

.sq.light { background: #f3e6c8; color: #1c1814; }
.sq.dark { background: #6b8f71; color: #1c1814; }

.sq .piece {
  pointer-events: none;
  width: 88%;
  height: 88%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1c1814;
  -webkit-text-fill-color: unset;
}

.sq .piece svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.sq .piece.white svg [fill],
.sq .piece.black svg [fill] {
  paint-order: fill stroke;
}
.sq.selected { outline: 3px solid oklch(var(--a)); outline-offset: -3px; }
.sq.legal::after {
  content: "";
  width: 28%;
  height: 28%;
  border-radius: 999px;
  background: rgb(40 60 45 / 0.28);
}
.sq.capture::after {
  width: 72%;
  height: 72%;
  border: 3px solid rgb(40 60 45 / 0.35);
  background: transparent;
  border-radius: 999px;
}
.sq.last { box-shadow: inset 0 0 0 100px rgb(250 204 21 / 0.22); }

.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(9, 2.4rem);
  width: max-content;
  border: 2px solid oklch(var(--bc) / 0.35);
}

.sudoku-grid input {
  width: 2.4rem;
  height: 2.4rem;
  text-align: center;
  font-size: 1.1rem;
  border: 1px solid oklch(var(--bc) / 0.12);
  background: oklch(var(--b1));
}

.sudoku-grid input:nth-child(9n+3),
.sudoku-grid input:nth-child(9n+6) {
  border-right-width: 2px;
  border-right-color: oklch(var(--bc) / 0.35);
}

.sudoku-grid input:nth-child(n+19):nth-child(-n+27),
.sudoku-grid input:nth-child(n+46):nth-child(-n+54) {
  border-bottom-width: 2px;
  border-bottom-color: oklch(var(--bc) / 0.35);
}

.sudoku-grid input.given {
  font-weight: 700;
  background: oklch(var(--b2));
}

.sudoku-grid input.bad {
  background: color-mix(in oklab, oklch(var(--er)) 22%, oklch(var(--b1)));
}

.ws-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(12, minmax(0, 1fr));
  width: min(100%, 420px);
  aspect-ratio: 1 / 1;
  gap: 3px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}

.ws-cell {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.35rem;
  background: oklch(var(--b2));
  font-size: clamp(0.65rem, 2.4vw, 0.9rem);
  font-weight: 700;
  pointer-events: none;
}

.ws-cell.hot { background: color-mix(in oklab, oklch(var(--a)) 45%, oklch(var(--b2))); }
.ws-cell.found { background: color-mix(in oklab, oklch(var(--su)) 40%, oklch(var(--b2))); }

.ws-list {
  font-size: 0.9rem;
}

.ws-list .done {
  text-decoration: line-through;
  opacity: 0.5;
}

.ws-custom-list {
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ws-custom-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

.glyph-board {
  display: grid;
  gap: 0.4rem;
  width: min(100%, 20rem);
}

.glyph-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
}

.glyph-tile {
  aspect-ratio: 1;
  border: 2px solid oklch(var(--b3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.35rem;
  text-transform: uppercase;
  border-radius: 0.4rem;
}

.glyph-tile.correct { background: #6aaa64; color: white; border-color: #6aaa64; }
.glyph-tile.present { background: #c9b458; color: white; border-color: #c9b458; }
.glyph-tile.absent { background: #787c7e; color: white; border-color: #787c7e; }

.glyph-keys {
  margin-top: 1rem;
  display: grid;
  gap: 0.35rem;
  width: min(100%, 32rem);
}

.glyph-keyrow {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
}

.glyph-key {
  min-width: 1.8rem;
  height: 2.6rem;
  padding: 0 0.45rem;
  border-radius: 0.4rem;
  background: oklch(var(--b2));
  font-weight: 700;
  font-size: 0.8rem;
}

.glyph-key.wide { min-width: 3.4rem; }
.glyph-key.correct { background: #6aaa64; color: white; }
.glyph-key.present { background: #c9b458; color: white; }
.glyph-key.absent { background: #787c7e; color: white; }

.tw-board {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  grid-template-rows: repeat(11, minmax(0, 1fr));
  width: min(100%, 520px);
  aspect-ratio: 1 / 1;
  height: auto;
  gap: 2px;
  background: #2f5d43;
  padding: 6px;
  border-radius: 0.75rem;
  box-sizing: border-box;
  container-type: inline-size;
}

.tw-cell {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  align-self: stretch;
  justify-self: stretch;
  aspect-ratio: auto;
  background: #f3ead4;
  color: #1c1814;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: clamp(0.7rem, 4.2cqi, 1rem);
  line-height: 1;
  position: relative;
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
}

.tw-cell.tw { background: #8ec5c3; }
.tw-cell.dw { background: #e8a0a0; }
.tw-cell.tl { background: #6aa8d8; }
.tw-cell.dl { background: #b7d4a8; }
.tw-cell.star { background: #e8c36a; }
.tw-cell.locked { background: #efe3c4; }
.tw-cell.pending { outline: 2px solid #c45c26; outline-offset: -2px; }

.tw-letter {
  font-weight: 800;
  line-height: 1;
}

.tw-val {
  position: absolute;
  right: 1px;
  bottom: 0;
  font-size: 0.48rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.85;
  pointer-events: none;
}

.tw-prem {
  font-size: clamp(0.42rem, 2.8cqi, 0.62rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  opacity: 0.88;
  text-transform: uppercase;
}

.tw-legend {
  width: min(100%, 520px);
}

.tw-rack {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tw-tile {
  position: relative;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.3rem;
  background: #efe0b8;
  border: 1px solid #cbb57a;
  color: #1c1814;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 0 #cbb57a;
}

.tw-tile .tw-val {
  font-size: 0.58rem;
  right: 2px;
  bottom: 1px;
}

.tw-tile.on { outline: 2px solid oklch(var(--p)); }

.cw-grid {
  display: grid;
  grid-template-columns: repeat(11, 2rem);
  width: max-content;
  border: 2px solid #222;
}

.cw-cell {
  width: 2rem;
  height: 2rem;
  border: 1px solid #333;
  position: relative;
  background: white;
}

.cw-cell.block { background: #222; }

.cw-cell input {
  width: 100%;
  height: 100%;
  border: 0;
  text-align: center;
  text-transform: uppercase;
  font-weight: 700;
  background: transparent;
}

.cw-cell .num {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 0.55rem;
  pointer-events: none;
}

.cw-cell.active { background: #fff3bf; }
.cw-cell.bad input { color: #b42318; }

.bingo-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.bingo-frame {
  border: 3px solid color-mix(in oklab, oklch(var(--p)) 70%, #3a2a1c);
  border-radius: 1rem;
  padding: 0.7rem 0.75rem 0.85rem;
  background: color-mix(in oklab, oklch(var(--b1)) 92%, oklch(var(--p)));
  box-shadow: 0 10px 24px -18px rgb(40 60 45 / 0.55);
}

.bingo-frame.won {
  border-color: oklch(var(--su));
  background: color-mix(in oklab, oklch(var(--su)) 12%, oklch(var(--b1)));
}

.bingo-frame.lost {
  opacity: 0.72;
}

.bingo-frame-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1rem;
  margin-bottom: 0.55rem;
  padding: 0 0.15rem;
}

.bingo-frame-head strong {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: oklch(var(--su));
}

.bingo-card {
  display: grid;
  grid-template-columns: repeat(5, 3.4rem);
  width: max-content;
  gap: 4px;
}

.bingo-call-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.6rem;
  gap: 0.85rem;
  align-items: start;
}

.bingo-pattern-carousel {
  padding: 0.55rem 0.5rem 0.65rem;
  border: 1px solid oklch(var(--b3));
  border-radius: 0.9rem;
  background: oklch(var(--b1));
  text-align: center;
}

.bingo-patterns-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
}

.bingo-pattern-stage {
  min-height: 5.6rem;
}

.bingo-pattern {
  margin: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  animation: pattern-swap 0.35s ease;
}

.bingo-pattern svg {
  width: 3.35rem;
  height: 3.35rem;
  display: block;
  flex: none;
}

@keyframes pattern-swap {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: none; }
}

.bingo-pattern .g {
  fill: none;
  stroke: oklch(var(--bc) / 0.35);
  stroke-width: 1.2;
}

.bingo-pattern .dots rect {
  fill: oklch(var(--b2));
  rx: 1;
}

.bingo-pattern .on rect {
  fill: oklch(var(--p));
  rx: 1;
}

.bingo-pattern figcaption {
  font-size: 0.68rem;
  opacity: 0.8;
  line-height: 1.2;
  width: 100%;
  min-height: 1.2em;
}

.bingo-cell {
  box-sizing: border-box;
  border: 0;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 0.5rem;
  background-color: oklch(var(--b2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.bingo-cell.head {
  background: oklch(var(--p));
  color: oklch(var(--pc));
  cursor: default;
}

.bingo-cell.daubed {
  background: color-mix(in oklab, oklch(var(--su)) 55%, oklch(var(--b2)));
  color: white;
}

.bingo-card .bingo-cell.win,
.bingo-card .bingo-cell.daubed.win {
  background-color: #e8c36a !important;
  color: #2a2418 !important;
  box-shadow: inset 0 0 0 3px #c45c26;
  opacity: 1;
  animation: bingo-win-pulse 0.9s ease-in-out infinite;
}

@keyframes bingo-win-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.bingo-confetti {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -12px;
  border-radius: 1px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% { transform: translate3d(0, -10px, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); opacity: 0.85; }
}

.bingo-called {
  min-height: 2.4rem;
  font-size: 0.85rem;
  opacity: 1;
}

.bingo-calls {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.35rem 0.7rem;
  align-items: start;
  width: 100%;
  max-width: 42rem;
}

.bingo-calls .letter {
  font-weight: 800;
  color: oklch(var(--p));
  line-height: 1.7;
}

.bingo-calls .nums {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-height: 1.7rem;
}

.bingo-calls .ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: oklch(var(--b2));
  font-weight: 700;
  font-size: 0.75rem;
}

.bingo-calls .ball.latest {
  background: oklch(var(--p));
  color: oklch(var(--pc));
}

.ludo-wrap, .sn-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.ludo-grid {
  display: grid;
  grid-template-columns: repeat(15, 1.35rem);
  grid-template-rows: repeat(15, 1.35rem);
  width: max-content;
  border: 4px solid color-mix(in oklab, oklch(var(--p)) 55%, #3a2a1c);
  border-radius: 0.6rem;
  overflow: hidden;
  background: #efe6d2;
}

.ludo-cell {
  position: relative;
  box-sizing: border-box;
  border: 1px solid rgb(40 40 30 / 0.12);
}

.ludo-cell.path { background: #f7f1e4; }
.ludo-cell.safe { background: #efe0b8; }
.ludo-cell.center { background: #d7c4a3; }
.ludo-cell.yard.r, .ludo-cell.run.r, .ludo-cell.start.r { background: color-mix(in oklab, #c45c26 35%, #f7f1e4); }
.ludo-cell.yard.g, .ludo-cell.run.g, .ludo-cell.start.g { background: color-mix(in oklab, #3f6b4f 35%, #f7f1e4); }
.ludo-cell.yard.y, .ludo-cell.run.y, .ludo-cell.start.y { background: color-mix(in oklab, #e8c36a 45%, #f7f1e4); }
.ludo-cell.yard.b, .ludo-cell.run.b, .ludo-cell.start.b { background: color-mix(in oklab, #3d6b8a 35%, #f7f1e4); }
.ludo-cell.pad { background: #fff; border-radius: 0.25rem; }

.ludo-cell[data-mark]::after {
  content: attr(data-mark);
  position: absolute;
  top: 0;
  left: 1px;
  font-size: 0.42rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  opacity: 0.85;
  pointer-events: none;
  z-index: 1;
}

.ludo-cell.yard-label,
.ludo-cell.home-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 0;
}

.ludo-cell.arrow-up::before,
.ludo-cell.arrow-down::before,
.ludo-cell.arrow-left::before,
.ludo-cell.arrow-right::before {
  content: "";
  position: absolute;
  inset: 28%;
  background: #1c1814;
  opacity: 0.35;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  pointer-events: none;
  z-index: 0;
}
.ludo-cell.arrow-down::before { transform: rotate(180deg); }
.ludo-cell.arrow-left::before { transform: rotate(-90deg); }
.ludo-cell.arrow-right::before { transform: rotate(90deg); }

.ludo-cell .token {
  position: absolute;
  inset: 12%;
  border-radius: 999px;
  border: 2px solid #1c1814;
  cursor: pointer;
  z-index: 2;
}
.ludo-cell .token.ready {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1c1814;
}
.ludo-cell.ludo-hop {
  box-shadow: inset 0 0 0 2px #1c1814;
}
.ludo-cell.ludo-target {
  box-shadow: inset 0 0 0 2px #c45c26;
  z-index: 1;
}
.ludo-ghost {
  position: absolute;
  inset: 22%;
  border-radius: 999px;
  border: 2px dashed #1c1814;
  opacity: 0.55;
  pointer-events: none;
  z-index: 2;
}

.ludo-help {
  list-style: decimal;
  padding-left: 1.1rem;
  max-width: 16rem;
  line-height: 1.45;
}

.ludo-dice {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  background: oklch(var(--b1));
  border: 2px solid oklch(var(--b3));
}

.ludo-scores { list-style: none; padding: 0; }
.ludo-scores li { display: flex; align-items: center; gap: 0.4rem; margin: 0.2rem 0; }
.ludo-scores .dot { width: 0.7rem; height: 0.7rem; border-radius: 999px; display: inline-block; }

.sn-stage {
  position: relative;
  width: min(100%, 26rem);
}

.sn-board {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: repeat(10, minmax(0, 1fr));
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 4px solid color-mix(in oklab, oklch(var(--p)) 55%, #3a2a1c);
  border-radius: 0.6rem;
  overflow: hidden;
  box-sizing: border-box;
}

.sn-paths {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.sn-ladder-rail {
  fill: none;
  stroke: #8a5a2b;
  stroke-width: 0.85;
  stroke-linecap: round;
}
.sn-ladder-rung {
  fill: none;
  stroke: #c48a4a;
  stroke-width: 0.7;
  stroke-linecap: round;
}
.sn-snake-body {
  fill: none;
  stroke: #9a3b2f;
  stroke-width: 2.15;
  stroke-linecap: round;
}
.sn-snake-head { fill: #9a3b2f; stroke: none; }
.sn-snake-eye { fill: #f7f1e4; stroke: none; }

.sn-cell {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  border: 1px solid rgb(40 40 30 / 0.12);
  position: relative;
  background: #f7f1e4;
  font-size: 0.58rem;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 1px;
  z-index: 1;
}

.sn-cell.ladder, .sn-cell.ladder-top { background: color-mix(in oklab, #8a5a2b 18%, #f7f1e4); }
.sn-cell.snake, .sn-cell.snake-tail { background: color-mix(in oklab, #9a3b2f 16%, #f7f1e4); }
.sn-mark {
  position: absolute;
  right: 1px;
  bottom: 1px;
  font-style: normal;
  font-size: 0.42rem;
  line-height: 1;
  letter-spacing: 0;
  opacity: 0.85;
}
.ladder-mark { color: #6b3f16; }
.snake-mark { color: #7a241c; }
.sn-cell.sn-hop {
  box-shadow: inset 0 0 0 2px #c45c26;
}

.c4-board {
  display: grid;
  grid-template-columns: repeat(7, 2.6rem);
  grid-template-rows: repeat(6, 2.6rem);
  width: max-content;
  gap: 4px;
  padding: 8px;
  border-radius: 0.9rem;
  background: #3d6b8a;
}

.c4-cell {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  border: 0;
  background: #f4ead8;
  cursor: pointer;
}
.c4-cell.p1 { background: #c45c26; }
.c4-cell.p2 { background: #e8c36a; }

.mem-board {
  display: grid;
  grid-template-columns: repeat(6, 3.2rem);
  gap: 0.45rem;
  width: max-content;
}

.mem-card {
  width: 3.2rem;
  height: 3.6rem;
  border-radius: 0.5rem;
  border: 1px solid oklch(var(--b3));
  background: oklch(var(--p));
  color: oklch(var(--pc));
  font-size: 1.3rem;
  cursor: pointer;
}
.mem-card.up { background: oklch(var(--b1)); color: oklch(var(--bc)); }
.mem-card.done { opacity: 0.55; }

.hg-gallows {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

.hg-word {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.6rem;
  letter-spacing: 0.2rem;
}

.hg-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-width: 22rem;
  margin-top: 0.75rem;
}

.hg-key {
  width: 2rem;
  height: 2rem;
  border-radius: 0.4rem;
  border: 1px solid oklch(var(--b3));
  background: oklch(var(--b2));
  font-weight: 700;
  cursor: pointer;
}
.hg-key.used { opacity: 0.35; }

.mn-board {
  display: grid;
  width: max-content;
  gap: 2px;
}

.mn-cell {
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  border-radius: 0.25rem;
  background: oklch(var(--p));
  color: oklch(var(--pc));
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.mn-cell.open { background: oklch(var(--b2)); color: oklch(var(--bc)); }
.mn-cell.flag { background: oklch(var(--a)); }
.mn-cell.mine { background: oklch(var(--er)); color: oklch(var(--erc)); }

.rv-board {
  display: grid;
  grid-template-columns: repeat(8, 2.4rem);
  grid-template-rows: repeat(8, 2.4rem);
  width: max-content;
  border: 6px solid #3a2a1c;
  border-radius: 0.6rem;
  overflow: hidden;
  background: #3f6b4f;
}

.rv-cell {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgb(20 40 28 / 0.25);
  background: #6b8f71;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.rv-cell.legal { box-shadow: inset 0 0 0 2px #efe0b8; }
.rv-disc {
  width: 72%;
  height: 72%;
  border-radius: 999px;
  border: 2px solid #1c1814;
}
.rv-disc.cream { background: #f4ead8; }
.rv-disc.ink { background: #1c1814; border-color: #f4ead8; }

.tt-board {
  display: grid;
  grid-template-columns: repeat(3, 4.2rem);
  grid-template-rows: repeat(3, 4.2rem);
  width: max-content;
  gap: 6px;
}

.tt-cell {
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 0.6rem;
  border: 2px solid oklch(var(--b3));
  background: oklch(var(--b1));
  font-family: "Fraunces", Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 640px) {
  .sudoku-grid { grid-template-columns: repeat(9, 2rem); }
  .sudoku-grid input { width: 2rem; height: 2rem; }
  .bingo-card { grid-template-columns: repeat(5, 2.8rem); }
  .bingo-cell { width: 2.8rem; height: 2.8rem; }
  .bingo-call-row { grid-template-columns: 1fr; }
  .ludo-grid { grid-template-columns: repeat(15, 1.05rem); grid-template-rows: repeat(15, 1.05rem); }
  .sn-board { width: 100%; }
  .game-table .card-body { padding: 0.85rem; }
  .chess-board { border-width: 5px; width: 100%; }
}
