/* Spires, a cliffside city at dusk. Fixed dark palette (same in light and dark OS modes). */
:root {
  color-scheme: dark;
  --sky-0: #1d1433;
  --sky-1: #33204a;
  --sky-2: #6a2f50;
  --sky-3: #c0584a;
  --ink: #f6ead9;
  --muted: #bca8c6;
  --panel: #251a3b;
  --panel-2: #302350;
  --line: #4d3a69;
  --ember: #f0703a;
  --ember-dark: #7a2a0e;
  --ember-light: #ffd0a8;
  --tide: #37c6c0;
  --tide-dark: #0c4a50;
  --tide-light: #c6f5f1;
  --gold: #ffcf5a;
  --violet: #c9a2ff;
  --rose: #ff5d7d;
  --ground: #6e5563;
  --ground-2: #634b5a;
  --tier1: #c29d86;
  --tier2: #dbbb9b;
  --tier3: #f1dcbd;
  --cap: #3c4aa0;
  --cell: 64px;
  /* tutorial kit (tutorial.css) */
  --tut-accent: #ffcf5a;
  --tut-accent-ink: #2a1a08;
  --tut-bubble: #fbf1e2;
  --tut-ink: #1d1433;
  --tut-muted: #6f5a7e;
  --tut-dim: rgba(12, 7, 24, .62);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--sky-0) 0%, var(--sky-1) 45%, var(--sky-2) 80%, var(--sky-3) 100%) fixed;
  color: var(--ink);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  touch-action: manipulation;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; touch-action: manipulation; }
[hidden] { display: none !important; }

.skyline {
  position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: 22vh; max-height: 170px;
  pointer-events: none; z-index: 0;
}

/* ---------- top bar ---------- */
.app {
  position: relative; z-index: 1;
  max-width: 1040px; margin: 0 auto;
  padding: env(safe-area-inset-top) max(10px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}
.topbar { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; min-height: 52px; }
.back {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  color: var(--muted); text-decoration: none; font-size: 24px; border-radius: 22px;
}
.back:hover, .back:focus-visible { color: var(--gold); background: rgba(255, 255, 255, .06); }
.title {
  margin: 0; font-size: 21px; letter-spacing: .08em; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.logo { width: 26px; height: 26px; }
.iconbtn {
  width: 44px; height: 44px; border: 0; border-radius: 22px; background: transparent;
  font-size: 22px; line-height: 1; color: var(--ink); cursor: pointer; justify-self: end;
}
.iconbtn:hover, .iconbtn[aria-expanded="true"] { background: rgba(255, 255, 255, .08); }
.iconbtn:focus-visible, .back:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.menu {
  position: absolute; z-index: 15; top: calc(env(safe-area-inset-top) + 50px); right: max(10px, env(safe-area-inset-right));
  min-width: 210px; padding: 6px; border-radius: 16px; background: var(--panel-2);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5), 0 0 0 1px var(--line);
  display: flex; flex-direction: column;
}
.menu button {
  min-height: 48px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent;
  text-align: left; font-weight: 600; cursor: pointer; color: var(--ink);
}
.menu button:hover, .menu button:focus-visible { background: rgba(255, 255, 255, .07); outline: none; }
.menu button:disabled { opacity: .4; cursor: default; background: transparent; }

.btn {
  min-height: 44px; padding: 0 16px; border-radius: 10px;
  border: 2px solid var(--ink); background: var(--ink); color: var(--sky-0);
  font-weight: 700; cursor: pointer; transition: transform .12s, background .15s, opacity .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn.small { min-height: 40px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: rgba(246, 234, 217, .55); }
.btn.primary { background: var(--gold); border-color: #c79a2a; color: #2a1a08; }
.btn.warn { background: transparent; border-color: var(--rose); color: #ffd6de; }
.btn.on { background: var(--violet); border-color: #8d66d6; color: #1d1030; }
.btn:disabled { opacity: .35; cursor: default; transform: none; }
.btn:focus-visible, .cell:focus-visible, .choice button:focus-visible, .talent-chip:focus-visible, .dcard:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}

/* ---------- layout (portrait first) ---------- */
.game { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.players { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pcard {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 6px 8px; border-radius: 12px; background: var(--panel);
  border: 2px solid transparent; transition: border-color .2s, box-shadow .2s;
  flex-wrap: wrap;
}
.pcard.turn.p0 { border-color: var(--ember); box-shadow: 0 0 0 3px rgba(240, 112, 58, .18); }
.pcard.turn.p1 { border-color: var(--tide); box-shadow: 0 0 0 3px rgba(55, 198, 192, .18); }
.pinfo { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.pname { font-size: 15px; }
.prole { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptoken { flex: none; width: 26px; height: 26px; }
.ptoken.p0 { border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--ember-light), var(--ember) 55%, var(--ember-dark)); box-shadow: 0 0 0 2px var(--ember-dark); }
.ptoken.p1 { border-radius: 5px; transform: rotate(45deg) scale(.82); background: radial-gradient(circle at 35% 30%, var(--tide-light), var(--tide) 55%, var(--tide-dark)); box-shadow: 0 0 0 2px var(--tide-dark); }
.talent-chip {
  min-height: 32px; padding: 2px 10px; border-radius: 16px; cursor: pointer;
  border: 1.5px solid var(--violet); background: rgba(201, 162, 255, .12); color: #eadcff;
  font-size: 12px; font-weight: 700; white-space: nowrap; max-width: 100%;
}
.talent-chip::before { content: "\2726 "; color: var(--gold); }

.status {
  min-height: 50px; padding: 6px 12px; border-radius: 12px; background: rgba(21, 14, 36, .72);
  border-left: 5px solid var(--muted); display: flex; flex-direction: column; justify-content: center;
}
.status.p0 { border-left-color: var(--ember); }
.status.p1 { border-left-color: var(--tide); }
.status.warn .status-sub { color: #ffc2cf; }
.status-main { font-weight: 800; font-size: 16px; }
.status-sub { font-size: 13px; color: var(--muted); }
.status.thinking .status-main::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ---------- board ---------- */
.board-col { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.board-wrap {
  position: relative;
  width: min(100%, 540px, calc(100vh - 290px));
  width: min(100%, 540px, calc(100dvh - 290px));
  min-width: min(100%, 300px);
  aspect-ratio: 1 / 1;
  padding: 8px; border-radius: 16px;
  background: linear-gradient(160deg, #3a2940, #22172b);
  box-shadow: 0 14px 30px rgba(8, 4, 18, .55), inset 0 0 0 2px #4a3552;
}
.board {
  position: relative; width: 100%; height: 100%;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(0, 1fr)); gap: 4px;
}
.board-svg { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); pointer-events: none; overflow: visible; }

.cell {
  position: relative; padding: 0; margin: 0; border: 0; border-radius: 8px; cursor: default;
  background: linear-gradient(145deg, var(--ground), var(--ground-2));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 -2px 0 rgba(0, 0, 0, .18);
  overflow: hidden; min-width: 0; min-height: 0;
}
.cell.tap { cursor: pointer; }
.tier {
  position: absolute; inset: 7%; border-radius: 9%;
  box-shadow: 0 3px 0 rgba(60, 34, 36, .55), 0 5px 8px rgba(10, 5, 20, .45);
  transition: background .2s;
}
.tier .tier { inset: 13%; }
.tier.t1 { background: linear-gradient(145deg, #cfac95, var(--tier1)); }
.tier.t2 { background: linear-gradient(145deg, #e6c9ab, var(--tier2)); }
.tier.t3 { background: linear-gradient(145deg, #fbeacd, var(--tier3)); }
.tier.t3::after { /* crenellation dots mark a finished roof */
  content: ""; position: absolute; inset: 10%; border-radius: 6%;
  border: 2px dotted rgba(122, 82, 60, .45);
}
.cap {
  position: absolute; inset: 14%; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #8b98e6 0%, var(--cap) 45%, #1c2256 100%);
  box-shadow: 0 3px 0 #12163d, 0 5px 10px rgba(5, 5, 25, .6);
}
.cap::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22%; height: 22%; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px 3px rgba(255, 207, 90, .7);
}
.cell > .cap { inset: 12%; }
.lvl {
  position: absolute; left: 3px; top: 2px; z-index: 3;
  min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px;
  font-size: 11px; line-height: 16px; font-weight: 800; text-align: center;
  background: rgba(29, 20, 51, .85); color: var(--ink);
}
.lvl.l3 { background: var(--gold); color: #3a2208; }
.lvl.capped { background: var(--cap); color: #fff; }

/* Builders */
.bld {
  position: absolute; left: 50%; top: 50%; width: 56%; height: 56%; z-index: 4;
  transform: translate(-50%, -50%); transition: transform .2s;
  filter: drop-shadow(0 3px 2px rgba(10, 5, 20, .55));
}
.bld svg { width: 100%; height: 100%; display: block; }
.cell.selectable .bld { animation: bob 1.5s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, -58%); } }
.cell.sel .bld { transform: translate(-50%, -56%) scale(1.1); }
.cell.sel::before {
  content: ""; position: absolute; inset: 6%; border-radius: 50%; z-index: 3;
  box-shadow: 0 0 0 3px var(--gold), 0 0 16px 4px rgba(255, 207, 90, .6);
}
.cell.ghost .bld { opacity: .35; }

/* Targets */
.cell.can-move::after, .cell.can-build::after, .cell.can-place::after { content: ""; position: absolute; z-index: 5; pointer-events: none; }
.cell.can-move::after {
  left: 50%; top: 50%; width: 34%; height: 34%; transform: translate(-50%, -50%); border-radius: 50%;
  background: rgba(255, 207, 90, .9); box-shadow: 0 0 0 3px rgba(42, 26, 8, .55), 0 0 14px 4px rgba(255, 207, 90, .55);
  animation: pulse 1.4s ease-in-out infinite;
}
.cell.can-move { box-shadow: inset 0 0 0 3px var(--gold); cursor: pointer; }
.cell.can-move.occupied::after { width: 80%; height: 80%; background: transparent; box-shadow: 0 0 0 4px var(--gold), 0 0 14px 4px rgba(255, 207, 90, .55); }
.cell.can-build { cursor: pointer; }
.cell.can-build::after {
  inset: 5%; border-radius: 10%;
  border: 3px dashed var(--violet); background: rgba(201, 162, 255, .18);
}
.cell.can-build .plus {
  position: absolute; right: 3px; bottom: 1px; z-index: 6; font-weight: 900; font-size: 16px; line-height: 1;
  color: #1d1030; background: var(--violet); border-radius: 6px; padding: 1px 4px; pointer-events: none;
}
.cell.can-place { cursor: pointer; }
.cell.can-place::after {
  left: 50%; top: 50%; width: 26%; height: 26%; transform: translate(-50%, -50%); border-radius: 50%;
  border: 3px solid rgba(255, 207, 90, .85);
}
.cell .star {
  position: absolute; right: 2px; top: 0; z-index: 6; color: var(--gold); font-size: 18px; line-height: 1;
  text-shadow: 0 0 6px rgba(0, 0, 0, .8); pointer-events: none;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.cell .danger {
  position: absolute; right: 0; top: 0; width: 0; height: 0; z-index: 2;
  border-top: 18px solid var(--rose); border-left: 18px solid transparent; pointer-events: none;
}
.cell.last-build .ring {
  position: absolute; inset: 3%; border-radius: 12%; z-index: 2; pointer-events: none;
  border: 2.5px solid var(--lastc, var(--ink)); opacity: .9;
  animation: fadeRing 2.4s ease-out 1;
}
.cell.last-from .foot {
  position: absolute; left: 50%; top: 50%; width: 22%; height: 22%; transform: translate(-50%, -50%);
  border-radius: 50%; border: 2px dashed var(--lastc, var(--ink)); opacity: .8; z-index: 2; pointer-events: none;
}
@keyframes fadeRing { 0% { transform: scale(1.25); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1); } }

/* ---------- actions / side panel ---------- */
.actions {
  width: min(100%, 540px); min-height: 44px;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px;
}
.actions .hint-text { font-size: 13px; color: var(--muted); text-align: center; }
.tray {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px;
  padding: 8px 10px; border-radius: 12px; background: rgba(21, 14, 36, .72); font-size: 13px;
}
.tray .pc { display: inline-flex; align-items: center; gap: 5px; }
.tray .pc.out { opacity: .4; text-decoration: line-through; }
.tray .ico { display: inline-block; width: 16px; height: 16px; border-radius: 3px; }
.tray .ico.t1 { background: var(--tier1); }
.tray .ico.t2 { background: var(--tier2); width: 13px; height: 13px; }
.tray .ico.t3 { background: var(--tier3); width: 10px; height: 10px; }
.tray .ico.c { background: var(--cap); border-radius: 50%; box-shadow: inset 0 0 0 4px var(--cap), inset 0 0 0 8px var(--gold); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg { display: inline-block; width: 14px; height: 14px; }
.lg-move { border-radius: 50%; background: var(--gold); }
.lg-build { border: 2px dashed var(--violet); border-radius: 3px; }
.lg-danger { border-top: 14px solid var(--rose); border-left: 14px solid transparent; width: 0; height: 0; }
.log {
  list-style: none; margin: 0; padding: 8px 10px; border-radius: 12px; background: rgba(21, 14, 36, .6);
  font-size: 13px;
}
.info-panel { width: min(100%, 560px); padding: 0; display: flex; flex-direction: column; }
.info-panel .legend { justify-content: flex-start; font-size: 13px; }
.info-panel .tray { justify-content: flex-start; }
.log li { padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); display: flex; gap: 7px; align-items: baseline; }
.log li:last-child { border-bottom: 0; }
.log .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.log .dot.p0 { background: var(--ember); }
.log .dot.p1 { background: var(--tide); border-radius: 2px; transform: rotate(45deg); }
.log li.sys { color: var(--muted); font-style: italic; }
.log li:first-child { color: var(--ink); font-weight: 600; }

/* ---------- overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  padding: 12px; background: rgba(12, 7, 24, .72);
  overflow-y: auto;
}
.sheet {
  width: min(100%, 520px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.sheet h2 { margin: 0 0 6px; font-size: 22px; }
.howwin {
  display: flex; gap: 10px; align-items: center; margin: 6px 0 12px; padding: 10px;
  border-radius: 12px; background: rgba(255, 207, 90, .09); border: 1px solid rgba(255, 207, 90, .4);
}
.howwin p { margin: 0; font-size: 13.5px; }
.howwin-art { width: 104px; flex: none; }
.choice { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.choice legend { font-weight: 700; font-size: 13px; margin-bottom: 5px; padding: 0; }
.choice .hint { font-weight: 400; color: var(--muted); }
.choice button {
  flex: 1 1 auto; min-height: 44px; padding: 0 12px; border-radius: 10px; cursor: pointer;
  border: 2px solid var(--line); background: var(--panel-2); color: var(--ink); font-weight: 600;
}
.choice button[aria-checked="true"] { border-color: var(--gold); background: rgba(255, 207, 90, .16); color: #fff3cf; }
.choice.disabled { opacity: .4; pointer-events: none; }
.fine { font-size: 12.5px; color: var(--muted); margin: 4px 0 8px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }

.draft-cards { display: grid; gap: 10px; }
.dcard {
  text-align: left; padding: 12px 14px; border-radius: 14px; cursor: pointer; min-height: 44px;
  border: 2px solid var(--violet); background: linear-gradient(145deg, #3a2a5e, #2b1f45); color: var(--ink);
}
.dcard b { display: block; font-size: 17px; margin-bottom: 3px; }
.dcard b::before { content: "\2726 "; color: var(--gold); }
.dcard span { display: block; font-size: 13.5px; }
.dcard i { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.dcard.taken { opacity: .35; border-style: dashed; cursor: default; }

.info-sheet, .over-sheet { text-align: center; }
.ti-mark, .over-mark { width: 64px; height: 64px; margin: 0 auto 8px; }
.over-way { font-size: 16px; font-weight: 700; margin: 4px 0; color: var(--gold); }

.help-sheet { width: min(100%, 640px); padding: 0; display: flex; flex-direction: column; }
.help-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 18px 8px; border-bottom: 1px solid var(--line); }
.help-head h2 { margin: 0; font-size: 20px; }
.help-body { padding: 4px 18px 18px; overflow-y: auto; }
.help-body h3 { margin: 16px 0 6px; font-size: 16px; color: var(--gold); }
.help-body p, .help-body li { font-size: 14px; }
.help-body ul, .help-body ol { padding-left: 20px; margin: 6px 0; }
.goal-box { padding: 10px 12px; border-radius: 10px; background: rgba(255, 207, 90, .1); border: 1px solid rgba(255, 207, 90, .45); }
.t-ember { color: var(--ember); }
.t-tide { color: var(--tide); }
.t-gold { color: var(--gold); }
.t-violet { color: var(--violet); }
.talent-list { display: grid; gap: 8px; }
.talent-list div { padding: 8px 10px; border-radius: 10px; background: var(--panel-2); font-size: 13.5px; }
.talent-list b { color: #eadcff; }
.talent-list i { color: var(--muted); }
.rates { border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.rates td, .rates th { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; }

/* ---------- wider screens: one centred column, a bigger board ---------- */
@media (min-width: 820px) {
  .game { max-width: 640px; margin: 0 auto; }
  .board-wrap { width: min(100%, 580px, calc(100vh - 250px)); width: min(100%, 580px, calc(100dvh - 250px)); }
}
@media (max-width: 380px) {
  .title { font-size: 18px; margin-left: 2px; }
  .logo { display: none; }
  .btn.small { padding: 0 8px; }
  .howwin-art { width: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- online play ---------- */
.pcard { position: relative; }
.pdot {
  position: absolute; left: 27px; top: 50%; margin-top: 4px; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--panel); background: #7d6f86; transition: background .3s;
}
.pdot.on { background: #5fd38a; }
.pdot.off { background: #7d6f86; }
/* Online result screen: Rematch full width on top, View board and Leave under it. */
.sheet-actions.online-over { justify-content: center; }
.sheet-actions.online-over .btn { flex: 1 1 0; }
.sheet-actions.online-over #over-rematch { order: -1; flex-basis: 100%; }

/* The online kit (online.js, online.css) in Spires' dusk palette: its dialog (#online.bp-online: invite
   link, friends list, List in Open games, joining, errors) and the end bar after a finished game. The
   kit's colours are variables; the few it fixes (white fields) are set here. #online outranks the kit. */
#online.bp-online {
  --on-accent: var(--gold); --on-accent-ink: #2a1a08; --on-panel: var(--panel); --on-ink: var(--ink);
  --on-muted: var(--muted); --on-line: rgba(246, 234, 217, .22); background: rgba(12, 7, 24, .72);
}
#online .online-sheet { border: 1px solid var(--line); }
#online .btn { background: rgba(255, 255, 255, .08); }
#online .btn.primary { background: var(--gold); color: #2a1a08; }
#online .btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px rgba(246, 234, 217, .55); }
#online .online-url { background: var(--sky-0); color: var(--ink); border: 2px solid var(--line); text-align: center; }
#online .online-url:focus { border-color: var(--gold); }
#online .online-friend, #online .on-sw { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); }
#online .online-friend .dot { background: rgba(255, 255, 255, .2); }
#online .online-friend.on .dot { background: #4cd07d; box-shadow: 0 0 0 3px rgba(76, 208, 125, .18); }
#online .online-friend .fstate { color: var(--muted); }
#online .online-friend .fact { color: var(--gold); }
#online .online-friend.sent .fact { color: #4cd07d; }
#online .online-friend.no .fact { color: var(--rose); }
#online .online-signin a { color: var(--gold); }
#online .on-sw-track { background: rgba(255, 255, 255, .18); }
#online .on-sw[aria-checked="true"] .on-sw-track { background: #4cd07d; }
body .bp-online-endbar { background: var(--panel-2); color: var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 1px var(--line); }
body .bp-online-endbar .bp-endbar-btn { background: rgba(255, 255, 255, .08); color: var(--ink); }
body .bp-online-endbar .bp-endbar-btn.primary { background: var(--gold); color: #2a1a08; }
/* While the end bar shows, it replaces the Rematch under the board (Results stays), with room to scroll above it. */
body:has(.bp-online-endbar:not([hidden])) #actions [data-act="rematch"] { display: none; }
body:has(.bp-online-endbar:not([hidden])) .app { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
