/* Backgammon identity: "leather case". Oxblood/brown chrome, stitched leather board, cream and oxblood felt points, gold accent. */
:root {
  --bg: #2a1a12; --surface: #3a2619; --surface-2: #4a3222; --ink: #f6ecd6; --ink-2: #c9b295; --line: #55392a;
  --accent: #e2b76a; --accent-ink: #2a1a12; --ok: #9fd8a6; --warn: #f2d38a; --bad: #f0958a; --info: #d9b98a;
  --leather: #6b4a2e; --leather-2: #4a3120; --bar: #3d2718; --stitch: #c9a56a; --pt-a: #e8d5b0; --pt-b: #8f2f2a; --gold: #e2b76a; --ivory: #f3e6c8; --ebony: #1c130c; --tray: #2b1a10;
  --white-ui: #f3e6c8; --black-ui: #5a4030;
  --font-display: "Playfair Display", Georgia, serif; --font-ui: "Nunito Sans", system-ui, sans-serif;
}
:root[data-theme="light"] { --bg: #f1e7d6; --surface: #fffaf0; --surface-2: #ead9bf; --ink: #2a1a12; --ink-2: #6e5340; --line: #d9c5a6; --accent: #b8822a; --accent-ink: #fff; --leather: #8a6340; --leather-2: #6b4a2e; --bar: #5a3d27; --stitch: #f3dfb5; --tray: #3d2718; --black-ui: #3a2a1e; }
:root[data-colorblind="1"] { --pt-b: #1f5f8b; --pt-a: #f0dfb5; }
:root[data-contrast="1"] { --ink-2: #e6d6bd; --stitch: #ffe2a8; --pt-b: #7a1f1a; }
body { background: radial-gradient(ellipse at 50% -10%, #4a2e1e 0%, var(--bg) 60%); }
:root[data-theme="light"] body { background: radial-gradient(ellipse at 50% -10%, #fffaf0 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: -8px; } .logo canvas { width: 240px; height: 96px; }
.title { font-size: clamp(2.6rem, 12vw, 4.6rem); font-weight: 700; letter-spacing: .01em; color: var(--accent); text-shadow: 0 2px 0 rgba(0,0,0,.4), 0 0 26px color-mix(in oklab, var(--accent) 45%, transparent); }
.tagline { font-family: var(--font-display); font-style: italic; font-size: 1.15rem; }
.modes { grid-template-columns: 1fr 1fr; }
.seg-line [role="radio"] { height: 40px; }
.picker[hidden] { display: none; }
.best-line { gap: 16px; }
.seat-row .seat-name { font-family: var(--font-display); font-size: 1rem; }
/* play: compact rails so the landscape board gets the height */
.play .hud { padding-bottom: 2px; }
.play .rail { min-height: 46px; padding: 2px 10px; }
.play .rail-top { padding-top: 0; } .play .rail-bottom { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.play .stage { padding: 2px 6px 4px; display: grid; grid-auto-rows: max-content; align-content: center; justify-items: center; row-gap: 12px; }
.play .stage-canvas { order: 1; }
.play .stage-canvas { border-radius: 14px; box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 22px 60px rgba(0,0,0,.55), 0 4px 14px rgba(0,0,0,.4); }
.controls { order: 2; position: relative; display: flex; gap: 8px; align-items: center; justify-content: center; min-height: 48px; width: 100%; padding: 0 4px; }
.ctl { height: 44px; min-height: 44px; padding: 0 14px; font-family: var(--font-ui); font-weight: 800; letter-spacing: .04em; border-radius: 999px; gap: 6px; }
.ctl .icon { width: 18px; height: 18px; }
.ctl-main { min-width: 124px; font-family: var(--font-display); font-size: 1.1rem; letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 8px 22px color-mix(in oklab, var(--accent) 45%, transparent), inset 0 -3px 0 rgba(0,0,0,.22), inset 0 2px 0 rgba(255,255,255,.35); animation: ctl-glow 1.6s ease-in-out infinite; }
.ctl-main:disabled { opacity: .4; animation: none; box-shadow: none; }
/* `data-off` (not `hidden`: base.css forces display:none) keeps the row height so the board never jumps between phases */
.ctl[data-off="true"] { visibility: hidden; pointer-events: none; animation: none; position: absolute; }
.cube-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: #f6ecd6; color: #2a1a12; font-family: var(--font-display); font-size: .7rem; font-weight: 700; box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); }
@keyframes ctl-glow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.15); } }
:root[data-motion="reduced"] .ctl-main { animation: none; }
.hud-pill .sep { color: var(--ink-2); padding: 0 2px; }
#hud-mode { color: var(--accent); }
/* seats: ivory / ebony discs, pip count on the right */
.seat { height: 42px; padding: 0 10px 0 5px; gap: 8px; max-width: 60vw; }
.seat[data-side="0"] { --pc: var(--white-ui); } .seat[data-side="1"] { --pc: var(--black-ui); }
.seat .avatar { width: 30px; height: 30px; background: radial-gradient(circle at 35% 30%, color-mix(in oklab, var(--pc) 70%, #fff), var(--pc) 55%, color-mix(in oklab, var(--pc) 60%, #000)); box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--pc) 60%, #000), 0 2px 4px rgba(0,0,0,.4); color: transparent; }
.seat .who b { font-family: var(--font-display); font-size: .95rem; }
.seat .who small { font-size: .62rem; letter-spacing: .06em; }
.seat .pips { margin-left: 4px; display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.seat .pips b { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); }
.seat .pips small { font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.seat .score { margin-left: 2px; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 800; }
.seat[data-active="true"] { background: color-mix(in oklab, var(--accent) 16%, var(--surface)); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 18px color-mix(in oklab, var(--accent) 40%, transparent); }
.seat[data-cube="true"] .avatar::after { content: "×"; position: absolute; }
/* overlay, sheets */
.overlay h2 { font-family: var(--font-display); text-transform: none; font-size: clamp(2.2rem, 10vw, 3.4rem); }
.overlay p { color: var(--ink-2); }
.result-verdict { font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); }
#cube-sheet .sheet-close { display: none; }
.cube-text { text-align: center; color: var(--ink); font-size: 1.05rem; }
.cube-big { width: 76px; height: 76px; margin: 6px auto 4px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #fffaf0, #d8c39a); color: #3a2412; font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; box-shadow: 0 10px 24px rgba(0,0,0,.4), inset 0 2px 0 #fff; animation: cube-turn .6s var(--ease-out); }
@keyframes cube-turn { from { transform: rotateY(90deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
:root[data-motion="reduced"] .cube-big { animation: none; }
.set-group { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; margin: 6px 0 -6px; }
@container screen (min-width: 640px) { .board-home .modes { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  .play { grid-template-columns: 1fr minmax(0, 150dvh) 1fr; }
  .play .stage { padding: 10px 12px 76px; row-gap: 14px; }
  .controls { position: absolute; left: 0; right: 0; bottom: 12px; }
  .play .rail { padding: 20px 14px; }
  .seat { height: 56px; padding: 0 14px 0 8px; max-width: none; }
  .seat .avatar { width: 38px; height: 38px; }
  .ctl-main { height: 50px; font-size: 1.2rem; min-width: 150px; }
}
/* keep toasts clear of the HUD pill on the play screen */
body:has(.play:not([hidden])) .toast-host { top: 108px; }
