:root { --ink: #fff8ec; --bg: #2b1a3d; --panel: rgba(30, 16, 44, .82); --gold: #ffcf4a; --red: #e63946; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; }
#stage { position: fixed; inset: 0; display: grid; place-items: center; }
#stage canvas { display: block; width: 100%; height: 100%; }
.board2d { width: min(96vw, calc(100vh - 190px)); height: auto; margin-top: -120px; }
.board2d .t.a { fill: #f6e3b4; } .board2d .t.b { fill: #e9c98a; }
.board2d .n { font-size: 12px; fill: #5a3a1a; } .board2d .gift { font-size: 22px; }
.board2d .ladder { stroke: #8b5a2b; stroke-width: 8; stroke-linecap: round; }
.board2d .snake { stroke: #2bb673; stroke-width: 9; fill: none; stroke-linecap: round; }
.board2d .snake-head { fill: #1b7a4a; } .board2d .ghost { fill: none; stroke: #fff; stroke-width: 4; stroke-dasharray: 6 4; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; background: linear-gradient(transparent, rgba(20, 8, 30, .7)); text-align: center; }
.screen[hidden], #hud[hidden], [hidden] { display: none !important; }
h1 { font-size: clamp(40px, 9vw, 88px); margin: 0; color: var(--gold); text-shadow: 0 4px 0 #8a2b0e, 0 8px 24px rgba(0, 0, 0, .5); letter-spacing: 1px; }
button, select, input[type=text] { font: inherit; color: inherit; background: var(--panel); border: 2px solid rgba(255, 255, 255, .25); border-radius: 12px; padding: 10px 16px; min-height: 44px; }
button { cursor: pointer; } button:hover, button:focus-visible { border-color: var(--gold); outline: none; }
button.big { font-size: 1.25rem; padding: 14px 28px; background: #c2410c; border-color: var(--gold); }
.err { color: #ffb3b3; min-height: 1.2em; margin: 0; }
.links a { color: var(--ink); }
#seats { display: grid; gap: 10px; width: min(560px, 100%); }
.seat { display: grid; grid-template-columns: 14px 1fr 1fr 1fr; gap: 8px; align-items: center; background: var(--panel); padding: 8px; border-radius: 12px; }
.seat .dot { width: 14px; height: 14px; border-radius: 50%; }
.seat input, .seat select { width: 100%; min-width: 0; }
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
#players { position: absolute; top: 8px; left: 8px; margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; max-width: 46vw; }
#players li { background: var(--panel); border-radius: 10px; padding: 4px 10px; border-left: 6px solid; font-size: .9rem; }
#players li.now { outline: 2px solid var(--gold); }
#toast { position: absolute; top: 18%; left: 50%; transform: translateX(-50%); background: var(--panel); padding: 8px 16px; border-radius: 12px; opacity: 0; transition: opacity .2s; pointer-events: none; font-weight: 700; }
#toast.on { opacity: 1; }
#banner { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20, 8, 30, .55); font-size: clamp(28px, 6vw, 56px); font-weight: 800; color: var(--gold); }
#controls { position: absolute; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; width: min(560px, calc(100vw - 32px)); }
#prompt { margin: 0; background: var(--panel); padding: 4px 12px; border-radius: 10px; }
#dice-row, #cards, #palit-pick { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.die { font-size: 1.4rem; min-width: 96px; } .die small { display: block; font-size: .75rem; opacity: .85; }
.card { min-width: 96px; } .card.armed { background: #15803d; border-color: var(--gold); } .card[disabled] { opacity: .6; cursor: default; }
#b-pause { position: absolute; top: 8px; right: 8px; }
#b-overview { position: absolute; top: 60px; right: 8px; }
#res-table { border-collapse: collapse; background: var(--panel); border-radius: 12px; }
#res-table td, #res-table th { padding: 6px 12px; }
body.nohud #hud { display: none; }
@media (max-width: 600px) { #players { font-size: .8rem; max-width: 60vw; } .die, .card { min-width: 76px; } }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
/* results sit low, so the winner on the stage stays in view */
#results { justify-content: flex-end; padding-bottom: max(24px, env(safe-area-inset-bottom)); background: linear-gradient(transparent 35%, rgba(20, 8, 30, .75)); }
#results h2 { color: var(--gold); text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
/* the title stands over the whole hill (the og image is that overview) */
#title { background: linear-gradient(rgba(20, 8, 30, .35), rgba(20, 8, 30, .8)), url(og.jpg) center / cover; }
