/* Shared by the TV and the phones. */
:root { --bg: #161412; --fg: #f4efe7; --muted: #b3a998; --me: #ffd166; --accent: #ff5b1f; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 16px/1.35 system-ui, -apple-system, sans-serif; }
body { display: flex; flex-direction: column; justify-content: center; overflow: hidden; -webkit-user-select: none; user-select: none; }
.player { display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-height: 52px; }
.player .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #0008; flex: none; }
.player .dot.w { background: #f6f0e4; } .player .dot.b { background: #2c2723; border-color: #fff5; }
.player .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .taken { display: flex; align-items: center; flex-wrap: wrap; margin-left: auto; min-height: 20px; }
.player .taken svg { margin-left: -5px; }
.player .lead { color: var(--muted); font-weight: 700; font-size: 14px; margin-left: 4px; }
.player.turn .name { color: var(--me); }
.status { text-align: center; font-weight: 700; min-height: 26px; padding: 2px 12px 6px; }
.status.mine { color: var(--me); }
.stage { flex: 0 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 8px; }
.stage svg.board { width: min(100%, 100vh); height: auto; max-height: 100%; aspect-ratio: 1; border-radius: 6px; box-shadow: 0 8px 30px #0008; touch-action: manipulation; }
.coord { font: 700 17px system-ui; }
.moving { will-change: transform; }
.bar { display: flex; justify-content: center; gap: 10px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
.bar button { appearance: none; border: 0; border-radius: 6px; padding: 12px 18px; font: 700 15px system-ui; background: #2e2a26; color: var(--fg); min-height: 48px; }
.bar button.danger { background: #6b231a; }
.picker { position: fixed; inset: 0; background: #000a; display: flex; align-items: center; justify-content: center; z-index: 50; }
.picker[hidden] { display: none; }
.picker .card { background: #241f1b; border-radius: 10px; padding: 16px; text-align: center; }
.picker .card p { margin: 0 0 10px; font-weight: 700; }
.picker .row { display: flex; gap: 8px; }
.picker button { appearance: none; border: 0; background: #efdcbc; border-radius: 8px; width: 72px; height: 72px; padding: 6px; }
.result { position: fixed; left: 50%; top: 46%; transform: translate(-50%, -50%); background: #000d; padding: 18px 26px; border-radius: 10px;
  font: 800 26px system-ui; text-align: center; pointer-events: none; max-width: 90vw; }
.result small { display: block; font: 600 15px system-ui; color: var(--muted); margin-top: 4px; }
.result[hidden] { display: none; }

/* The TV: board on the left, players and moves on the right. */
body.tv { flex-direction: row; padding: 4vh 4vw; gap: 4vw; }
body.tv .stage { flex: none; height: 92vh; width: 92vh; padding: 0; }
body.tv .stage svg.board { width: 100%; }
body.tv .side { flex: 1; display: flex; flex-direction: column; gap: 2vh; min-width: 0; }
body.tv .player { font-size: 3vh; padding: 1vh 0; }
body.tv .player .dot { width: 2.4vh; height: 2.4vh; }
body.tv .status { font-size: 3.6vh; text-align: left; padding: 1vh 0; }
body.tv .moves { flex: 1; overflow: hidden; display: grid; grid-template-columns: 3ch 1fr 1fr; gap: .6vh 1.5vw; align-content: start;
  font: 600 2.6vh ui-monospace, monospace; color: var(--muted); }
body.tv .moves .n { opacity: .6; } body.tv .moves .now { color: var(--fg); }
body.tv .result { font-size: 5vh; } body.tv .result small { font-size: 2.6vh; }
