/* ============================================================
   CHECKERS.NOW — Board, pieces, and multiplayer UI
   Loaded on top of main.css (site design system).
   ============================================================ */

:root {
  --wood-dark: #8a5a2b;
  --wood-light: #f0d6ac;
  --board-frame: #3a2416;
  --piece-red: #d23b2c;
  --piece-red-dk: #8f1d13;
  --piece-white: #f4ead9;
  --piece-white-dk: #c2ab8f;
  --gold: #e8b23a;
}

/* ---- GAME SHELL ---- */
.game-shell {
  background: radial-gradient(ellipse at 50% -25%, #4a3420, #2e2013 60%, #1c130b);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), inset 0 0 80px rgba(0,0,0,.28);
  padding: .75rem .75rem 1.25rem;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
/* Table (backdrop) themes applied to .game-shell */
.game-shell.table-walnut  { background: radial-gradient(ellipse at 50% -25%, #4a3420, #2e2013 60%, #1c130b); }
.game-shell.table-charcoal{ background: radial-gradient(ellipse at 50% -25%, #3a4049, #262b31 60%, #14181c); }
.game-shell.table-green   { background: radial-gradient(ellipse at 50% -25%, #2f6b40, #1e4a2c 60%, #123019); }
.game-shell.table-slate   { background: radial-gradient(ellipse at 50% -25%, #4a5568, #2f3a4c 60%, #1b2331); }
.game-shell.table-crimson { background: radial-gradient(ellipse at 50% -25%, #8f2a20, #5f1a13 60%, #3a0f0a); }

.game-shell:fullscreen { display:flex; flex-direction:column; justify-content:center; border-radius:0; padding:1rem; }
.game-shell:fullscreen .board-wrap { flex:1; display:flex; align-items:center; }

/* ---- TOOLBAR ---- */
.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
  padding: .35rem .5rem .6rem;
}
.game-stats {
  display: flex;
  gap: 1rem;
  align-items: center;
  color: #fff;
  font-variant-numeric: tabular-nums;
  font-size: .85rem;
  font-weight: 600;
}
.game-stats .stat-label {
  opacity: .65;
  font-weight: 500;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-right: .25rem;
}
.game-buttons { display: flex; gap: .4rem; flex-wrap: wrap; }
.btn-felt {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-sm);
  padding: .35rem .7rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.btn-felt:hover { background: rgba(255,255,255,.22); color: #fff; }
.btn-felt:disabled { opacity: .4; cursor: default; }
.btn-felt.btn-felt-primary { background: var(--gold); border-color: var(--gold); color: #52380a; }
.btn-felt.btn-felt-primary:hover { background: #f2c455; }

/* Turn indicator pill in the toolbar */
.turn-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  color: #fff; font-size: .8rem; font-weight: 700;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px; padding: .2rem .7rem;
}
.turn-pill .turn-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.3); }
.turn-pill .turn-dot.red { background: radial-gradient(circle at 35% 30%, #f06a5c, var(--piece-red) 55%, var(--piece-red-dk)); }
.turn-pill .turn-dot.white { background: radial-gradient(circle at 35% 30%, #fff, var(--piece-white) 55%, var(--piece-white-dk)); }

/* ---- BOARD ---- */
/* The shell mounts the board inside <div id="board-wrap">; center it there. */
#board-wrap, .board-wrap {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}
.cb-board {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 1 / 1;
  border: 12px solid var(--board-frame);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4), inset 0 0 0 2px rgba(0,0,0,.25);
  background: var(--wood-light);
  display: grid;
  /* none (not manipulation) so a touch-drag of a piece is never stolen by the
     browser as a page scroll or pinch-zoom. The board fits within the viewport
     on mobile; the page scrolls from the areas around it. */
  touch-action: none;
}
.cb-board * { -webkit-tap-highlight-color: transparent; touch-action: none; }

/* Board colour themes (applied via .cb-board.board-*) */
.cb-board.board-walnut   { --sq-dark: #8a5a2b; --sq-light: #f0d6ac; border-color:#3a2416; }
.cb-board.board-green    { --sq-dark: #4a7a48; --sq-light: #ede6cf; border-color:#2c3d27; }
.cb-board.board-charcoal { --sq-dark: #46505c; --sq-light: #c4ccd4; border-color:#242a31; }
.cb-board.board-blue     { --sq-dark: #3c6394; --sq-light: #d6e4f4; border-color:#22344c; }
.cb-board.board-tournament { --sq-dark: #6f8f5a; --sq-light: #efe7c8; border-color:#2f3a25; }
.cb-board { --sq-dark: #8a5a2b; --sq-light: #f0d6ac; }

.cb-square {
  position: relative;
  width: 100%;
  height: 100%;
}
.cb-square.dark  { background: var(--sq-dark); }
.cb-square.light { background: var(--sq-light); }

/* square coordinate label (a1 style) in the corner, subtle */
.cb-square .cb-coord {
  position: absolute; bottom: 1px; right: 3px;
  font-size: 9px; font-weight: 700; opacity: .35; pointer-events: none;
  color: rgba(0,0,0,.6);
}
.cb-square.dark .cb-coord { color: rgba(255,255,255,.5); }

/* Playable-square affordances. grab hints the piece is draggable on desktop;
   touch devices ignore cursors. */
.cb-square.playable { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .cb-square.playable { cursor: grab; } }
.cb-board.is-dragging .cb-square { cursor: grabbing; }
.cb-square.sel::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 4px var(--gold);
  border-radius: 2px; pointer-events: none;
}
.cb-square.move-target::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 30%; height: 30%; transform: translate(-50%,-50%);
  background: rgba(232,178,58,.6); border-radius: 50%;
  pointer-events: none;
}
.cb-square.move-capture::before {
  width: 42%; height: 42%;
  background: rgba(210,59,44,.55);
  box-shadow: 0 0 0 3px rgba(210,59,44,.35);
}
.cb-square.last-from, .cb-square.last-to { box-shadow: inset 0 0 0 4px rgba(232,178,58,.45); }
.cb-square.hint-glow { animation: cbHint 1s ease-in-out 2; }
@keyframes cbHint {
  0%,100% { box-shadow: inset 0 0 0 0 rgba(232,178,58,0); }
  50% { box-shadow: inset 0 0 0 6px rgba(232,178,58,.9); }
}

/* ---- PIECES (absolute layer over the board) ---- */
.cb-pieces { position: absolute; inset: 0; pointer-events: none; }
.cb-piece {
  position: absolute;
  border-radius: 50%;
  transition: left .22s cubic-bezier(.4,0,.2,1), top .22s cubic-bezier(.4,0,.2,1);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 6px rgba(0,0,0,.4);
  will-change: left, top;
}
.cb-board.no-animations .cb-piece { transition: none; }
.cb-piece::before {
  content: ""; position: absolute; inset: 12%;
  border-radius: 50%;
  box-shadow: inset 0 2px 3px rgba(255,255,255,.35), inset 0 -3px 5px rgba(0,0,0,.35);
}
.cb-piece.red  { background: radial-gradient(circle at 35% 30%, #f0685a, var(--piece-red) 52%, var(--piece-red-dk)); }
.cb-piece.white{ background: radial-gradient(circle at 35% 30%, #ffffff, var(--piece-white) 52%, var(--piece-white-dk)); }
.cb-piece.red::before  { background: radial-gradient(circle at 40% 35%, #e2503f, #a52418); }
.cb-piece.white::before{ background: radial-gradient(circle at 40% 35%, #f7efe2, #d8c6ab); }
/* concentric ridge lines */
.cb-piece .cb-ridge { position: absolute; inset: 22%; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); pointer-events:none; }
.cb-piece.white .cb-ridge { border-color: rgba(120,90,50,.3); }

/* King crown */
.cb-piece.king .cb-crown {
  position: relative; z-index: 2;
  font-size: 55%; line-height: 1;
  color: var(--gold);
  text-shadow: 0 1px 1px rgba(0,0,0,.5);
}
.cb-piece.king::after {
  content: ""; position: absolute; inset: 20%;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--gold), inset 0 0 6px rgba(232,178,58,.5);
  pointer-events: none;
}
.cb-piece.sel { z-index: 20; }
/* A piece being dragged: lifts above the board, follows the pointer with no
   position tween (JS sets a live transform), and shows a grabbing cursor. */
.cb-piece.dragging {
  z-index: 40;
  transition: none;
  cursor: grabbing;
  box-shadow: 0 10px 22px rgba(0,0,0,.55);
}
/* The square the dragged piece is hovering over, when it is a legal drop. */
.cb-square.drag-over::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 4px var(--gold);
  background: rgba(232,178,58,.22);
  border-radius: 2px; pointer-events: none; z-index: 1;
}
.cb-piece.captured { transition: opacity .2s, transform .2s; opacity: 0; transform: scale(.3); }
.cb-piece.pop-in { animation: cbPop .25s ease; }
@keyframes cbPop { 0% { transform: scale(.4); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ---- WIN / RESULT OVERLAY ---- */
.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28, 19, 11, .84);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  border-radius: var(--radius-lg);
}
.game-overlay.open { display: flex; }
.game-overlay-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem 2.25rem;
  max-width: 420px;
  width: calc(100% - 2rem);
  text-align: center;
}
.game-overlay-card h2,
.game-overlay-card .overlay-title { font-size: 1.6rem; font-weight: 700; line-height: 1.2; margin-bottom: .5rem; }
.win-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1rem 0 1.25rem;
}
.win-stats > div { text-align: center; }
.win-stats .num { font-size: 1.4rem; font-weight: 800; color: var(--blue); font-variant-numeric: tabular-nums; }
.win-stats .lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; }
.overlay-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

/* ---- SETTINGS MODAL ---- */
.sn-modal {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(28,19,11,.55);
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
}
.sn-modal.open { display: flex; }
.sn-modal-card {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 440px; max-width: 100%;
  max-height: 88vh; overflow-y: auto; padding: 1.25rem 1.5rem 1.5rem;
}
.sn-modal-card h2 { font-size: 1.2rem; margin-bottom: 1rem; display:flex; justify-content:space-between; align-items:center; }
.sn-modal-close { background:none; border:none; font-size:1.4rem; cursor:pointer; color:var(--text-muted); line-height:1; }
.sn-set-row { margin-bottom: 1.1rem; }
.sn-set-row > .sn-set-label { font-weight:600; font-size:.9rem; margin-bottom:.45rem; display:block; }
.sn-swatches { display:flex; gap:.5rem; flex-wrap:wrap; }
.sn-swatch {
  width:44px; height:32px; border-radius:8px; cursor:pointer;
  border:3px solid transparent; box-shadow: var(--shadow-sm);
}
.sn-swatch.active { border-color: var(--gold); }
.sn-toggle-row { display:flex; align-items:center; justify-content:space-between; padding:.4rem 0; }
.sn-toggle-row label { font-size:.9rem; }
.sn-seg { display:inline-flex; border:1px solid var(--border); border-radius:999px; overflow:hidden; }
.sn-seg button { border:none; background:var(--surface); padding:.3rem .8rem; font-size:.82rem; font-weight:600; cursor:pointer; color:var(--text); font-family:var(--font); }
.sn-seg button.active { background:var(--blue); color:#fff; }

/* ---- CONFETTI ---- */
.confetti {
  position: absolute;
  width: 10px; height: 14px;
  top: -20px;
  z-index: 1100;
  pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: .2; }
}

/* Full-width factual intro under the hero (positioning + answer-engine summary). */
.home-intro {
  margin: .25rem 0 1rem;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text-muted);
}
.home-intro strong { color: var(--text); }

/* ---- PLAY AREA (header + intro + board) ----
   Desktop keeps the natural order (header, intro, board). On mobile the board
   is reordered to sit right under the header so the game is always in view,
   and the full-width intro paragraphs drop below it. */
.play-area { display: flex; flex-direction: column; }
.play-area .game-header { order: 1; }
.play-area .play-intro { order: 2; }
.play-area .play-board { order: 3; }
@media (max-width: 768px) {
  .play-area .play-board { order: 2; }
  .play-area .play-intro { order: 3; margin-top: 1.25rem; }
}

/* ---- GAME PAGE LAYOUT ---- */
.game-header { margin: 1.25rem 0 .75rem; display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.game-header h1 { font-size: 1.45rem; }
.game-header .tagline { color: var(--text-muted); font-size: .92rem; }
.mode-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.mode-tab {
  padding: .3rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .82rem;
  font-weight: 600;
}
.mode-tab:hover { border-color: var(--blue); color: var(--blue); }
.mode-tab.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Below-the-fold content */
.game-content { margin-top: 2.5rem; }
.game-content h2 { margin: 2rem 0 .75rem; font-size: 1.35rem; }
.game-content h3 { margin: 1.25rem 0 .5rem; }
.howto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; margin: 1rem 0; }
.howto-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.howto-card h3 { margin: 0 0 .4rem; font-size: 1rem; color: var(--blue-dark); }
.howto-card p { font-size: .9rem; margin: 0; }
.howto-card.has-img { padding-top: 0; overflow: hidden; }
.howto-card .howto-img {
  width: calc(100% + 2.5rem);
  max-width: none;
  margin: 0 -1.25rem .95rem;
  height: 200px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 480px) {
  .howto-card .howto-img { height: 170px; }
}
.strategy-list { margin: .75rem 0 1rem 1.25rem; color: var(--text-muted); }
.strategy-list li { margin-bottom: .55rem; font-size: .95rem; }
ol.strategy-list.numbered { list-style: decimal; padding-left: .5rem; }
ol.strategy-list.numbered li { padding-left: .35rem; }
ol.strategy-list.numbered li::marker { color: var(--blue); font-weight: 800; }

/* TL;DR summary box */
.tldr {
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: .8rem 1.1rem;
  font-size: .96rem;
  line-height: 1.65;
  margin: 0 0 1.25rem;
  color: var(--text);
}
.tldr strong { color: var(--blue-dark); }

/* Highlighted "top tip" callout */
.tip-callout {
  background: var(--accent-light, #fdf6ec);
  border: 1px solid #f2d79a;
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .95rem;
  line-height: 1.6;
  margin: .5rem 0 1rem;
}

/* Clean two-column facts table */
.facts-table {
  width: 100%;
  border-collapse: collapse;
  margin: .5rem 0 1.5rem;
  font-size: .93rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.facts-table th, .facts-table td { padding: .6rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.facts-table tr:last-child th, .facts-table tr:last-child td { border-bottom: none; }
.facts-table th { width: 34%; background: var(--surface-2); font-weight: 700; color: var(--text); white-space: nowrap; }
.facts-table td { color: var(--text-muted); }
@media (max-width: 520px) {
  .facts-table th { width: 42%; white-space: normal; }
}

/* ---- FAQ ACCORDION (collapsible hub) ---- */
.faq-accordion { margin-top: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.faq-acc-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq-acc-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.faq-acc-item summary::-webkit-details-marker { display: none; }
.faq-acc-item summary h3 { font-size: 1rem; margin: 0; color: var(--text); }
.faq-acc-item[open] summary h3 { color: var(--blue-dark); }
.faq-acc-chevron { flex-shrink: 0; color: var(--text-muted); transition: transform .2s ease; }
.faq-acc-item[open] .faq-acc-chevron { transform: rotate(180deg); }
.faq-acc-item summary:hover h3 { color: var(--blue); }
.faq-acc-body { padding: 0 1.25rem 1.15rem; }
.faq-acc-body p { font-size: .92rem; margin: 0; color: var(--text-muted); }

.faq-list { margin-top: 1rem; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
}
.faq-item h3 { margin: 0 0 .4rem; font-size: 1rem; }
.faq-item p { font-size: .92rem; margin: 0; }

.variant-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin-top: 1rem; }
.variant-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  color: var(--text);
}
.variant-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--blue-border); color: var(--text); }
.variant-card .vc-name { font-weight: 700; color: var(--blue-dark); margin-bottom: .25rem; display: flex; align-items: center; gap: .4rem; }
.variant-card .vc-tag { font-size: .84rem; color: var(--text-muted); line-height: 1.45; }
.variant-card .vc-meta { margin-top: .6rem; font-size: .72rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: .04em; }

/* ---- 404 PAGE ---- */
.nf-hero {
  position: relative;
  text-align: center;
  color: #fff;
  background: radial-gradient(ellipse at 50% -10%, #4a3420, #2e2013 60%, #1c130b);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), inset 0 0 80px rgba(0,0,0,.25);
  padding: 2.5rem 1.25rem 2.75rem;
  overflow: hidden;
}
.nf-hero h1 { color: #fff; font-size: 1.7rem; margin: .25rem 0 .5rem; }
.nf-hero p { color: rgba(255,255,255,.85); max-width: 34rem; margin: 0 auto 1.5rem; line-height: 1.6; }
.nf-code {
  font-size: 3rem; font-weight: 800; letter-spacing: .1em;
  color: var(--gold); line-height: 1; margin-top: 1rem;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.nf-discs { display: flex; justify-content: center; align-items: center; gap: .5rem; height: 90px; margin-bottom: .25rem; }
.nf-disc {
  width: 62px; height: 62px; border-radius: 50%;
  box-shadow: 0 6px 14px rgba(0,0,0,.4), inset 0 3px 4px rgba(255,255,255,.25), inset 0 -4px 6px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: 1.5rem;
}
.nf-disc.red  { background: radial-gradient(circle at 35% 30%, #f0685a, var(--piece-red) 52%, var(--piece-red-dk)); transform: rotate(-6deg); }
.nf-disc.white{ background: radial-gradient(circle at 35% 30%, #fff, var(--piece-white) 52%, var(--piece-white-dk)); transform: translateY(-8px); }
.nf-disc.king { transform: scale(1.08); }
.nf-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.btn-outline-light {
  background: transparent; border: 1px solid rgba(255,255,255,.55); color: #fff;
  padding: .55rem 1.1rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem;
}
.btn-outline-light:hover { background: rgba(255,255,255,.14); color: #fff; }
.nf-linkcols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.25rem;
  margin-top: 1rem; text-align: left;
}
.nf-linkcols h3 { font-size: 1rem; color: var(--blue-dark); margin-bottom: .5rem; }
.nf-linkcols ul { list-style: none; padding: 0; margin: 0; }
.nf-linkcols li { margin-bottom: .4rem; }
.nf-linkcols a { font-size: .92rem; }

/* ---- MULTIPLAYER ---- */
.mp-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.mp-players { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.mp-player { padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.mp-player.me { border-color: var(--blue-border); background: var(--blue-light); }
.mp-player.turn { box-shadow: 0 0 0 2px var(--gold); }
.mp-player .mp-name { font-weight: 700; display: flex; align-items: center; gap: .4rem; }
.mp-player .mp-status { font-size: .75rem; color: var(--text-muted); }
.mp-progress-track {
  height: 10px; border-radius: 999px; background: var(--surface-3);
  margin-top: .5rem; overflow: hidden;
}
.mp-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--blue), #e0592b);
  border-radius: 999px;
  transition: width .4s ease;
}
.mp-code {
  font-size: 1.6rem; font-weight: 800; letter-spacing: .35em;
  font-variant-numeric: tabular-nums;
  background: var(--surface-3);
  border-radius: var(--radius-sm);
  padding: .4rem .6rem .4rem .9rem;
  display: inline-block;
}
.mp-chat { max-height: 180px; overflow-y: auto; font-size: .85rem; margin: .5rem 0; }
.mp-chat .mp-chat-line { margin-bottom: .25rem; }
.mp-chat .mp-chat-name { font-weight: 700; color: var(--blue-dark); }
.mp-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.mp-dot.on { background: #2fae5a; }
.mp-dot.off { background: #cbb8ad; }

/* ---- RATING WIDGET ---- */
.rating-widget {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding: .7rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: .9rem;
}
.rating-label { font-weight: 600; color: var(--text); }
.rating-stars { display: inline-flex; }
.rating-star {
  background: none; border: none; cursor: pointer; padding: 0 .1rem;
  font-size: 1.5rem; line-height: 1; color: #d9cabf; transition: color .1s;
}
.rating-star.on { color: var(--gold); }
.rating-star:hover { color: #f2c455; }
.rating-summary { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rating-widget.rated .rating-label::after { content: " thanks!"; color: var(--blue); font-weight: 400; }

/* ---- STATS BAR (localStorage per-game) ---- */
.stats-strip {
  display: flex; gap: 1.75rem; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem 1.25rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-sm);
}
.stats-strip > div { text-align: center; }
.stats-strip .num { font-weight: 800; font-size: 1.1rem; color: var(--blue-dark); font-variant-numeric: tabular-nums; }
.stats-strip .lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; }

/* Promo cards on the home page */
.promo-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.25rem 0; }
.promo-card {
  display: flex; flex-direction: column; gap: .3rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s; color: var(--text);
}
.promo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--blue-border); color: var(--text); }
.promo-card .pc-icon { font-size: 1.5rem; }
.promo-card .pc-title { font-weight: 700; color: var(--blue-dark); }
.promo-card .pc-desc { font-size: .85rem; color: var(--text-muted); line-height: 1.45; }
@media (max-width: 720px) { .promo-cards { grid-template-columns: 1fr; } }

@media (max-width: 640px) {
  .game-shell { padding: .4rem .4rem .6rem; border-radius: var(--radius); }
  .game-stats { gap: .55rem; font-size: .75rem; flex-wrap: wrap; }
  .game-buttons { gap: .3rem; }
  .btn-felt { padding: .3rem .55rem; font-size: .74rem; }
  .mp-players { grid-template-columns: 1fr; }
  .game-header h1 { font-size: 1.2rem; }
  /* Keep the whole board on screen: never taller than the viewport minus the
     toolbar and nav, and never wider than the phone. The board stays fully in
     view without pinch-zoom or scrolling within the shell. */
  .cb-board {
    border-width: 6px;
    width: min(94vw, calc(100svh - 200px));
    max-width: 94vw;
  }
}
@media (max-width: 640px) and (orientation: landscape) {
  .cb-board { width: min(70vh, 92vw); }
}
