/* ============================================================
   Mancala — styles
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  color-scheme: dark;

  --bg-0: #0a0d1a;
  --bg-1: #121732;
  --ink: #eef1ff;
  --ink-dim: #a3abcc;
  --ink-faint: #6f78a0;

  --p1: #f5b93f;          /* Player One — amber */
  --p1-soft: #ffd98a;
  --p2: #45dcc7;          /* Player Two — teal */
  --p2-soft: #a5f3e7;

  --wood-0: #6b3f22;
  --wood-1: #8a5430;
  --wood-2: #a9683a;
  --wood-edge: #40230f;

  --pit-0: #2a1608;
  --pit-1: #4a2a14;

  --glass: rgba(255, 255, 255, .055);
  --glass-line: rgba(255, 255, 255, .11);

  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --shadow-soft: 0 18px 50px -18px rgba(0, 0, 0, .85);

  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 50% -10%, #1c2450 0%, transparent 62%),
    linear-gradient(170deg, var(--bg-1) 0%, var(--bg-0) 55%, #05060f 100%);
  background-attachment: fixed;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- ambient background ---------- */

.bg-glow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blob {
  position: absolute; display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .34;
  will-change: transform;
}
.blob-a { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: #3a4bd8; animation: drift-a 26s ease-in-out infinite; }
.blob-b { width: 40vmax; height: 40vmax; right: -12vmax; top: 8vmax; background: #14a08c; opacity: .26; animation: drift-b 32s ease-in-out infinite; }
.blob-c { width: 38vmax; height: 38vmax; left: 30vmax; bottom: -18vmax; background: #a8631d; opacity: .22; animation: drift-a 38s ease-in-out infinite reverse; }

@keyframes drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(6vmax, 4vmax, 0) scale(1.12); }
}
@keyframes drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.06); }
  50%      { transform: translate3d(-7vmax, 5vmax, 0) scale(1); }
}

/* ---------- layout ---------- */

.app {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(14px, 2.4vw, 30px) clamp(12px, 3vw, 28px) clamp(20px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(12px, 1.8vw, 20px);
}

/* ---------- topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--p1); }
.brand-mark { display: inline-flex; opacity: .9; }

/* back to the jahe.dev index */
.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  color: var(--ink-dim);
  text-decoration: none;
  flex: none;
  transition: color .2s, border-color .2s, background .2s, transform .16s cubic-bezier(.2,.8,.3,1);
}
.home-link:hover {
  color: var(--ink);
  border-color: rgba(255,255,255,.24);
  background: rgba(255,255,255,.1);
  transform: translateX(-2px);
}
.home-link:focus-visible { outline: 2px solid var(--p2); outline-offset: 3px; }

.brand h1 {
  font-family: var(--font-display);
  font-size: clamp(26px, 4.4vw, 40px);
  font-weight: 600;
  letter-spacing: .02em;
  margin: 0;
  background: linear-gradient(100deg, var(--p1-soft), #fff 42%, var(--p2-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.btn {
  appearance: none;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  padding: 9px 15px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform .16s cubic-bezier(.2,.8,.3,1), background .2s, border-color .2s, box-shadow .2s, opacity .2s;
}
.btn:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.2); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn:focus-visible { outline: 2px solid var(--p2); outline-offset: 3px; }

.btn-primary {
  background: linear-gradient(135deg, var(--p1) 0%, #e08a2a 100%);
  border-color: transparent;
  color: #2a1704;
  font-weight: 700;
  box-shadow: 0 10px 26px -10px rgba(245,185,63,.75);
}
.btn-primary:hover { background: linear-gradient(135deg, #ffc95c 0%, #ef9a34 100%); }

.btn-lg { padding: 12px 26px; font-size: 15px; }

.btn .icon { font-size: 14px; line-height: 1; opacity: .95; }
.btn[aria-pressed="false"] { opacity: .55; }

.select-wrap { position: relative; display: inline-flex; }
.select-wrap::after {
  content: "";
  position: absolute; right: 13px; top: 50%;
  width: 6px; height: 6px;
  border-right: 1.6px solid var(--ink-dim);
  border-bottom: 1.6px solid var(--ink-dim);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
#speed {
  appearance: none;
  font: inherit; font-size: 14px; font-weight: 550;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  padding: 9px 32px 9px 15px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#speed:focus-visible { outline: 2px solid var(--p2); outline-offset: 3px; }
#speed option { background: #171d3a; color: var(--ink); }

/* ---------- status ---------- */

.status-bar { display: flex; justify-content: center; }

.status {
  margin: 0;
  font-size: clamp(14px, 1.7vw, 16.5px);
  font-weight: 550;
  letter-spacing: .01em;
  text-align: center;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink-dim);
  /* NB: must not be a flex container — flex layout strips the whitespace
     between an inline <b> and the following text node. */
  display: block;
  line-height: 1.35;
  transition: color .3s, border-color .3s, box-shadow .3s, background .3s;
}
.status b { color: var(--ink); font-weight: 700; }
.status.tone-p1 { color: var(--p1-soft); border-color: rgba(245,185,63,.4); box-shadow: 0 0 30px -10px rgba(245,185,63,.7) inset; }
.status.tone-p2 { color: var(--p2-soft); border-color: rgba(69,220,199,.4); box-shadow: 0 0 30px -10px rgba(69,220,199,.7) inset; }
.status.tone-alert { color: #ffb4b4; border-color: rgba(255,120,120,.45); }
.status.pop { animation: status-pop .42s cubic-bezier(.2,1.5,.4,1); }
@keyframes status-pop {
  0% { transform: scale(.94); opacity: .5; }
  60% { transform: scale(1.025); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---------- table & panels ---------- */

.table { display: flex; flex-direction: column; gap: clamp(10px, 1.6vw, 16px); }

.panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px clamp(14px, 2vw, 22px);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-line);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  transition: border-color .35s, box-shadow .35s, transform .35s, background .35s;
}
.panel::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, var(--accent-rgb-soft, transparent), transparent 58%);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.panel-p1 { --accent: var(--p1); --accent-rgb-soft: rgba(245,185,63,.13); }
.panel-p2 { --accent: var(--p2); --accent-rgb-soft: rgba(69,220,199,.13); }

.panel.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent),
              0 18px 44px -24px color-mix(in srgb, var(--accent) 90%, transparent);
}
.panel.is-active::before { opacity: 1; }

.panel-id { display: flex; align-items: center; gap: 12px; min-width: 0; }

.dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  flex: none;
  transition: box-shadow .3s;
}
.panel.is-active .dot { animation: pulse-dot 2.1s ease-out infinite; }
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 65%, transparent); }
  70%  { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.panel-names { min-width: 0; }
.panel-name {
  margin: 0;
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 650;
  letter-spacing: .01em;
  white-space: nowrap;
}
.panel.is-active .panel-name { color: var(--accent); }
.panel-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-score { display: flex; align-items: baseline; gap: 8px; flex: none; }
.score-num {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.6vw, 34px);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  display: inline-block;
}
.score-num.bump { animation: bump .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.28); }
  100% { transform: scale(1); }
}
.score-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-faint); }

/* ---------- board ---------- */

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

.board {
  --gap: clamp(5px, 1.05vw, 13px);
  --stone-size: clamp(13px, 2.15vw, 27px);

  position: relative;
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: clamp(8px, 1.5vw, 20px);
  padding: clamp(10px, 1.9vw, 24px);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(163deg, var(--wood-2) 0%, var(--wood-1) 38%, var(--wood-0) 78%, #58311a 100%);
  box-shadow:
    0 2px 0 rgba(255, 226, 190, .28) inset,
    0 -3px 0 rgba(0, 0, 0, .34) inset,
    0 0 0 1px var(--wood-edge),
    0 34px 70px -26px rgba(0, 0, 0, .92),
    0 6px 20px -8px rgba(0, 0, 0, .6);
  isolation: isolate;
}

/* wood grain + vignette */
.board-grain {
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: .5;
  background-image:
    repeating-linear-gradient(97deg,
      rgba(255, 226, 190, .055) 0px,
      rgba(255, 226, 190, .055) 1px,
      transparent 1px,
      transparent 4px),
    repeating-linear-gradient(93deg,
      rgba(60, 26, 8, .10) 0px,
      rgba(60, 26, 8, .10) 2px,
      transparent 2px,
      transparent 9px),
    radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(30, 12, 2, .45) 100%);
  mix-blend-mode: overlay;
}

.pit-grid {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: var(--gap);
  min-width: 0;
}

.row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gap);
  border-radius: 999px;
  padding: 2px;
  transition: box-shadow .4s, background .4s;
}
.row.is-turn { background: rgba(255,255,255,.045); }
.row-bottom.is-turn { box-shadow: 0 0 0 1px rgba(245,185,63,.3), 0 0 34px -8px rgba(245,185,63,.55); }
.row-top.is-turn    { box-shadow: 0 0 0 1px rgba(69,220,199,.3), 0 0 34px -8px rgba(69,220,199,.55); }

/* ---------- pits ---------- */

.pit {
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: default;
  font: inherit;
  color: inherit;
  background:
    radial-gradient(78% 78% at 50% 34%, var(--pit-1) 0%, var(--pit-0) 68%, #190c03 100%);
  box-shadow:
    0 6px 14px -4px rgba(0, 0, 0, .75) inset,
    0 -2px 5px rgba(255, 220, 180, .16) inset,
    0 1px 0 rgba(255, 226, 190, .22);
  transition: transform .2s cubic-bezier(.2,.8,.3,1), box-shadow .25s, filter .25s;
}
.pit::after { /* rim highlight ring used for playable/preview states */
  content: "";
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color .25s, box-shadow .25s, transform .25s;
  pointer-events: none;
}

.pit.is-playable { cursor: pointer; }
.pit.is-playable::after { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.pit.is-playable:hover { transform: translateY(-3px) scale(1.035); }
.pit.is-playable:hover::after {
  border-color: var(--accent);
  box-shadow: 0 0 22px -2px color-mix(in srgb, var(--accent) 75%, transparent);
}
.pit.is-playable:focus-visible { outline: none; }
.pit.is-playable:focus-visible::after {
  border-color: #fff;
  box-shadow: 0 0 22px -2px rgba(255,255,255,.8);
}
.pit-p1 { --accent: var(--p1); }
.pit-p2 { --accent: var(--p2); }

/* sow preview */
.pit.preview::after { border-color: rgba(255, 255, 255, .42); }
.pit.preview-last::after {
  border-color: #fff;
  box-shadow: 0 0 20px -2px rgba(255,255,255,.75);
}
.pit.preview-capture::after {
  border-color: #ff8f6b;
  box-shadow: 0 0 24px -2px rgba(255, 143, 107, .9);
}

.pit.is-source { transform: scale(.965); box-shadow: 0 8px 18px -4px rgba(0,0,0,.9) inset, 0 0 0 2px rgba(255,255,255,.14) inset; }

.pit.shake { animation: shake .42s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

.pit.flash-capture { animation: flash-capture .6s ease-out; }
@keyframes flash-capture {
  0% { box-shadow: 0 0 0 0 rgba(255,143,107,.9) inset, 0 0 28px 4px rgba(255,143,107,.7); }
  100% { box-shadow: 0 6px 14px -4px rgba(0,0,0,.75) inset, 0 0 0 0 transparent; }
}

/* per-pit count badge */
.count {
  position: absolute;
  left: 50%;
  bottom: -2%;
  transform: translateX(-50%);
  z-index: 4;
  font-size: clamp(9px, 1.05vw, 12px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  color: #ffeccb;
  background: rgba(20, 9, 2, .8);
  border: 1px solid rgba(255, 226, 190, .18);
  pointer-events: none;
  transition: opacity .2s, color .2s;
}
.pit[data-empty="true"] .count { opacity: .32; }

/* ---------- stores ---------- */

.store {
  position: relative;
  width: clamp(50px, 8.4vw, 100px);
  border-radius: 999px;
  background:
    radial-gradient(64% 42% at 50% 20%, var(--pit-1) 0%, var(--pit-0) 62%, #170b03 100%);
  box-shadow:
    0 10px 22px -6px rgba(0, 0, 0, .8) inset,
    0 -2px 6px rgba(255, 220, 180, .16) inset,
    0 1px 0 rgba(255, 226, 190, .22);
  overflow: visible;
  transition: box-shadow .35s;
}
.store-p1 { --accent: var(--p1); }
.store-p2 { --accent: var(--p2); }
.store.is-turn { box-shadow: 0 10px 22px -6px rgba(0,0,0,.8) inset, 0 -2px 6px rgba(255,220,180,.16) inset, 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.store.gain { animation: store-gain .5s ease-out; }
@keyframes store-gain {
  0% { box-shadow: 0 10px 22px -6px rgba(0,0,0,.8) inset, 0 0 30px 2px color-mix(in srgb, var(--accent) 80%, transparent); }
  100% { box-shadow: 0 10px 22px -6px rgba(0,0,0,.8) inset, 0 0 0 0 transparent; }
}

.store-count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 4.2vw, 46px);
  font-weight: 700;
  color: color-mix(in srgb, var(--accent) 70%, #fff);
  opacity: .17;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.store-tag {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  color: color-mix(in srgb, var(--accent) 80%, #fff);
  opacity: .5;
  pointer-events: none;
}
.store-p1 .store-tag { bottom: 8px; }
.store-p2 .store-tag { top: 8px; }

/* ---------- stones ---------- */

.stones {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.stone {
  position: absolute;
  width: var(--stone-size);
  height: var(--stone-size);
  margin-left: calc(var(--stone-size) / -2);
  margin-top: calc(var(--stone-size) / -2);
  border-radius: 50%;
  will-change: transform;
  background-image:
    radial-gradient(58% 52% at 34% 28%, rgba(255,255,255,.85) 0%, rgba(255,255,255,.2) 26%, transparent 55%),
    var(--stone-fill);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, .6),
    0 0 0 .5px rgba(0, 0, 0, .35),
    0 -1px 2px rgba(255, 255, 255, .12) inset;
}

.stone.c0 { --stone-fill: radial-gradient(circle at 38% 32%, #7fe8d2 0%, #24a48d 52%, #10574c 100%); }
.stone.c1 { --stone-fill: radial-gradient(circle at 38% 32%, #ffd98d 0%, #e39b2c 52%, #7d4c0c 100%); }
.stone.c2 { --stone-fill: radial-gradient(circle at 38% 32%, #cfd6ff 0%, #7b88d8 52%, #38407e 100%); }
.stone.c3 { --stone-fill: radial-gradient(circle at 38% 32%, #ffc9c0 0%, #e0776a 52%, #7c3229 100%); }
.stone.c4 { --stone-fill: radial-gradient(circle at 38% 32%, #f6f2ea 0%, #cbc2b2 52%, #6f6558 100%); }

.stone.flying { z-index: 40; box-shadow: 0 8px 14px rgba(0,0,0,.55), 0 0 0 .5px rgba(0,0,0,.35); }

/* ---------- hint ---------- */

.hint {
  margin: 2px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-faint);
}
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--glass-line);
  background: rgba(255,255,255,.06);
  color: var(--ink-dim);
}

/* ---------- overlays / modals ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 6, 16, .72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fade-in .3s ease-out;
}
.overlay[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  z-index: 2;
  width: min(520px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: clamp(22px, 3.4vw, 34px);
  border-radius: 24px;
  border: 1px solid var(--glass-line);
  background: linear-gradient(165deg, rgba(35, 42, 82, .96), rgba(15, 19, 42, .97));
  box-shadow: var(--shadow-soft);
  text-align: center;
  animation: modal-in .48s cubic-bezier(.2, 1.2, .3, 1);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(22px) scale(.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.trophy { font-size: 54px; line-height: 1; animation: trophy-in .8s cubic-bezier(.2,1.4,.3,1) both; }
@keyframes trophy-in {
  0% { transform: scale(0) rotate(-40deg); }
  60% { transform: scale(1.2) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}

.modal-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  margin: 12px 0 6px;
}
.modal-sub { margin: 0 0 20px; color: var(--ink-dim); font-size: 14.5px; }

.final-scores {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-bottom: 24px;
}
.final-card {
  flex: 1;
  padding: 14px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-line);
  background: rgba(255,255,255,.045);
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .3s, box-shadow .3s;
}
.final-card.winner {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 26px -10px color-mix(in srgb, var(--accent) 100%, transparent);
}
#final-0 { --accent: var(--p1); }
#final-1 { --accent: var(--p2); }
.final-name { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.final-num {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 700; line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.final-vs { font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .1em; }

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

.rules-list {
  text-align: left;
  margin: 0 0 24px;
  padding-left: 20px;
  color: var(--ink-dim);
  font-size: 14.5px;
  line-height: 1.62;
}
.rules-list li { margin-bottom: 10px; }
.rules-list b { color: var(--ink); font-weight: 650; }
.rules-list i { color: var(--p1-soft); font-style: normal; }

/* ---------- confetti ---------- */

.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.confetti i {
  position: absolute;
  top: -12vh;
  width: 9px;
  height: 15px;
  border-radius: 2px;
  opacity: 0;
  animation: fall var(--dur, 3s) linear var(--delay, 0s) forwards;
}
@keyframes fall {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg); }
  8%   { opacity: 1; }
  100% { opacity: .15; transform: translate3d(var(--drift, 40px), 112vh, 0) rotate(var(--spin, 720deg)); }
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .btn-label { display: none; }
  .btn { padding: 9px 12px; }
  .btn-primary { padding: 9px 16px; }
  .btn-primary .btn-label { display: inline; }
  .panel-sub { display: none; }
  .board { --stone-size: clamp(11px, 3.1vw, 20px); }
  .hint { display: none; }
}

@media (max-width: 460px) {
  .board { padding: 9px; gap: 7px; }
  .store { width: 42px; }
  .count { font-size: 9px; padding: 2px 5px; }
  .panel { padding: 10px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .blob { display: none; }
}
