/* PlayNook shared effects + larger boards. Loaded after site.css so it can refine it. */

/* ---------- motion primitives ---------- */
@keyframes fx-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes fx-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
@keyframes fx-flash {
  0% { box-shadow: 0 0 0 0 rgb(232 195 106 / 0.85); }
  100% { box-shadow: 0 0 0 18px rgb(232 195 106 / 0); }
}
@keyframes fx-drop {
  0% { transform: translateY(-26px) scale(0.86); opacity: 0; }
  70% { transform: translateY(0) scale(1.06); opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}
@keyframes fx-rise {
  0% { transform: translateY(8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes fx-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgb(232 195 106 / 0.0); }
  50% { box-shadow: 0 0 14px 2px rgb(232 195 106 / 0.75); }
}
@keyframes fx-wiggle {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(-5deg); }
  70% { transform: rotate(5deg); }
}

.fx-pop { animation: fx-pop 0.34s ease; }
.fx-shake { animation: fx-shake 0.42s ease; }
.fx-flash { animation: fx-flash 0.5s ease; }
.fx-drop { animation: fx-drop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
.fx-rise { animation: fx-rise 0.3s ease; }
.fx-glow { animation: fx-glow 1.2s ease infinite; }
.fx-wiggle { animation: fx-wiggle 0.4s ease; }

@media (prefers-reduced-motion: reduce) {
  .fx-pop, .fx-shake, .fx-flash, .fx-drop, .fx-rise, .fx-glow, .fx-wiggle { animation: none; }
}

/* ---------- confetti ---------- */
#fx-confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 70;
  display: none;
}

/* ---------- celebration banner ---------- */
.fx-banner {
  position: fixed;
  left: 50%;
  top: 4.5rem;
  z-index: 80;
  transform: translate(-50%, -1.5rem) scale(0.92);
  opacity: 0;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.4), opacity 0.32s ease;
  box-shadow: 0 18px 40px -22px rgb(0 0 0 / 0.6);
}
.fx-banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.fx-banner-win { background: #0d3d32; color: #e8fff6; border: 2px solid #f0c14b; }
.fx-banner-lose { background: #4a1230; color: #ffe8f2; border: 2px solid #ff4d9a; }
.fx-banner-info { background: oklch(var(--b1)); color: oklch(var(--bc)); border: 2px solid oklch(var(--b3)); }

/* ---------- mute toggle ---------- */
.fx-mute {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid oklch(var(--b3));
  background: rgb(8 14 24 / 0.92);
  color: #f0c14b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 10px 24px -18px rgb(0 0 0 / 0.55);
}
.fx-mute.off { opacity: 0.6; }

/* ---------- defeat / draw ---------- */
@keyframes fx-vignette-in {
  0% { opacity: 0; }
  18% { opacity: 1; }
  100% { opacity: 0; }
}
.fx-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 65;
  opacity: 0;
}
.fx-vignette-lose {
  background: radial-gradient(120% 90% at 50% 50%, transparent 38%, rgb(138 59 47 / 0.55) 100%);
}
.fx-vignette-win {
  background: radial-gradient(120% 90% at 50% 50%, transparent 42%, rgb(63 107 79 / 0.45) 100%);
}
.fx-vignette.show { animation: fx-vignette-in 1.6s ease forwards; }

@keyframes fx-lost {
  0% { filter: none; }
  30% { filter: grayscale(0.75) brightness(0.86); }
  100% { filter: none; }
}
.fx-lost { animation: fx-lost 1.1s ease; }

.fx-banner-lose { box-shadow: 0 0 42px -6px rgb(138 59 47 / 0.85); }

/* ---------- shared interactive polish ---------- */
.sq,
.ws-cell,
.c4-cell,
.rv-cell,
.mem-card,
.hg-key,
.glyph-key,
.mn-cell,
.tt-cell,
.cw-cell,
.bingo-cell,
.tw-tile {
  transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.sq:active,
.c4-cell:active,
.rv-cell:active,
.mem-card:active,
.hg-key:active,
.glyph-key:active,
.mn-cell:active,
.tt-cell:active,
.tw-tile:active { transform: scale(0.94); }

.cw-cell.active { box-shadow: inset 0 0 0 2px #c48a4a; }
.rv-cell.legal { animation: fx-glow 1.4s ease infinite; }
.mem-card.up { box-shadow: inset 0 0 0 2px oklch(var(--a)); }
.bingo-cell.daubed { animation: fx-pop 0.32s ease; }
.glyph-tile.correct { animation: fx-pop 0.36s ease; }
.ws-cell.found { animation: fx-pop 0.3s ease; }
.mn-cell.open { animation: fx-rise 0.22s ease; }

/* ---------- larger boards ---------- */
.chess-board { width: min(100%, 38rem); }

.sudoku-grid {
  grid-template-columns: repeat(9, var(--sudoku-cell, 3rem));
  --sudoku-cell: clamp(1.9rem, 6.4vw, 3rem);
  border-width: 3px;
}
.sudoku-grid input {
  width: var(--sudoku-cell, 3rem);
  height: var(--sudoku-cell, 3rem);
  font-size: calc(var(--sudoku-cell, 3rem) * 0.46);
}
.sudoku-grid input:focus { outline: 2px solid oklch(var(--a)); outline-offset: -2px; }

.ws-grid { width: min(100%, 34rem); gap: 4px; }
.ws-cell { font-size: clamp(0.7rem, 2.9vw, 1.05rem); }

.glyph-board { width: min(100%, 26rem); }

.cw-grid { grid-template-columns: repeat(11, var(--cw-cell, 2.6rem)); }
.cw-cell { width: var(--cw-cell, 2.6rem); height: var(--cw-cell, 2.6rem); }
.cw-grid { --cw-cell: clamp(1.55rem, 5vw, 2.6rem); }
.cw-cell input { font-size: calc(var(--cw-cell, 2.6rem) * 0.56); }

.c4-board {
  grid-template-columns: repeat(7, var(--c4-cell, 3.4rem));
  grid-template-rows: repeat(6, var(--c4-cell, 3.4rem));
  --c4-cell: clamp(1.95rem, 7.2vw, 3.4rem);
}
.c4-cell { width: var(--c4-cell, 3.4rem); height: var(--c4-cell, 3.4rem); }

.mem-board {
  --mem-cols: 6;
  --mem-cell: clamp(2.1rem, 8vw, 3.9rem);
  --mem-gap: clamp(0.28rem, 1vw, 0.5rem);
  display: grid;
  grid-template-columns: repeat(var(--mem-cols), minmax(0, 1fr));
  gap: var(--mem-gap);
  width: min(100%, calc(var(--mem-cols) * var(--mem-cell) + (var(--mem-cols) - 1) * var(--mem-gap)));
  container-type: inline-size;
}
.mem-card {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1.14;
  font-size: calc(48cqi / var(--mem-cols));
}

.mn-board { --mn-cell: clamp(1.5rem, 4.6vw, 2.3rem); }
.mn-cell { width: var(--mn-cell, 2.3rem); height: var(--mn-cell, 2.3rem); font-size: calc(var(--mn-cell, 2.3rem) * 0.46); }

.rv-board {
  grid-template-columns: repeat(8, var(--rv-cell, 3.1rem));
  grid-template-rows: repeat(8, var(--rv-cell, 3.1rem));
  --rv-cell: clamp(1.9rem, 6.4vw, 3.1rem);
}
.rv-cell { width: var(--rv-cell, 3.1rem); height: var(--rv-cell, 3.1rem); }

.tt-board {
  grid-template-columns: repeat(3, var(--tt-cell, 5.2rem));
  grid-template-rows: repeat(3, var(--tt-cell, 5.2rem));
  --tt-cell: clamp(3.4rem, 13vw, 5.2rem);
}
.tt-cell { width: var(--tt-cell, 5.2rem); height: var(--tt-cell, 5.2rem); font-size: calc(var(--tt-cell, 5.2rem) * 0.46); }

.ludo-grid {
  grid-template-columns: repeat(15, var(--ludo-cell, 1.85rem));
  grid-template-rows: repeat(15, var(--ludo-cell, 1.85rem));
  --ludo-cell: clamp(1.05rem, 4.1vw, 1.85rem);
}
.ludo-cell[data-mark]::after { font-size: calc(var(--ludo-cell, 1.85rem) * 0.34); }
.ludo-cell.yard-label, .ludo-cell.home-label { font-size: calc(var(--ludo-cell, 1.85rem) * 0.36); }

.sn-stage { width: min(100%, 34rem); }
.sn-cell { font-size: clamp(0.5rem, 1.6vw, 0.72rem); }
.sn-tokens {
  position: absolute;
  inset: 4px;
  pointer-events: none;
  z-index: 4;
}

.sn-token {
  position: absolute;
  width: 7.4%;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  border: 2px solid #1c1814;
  box-shadow: 0 0 0 2px #f7f1e4, 0 3px 7px rgb(0 0 0 / 0.4);
  transform: translate(-50%, -50%);
  transition: left 0.26s ease, top 0.26s ease, transform 0.2s ease;
}
.sn-token.p0 { background: radial-gradient(circle at 34% 30%, #f0a06a, #c45c26 70%); }
.sn-token.p1 { background: radial-gradient(circle at 34% 30%, #6d6a63, #1c1814 70%); }

.sn-token.stack-0 { transform: translate(-50%, -50%) translate(-34%, -32%); }
.sn-token.stack-1 { transform: translate(-50%, -50%) translate(34%, 32%); }

@keyframes sn-token-pop {
  0%, 100% { scale: 1; }
  50% { scale: 1.3; }
}
.sn-token.sn-land { animation: sn-token-pop 0.3s ease; }

.bingo-card {
  grid-template-columns: repeat(5, var(--bingo-cell, clamp(2.4rem, 8vw, 3.6rem)));
  --bingo-cell: clamp(2.4rem, 8vw, 3.6rem);
}
.bingo-cell { width: var(--bingo-cell, 3.6rem); height: var(--bingo-cell, 3.6rem); font-size: calc(var(--bingo-cell, 3.6rem) * 0.42); }

.hg-gallows { font-size: clamp(0.8rem, 2.2vw, 1.15rem); }
.hg-word { font-size: clamp(1.5rem, 4.5vw, 2.4rem); }
.hg-key { width: clamp(1.8rem, 5.4vw, 2.5rem); height: clamp(1.8rem, 5.4vw, 2.5rem); font-size: clamp(0.7rem, 2vw, 0.95rem); }
.hg-keys { max-width: 30rem; }

.glyph-key { height: clamp(2.2rem, 6vw, 3rem); min-width: clamp(1.5rem, 4vw, 2.1rem); }

.tt-cell { font-family: "Fraunces", Georgia, serif; }

.nook-die {
  --die: 4.5rem;
  width: var(--die);
  height: var(--die);
  perspective: 720px;
  cursor: pointer;
  user-select: none;
  transform-style: preserve-3d;
  filter: drop-shadow(0 10px 12px rgb(28 24 20 / 0.28));
}
.nook-die-cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}
.nook-die-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 0.5rem;
  gap: 0.08rem;
  background:
    linear-gradient(155deg, #fffaf0 0%, #f4ead8 55%, #e8d9bc 100%);
  border: 2px solid #1c1814;
  border-radius: 0.7rem;
  box-shadow: inset 0 0 0 1px rgb(28 24 20 / 0.08);
  backface-visibility: hidden;
}
.nook-die-face-1 { transform: rotateY(0deg) translateZ(calc(var(--die) / 2)); }
.nook-die-face-2 { transform: rotateY(90deg) translateZ(calc(var(--die) / 2)); }
.nook-die-face-3 { transform: rotateX(-90deg) translateZ(calc(var(--die) / 2)); }
.nook-die-face-4 { transform: rotateX(90deg) translateZ(calc(var(--die) / 2)); }
.nook-die-face-5 { transform: rotateY(-90deg) translateZ(calc(var(--die) / 2)); }
.nook-die-face-6 { transform: rotateY(180deg) translateZ(calc(var(--die) / 2)); }
.nook-die-pip {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  margin: auto;
  background: transparent;
}
.nook-die-pip.on {
  background: radial-gradient(circle at 35% 30%, #4a4036, #1c1814 70%);
  box-shadow: 0 1px 1px rgb(0 0 0 / 0.25);
}
.nook-die.rolling {
  animation: nook-die-toss 0.95s ease;
}
@keyframes nook-die-toss {
  0% { transform: translateY(0) scale(1); }
  28% { transform: translateY(-14px) scale(1.06); }
  100% { transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .nook-die.rolling { animation: none; }
  .nook-die-cube { transition: none !important; }
}

.ludo-dice.nook-die {
  display: block;
  width: var(--die);
  height: var(--die);
  border: 0;
  background: transparent;
  border-radius: 0;
  font-size: 0;
  box-shadow: none;
  overflow: visible;
}

.game-table:has(.sol-table) {
  overflow: visible;
}
.game-table:has(.sol-table) .card-body {
  overflow: visible;
  padding-bottom: 1.4rem;
}

.sol-table {
  --sol-gap: clamp(0.22rem, 1vw, 0.5rem);
  --sol-fan: clamp(0.62rem, 3.1cqw, 1.12rem);
  container-type: inline-size;
  display: grid;
  gap: 0.8rem var(--sol-gap);
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
  overflow: visible;
}
.sol-stock-row {
  display: contents;
}
.sol-found {
  display: contents;
}
.sol-pile {
  position: relative;
  min-width: 0;
  width: 100%;
}
.sol-waste {
  position: relative;
  grid-column: span 2;
  min-width: 0;
  width: 100%;
  overflow: visible;
}
.sol-waste::before {
  content: "";
  display: block;
  width: calc((100% - var(--sol-gap)) / 2);
  aspect-ratio: 1 / 1.4;
}
.sol-waste .sol-card,
.sol-waste .sol-slot {
  position: absolute;
  left: 0;
  top: 0;
  width: calc((100% - var(--sol-gap)) / 2);
}
.sol-col {
  position: relative;
  min-width: 0;
  width: 100%;
}
.sol-card,
.sol-slot {
  width: 100%;
  aspect-ratio: 1 / 1.4;
  height: auto;
  border-radius: 0.45rem;
  border: 1px solid #1c1814;
  box-sizing: border-box;
  container-type: inline-size;
}
.sol-slot {
  background: color-mix(in oklab, oklch(var(--p)) 12%, #efe6d2);
  border-style: dashed;
  opacity: 0.7;
}
.sol-card {
  position: relative;
  background: #f7f1e4;
  box-shadow: 0 2px 0 #1c1814, 0 6px 12px -8px rgb(0 0 0 / 0.45);
  cursor: grab;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
.sol-card.back { cursor: pointer; }
.sol-col .sol-card { position: absolute; left: 0; width: 100%; }
.sol-card.back {
  background:
    repeating-linear-gradient(45deg, #3f6b4f 0 6px, #345a43 6px 12px),
    #3f6b4f;
  border-color: #1c1814;
}
.sol-card.back::after {
  content: "PN";
  position: absolute;
  inset: 18%;
  border: 1px solid #f4ead8;
  border-radius: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f4ead8;
  font-family: "Fraunces", Georgia, serif;
  font-size: 22cqi;
  font-weight: 700;
}
.sol-card.red { color: #9a3b2f; }
.sol-card.black { color: #1c1814; }
.sol-card.on { outline: 3px solid #e8c36a; outline-offset: -3px; }
.sol-card.dragging { opacity: 0.38; pointer-events: none; }
.sol-card .sol-rank {
  position: absolute;
  top: 0.18rem;
  left: 0.28rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 26cqi;
  font-weight: 700;
  line-height: 1;
}
.sol-card .sol-suit {
  position: absolute;
  right: 0.22rem;
  bottom: 0.12rem;
  font-size: 34cqi;
  line-height: 1;
}
.sol-card .sol-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42cqi;
}
.sol-hot {
  outline: 2px dashed #c45c26;
  outline-offset: 3px;
  border-radius: 0.55rem;
}
.sol-ghost {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  filter: drop-shadow(0 12px 16px rgb(0 0 0 / 0.35));
}
.sol-ghost .sol-card {
  position: absolute;
  left: 0;
  cursor: grabbing;
}
body.sol-dragging,
body.sol-dragging .sol-card { cursor: grabbing; }

.dm-wrap { display: flex; flex-direction: column; gap: 0.85rem; }
.dm-rack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 3.2rem;
}
.dm-house .dm-tile { cursor: default; }
.dm-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  min-height: 4.6rem;
  padding: 0.7rem;
  border-radius: 0.8rem;
  background: color-mix(in oklab, oklch(var(--p)) 10%, #efe6d2);
  border: 1px solid oklch(var(--b3));
}
.dm-tile {
  --dm-w: 2.4rem;
  --dm-h: 4.5rem;
  width: var(--dm-w);
  height: var(--dm-h);
  border-radius: 0.4rem;
  border: 1.5px solid #1c1814;
  background: linear-gradient(180deg, #fffaf0, #efe0c4);
  box-shadow: 0 2px 0 #1c1814;
  display: grid;
  grid-template-rows: 1fr 2px 1fr;
  cursor: pointer;
  position: relative;
  padding: 0.18rem;
}
.dm-tile.across {
  width: var(--dm-h);
  height: var(--dm-w);
  grid-template-rows: none;
  grid-template-columns: 1fr 2px 1fr;
}
.dm-tile.back {
  background: repeating-linear-gradient(45deg, #3f6b4f 0 5px, #345a43 5px 10px);
  cursor: default;
}
.dm-tile.back .dm-half, .dm-tile.back .dm-bar { visibility: hidden; }
.dm-tile.on { outline: 3px solid #c45c26; outline-offset: 1px; }
.dm-bar { background: #1c1814; }
.dm-half {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}
.dm-pip {
  width: 0.42rem;
  height: 0.42rem;
  margin: auto;
  border-radius: 999px;
  background: transparent;
}
.dm-pip.on { background: #1c1814; }

.mj-stage {
  width: 100%;
  overflow: visible;
}
.mj-board {
  --mj-w: clamp(1.7rem, 4.6vw, 2.9rem);
  --mj-h: calc(var(--mj-w) * 1.28);
  position: relative;
  width: 100%;
  min-height: calc(var(--mj-h) * 8.2);
}
.mj-board[data-level="easy"] { min-height: calc(var(--mj-h) * 5.2); }
.mj-board[data-level="medium"] { min-height: calc(var(--mj-h) * 6.4); }
.mj-board[data-level="hard"] { min-height: calc(var(--mj-h) * 8.2); }
.mj-board[data-level="expert"] { min-height: calc(var(--mj-h) * 8.6); }
.mj-board[data-level="master"] { min-height: calc(var(--mj-h) * 9.6); }
.mj-tile {
  position: absolute;
  width: var(--mj-w);
  height: var(--mj-h);
  border: 1.5px solid #1c1814;
  border-radius: 0.35rem;
  background: linear-gradient(165deg, #fffdf6, #efe4c8 70%);
  box-shadow: 2px 3px 0 #1c1814;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  font-family: "Fraunces", Georgia, serif;
  line-height: 1;
}
.mj-tile::before {
  content: "";
  position: absolute;
  left: 0.18rem;
  top: 0.28rem;
  bottom: 0.28rem;
  width: 0.18rem;
  border-radius: 999px;
  background: #c45c26;
  opacity: 0.55;
}
.mj-tile.blocked { filter: brightness(0.86); cursor: default; }
.mj-tile.free:hover { transform: translateY(-2px); }
.mj-tile.on { outline: 3px solid #c45c26; outline-offset: -2px; z-index: 20 !important; }
.mj-glyph { font-size: calc(var(--mj-w) * 0.48); }
.mj-label { font-size: calc(var(--mj-w) * 0.22); opacity: 0.7; margin-top: 0.12rem; }
.mj-dot { font-size: calc(var(--mj-w) * 0.22); letter-spacing: 0.04em; }
.mj-dots { color: #9a3b2f; }
.mj-bam { color: #3f6b4f; }
.mj-char { color: #3d6b8a; }
.mj-flower { color: #8a5a2b; }
.mj-wind { color: #1c1814; }
.mj-dragon { color: #1c1814; }
.mj-red { color: #9a3b2f; }
.mj-green { color: #3f6b4f; }

.ht-wrap { display: flex; flex-direction: column; gap: 0.7rem; }
.ht-scores {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.ht-score {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0.6rem;
  border: 1px solid oklch(var(--b3));
  font-size: 0.85rem;
}
.ht-score.you { background: color-mix(in oklab, oklch(var(--p)) 12%, #efe6d2); }
.ht-score.win { outline: 2px solid #e8c36a; }
.ht-table {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 0.4rem;
  min-height: 12rem;
  padding: 0.6rem;
  border-radius: 0.9rem;
  background: color-mix(in oklab, oklch(var(--p)) 10%, #efe6d2);
  border: 1px solid oklch(var(--b3));
}
.ht-north { grid-column: 2; grid-row: 1; justify-self: center; }
.ht-west { grid-column: 1; grid-row: 2; align-self: center; }
.ht-east { grid-column: 3; grid-row: 2; align-self: center; justify-self: end; }
.ht-south { grid-column: 2; grid-row: 3; justify-self: center; }
.ht-trick {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  min-height: 6.4rem;
}
.ht-seat { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.ht-name { font-size: 0.72rem; opacity: 0.7; }
.ht-seat .ht-card { width: 2.2rem; pointer-events: none; }
.ht-card {
  width: 3.2rem;
  aspect-ratio: 1 / 1.4;
  border-radius: 0.4rem;
  border: 1px solid #1c1814;
  background: #f7f1e4;
  box-shadow: 0 2px 0 #1c1814;
  position: relative;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  container-type: inline-size;
}
.ht-card.red { color: #9a3b2f; }
.ht-card.black { color: #1c1814; }
.ht-card.on { outline: 3px solid #e8c36a; outline-offset: -3px; }
.ht-card.back {
  background: repeating-linear-gradient(45deg, #3f6b4f 0 6px, #345a43 6px 12px);
  cursor: default;
}
.ht-card.back::after {
  content: "PN";
  position: absolute;
  inset: 18%;
  border: 1px solid #f4ead8;
  border-radius: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f4ead8;
  font-family: "Fraunces", Georgia, serif;
  font-size: 22cqi;
  font-weight: 700;
}
.ht-rank {
  position: absolute;
  top: 0.18rem;
  left: 0.22rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 26cqi;
  font-weight: 700;
  line-height: 1;
}
.ht-suit {
  position: absolute;
  right: 0.18rem;
  bottom: 0.1rem;
  font-size: 32cqi;
}
.ht-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40cqi;
}
.ht-played {
  position: absolute;
  width: 2.8rem;
  cursor: default;
  left: 50%;
  top: 50%;
}
.ht-played.ht-south { transform: translate(-50%, 18%); }
.ht-played.ht-north { transform: translate(-50%, -118%); }
.ht-played.ht-west { transform: translate(-150%, -50%); }
.ht-played.ht-east { transform: translate(50%, -50%); }
.ht-hand {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.28rem;
}

.gf-wrap, .e8-wrap, .yt-wrap { display: flex; flex-direction: column; gap: 0.75rem; }
.gf-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; font-size: 0.9rem; }
.gf-seat.you { font-weight: 700; }
.gf-pond { opacity: 0.75; }
.gf-books { font-size: 0.85rem; opacity: 0.85; }
.gf-book-row + .gf-book-row { margin-top: 0.2rem; }

.e8-table { display: flex; align-items: center; justify-content: center; gap: 1.2rem; min-height: 6rem; }
.e8-discard { min-width: 3.2rem; min-height: 4.4rem; }
.e8-wild {
  position: absolute;
  right: 0.2rem;
  top: 0.15rem;
  font-size: 0.85rem;
}
.e8-suits { display: flex; justify-content: center; gap: 0.4rem; }
.e8-suits button {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid #1c1814;
  background: #f7f1e4;
  font-size: 1.2rem;
  cursor: pointer;
}

.yt-dice { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem; }
.yt-die-wrap {
  --die: 3.4rem;
  width: var(--die);
  height: var(--die);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.yt-die-wrap .nook-die { --die: 3.4rem; }
.yt-die-wrap.held { outline: 3px solid #e8c36a; outline-offset: 4px; border-radius: 0.8rem; }
.yt-sheet { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.yt-sheet th, .yt-sheet td { padding: 0.28rem 0.4rem; border-bottom: 1px solid oklch(var(--b3)); text-align: left; }
.yt-sheet td { text-align: center; width: 4.5rem; }
.yt-score {
  min-width: 2.4rem;
  border-radius: 999px;
  border: 1px solid #1c1814;
  background: #f7f1e4;
  cursor: pointer;
  font-size: 0.85rem;
}
.yt-score:disabled { opacity: 0.45; cursor: default; }

.mc-board {
  display: grid;
  grid-template-columns: 4.2rem 1fr 4.2rem;
  gap: 0.55rem;
  align-items: stretch;
  padding: 0.7rem;
  border-radius: 1rem;
  background: color-mix(in oklab, oklch(var(--p)) 12%, #efe6d2);
  border: 1px solid oklch(var(--b3));
}
.mc-rows { display: flex; flex-direction: column; gap: 0.45rem; }
.mc-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.35rem; }
.mc-pit, .mc-store {
  position: relative;
  min-height: 4.4rem;
  border-radius: 999px;
  border: 1.5px solid #1c1814;
  background: #efe0c4;
  overflow: hidden;
}
.mc-pit { cursor: pointer; }
.mc-pit:disabled { cursor: default; opacity: 0.92; }
.mc-store { border-radius: 1.4rem; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mc-count { position: relative; z-index: 1; font-family: "Fraunces", Georgia, serif; font-weight: 700; }
.mc-lab { font-size: 0.7rem; opacity: 0.7; }
.mc-seeds { position: absolute; inset: 0; }
.mc-seeds span {
  position: absolute;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  left: var(--x);
  top: var(--y);
  background: radial-gradient(circle at 30% 30%, #c45c26, #7a3214);
}

.gm-board {
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  width: min(100%, 32rem);
  aspect-ratio: 1 / 1;
  background: #c9a36a;
  border: 6px solid #3a2a1c;
  border-radius: 0.6rem;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.2);
}
.gm-cell {
  border: 0;
  background:
    linear-gradient(#3a2a1c, #3a2a1c) center / 100% 1px no-repeat,
    linear-gradient(#3a2a1c, #3a2a1c) center / 1px 100% no-repeat,
    transparent;
  cursor: pointer;
  position: relative;
}
.gm-cell.black::after,
.gm-cell.white::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 999px;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.35);
}
.gm-cell.black::after { background: radial-gradient(circle at 32% 28%, #555, #111); }
.gm-cell.white::after { background: radial-gradient(circle at 32% 28%, #fff, #d8d0c4); }

.tfe-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  width: min(100%, 22rem);
  aspect-ratio: 1 / 1;
  gap: 0.45rem;
  padding: 0.55rem;
  border-radius: 0.9rem;
  background: #1a2438;
  outline: none;
}
.tfe-cell {
  border-radius: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 4.2vw, 1.6rem);
  background: #0e1624;
  color: #f4ead8;
}
.tfe-2 { background: #3d4c68; }
.tfe-4 { background: #3a5a78; }
.tfe-8 { background: #c45c26; color: #fff; }
.tfe-16 { background: #d46a2c; color: #fff; }
.tfe-32 { background: #e07a38; color: #fff; }
.tfe-64 { background: #e45a2a; color: #fff; }
.tfe-128, .tfe-256, .tfe-512 { background: #e8c36a; color: #1a1204; }
.tfe-1024, .tfe-2048, .tfe-4096 { background: #f0c14b; color: #1a1204; box-shadow: 0 0 16px rgb(240 193 75 / 0.45); }

.cb-rows { display: flex; flex-direction: column; gap: 0.4rem; }
.cb-row { display: flex; align-items: center; gap: 0.4rem; }
.cb-peg, .cb-swatch {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  border: 2px solid #f4ead8;
  background: rgb(255 255 255 / 0.08);
}
.cb-swatch { cursor: pointer; }
.cb-pick { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cb-fb { display: grid; grid-template-columns: repeat(2, 0.55rem); gap: 0.18rem; margin-left: 0.4rem; }
.cb-fb i { width: 0.5rem; height: 0.5rem; border-radius: 999px; background: #f4ead8; display: block; }
.cb-fb i.on { background: #1c1814; }
.cb-fb i.off { background: #f4ead8; border: 1px solid #1c1814; }

.peg-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: min(100%, 22rem);
  aspect-ratio: 1 / 1;
  gap: 0.35rem;
}
.peg-cell {
  border: 0;
  border-radius: 999px;
  background: #3a2a1c;
  box-shadow: inset 0 0 0 3px #1c1814;
  cursor: pointer;
}
.peg-cell.off { visibility: hidden; }
.peg-cell.filled {
  background: radial-gradient(circle at 32% 28%, #f0c14b, #a36b12);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.4);
}
.peg-cell.sel { outline: 3px solid #3cf0d0; }
.peg-cell.legal { box-shadow: 0 0 0 3px #3cf0d0; }

.war-table { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 28rem; }
.war-card {
  min-height: 8.5rem;
  border-radius: 0.7rem;
  border: 2px solid #f4ead8;
  background: #f7f1e4;
  color: #1c1814;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fraunces", Georgia, serif;
  font-size: 2.2rem;
  font-weight: 700;
}
.war-card.red { color: #a1262c; }
.war-card.empty { background: #123d2e; border-style: dashed; color: transparent; }

.pig-table {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  max-width: 28rem;
}
.pig-score {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pig-score strong { font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif; font-size: 1.8rem; color: #f0c14b; }

.ftn-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 20rem);
  aspect-ratio: 1 / 1;
  gap: 0.4rem;
  padding: 0.45rem;
  background: #1a2438;
  border-radius: 0.8rem;
}
.ftn-tile {
  border: 0;
  border-radius: 0.4rem;
  background: #f0c14b;
  color: #1a1204;
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  cursor: pointer;
}
.ftn-tile.gap { background: #0e1624; cursor: default; color: transparent; }

.smn-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(100%, 16rem);
  aspect-ratio: 1 / 1;
  gap: 0.55rem;
  padding: 0.55rem;
  border-radius: 50%;
  background: #10182a;
  border: 6px solid #1c1814;
}
.smn-pad {
  border: 0;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.12s ease, filter 0.12s ease;
}
.smn-pad:nth-child(1) { background: #2ecc71; border-radius: 100% 8% 8% 8%; }
.smn-pad:nth-child(2) { background: #e74c3c; border-radius: 8% 100% 8% 8%; }
.smn-pad:nth-child(3) { background: #f1c40f; border-radius: 8% 8% 8% 100%; }
.smn-pad:nth-child(4) { background: #3498db; border-radius: 8% 8% 100% 8%; }
.smn-pad.on { opacity: 1; filter: brightness(1.25); }

.dots-board {
  display: grid;
  width: min(100%, 22rem);
  aspect-ratio: 1 / 1;
  gap: 0;
}
.dots-dot {
  width: 0.7rem;
  height: 0.7rem;
  margin: auto;
  border-radius: 999px;
  background: #f4ead8;
  border: 0;
  padding: 0;
}
.dots-h, .dots-v {
  border: 0;
  background: rgb(255 255 255 / 0.12);
  cursor: pointer;
  padding: 0;
}
.dots-h { height: 0.4rem; align-self: center; width: 100%; }
.dots-v { width: 0.4rem; justify-self: center; height: 100%; }
.dots-h.on.p1, .dots-v.on.p1 { background: #f0c14b; }
.dots-h.on.p2, .dots-v.on.p2 { background: #3cf0d0; }
.dots-box { border: 0; background: transparent; }
.dots-box.p1 { background: rgb(240 193 75 / 0.35); }
.dots-box.p2 { background: rgb(60 240 208 / 0.28); }

.nim-heap { display: flex; flex-wrap: wrap; gap: 0.35rem; max-width: 22rem; }
.nim-stick {
  width: 0.45rem;
  height: 4.2rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #f0c14b, #8a5a12);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.35);
}

.bj-table { display: grid; gap: 1.2rem; max-width: 28rem; }
.bj-hand { display: flex; flex-wrap: wrap; gap: 0.4rem; min-height: 5.2rem; }
.bj-card {
  min-width: 3.2rem;
  padding: 0.7rem 0.55rem;
  border-radius: 0.45rem;
  background: #f7f1e4;
  color: #1c1814;
  border: 2px solid #1c1814;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
}
.bj-card.red { color: #a1262c; }

.lo-board {
  display: grid;
  grid-template-columns: repeat(var(--lo-n, 5), minmax(0, 1fr));
  width: min(100%, 18rem);
  aspect-ratio: 1 / 1;
  gap: 0.35rem;
}
.lo-cell {
  border: 0;
  border-radius: 0.4rem;
  background: #1a2438;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.08);
}
.lo-cell.on {
  background: #f0c14b;
  box-shadow: 0 0 12px rgb(240 193 75 / 0.45);
}

.jb-mix {
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  letter-spacing: 0.28em;
  color: #f0c14b;
}

.snp-table { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 22rem; }

.flt-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  width: min(100%, 22rem);
  aspect-ratio: 1 / 1;
  gap: 3px;
  background: #0a3a4a;
  padding: 4px;
  border-radius: 0.5rem;
}
.flt-cell {
  border: 0;
  background: #145c6e;
  cursor: pointer;
  border-radius: 0.15rem;
}
.flt-cell.miss { background: #0e1624; }
.flt-cell.hit { background: #e74c3c; }

.sb-lids { display: flex; flex-wrap: wrap; gap: 0.4rem; max-width: 24rem; }
.sb-lid {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.45rem;
  border: 2px solid #f0c14b;
  background: #f0c14b;
  color: #1a1204;
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  cursor: pointer;
}
.sb-lid.shut { background: #1a2438; color: #667; border-color: #334; }
.sb-lid.pick { outline: 3px solid #3cf0d0; }

.hn-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  width: min(100%, 26rem);
  min-height: 14rem;
}
.hn-peg {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.18rem;
  min-height: 14rem;
  padding: 0.5rem 0.3rem 0.8rem;
  border: 0;
  background: rgb(255 255 255 / 0.04);
  border-radius: 0.6rem;
  cursor: pointer;
}
.hn-peg.hold { outline: 2px solid #f0c14b; }
.hn-pole {
  position: absolute;
  bottom: 0.5rem;
  width: 0.35rem;
  height: 85%;
  background: #f4ead8;
  border-radius: 999px;
  opacity: 0.35;
}
.hn-disk {
  position: relative;
  z-index: 1;
  height: 1.1rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #f0c14b, #c4891a);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.35);
}

.fl-board {
  display: grid;
  grid-template-columns: repeat(var(--fl-n, 10), minmax(0, 1fr));
  width: min(100%, 22rem);
  aspect-ratio: 1 / 1;
  gap: 2px;
  border-radius: 0.4rem;
  overflow: hidden;
}
.fl-picks { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.fl-swatch {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 2px solid #f4ead8;
  cursor: pointer;
}

.rx-pad {
  width: min(100%, 16rem);
  aspect-ratio: 1 / 1;
  border-radius: 1rem;
  border: 0;
  background: #1a2438;
  color: #d7e6ff;
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.rx-pad.go { background: #f0c14b; color: #1a1204; box-shadow: 0 0 28px rgb(240 193 75 / 0.5); }
.rx-pad.bad { background: #e74c3c; color: #fff; }

.sm-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(10, minmax(0, 1fr));
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  gap: 3px;
}
.sm-cell {
  border: 0;
  border-radius: 0.2rem;
  cursor: pointer;
  min-height: 0;
}
.sm-cell.empty { background: transparent; cursor: default; }

.mz-board {
  display: grid;
  grid-template-columns: repeat(var(--mz-n, 13), minmax(0, 1fr));
  width: min(100%, 24rem);
  aspect-ratio: 1 / 1;
  background: #0a241c;
  outline: none;
}
.mz-cell { background: #145c45; }
.mz-cell.wall { background: #071410; }
.mz-cell.you { background: #f0c14b; box-shadow: inset 0 0 0 2px #1a1204; }
.mz-cell.exit { background: #3cf0d0; }
.mz-cell.start { box-shadow: inset 0 0 0 2px rgb(240 193 75 / 0.4); }

.nook-how {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: rgb(14 22 36 / 0.72);
  border: 1px solid rgb(240 193 75 / 0.22);
}
.nook-how h2 {
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f0c14b;
  margin: 0 0 0.4rem;
}
.nook-how ol {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.8rem;
  line-height: 1.5;
  opacity: 0.88;
}
.nook-how ol li + li { margin-top: 0.2rem; }
.nook-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  margin-top: 0.65rem;
  font-size: 0.72rem;
  opacity: 0.82;
}
.nook-swatch {
  display: inline-block;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 0.15rem;
  vertical-align: -0.08rem;
  margin-right: 0.28rem;
  box-shadow: inset 0 0 0 1px rgb(244 234 216 / 0.25);
}
.nook-pad {
  display: grid;
  grid-template-columns: repeat(3, 2.6rem);
  grid-template-rows: repeat(3, 2.6rem);
  gap: 0.35rem;
  margin-top: 0.85rem;
  width: max-content;
}
.nook-pad button {
  border: 0;
  border-radius: 0.45rem;
  background: #1a2438;
  color: #f0c14b;
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
}
.nook-pad button:disabled { opacity: 0.35; cursor: default; }
.nook-pad .nook-pad-up { grid-column: 2; grid-row: 1; }
.nook-pad .nook-pad-left { grid-column: 1; grid-row: 2; }
.nook-pad .nook-pad-right { grid-column: 3; grid-row: 2; }
.nook-pad .nook-pad-down { grid-column: 2; grid-row: 3; }
.nook-goal {
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3cf0d0;
  margin: 0 0 0.75rem;
}

.flw-board {
  display: grid;
  grid-template-columns: repeat(var(--flw-n, 6), minmax(0, 1fr));
  width: min(100%, 22rem);
  aspect-ratio: 1 / 1;
  gap: 3px;
  background: #0e1624;
  padding: 4px;
  border-radius: 0.5rem;
  touch-action: none;
  user-select: none;
}
.flw-cell {
  position: relative;
  border-radius: 0.25rem;
  background: #1a2438;
  min-height: 0;
}
.flw-cell.path { box-shadow: inset 0 0 0 1px rgb(244 234 216 / 0.2); }
.flw-cell.draw { filter: brightness(1.18); }
.flw-cell.node::after {
  content: "";
  position: absolute;
  inset: 22%;
  border-radius: 999px;
  background: #f4ead8;
  box-shadow: 0 0 0 3px rgb(14 22 36 / 0.45);
  pointer-events: none;
}

.arr-board {
  display: grid;
  grid-template-columns: repeat(var(--arr-n, 6), minmax(0, 1fr));
  width: min(100%, 22rem);
  aspect-ratio: 1 / 1;
  gap: 4px;
}
.arr-cell {
  border: 0;
  border-radius: 0.4rem;
  background: #121a28;
  color: #6a7a90;
  font-size: 1.45rem;
  cursor: pointer;
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
}
.arr-cell.empty { cursor: default; background: #0b1220; }
.arr-cell.blocked { color: #8aa0b8; background: #1a2438; }
.arr-cell.ready { background: #145c45; color: #f0c14b; box-shadow: 0 0 10px rgb(240 193 75 / 0.28); }

.psh-board {
  display: grid;
  grid-template-columns: repeat(var(--psh-c, 7), minmax(0, 1fr));
  grid-template-rows: repeat(var(--psh-r, 6), minmax(0, 1fr));
  width: min(100%, 22rem);
  aspect-ratio: calc(var(--psh-c, 7) / var(--psh-r, 6));
  gap: 2px;
  background: #0a241c;
  outline: none;
}
.psh-cell { background: #145c45; position: relative; }
.psh-cell.wall { background: #071410; }
.psh-cell.goal { background: #3a5a28; box-shadow: inset 0 0 0 3px #f0c14b; }
.psh-cell.crate { background: #c4891a; border-radius: 0.2rem; }
.psh-cell.crate-ok { background: #f0c14b; }
.psh-cell.you { box-shadow: inset 0 0 0 3px #3cf0d0; }
.psh-cell.step { outline: 2px solid rgb(60 240 208 / 0.55); outline-offset: -2px; cursor: pointer; }

.nook-portrait,
.twr-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.nook-portrait-play,
.twr-play {
  width: min(100%, 22rem);
  margin-inline: auto;
}
.nook-portrait-how,
.twr-how { margin-top: 0; }
.nook-portrait-stage {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: min(72vh, 40rem);
  height: auto;
  background: #0e1624;
  border-radius: 0.6rem;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
}
.twr-stage {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: min(72vh, 40rem);
  height: auto;
  background: #0e1624;
  border-radius: 0.6rem;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
@media (min-width: 768px) {
  .nook-portrait,
  .twr-layout {
    flex-direction: row;
    align-items: stretch;
    gap: 1.25rem;
  }
  .nook-portrait-play,
  .twr-play {
    width: min(100%, 22rem);
    margin-inline: 0;
    flex: 0 0 auto;
  }
  .nook-portrait-how,
  .twr-how {
    flex: 1 1 0;
    min-width: 12rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
}
.twr-hold {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.4rem;
  display: flex;
  flex-direction: column-reverse;
}
.twr-floor {
  position: relative;
  height: 1.15rem;
  margin-top: 2px;
  background: linear-gradient(180deg, #f0c14b, #c4891a);
  border-radius: 0.15rem;
}
.twr-floor.live { background: linear-gradient(180deg, #3cf0d0, #1a8a78); }
.twr-floor.perfect {
  background: linear-gradient(180deg, #fff3c4, #f0c14b);
  animation: twr-perfect 0.5s ease;
  box-shadow: 0 0 14px rgb(240 193 75 / 0.85);
}
@keyframes twr-perfect {
  0% { filter: brightness(2.1); transform: scaleX(1.04); }
  100% { filter: brightness(1); transform: scaleX(1); }
}
.twr-bonus {
  position: absolute;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #ffe9a8;
  text-shadow: 0 0 12px rgb(240 193 75 / 0.9);
  pointer-events: none;
  animation: twr-bonus 0.9s ease forwards;
}
@keyframes twr-bonus {
  0% { opacity: 0; transform: translate(-50%, 0.6rem) scale(0.8); }
  25% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -1.8rem) scale(1); }
}

.ch-board {
  display: grid;
  grid-template-columns: repeat(var(--ch-n, 5), minmax(0, 1fr));
  width: min(100%, 22rem);
  aspect-ratio: 1 / 1;
  gap: 2px;
}
.ch-cell {
  border: 0;
  background: transparent;
  color: #9ab;
  font-size: 1.1rem;
}
.ch-cell.isle {
  border-radius: 999px;
  background: #1a2438;
  color: #f4ead8;
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px #f0c14b;
}
.ch-cell.isle.ok { background: #145c45; }
.ch-cell.isle.sel { outline: 3px solid #3cf0d0; }
.ch-cell.isle.hint { box-shadow: inset 0 0 0 2px #f0c14b, 0 0 10px rgb(240 193 75 / 0.35); }
.ch-cell.sea { cursor: default; }
.ch-cell.sea.bridge { color: #3cf0d0; }

.pp-board {
  display: grid;
  grid-template-columns: repeat(var(--pp-n, 5), minmax(0, 1fr));
  width: min(100%, 22rem);
  aspect-ratio: 1 / 1;
  gap: 4px;
}
.pp-cell {
  position: relative;
  border: 0;
  border-radius: 0.35rem;
  background: #1a2438;
  color: #7a8aa0;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}
.pp-arm {
  position: absolute;
  background: currentColor;
  pointer-events: none;
}
.pp-arm.n { left: 38%; right: 38%; top: 0; height: 58%; }
.pp-arm.s { left: 38%; right: 38%; bottom: 0; height: 58%; }
.pp-arm.e { top: 38%; bottom: 38%; right: 0; width: 58%; }
.pp-arm.w { top: 38%; bottom: 38%; left: 0; width: 58%; }
.pp-hub {
  position: absolute;
  inset: 30%;
  border-radius: 999px;
  background: currentColor;
  pointer-events: none;
}
.pp-cell.in { box-shadow: inset 0 0 0 3px #3cf0d0; }
.pp-cell.out { box-shadow: inset 0 0 0 3px #f0c14b; }
.pp-cell.live { color: #3cf0d0; background: #0d3d32; }
.pp-cell.wet { color: #3cf0d0; background: #12382f; }
.pp-cell.in::before,
.pp-cell.out::before {
  position: absolute;
  left: 0.2rem;
  top: 0.15rem;
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  color: #f4ead8;
  opacity: 0.9;
}
.pp-cell.in::before { content: "IN"; }
.pp-cell.out::before { content: "OUT"; }

.ub-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  width: min(100%, 22rem);
  aspect-ratio: 1 / 1;
  gap: 3px;
  background: #1a2438;
  padding: 4px;
  border-radius: 0.4rem;
  position: relative;
}
.ub-cell { border: 0; background: #0e1624; cursor: pointer; border-radius: 0.2rem; }
.ub-cell.car { background: #4d7cff; }
.ub-cell.gold { background: #f0c14b; }
.ub-cell.sel { outline: 2px solid #3cf0d0; outline-offset: -1px; }
.ub-cell.lane { background: #16324a; box-shadow: inset 0 0 0 1px rgb(60 240 208 / 0.35); }
.ub-cell.exit {
  box-shadow: inset -4px 0 0 #3cf0d0;
  background-image: linear-gradient(90deg, transparent 60%, rgb(60 240 208 / 0.28));
}
.ub-exit-tag {
  font-family: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: #3cf0d0;
  margin: 0.35rem 0 0;
  width: min(100%, 22rem);
  text-align: right;
  text-transform: uppercase;
}

.m3-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(10, minmax(0, 1fr));
  width: 100%;
  height: 100%;
  gap: 3px;
}
.m3-cell { border: 0; border-radius: 0.3rem; cursor: pointer; min-height: 0; }
.m3-cell.sel { outline: 3px solid #f4ead8; outline-offset: -1px; }
.m3-cell.nbr { outline: 2px dashed rgb(244 234 216 / 0.55); outline-offset: -2px; }

.tet-board {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: repeat(20, minmax(0, 1fr));
  width: 100%;
  height: 100%;
  gap: 1px;
  background: #070b12;
}
.tet-cell {
  min-height: 0;
  background: #0e1624;
  border-radius: 1px;
}
.tet-cell.ghost {
  box-shadow: inset 0 0 0 1px rgb(244 234 216 / 0.28);
  background: rgb(244 234 216 / 0.08);
}
.tet-cell.live,
.tet-cell.lock {
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.28);
}
