/* Checkers Club — a lamplit tournament room (shared look with Chess Club).
   Single committed visual world; every colour painted explicitly. */

:root {
  --night:    #10131A;
  --night-2:  #0A0C11;
  --panel:    #161A22;
  --panel-2:  #1D222C;
  --line:     #2C313C;
  --bone:     #EFE3C8;
  --ink:      #E7E0D0;
  --muted:    #97917F;
  --muted-2:  #6E6A5E;
  --brass:    #C9A227;
  --brass-dim:#8A6F1C;
  --jade:     #3FA98A;
  --ember:    #D9573D;
  --teak:     #6E3F22;

  --ui: 'Nunito Sans', 'Sarabun', 'Segoe UI', 'Trebuchet MS', system-ui, sans-serif;
  --display: 'Nunito', 'Sarabun', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --chess: 'Segoe UI Symbol', 'Apple Symbols', 'Noto Sans Symbols 2', 'DejaVu Sans', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ---------- shell ---------- */
#app {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: linear-gradient(180deg, #131822 0%, #0E1219 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(201, 162, 39, 0.22);
}

.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand .mark {
  font-family: var(--chess);
  font-size: 22px;
  line-height: 1;
  color: var(--brass);
}
.brand h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0;
  color: var(--bone);
  white-space: nowrap;
}
.brand .school {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}

.topbar .spacer { flex: 1; }

.turn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 13px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
.turn .disc {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--bone);
  border: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.3);
  flex: none;
}
.turn.black .disc { background: #2A1C15; border-color: #12100E; }
.turn .who { font-size: 14px; letter-spacing: 0.02em; }
.turn.thinking .who::after {
  content: '';
  display: inline-block;
  width: 1em; text-align: left;
  animation: dots 1.1s steps(4, end) infinite;
}
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

.iconbtn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.iconbtn:hover { color: var(--bone); border-color: var(--brass-dim); background: rgba(201, 162, 39, 0.08); }
.iconbtn[aria-pressed="false"] { color: var(--muted-2); }
.iconbtn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- stage ---------- */
.stage { position: relative; min-height: 0; background: var(--night-2); }
#scene { display: block; width: 100%; height: 100%; touch-action: none; cursor: pointer; }

.banner {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  padding: 7px 18px;
  border-radius: 999px;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.04em;
  background: rgba(217, 87, 61, 0.16);
  border: 1px solid rgba(217, 87, 61, 0.55);
  color: #F3A492;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.coach {
  position: absolute;
  left: 50%; bottom: 16px;
  transform: translateX(-50%);
  max-width: min(520px, calc(100% - 32px));
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 15px;
  border-radius: 12px;
  background: rgba(16, 20, 27, 0.9);
  border: 1px solid var(--line);
  border-left: 3px solid var(--jade);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.coach b { color: var(--jade); font-weight: 700; }
.coach.warn { border-left-color: var(--ember); }
.coach.warn b { color: #F0937D; }

/* ---------- rail ---------- */
.rail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.panel { background: var(--panel); padding: 15px 17px; }
.panel h2 {
  margin: 0 0 11px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.field + .field { margin-top: 13px; }
.field > label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.seg {
  display: flex;
  padding: 3px;
  gap: 3px;
  background: var(--night-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.seg button {
  flex: 1;
  padding: 8px 4px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.seg button:hover { color: var(--bone); }
.seg button[aria-pressed="true"] {
  background: var(--brass);
  color: #14110A;
  font-weight: 700;
}

.modehint {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

/* captures */
.trays { display: flex; flex-direction: column; gap: 10px; }
.tray { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.tray .side {
  font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted-2); width: 64px; flex: none; line-height: 1.25;
}
.tray .glyphs {
  font-family: var(--chess);
  font-size: 21px;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--bone);
  flex: 1;
  word-break: break-all;
}
.tray.dark .glyphs { color: #9A8F7C; }
.tray .edge {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--jade);
  flex: none;
}

/* notation */
.moves { flex: 1; min-height: 140px; display: flex; flex-direction: column; }
.movelist {
  flex: 1;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.9;
  min-height: 90px;
}
.movelist .row { display: grid; grid-template-columns: 30px 1fr 1fr; gap: 6px; }
.movelist .row:nth-child(odd) { background: rgba(255, 255, 255, 0.018); }
.movelist .n { color: var(--muted-2); }
.movelist .w { color: var(--bone); }
.movelist .b { color: #A79C88; }
.movelist .empty { color: var(--muted-2); font-family: var(--ui); font-size: 12px; line-height: 1.6; }

/* actions */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn {
  padding: 11px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color .16s, background .16s, color .16s;
}
.btn:hover { border-color: var(--brass-dim); background: #242A36; }
.btn:disabled { opacity: 0.38; cursor: default; }
.btn:disabled:hover { border-color: var(--line); background: var(--panel-2); }
.btn.primary {
  grid-column: 1 / -1;
  background: var(--brass);
  border-color: var(--brass);
  color: #14110A;
  font-weight: 500;
}
.btn.primary:hover { background: #D9B437; border-color: #D9B437; }

/* ---------- overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 8, 12, 0.72);
  backdrop-filter: blur(7px);
  z-index: 20;
}
.card {
  width: min(520px, 100%);
  max-height: 100%;
  overflow-y: auto;
  background: linear-gradient(180deg, #1A1F29 0%, #141822 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 26px 22px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.card .kicker {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--brass); margin-bottom: 9px;
}
.card h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(27px, 6vw, 35px);
  line-height: 1.15;
  color: var(--bone);
  text-wrap: balance;
}
.card p.lede { margin: 0 0 20px; color: var(--muted); font-size: 14.5px; line-height: 1.6; max-width: 44ch; }
.card .field + .field { margin-top: 15px; }
.card .btn.primary { margin-top: 20px; width: 100%; padding: 13px; font-size: 14.5px; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.choice button {
  display: block;
  text-align: left;
  padding: 12px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--night-2);
  color: var(--ink);
  font-family: var(--ui);
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.choice button:hover { border-color: var(--brass-dim); }
.choice button[aria-pressed="true"] {
  border-color: var(--brass);
  background: rgba(201, 162, 39, 0.11);
}
.choice .t { display: block; font-size: 15px; font-weight: 700; margin-bottom: 3px; color: var(--bone); }
.choice .d { display: block; font-size: 12.5px; color: var(--muted-2); line-height: 1.4; }

/* result */
.result-figure {
  font-family: var(--chess);
  font-size: 54px;
  line-height: 1;
  color: var(--brass);
  margin-bottom: 10px;
}
.result-line { font-family: var(--mono); color: var(--muted); font-size: 13px; margin: 0 0 4px; }

@media (max-width: 900px) {
  #app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(200px, 1fr) auto;
  }
  .rail {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: 40vh;
  }
  .brand .school { display: none; }
  .brand h1 { font-size: 18px; }
  .moves { min-height: 0; }
  .movelist { max-height: 120px; }
}

@media (max-width: 560px) {
  .topbar { padding-inline: 16px; gap: 9px; }
  .panel { padding: 13px 16px; }
  .brand { gap: 7px; }
  .brand .mark { font-size: 18px; }
  .brand h1 { font-size: 16px; }
  .turn { padding: 5px 10px 5px 7px; gap: 7px; }
  .turn .who { font-size: 11.5px; }
  .turn .disc { width: 12px; height: 12px; }
  .iconbtn { width: 32px; height: 32px; }
  .iconbtn svg { width: 17px; height: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- players, clocks, summary (added) ---------- */
.players { display: flex; flex-direction: column; gap: 7px; }
.player {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--night-2);
}
.player .disc {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bone);
  border: 1px solid rgba(0, 0, 0, 0.45);
  flex: none;
}
.player .disc.dark { background: #2A1C15; border-color: #12100E; }
.player .nm {
  flex: 1; min-width: 0;
  font-size: 14px;
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.player .pts {
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--brass);
  flex: none;
}
.player.active { border-color: var(--brass-dim); background: rgba(201, 162, 39, 0.08); }
.matchline { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted-2); }

.summary { margin: 0; display: flex; flex-direction: column; gap: 7px; }
.summary > div { display: flex; align-items: baseline; gap: 10px; }
.summary dt {
  font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted-2); width: 76px; flex: none;
}
.summary dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }

/* clocks over the board */
.clocks {
  position: absolute;
  top: 14px; left: 14px;
  display: flex; flex-direction: column; gap: 7px;
  pointer-events: none;
}
.clock {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 12px 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(11, 14, 19, 0.82);
  backdrop-filter: blur(7px);
  min-width: 166px;
}
.clock .disc {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bone); border: 1px solid rgba(0, 0, 0, 0.45); flex: none;
}
.clock .disc.dark { background: #2A1C15; border-color: #12100E; }
.clock .nm {
  flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.clock .tm {
  font-family: var(--mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  flex: none;
}
.clock.active { border-color: var(--brass); background: rgba(201, 162, 39, 0.14); }
.clock.active .nm { color: var(--bone); }
.clock.low .tm { color: var(--ember); }

/* name entry */
.namerow { display: flex; align-items: center; gap: 10px; }
.namerow + .namerow { margin-top: 8px; }
.namerow .disc {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bone); border: 1px solid rgba(0, 0, 0, 0.45); flex: none;
}
.namerow .disc.dark { background: #2A1C15; border-color: #12100E; }
.input {
  flex: 1; min-width: 0;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--night-2);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 14px;
}
.input::placeholder { color: var(--muted-2); }
.input:focus { border-color: var(--brass-dim); outline: none; }
.input:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }

/* scoreboard on the result card */
.scoreboard {
  margin: 18px 0 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}
.sb-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--night-2);
}
.sb-row + .sb-row { border-top: 1px solid var(--line); }
.sb-row.draws .sb-name, .sb-row.draws .sb-val { color: var(--muted-2); }
.sb-name { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-val {
  font-family: var(--mono); font-size: 17px;
  font-variant-numeric: tabular-nums; color: var(--brass); flex: none;
}
#result .actions { grid-template-columns: 1fr 1fr; margin-top: 18px; }
#result .btn.primary { grid-column: 1 / -1; }

.btn.ghost {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 9px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn.ghost:hover { background: transparent; border-color: var(--line); color: var(--ink); }

/* full-screen board */
.stage-turn {
  position: absolute;
  top: 14px; right: 14px;
  display: none;
  align-items: center; gap: 9px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(11, 14, 19, 0.82);
  backdrop-filter: blur(7px);
  font-size: 13px;
  color: var(--ink);
  pointer-events: none;
}
.cinema-exit {
  position: absolute;
  bottom: 16px; right: 16px;
  display: none;
  padding: 9px 15px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(11, 14, 19, 0.86);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(7px);
}
.cinema-exit:hover { border-color: var(--brass-dim); }

#app.cinema { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
#app.cinema .topbar, #app.cinema .rail { display: none; }
#app.cinema .stage-turn { display: flex; }
#app.cinema .cinema-exit { display: block; }
#app.cinema .coach { bottom: 70px; }

@media (max-width: 560px) {
  .clock { min-width: 0; padding: 6px 10px 6px 8px; gap: 7px; }
  .clock .nm { display: none; }
  .clock .tm { font-size: 13.5px; }
  .clocks { top: 10px; left: 10px; gap: 6px; }
  .stage-turn { font-size: 12px; padding: 6px 11px; top: 10px; right: 10px; }
  #result .actions { grid-template-columns: 1fr; }
}

/* fixes after review */
#field-view { margin-top: 15px; }
.tray .side {
  width: auto;
  max-width: 124px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.tray .glyphs { min-width: 0; }
@media (max-width: 560px) {
  .turn .who { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* keep paired choice cards the same height */
.choice button { align-self: stretch; }

/* ---------- checkers additions ---------- */
:root { --lacquer: #A3241E; }
.brand { align-items: center; }
.brand .mark svg { width: 24px; height: 24px; display: block; fill: none; stroke: var(--brass); stroke-width: 1.5; stroke-linejoin: round; }

.disc.red, .turn.red .disc { background: var(--lacquer) !important; border-color: #4A0E0B !important; }
.disc.dark, .turn:not(.red) .disc { background: #2A1C15; border-color: #12100E; }

.tray .tokens { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.token {
  width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.35), inset 0 0 0 3px rgba(255, 255, 255, 0.06);
}
.token.dark { background: #2A1C15; }
.token.red { background: var(--lacquer); }
.token.king { box-shadow: inset 0 0 0 2px var(--brass); }
.tray .none { font-size: 12.5px; color: var(--muted-2); }

.result-figure { display: flex; }
.bigdisc {
  width: 58px; height: 58px; border-radius: 50%;
  background: #2A1C15; border: 2px solid #12100E;
  box-shadow: inset 0 0 0 5px rgba(255,255,255,0.06), inset 0 -6px 10px rgba(0,0,0,0.45), 0 0 0 3px var(--brass);
}
.bigdisc.red { background: var(--lacquer); border-color: #4A0E0B; }
.bigdisc.draw {
  background: linear-gradient(90deg, #2A1C15 50%, var(--lacquer) 50%);
}
.card p.lede b { color: var(--bone); }
@media (max-width: 420px) {
  .brand .mark { display: none; }
}

/* ---------- 2D board ---------- */
.board2d { position: absolute; inset: 0; overflow: hidden; }
.b2-frame {
  --b2-pad: 5.2%;
  position: absolute;
  border-radius: 10px;
  padding: var(--b2-pad);
  background:
    repeating-linear-gradient(97deg, rgba(0,0,0,0.10) 0 2px, transparent 2px 9px),
    linear-gradient(160deg, #54301C, #3A1F11);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.b2-inner {
  position: relative; width: 100%; height: 100%;
  outline: 3px solid var(--brass);
  outline-offset: 2px;
  touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.b2-cell { position: absolute; width: 12.5%; height: 12.5%; cursor: pointer; }
.b2-cell.light {
  background:
    repeating-linear-gradient(92deg, rgba(150,110,60,0.10) 0 1px, transparent 1px 7px),
    #E6D3AC;
}
.b2-cell.dark {
  background:
    repeating-linear-gradient(88deg, rgba(0,0,0,0.13) 0 1px, transparent 1px 6px),
    #6E3F22;
}
.b2-tint { position: absolute; inset: 0; pointer-events: none; transition: background 0.15s; }
.b2-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--display); font-weight: 700;
  font-size: clamp(9px, 1.6vmin, 14px);
  color: var(--brass); opacity: 0.85;
  pointer-events: none;
}
.b2-label.top { top: calc(var(--b2-pad) / 2); }
.b2-label.bottom { top: calc(100% - var(--b2-pad) / 2); }
.b2-label.left { left: calc(var(--b2-pad) / 2); }
.b2-label.right { left: calc(100% - var(--b2-pad) / 2); }

.b2-layer { position: absolute; inset: 0; pointer-events: none; }
.b2-piece { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; will-change: transform; }
.b2-turning .b2-piece { transition: transform 0.5s ease-in-out; }
.b2-disc {
  position: absolute; inset: 10%;
  border-radius: 50%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.b2-disc::before, .b2-disc::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.b2-disc::before { inset: 14%; border: 2px solid rgba(0, 0, 0, 0.28); box-shadow: 0 1px 0 rgba(255,255,255,0.12); }
.b2-disc::after { inset: 32%; border: 1.5px solid rgba(0, 0, 0, 0.22); }
.b2-disc.red {
  background: radial-gradient(circle at 34% 28%, #E4594A 0%, #B82A20 46%, #7A1610 100%);
  box-shadow: 0 3px 0 #5A0F0A, 0 6px 10px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.35);
}
.b2-disc.dark {
  /* lighter charcoal body plus a pale rim so black pieces stand out on the dark squares */
  background: radial-gradient(circle at 34% 28%, #8C7768 0%, #4A3A31 42%, #241A15 100%);
  box-shadow:
    0 0 0 2px rgba(236, 220, 196, 0.75),
    0 3px 0 2px #0A0705,
    0 7px 12px rgba(0,0,0,0.6),
    inset 0 1px 1px rgba(255,255,255,0.3);
}
.b2-disc.dark::before { border-color: rgba(236, 220, 196, 0.32); }
.b2-disc.dark::after { border-color: rgba(236, 220, 196, 0.22); }
.b2-piece.lifted .b2-disc.dark {
  box-shadow: 0 0 0 2px rgba(236, 220, 196, 0.75), 0 3px 0 2px rgba(0,0,0,0.6), 0 14px 16px rgba(0,0,0,0.45), 0 0 0 5px var(--brass);
}
.b2-piece.lifted .b2-disc {
  transform: translateY(-7%) scale(1.08);
  box-shadow: 0 3px 0 rgba(0,0,0,0.6), 0 14px 16px rgba(0,0,0,0.45), 0 0 0 3px var(--brass);
}
.b2-disc.king::before, .b2-disc.king::after { opacity: 0.35; }
.b2-crown {
  position: absolute; left: 50%; top: 50%;
  width: 56%; height: 56%;
  transform: translate(-50%, -50%);
  fill: #E2BC3A; stroke: #7A5F12; stroke-width: 0.9; stroke-linejoin: round;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.6));
  z-index: 1;
}
.b2-dot {
  position: absolute; left: 50%; top: 50%;
  width: 34%; height: 34%; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--jade);
  box-shadow: 0 0 12px rgba(83, 214, 172, 0.6);
  animation: b2pulse 1.2s ease-in-out infinite;
  pointer-events: none;
}
.b2-ring, .b2-hint {
  position: absolute; inset: 4%; border-radius: 50%;
  pointer-events: none; z-index: 2;
}
.b2-ring { border: 3px solid var(--ember); box-shadow: 0 0 10px rgba(217, 87, 61, 0.6); }
.b2-hint { border: 4px solid var(--brass); box-shadow: 0 0 14px rgba(201, 162, 39, 0.7); animation: b2pulse 1.2s ease-in-out infinite; }
/* markers sit on their own layer above the pieces */
.b2-marks { position: absolute; inset: 0; pointer-events: none; }
.b2-spot { position: absolute; width: 12.5%; height: 12.5%; }
@keyframes b2pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) {
  .b2-dot, .b2-hint { animation: none; }
}
@media (max-width: 560px) {
  .b2-frame { --b2-pad: 6%; border-radius: 7px; }
  .view-2d .clocks { flex-direction: row; }
}

/* view switching */
#app.view-2d #scene { display: none; }
#app.view-3d .board2d { display: none; }
.th { font-family: 'Sarabun', var(--ui); }

.panel .modehint + .field { margin-top: 14px; }

/* ---------- English Room Games links ---------- */
a.iconbtn { text-decoration: none; flex-shrink: 0; }
.brand a.school { text-decoration: none; }
.brand a.school:hover { color: var(--brass); }
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
/* phones: the home button takes the place of the small logo so the top bar still fits */
@media (max-width: 560px) {
  .topbar { padding-inline: 12px; gap: 7px; }
  .brand .mark { display: none; }
}
