/* ludo.css — game shell, Ludo board, dice, tokens, multiplayer and the
   long-form content components. Board-scoped rules use the lb- prefix so
   generic names never leak onto content pages. */

:root {
  --lb-red: #dc2626;
  --lb-red-dark: #991b1b;
  --lb-green: #16a34a;
  --lb-green-dark: #14532d;
  --lb-yellow: #eab308;
  --lb-yellow-dark: #854d0e;
  --lb-blue: #2563eb;
  --lb-blue-dark: #1e3a8a;
  --gold: #fbbf24;
}

/* ── Game shell ─────────────────────────────────────────────────────────── */
.game-shell {
  --lb-bg: #fdfaf3;
  --lb-cell: #ffffff;
  --lb-cell-border: #d6cfc2;
  --lb-yard-inner: #fffdf8;
  --lb-glyph: #b3a893;
  --shell-bg: radial-gradient(ellipse at center, #276749 0%, #1d5238 70%, #16402c 100%);
  background: var(--shell-bg);
  border-radius: var(--radius, 10px);
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  position: relative;
}
.game-shell.board-classic { --shell-bg: radial-gradient(ellipse at center, #276749 0%, #1d5238 70%, #16402c 100%); }
.game-shell.board-night   { --shell-bg: radial-gradient(ellipse at center, #2a3350 0%, #1c2333 70%, #131826 100%); --lb-bg:#232b3f; --lb-cell:#2e3852; --lb-cell-border:#414d6e; --lb-yard-inner:#283148; --lb-glyph:#5c6b94; }
.game-shell.board-wood    { --shell-bg: radial-gradient(ellipse at center, #9c6b3f 0%, #7a4e2e 70%, #5e3a20 100%); --lb-bg:#f7ead6; --lb-cell:#fffaf0; --lb-cell-border:#d9c3a3; --lb-yard-inner:#fdf5e8; }
.game-shell.board-felt    { --shell-bg: radial-gradient(ellipse at center, #1e7a44 0%, #1a6b3c 70%, #14532d 100%); }
.game-shell.board-sky     { --shell-bg: radial-gradient(ellipse at center, #3b82f6 0%, #2563eb 70%, #1d4ed8 100%); --lb-bg:#eff6ff; --lb-cell:#ffffff; --lb-cell-border:#bfdbfe; --lb-yard-inner:#f8fbff; }
.game-shell.board-rose    { --shell-bg: radial-gradient(ellipse at center, #e05a72 0%, #c0392b 70%, #96281d 100%); --lb-bg:#fff1f2; --lb-cell:#ffffff; --lb-cell-border:#fecdd3; --lb-yard-inner:#fff7f7; }
/* Variant-identity themes (the "Auto" board picks these per game) */
.game-shell.board-cloth   { --shell-bg: radial-gradient(ellipse at center, #b3742f 0%, #935c22 70%, #6f451a 100%); --lb-bg:#f3e2c3; --lb-cell:#fbf0da; --lb-cell-border:#cfa96b; --lb-yard-inner:#f8ecd6; --lb-glyph:#a97f3f; }
.game-shell.board-vintage { --shell-bg: radial-gradient(ellipse at center, #27466e 0%, #1f3a5f 70%, #152a47 100%); --lb-bg:#f5efdd; --lb-cell:#fffdf2; --lb-cell-border:#b9ad8d; --lb-yard-inner:#faf6e9; --lb-glyph:#8b95b0; }
.game-shell.board-birch   { --shell-bg: radial-gradient(ellipse at center, #8fa8ba 0%, #74909f 70%, #5c7889 100%); --lb-bg:#f6efe3; --lb-cell:#fcf8ef; --lb-cell-border:#d8c9ac; --lb-yard-inner:#faf5eb; --lb-glyph:#b19d76; }
.game-shell.board-parchment { --shell-bg: radial-gradient(ellipse at center, #b3402f 0%, #96281d 70%, #6f1d15 100%); --lb-bg:#f7f0c9; --lb-cell:#ffffff; --lb-cell-border:#57534e; --lb-yard-inner:#fbf6dd; --lb-glyph:#8c8460; }
.game-shell.board-uckers  { --shell-bg: radial-gradient(ellipse at center, #7a4e2e 0%, #5e3a20 70%, #472b16 100%); --lb-bg:#e9a95d; --lb-cell:#f7d9a8; --lb-cell-border:#c9853f; --lb-yard-inner:#f9e4bd; --lb-glyph:#b3813f; }

.game-shell:fullscreen {
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: auto;
  padding: 1rem clamp(1rem, 4vw, 3rem);
}
.game-shell:fullscreen #board-wrap { flex: 1; display: flex; align-items: center; justify-content: center; max-width: none; aspect-ratio: auto; }
.game-shell:fullscreen .ludo-board { max-width: min(92vh, 780px); }

/* Toolbar */
.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.game-stats { display: flex; gap: 1.1rem; color: #fff; font-variant-numeric: tabular-nums; }
.game-stats > span { display: flex; flex-direction: column; line-height: 1.15; }
.game-stats .stat-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.75; }
.game-stats span span:last-child { font-weight: 700; font-size: 1rem; }
.game-buttons { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.btn-felt {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 0.42rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font, inherit);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-felt:hover { background: rgba(255, 255, 255, 0.22); }
.btn-felt:active { background: rgba(255, 255, 255, 0.3); }
.btn-felt-primary { background: var(--gold); border-color: var(--gold); color: #78350f; }
.btn-felt-primary:hover { background: #f59e0b; }
.btn-felt, .ludo-die, .ludo-mini-die, .ludo-chip, .rating-star {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

/* ── The board ──────────────────────────────────────────────────────────── */
/* board-wrap reserves the board's height BEFORE the JS-built SVG lands, so the
   content below never jumps (CLS). The engine injects a square SVG + a dice bar;
   the aspect-ratio here is tuned to be a hair taller than that combined height so
   the reserved box is never smaller than the finished board. Mobile overrides it
   below (the fixed-height dice bar is a bigger fraction of a small board). */
#board-wrap {
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  aspect-ratio: 1 / 1.12;
}
.ludo-board {
  width: 100%;
  max-width: 640px;
  position: relative;
  touch-action: manipulation;      /* kill the 300ms tap delay + double-tap zoom */
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
.ludo-svg { width: 100%; height: auto; display: block; border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); touch-action: manipulation; }

.lb-bg { fill: var(--lb-bg); }
.lb-cell { fill: var(--lb-cell); stroke: var(--lb-cell-border); stroke-width: 1; }
.lb-cell.lb-safe { fill: color-mix(in srgb, var(--lb-cell) 80%, var(--lb-glyph) 20%); }
.lb-fill-red { fill: var(--lb-red); }
.lb-fill-green { fill: var(--lb-green); }
.lb-fill-yellow { fill: var(--lb-yellow); }
.lb-fill-blue { fill: var(--lb-blue); }
.lb-cell.lb-home.lb-fill-red { fill: color-mix(in srgb, var(--lb-red) 55%, var(--lb-cell) 45%); stroke: var(--lb-red); }
.lb-cell.lb-home.lb-fill-green { fill: color-mix(in srgb, var(--lb-green) 55%, var(--lb-cell) 45%); stroke: var(--lb-green); }
.lb-cell.lb-home.lb-fill-yellow { fill: color-mix(in srgb, var(--lb-yellow) 55%, var(--lb-cell) 45%); stroke: var(--lb-yellow); }
.lb-cell.lb-home.lb-fill-blue { fill: color-mix(in srgb, var(--lb-blue) 55%, var(--lb-cell) 45%); stroke: var(--lb-blue); }
.lb-yard-fill { opacity: 0.92; }
.lb-yard.lb-inactive .lb-yard-fill { opacity: 0.25; }
.lb-yard.lb-inactive .lb-spot { opacity: 0.3; }
.lb-yard-inner { fill: var(--lb-yard-inner); }
.lb-spot { fill: var(--lb-yard-inner); stroke: var(--lb-cell-border); stroke-width: 1.5; }
.lb-spot-red { stroke: var(--lb-red); }
.lb-spot-green { stroke: var(--lb-green); }
.lb-spot-yellow { stroke: var(--lb-yellow); }
.lb-spot-blue { stroke: var(--lb-blue); }
.lb-tri { stroke: rgba(0, 0, 0, 0.15); stroke-width: 1; }
.lb-glyph { fill: var(--lb-glyph); font-size: 19px; font-family: var(--font, sans-serif); pointer-events: none; }
.lb-arrow { fill: rgba(255, 255, 255, 0.9); font-size: 17px; font-weight: 700; font-family: var(--font, sans-serif); pointer-events: none; }
/* Variant board-style extras */
.lb-num { fill: #64748b; font-size: 11px; font-weight: 600; font-family: var(--font, sans-serif); pointer-events: none; font-variant-numeric: tabular-nums; }
.lb-safe-disc { fill: #cbd5e1; stroke: #94a3b8; stroke-width: 1; pointer-events: none; }
.lb-connector { fill: none; stroke: color-mix(in srgb, var(--lb-glyph) 70%, transparent); stroke-width: 2; }
.lb-cell.lb-arm-red { fill: color-mix(in srgb, var(--lb-red) 32%, var(--lb-cell) 68%); stroke: color-mix(in srgb, var(--lb-red) 45%, var(--lb-cell-border) 55%); }
.lb-cell.lb-arm-green { fill: color-mix(in srgb, var(--lb-green) 32%, var(--lb-cell) 68%); stroke: color-mix(in srgb, var(--lb-green) 45%, var(--lb-cell-border) 55%); }
.lb-cell.lb-arm-yellow { fill: color-mix(in srgb, var(--lb-yellow) 32%, var(--lb-cell) 68%); stroke: color-mix(in srgb, var(--lb-yellow) 45%, var(--lb-cell-border) 55%); }
.lb-cell.lb-arm-blue { fill: color-mix(in srgb, var(--lb-blue) 32%, var(--lb-cell) 68%); stroke: color-mix(in srgb, var(--lb-blue) 45%, var(--lb-cell-border) 55%); }

/* Tokens */
.lb-token { cursor: default; transition: transform 0.12s linear; -webkit-tap-highlight-color: transparent; }
/* Invisible, finger-sized hit area layered under each token so taps register
   even though the painted token is small on a phone. */
.lb-token-hit { fill: transparent; pointer-events: all; }
.lb-token-shadow { fill: rgba(0, 0, 0, 0.25); pointer-events: none; }
.lb-token-body { stroke-width: 2.5; }
.lb-token-dot { fill: rgba(255, 255, 255, 0.85); }
.lb-token-red .lb-token-body { fill: var(--lb-red); stroke: var(--lb-red-dark); }
.lb-token-green .lb-token-body { fill: var(--lb-green); stroke: var(--lb-green-dark); }
.lb-token-yellow .lb-token-body { fill: var(--lb-yellow); stroke: var(--lb-yellow-dark); }
.lb-token-blue .lb-token-body { fill: var(--lb-blue); stroke: var(--lb-blue-dark); }
.ludo-board[data-tokens="flat"] .lb-token-dot { fill: rgba(0, 0, 0, 0.18); }
.ludo-board[data-tokens="flat"] .lb-token-shadow { display: none; }
.ludo-board[data-tokens="outline"] .lb-token-body { fill: var(--lb-cell); }
.ludo-board[data-tokens="outline"].ludo-board .lb-token-red .lb-token-dot { fill: var(--lb-red); }
.ludo-board[data-tokens="outline"].ludo-board .lb-token-green .lb-token-dot { fill: var(--lb-green); }
.ludo-board[data-tokens="outline"].ludo-board .lb-token-yellow .lb-token-dot { fill: var(--lb-yellow); }
.ludo-board[data-tokens="outline"].ludo-board .lb-token-blue .lb-token-dot { fill: var(--lb-blue); }

.lb-token.can-move { cursor: pointer; }
/* A movable token is draggable: claim the touch so a drag doesn't scroll the page. */
.lb-token.can-move .lb-token-hit { touch-action: none; cursor: grab; }
.lb-token.can-move .lb-token-body { animation: lbPulse 1.1s ease-in-out infinite; }
.lb-token.hint-glow .lb-token-body { animation: lbHint 0.55s ease-in-out 3; }
.lb-token.done { opacity: 0.85; }
.lb-token.moving { transition: transform 0.1s linear; }
.lb-token.dragging { cursor: grabbing; }
.lb-token.dragging .lb-token-body { animation: none; stroke-width: 3.5; }
.lb-token.dragging .lb-token-hit { cursor: grabbing; }
.lb-token.shake { animation: lbShake 0.3s; }
/* Landing markers double as drop targets: tapping one plays the move, and a
   token dragged onto one snaps home. A finger-sized transparent hit ring sits
   under the visible dashed marker. */
.lb-target { fill: none; stroke: var(--gold); stroke-width: 3; stroke-dasharray: 5 4; opacity: 0.9; pointer-events: none; animation: lbSpin 4s linear infinite; transform-box: fill-box; transform-origin: center; }
.lb-target-hit { fill: transparent; pointer-events: all; touch-action: none; cursor: pointer; }
.lb-target.drop-hot { opacity: 1; stroke-width: 4.5; fill: color-mix(in srgb, var(--gold) 28%, transparent); }

@keyframes lbPulse { 0%, 100% { stroke-width: 2.5; } 50% { stroke-width: 6; } }
@keyframes lbHint { 0%, 100% { stroke: var(--gold); stroke-width: 3; } 50% { stroke: var(--gold); stroke-width: 8; } }
@keyframes lbShake { 0%, 100% { translate: 0 0; } 25% { translate: -4px 0; } 75% { translate: 4px 0; } }
@keyframes lbSpin { to { transform: rotate(360deg); } }

.no-animations .lb-token,
.no-animations .lb-token.can-move .lb-token-body,
.no-animations .lb-target { animation: none !important; transition: none !important; }

/* ── Dice bar ───────────────────────────────────────────────────────────── */
.ludo-dicebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.ludo-turnlabel { color: #fff; font-size: 0.9rem; font-weight: 600; min-height: 1.3em; }
.ludo-die {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  background: #fff;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 9px;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.12s;
  place-items: center;
}
.ludo-die:active { transform: scale(0.94); }
.ludo-die.rolling { animation: dieWobble 0.25s linear infinite; }
.ludo-die.idle { animation: dieBeckon 1.4s ease-in-out infinite; }
.ludo-die-c-red { box-shadow: 0 0 0 3px var(--lb-red), 0 4px 10px rgba(0,0,0,.35); }
.ludo-die-c-green { box-shadow: 0 0 0 3px var(--lb-green), 0 4px 10px rgba(0,0,0,.35); }
.ludo-die-c-yellow { box-shadow: 0 0 0 3px var(--lb-yellow), 0 4px 10px rgba(0,0,0,.35); }
.ludo-die-c-blue { box-shadow: 0 0 0 3px var(--lb-blue), 0 4px 10px rgba(0,0,0,.35); }
.ludo-pip { width: 9px; height: 9px; border-radius: 50%; background: transparent; }
.ludo-pip.on { background: #1e293b; }
.ludo-die-label { grid-column: 1 / 4; grid-row: 1 / 4; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; color: #1e293b; }

/* Thrown values: mini dice awaiting use (two-dice games) + cowrie throws */
.ludo-dice { display: flex; align-items: center; gap: 0.5rem; }
.ludo-dice-values { display: flex; align-items: center; gap: 0.4rem; }
.ludo-mini-die {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  background: #fff;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 7px;
  gap: 1px;
  cursor: pointer;
  place-items: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s, opacity 0.15s;
}
.ludo-mini-die .ludo-pip { width: 7px; height: 7px; }
.ludo-mini-die.active { outline: 3px solid var(--gold); outline-offset: 1px; transform: translateY(-3px); }
.ludo-mini-die.used { opacity: 0.32; cursor: default; box-shadow: none; transform: none; }
.ludo-mini-die .ludo-cowrie-val { grid-column: 1 / 4; grid-row: 1 / 4; }
.ludo-cowries {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}
.ludo-cowries.used { opacity: 0.32; }
.ludo-shell {
  width: 11px;
  height: 15px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: #b8a284;
  border: 1px solid #8a7458;
  display: inline-block;
}
.ludo-shell.up { background: #fdf6e9; border-color: #c9b696; box-shadow: inset 0 0 0 1.5px #e4d3b4; }
.ludo-cowrie-val { font-weight: 800; font-size: 1.05rem; color: #1e293b; margin-left: 4px; font-variant-numeric: tabular-nums; }
@keyframes dieWobble { 0% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } 100% { transform: rotate(-6deg); } }
@keyframes dieBeckon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.no-animations .ludo-die { animation: none !important; }

.ludo-players { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.ludo-chip {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  opacity: 0.55;
  border: 2px solid transparent;
}
.ludo-chip.active { opacity: 1; border-color: #fff; }
.ludo-chip-red { background: var(--lb-red); }
.ludo-chip-green { background: var(--lb-green); }
.ludo-chip-yellow { background: var(--lb-yellow); color: #422006; }
.ludo-chip-blue { background: var(--lb-blue); }

/* ── Win / defeat overlay ───────────────────────────────────────────────── */
.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  border-radius: inherit;
  padding: 1rem;
}
.game-overlay.show { display: flex; }
.game-overlay-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.8rem 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.overlay-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.35rem; }
.game-overlay-card p { color: var(--text-muted, #475569); margin: 0 0 0.75rem; }
.win-stats { display: flex; justify-content: center; gap: 1.75rem; margin: 1rem 0; }
.win-stats .num { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.win-stats .lbl { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-light, #94a3b8); }
.overlay-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }

/* ── Stats strip / toast ────────────────────────────────────────────────── */
.stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0.7rem 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted, #475569);
  min-height: 2.6rem;  /* reserve a row so the JS-filled stats don't shift content (CLS) */
  align-content: center;
}
.stats-strip .stat { display: inline-flex; gap: 0.4rem; align-items: baseline; }
.stats-strip .stat-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light, #94a3b8); }
.stats-strip .stat-value { font-weight: 700; font-variant-numeric: tabular-nums; }

#ln-toast {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 3000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
#ln-toast.show { display: block; }

/* ── Confetti ───────────────────────────────────────────────────────────── */
.confetti {
  position: absolute;
  top: -12px;
  width: 9px;
  height: 14px;
  z-index: 60;
  border-radius: 2px;
  animation: confettiFall 2s ease-in forwards;
  pointer-events: none;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(600deg); opacity: 0.2; }
}

/* ── Game header / mode tabs ────────────────────────────────────────────── */
.game-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.game-header h1 { font-size: 1.6rem; margin: 0 0 0.15rem; }
.game-header .tagline { color: var(--text-muted, #475569); font-size: 0.95rem; }
.mode-tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.mode-tab {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #475569);
  text-decoration: none;
  background: var(--surface, #fff);
  transition: all 0.15s;
}
.mode-tab:hover { border-color: var(--blue, #2563eb); color: var(--blue, #2563eb); }
.mode-tab.active { background: var(--blue, #2563eb); border-color: var(--blue, #2563eb); color: #fff; }

.home-intro {
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--text-muted, #475569);
  max-width: 62rem;
  margin: 0 0 1.25rem;
}

/* ── Long-form content ──────────────────────────────────────────────────── */
.game-content { margin-top: 2.5rem; }
.game-content h2 { font-size: 1.45rem; margin: 2.25rem 0 0.9rem; }
.game-content h3 { font-size: 1.1rem; margin: 1.6rem 0 0.7rem; }
.game-content p { line-height: 1.8; color: var(--text-muted, #475569); margin: 0 0 1rem; }
.game-content li { line-height: 1.75; }

.tldr {
  background: var(--blue-light, #eff6ff);
  border: 1px solid var(--blue-border, #bfdbfe);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  line-height: 1.7;
  color: var(--text, #1e293b);
}
.tip-callout {
  background: var(--accent-light, #fffbeb);
  border: 1px solid #fde68a;
  border-left: 4px solid var(--accent, #f59e0b);
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  line-height: 1.7;
  color: #713f12;
  max-width: 46rem;
}

.facts-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.92rem;
  margin: 0.75rem 0 1.5rem;
}
.facts-table th {
  text-align: left;
  padding: 0.6rem 0.9rem;
  background: var(--surface-2, #f8fafc);
  font-weight: 700;
  width: 32%;
  border-bottom: 1px solid var(--border, #e2e8f0);
  vertical-align: top;
}
.facts-table td { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border, #e2e8f0); line-height: 1.6; color: var(--text-muted, #475569); }
.facts-table thead th { width: auto; }
.facts-table tr:last-child th, .facts-table tr:last-child td { border-bottom: none; }

.strategy-list { padding-left: 1.25rem; margin: 0 0 1.25rem; color: var(--text-muted, #475569); }
.strategy-list li { margin-bottom: 0.6rem; }
.strategy-list.numbered { counter-reset: tip; list-style: none; padding-left: 0; }
.strategy-list.numbered li {
  counter-increment: tip;
  position: relative;
  padding-left: 2.4rem;
  margin-bottom: 0.8rem;
}
.strategy-list.numbered li::before {
  content: counter(tip);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--blue-light, #eff6ff);
  color: var(--blue, #2563eb);
  border: 1px solid var(--blue-border, #bfdbfe);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.howto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.howto-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  overflow: hidden;
}
.howto-card h3, .howto-card h4 { margin: 0 0 0.5rem; font-size: 1rem; }
.howto-card p { margin: 0; font-size: 0.92rem; line-height: 1.7; }
.howto-card.has-img { padding: 0; }
.howto-card.has-img h3, .howto-card.has-img p { padding: 0 1.2rem; }
.howto-card.has-img h3 { margin-top: 0.9rem; }
.howto-card.has-img p { padding-bottom: 1.1rem; }
.howto-img { width: 100%; height: 200px; object-fit: cover; display: block; background: var(--surface-2, #f8fafc); }

.rules-img {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  margin: 0 0 1rem;
  background: var(--surface-2, #f8fafc);
}

/* FAQ accordion + list */
.faq-accordion { border: 1px solid var(--border, #e2e8f0); border-radius: 12px; overflow: hidden; background: var(--surface, #fff); }
.faq-acc-item { border-bottom: 1px solid var(--border, #e2e8f0); }
.faq-acc-item:last-child { border-bottom: none; }
.faq-acc-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.2rem;
  cursor: pointer;
  list-style: none;
}
.faq-acc-item summary::-webkit-details-marker { display: none; }
.faq-acc-item summary h3 { margin: 0; font-size: 0.98rem; font-weight: 600; }
.faq-acc-chevron { flex-shrink: 0; transition: transform 0.2s; color: var(--text-light, #94a3b8); }
.faq-acc-item[open] .faq-acc-chevron { transform: rotate(180deg); }
.faq-acc-body { padding: 0 1.2rem 1rem; }
.faq-acc-body p { margin: 0; font-size: 0.93rem; line-height: 1.75; color: var(--text-muted, #475569); }

.faq-list { display: grid; gap: 1rem; margin: 1rem 0; }
.faq-item {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 1rem 1.2rem;
}
.faq-item h3 { margin: 0 0 0.45rem; font-size: 1rem; }
.faq-item p { margin: 0; font-size: 0.93rem; line-height: 1.75; color: var(--text-muted, #475569); }

/* Variant cards */
.variant-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.variant-card {
  display: block;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 1.05rem 1.15rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.variant-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));
  border-color: var(--blue-border, #bfdbfe);
}
.vc-name { font-weight: 700; margin-bottom: 0.3rem; }
.vc-tag { font-size: 0.85rem; color: var(--text-muted, #475569); line-height: 1.55; margin-bottom: 0.45rem; }
.vc-meta { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light, #94a3b8); }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.82rem;
  padding-top: 1rem;
  color: var(--text-light, #94a3b8);
}
.breadcrumb a { color: var(--text-muted, #475569); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue, #2563eb); }
.breadcrumb .sep { color: var(--text-light, #94a3b8); }
.breadcrumb span[aria-current] { color: var(--text, #1e293b); font-weight: 600; }

/* ── Rating widget ──────────────────────────────────────────────────────── */
.rating-widget {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.9rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted, #475569);
}
.rating-label { font-weight: 600; }
.rating-stars { display: inline-flex; gap: 0.1rem; }
.rating-star {
  background: none;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: #d1d5db;
  padding: 0.05rem;
  transition: color 0.1s, transform 0.1s;
}
.rating-star:hover { transform: scale(1.15); }
.rating-star.on { color: var(--gold); }
.rating-summary { font-variant-numeric: tabular-nums; }
.rating-widget.rated .rating-label::after { content: " - thanks!"; color: var(--blue, #2563eb); }

/* ── Multiplayer ────────────────────────────────────────────────────────── */
.mp-panel {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin: 1rem 0 1.5rem;
}
.mp-code {
  display: inline-block;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.3em;
  background: var(--blue-light, #eff6ff);
  border: 1px dashed var(--blue-border, #bfdbfe);
  color: var(--blue-dark, #1d4ed8);
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
}
.mp-players { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.mp-player {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  background: var(--surface-2, #f8fafc);
}
.mp-player.is-you { border-color: var(--blue, #2563eb); box-shadow: 0 0 0 1px var(--blue, #2563eb); }
.mp-name { display: flex; align-items: center; gap: 0.45rem; font-weight: 700; margin-bottom: 0.2rem; }
.mp-dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; flex-shrink: 0; }
.mp-player.connected .mp-dot { background: #22c55e; }
.mp-player.ready .mp-status::after { content: " ✓"; color: #16a34a; }
.mp-status { font-size: 0.8rem; color: var(--text-muted, #475569); margin-bottom: 0.55rem; }
.mp-progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--border, #e2e8f0);
  overflow: hidden;
}
.mp-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue, #2563eb), #60a5fa);
  transition: width 0.4s ease;
}
.mp-chat {
  margin-top: 1rem;
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.84rem;
  background: var(--surface, #fff);
  margin-bottom: 0.5rem;
}
.mp-chat:empty { display: none; }
.mp-chat-line { margin-bottom: 0.3rem; line-height: 1.5; }
.mp-chat-line b { color: var(--blue, #2563eb); font-weight: 700; }
.mp-chat-line.me b { color: var(--text, #1e293b); }

.hidden { display: none !important; }

/* ── Settings modal ─────────────────────────────────────────────────────── */
.ln-modal { position: fixed; inset: 0; z-index: 4000; display: none; }
.ln-modal.show { display: block; }
.ln-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55); }
.ln-modal-card {
  position: relative;
  max-width: 430px;
  margin: 8vh auto 0;
  background: #fff;
  border-radius: 16px;
  padding: 1.3rem 1.5rem 1.5rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  max-height: 82vh;
  overflow-y: auto;
}
.ln-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.ln-modal-head h3 { margin: 0; font-size: 1.15rem; }
.ln-modal-close { background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--text-light, #94a3b8); }
.ln-modal-section { margin-top: 1rem; }
.ln-modal-section h4 { margin: 0 0 0.5rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light, #94a3b8); }
.ln-swatches { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ln-swatch {
  border: 2px solid var(--border, #e2e8f0);
  background: var(--surface, #fff);
  border-radius: 10px;
  padding: 0.45rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 62px;
}
.ln-swatch.active { border-color: var(--blue, #2563eb); }
.ln-swatch span { width: 34px; height: 24px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.12); display: block; }
.ln-swatch em { font-style: normal; font-size: 0.68rem; font-weight: 600; color: var(--text-muted, #475569); }
.ln-swatch .tok { width: 24px; height: 24px; border-radius: 50%; }
.ln-swatch .tok-classic { background: radial-gradient(circle at 35% 30%, #f87171, var(--lb-red)); border: 2px solid var(--lb-red-dark); }
.ln-swatch .tok-flat { background: var(--lb-red); }
.ln-swatch .tok-outline { background: #fff; border: 3px solid var(--lb-red); }
.ln-modal-toggles { display: flex; flex-direction: column; gap: 0.5rem; }
.ln-modal-toggles label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; cursor: pointer; }

/* ── 404 page ───────────────────────────────────────────────────────────── */
.nf-hero {
  background: radial-gradient(ellipse at center, #276749 0%, #1d5238 70%, #16402c 100%);
  border-radius: 16px;
  color: #fff;
  text-align: center;
  padding: 3rem 1.5rem 2.5rem;
  margin-top: 1.5rem;
}
.nf-tokens { display: flex; justify-content: center; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.nf-token { width: 42px; height: 42px; border-radius: 50%; display: inline-block; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.25), 0 4px 8px rgba(0, 0, 0, 0.3); }
.nf-token.red { background: var(--lb-red); }
.nf-token.blue { background: var(--lb-blue); }
.nf-die {
  width: 46px; height: 46px; border-radius: 10px; background: #fff; color: #1e293b;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.3rem; transform: rotate(-8deg);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
.nf-code { font-size: 4.5rem; font-weight: 800; line-height: 1; margin-bottom: 0.5rem; letter-spacing: 0.03em; }
.nf-hero h1 { color: #fff; margin: 0 0 0.5rem; }
.nf-hero p { color: rgba(255, 255, 255, 0.85); max-width: 34rem; margin: 0 auto 1.25rem; line-height: 1.7; }
.nf-actions { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
.btn-outline-light {
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.14); }
.nf-linkcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; margin: 1.5rem 0 3rem; }
.nf-linkcols h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light, #94a3b8); margin-bottom: 0.6rem; }
.nf-linkcols ul { list-style: none; padding: 0; margin: 0; }
.nf-linkcols li { margin-bottom: 0.45rem; }
.nf-linkcols a { color: var(--text-muted, #475569); text-decoration: none; font-size: 0.92rem; }
.nf-linkcols a:hover { color: var(--blue, #2563eb); }

/* ── Printable board ────────────────────────────────────────────────────── */
.print-board { margin: 1.5rem 0; }
.pb-grid { border-collapse: collapse; margin: 0 auto; }
.pb-grid td {
  width: 30px; height: 30px; border: 1px solid #94a3b8; padding: 0;
  text-align: center; vertical-align: middle; font-size: 15px; color: #64748b;
}
.pb-red { background: #ef9a9a; border-color: #b91c1c !important; }
.pb-green { background: #a5d6a7; border-color: #15803d !important; }
.pb-yellow { background: #fde68a; border-color: #a16207 !important; }
.pb-blue { background: #93c5fd; border-color: #1d4ed8 !important; }
.pb-red-soft { background: #fecaca; }
.pb-green-soft { background: #bbf7d0; }
.pb-yellow-soft { background: #fef08a; }
.pb-blue-soft { background: #bfdbfe; }
.pb-centre { background: #e2e8f0; }
.pb-entry { position: relative; }
.pb-star { background: #f1f5f9; }
.pb-track { background: #fff; }
.pb-off { background: transparent; border: none !important; }

@media print {
  .no-print, .site-nav, .site-footer, .breadcrumb, .nav-mobile-panel { display: none !important; }
  .print-board { page-break-inside: avoid; }
  .pb-grid td { width: 36px; height: 36px; }
}

/* ── Auth pages ─────────────────────────────────────────────────────────── */
.auth-card { max-width: 460px; margin: 2rem auto; }
.auth-divider { height: 1px; background: var(--border, #e2e8f0); margin: 1.4rem 0; }
.auth-benefits { list-style: none; padding: 0; margin: 0; }
.auth-benefits li { padding-left: 1.6rem; position: relative; margin-bottom: 0.65rem; font-size: 0.92rem; line-height: 1.6; color: var(--text-muted, #475569); }
.auth-benefits li::before { content: "✓"; position: absolute; left: 0; color: var(--blue, #2563eb); font-weight: 800; }

/* ── Mobile tweaks ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .game-shell { padding: 0.6rem; }
  /* Taller reservation: on a phone the board fills the width and the dice bar
     wraps to two rows, so it eats a larger share of the total height. */
  #board-wrap { aspect-ratio: 1 / 1.32; }
  .game-stats { gap: 0.75rem; }
  .game-stats span span:last-child { font-size: 0.9rem; }
  /* Bigger, finger-friendly controls (>=44px tall meets the touch-target guide). */
  .btn-felt { padding: 0.5rem 0.7rem; font-size: 0.8rem; min-height: 44px; display: inline-flex; align-items: center; }
  .game-buttons { gap: 0.5rem; }
  .ludo-die { width: 56px; height: 56px; }
  .ludo-mini-die { width: 52px; height: 52px; }
  .rating-star { font-size: 1.7rem; padding: 0.2rem; }
  .ludo-chip { padding: 0.3rem 0.7rem; font-size: 0.76rem; }
  .ludo-turnlabel { font-size: 0.82rem; width: 100%; text-align: center; order: -1; }
  .ludo-dicebar { justify-content: center; gap: 0.6rem 0.75rem; }
  .mp-players { grid-template-columns: 1fr; }
  .game-header h1 { font-size: 1.3rem; }
  .win-stats { gap: 1.1rem; }
  .overlay-actions .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .hub-layout { grid-template-columns: 1fr !important; }
  .hub-sidebar { position: static !important; }
}
