/* Ludo identity: "playroom lacquer". Deep indigo chrome, warm off-white board, candy player colours, amber accent. */
:root {
  --bg: #0e1220; --surface: #181d31; --surface-2: #232a44; --ink: #f4f1ea; --ink-2: #a3a9c2; --line: #2c344f;
  --accent: #ffb703; --accent-ink: #2a1a00; --ok: #7ee2a8; --warn: #ffd166; --bad: #ff7a8a; --info: #8fbfff;
  --board: #f7f2e8; --board-2: #ebe3d3; --frame: #2a2140; --frame-2: #17122a; --cell: #ffffff; --cell-edge: #d9d1c1;
  --red: #e63946; --green: #2a9d8f; --yellow: #f4a261; --blue: #457bd6;
  --font-display: "Baloo 2", "Nunito Sans", system-ui, sans-serif; --font-ui: "Nunito Sans", system-ui, sans-serif;
}
:root[data-theme="light"] { --bg: #f1ecff; --surface: #ffffff; --surface-2: #e6e0f5; --ink: #1b1533; --ink-2: #5d5680; --line: #d5cdea; --accent: #e09a00; --accent-ink: #fff; --frame: #3b2f5c; --frame-2: #26203f; }
:root[data-colorblind="1"] { --red: #d55e00; --green: #009e73; --yellow: #f0e442; --blue: #0072b2; }
:root[data-contrast="1"] { --cell-edge: #9a8f7a; --ink-2: #c9cde0; }
body { background: radial-gradient(ellipse at 50% -10%, #23294a 0%, var(--bg) 55%); }
:root[data-theme="light"] body { background: radial-gradient(ellipse at 50% -10%, #ffffff 0%, var(--bg) 60%); }
h1, h2, .title, .sheet-title, .mode b, .cta { font-family: var(--font-display); }
.logo { display: flex; justify-content: center; margin-bottom: -10px; } .logo canvas { width: 240px; height: 96px; }
.title { font-size: clamp(3.4rem, 17vw, 5.6rem); font-weight: 800; letter-spacing: .02em; color: var(--accent); text-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 26px color-mix(in oklab, var(--accent) 50%, transparent); }
.tagline { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.modes { grid-template-columns: 1fr 1fr; }
.mode b { font-size: 1.15rem; }
.seat-row .seat-name { font-family: var(--font-display); font-size: 1.05rem; }
.seat-row .seat-toggle { width: 36px; height: 36px; min-width: 36px; font-size: 1.2rem; }
.best-line { gap: 16px; }
/* play */
.play .stage { padding: 4px 8px 6px; grid-auto-rows: max-content; align-content: center; row-gap: 12px; }
.play .stage-canvas { border-radius: 18px; box-shadow: 0 0 0 1px rgba(255,255,255,.05), 0 24px 60px rgba(0,0,0,.55), 0 4px 12px rgba(0,0,0,.35); }
.roll-pill { position: static; order: 2; z-index: 4; height: 40px; min-width: 132px; padding: 0 22px; font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; background: var(--pc, var(--accent)); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.3); box-shadow: 0 8px 22px color-mix(in oklab, var(--pc, var(--accent)) 55%, transparent), inset 0 -3px 0 rgba(0,0,0,.22), inset 0 2px 0 rgba(255,255,255,.35); animation: pill-glow 1.6s ease-in-out infinite; }
.roll-pill:disabled { opacity: .35; animation: none; }
/* `data-off` (not `hidden`: base.css forces display:none) keeps the pill's row so the board never jumps between the roll and move phases */
.roll-pill[data-off="true"] { visibility: hidden; pointer-events: none; animation: none; }
@keyframes pill-glow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }
:root[data-motion="reduced"] .roll-pill { animation: none; }
.hud-pill .sep { color: var(--ink-2); padding: 0 2px; }
#hud-mode-label { color: var(--accent); }
/* rails: two fixed slots each so seats sit under their board corners */
.rail { justify-content: space-between; gap: 8px; min-height: 54px; padding: 4px 10px; }
.rail .slot { flex: 1 1 0; min-width: 0; display: flex; }
.rail .slot[data-side="right"] { justify-content: flex-end; }
.seat { max-width: 100%; height: 44px; padding: 0 10px 0 5px; gap: 7px; }
.seat .avatar { width: 32px; height: 32px; font-family: var(--font-display); font-size: .95rem; font-weight: 800; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.3); box-shadow: inset 0 -4px 0 rgb(0 0 0 / .22), inset 0 2px 0 rgb(255 255 255 / .35); position: relative; }
.seat .avatar .rank { position: absolute; right: -6px; top: -7px; background: var(--accent); color: var(--accent-ink); font-size: .58rem; padding: 1px 5px; border-radius: 999px; box-shadow: 0 2px 4px rgba(0,0,0,.35); font-family: var(--font-ui); }
.seat .who b { font-family: var(--font-display); font-size: .92rem; }
.seat .who small { font-size: .64rem; letter-spacing: .05em; }
.seat .who small .tnum { color: var(--ink); font-weight: 800; }
.seat[data-active="true"] { background: color-mix(in oklab, var(--pc) 18%, var(--surface)); }
.seat[data-done="true"] { opacity: .8; }
.play .rail-top { padding-top: 0; } .play .rail-bottom { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
/* result */
.result-verdict { font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); }
.result-ranks { list-style: none; display: flex; flex-direction: column; gap: 6px; padding: 0; margin: 0; }
.result-ranks li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-md); background: var(--surface-2); font-weight: 700; }
.result-ranks .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--pc); box-shadow: inset 0 -3px 0 rgb(0 0 0 / .25); flex: 0 0 auto; }
.result-ranks .pos { font-family: var(--font-display); font-size: 1.1rem; width: 2.2em; color: var(--accent); }
.result-ranks small { margin-left: auto; color: var(--ink-2); font-weight: 600; }
.set-group { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; margin: 6px 0 -6px; }
.set-group small { text-transform: none; letter-spacing: 0; font-weight: 600; }
@container screen (min-width: 640px) { .board-home .modes { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  .play .stage { padding: 10px 10px 62px; display: grid; place-items: center; }
  .roll-pill { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); }
  .rail .slot { flex: 0 0 auto; justify-content: center; }
  .play .rail-top, .play .rail-bottom { gap: 18px; }
  .seat { height: 56px; padding: 0 14px 0 8px; }
  .seat .avatar { width: 38px; height: 38px; }
  .roll-pill { height: 48px; font-size: 1.25rem; }
}

/* keep turn toasts clear of the HUD pill on the play screen */
body:has(.play:not([hidden])) .toast-host { top: 108px; }
