@import url(/static/fonts/fonts.css);

/* A dark grey octagonal felt table on a wooden floor, white dice that turn
   red when selected and blue when kept, red-orange lettering. */
:root {
  --wood: #6e4528;
  --wood-dk: #3d2514;
  --felt: #3a3a3a;
  --felt-dk: #242424;
  --ink: #1f1d1b;
  --night: #161412;
  --ink-shadow: #161412;
  --red: #d9361b;
  --red-dark: #8f1f0c;
  --orange: #f28c1b;
  --yellow: #ffcf4a;
  --green: #2aa84a;
  --blue: #2f6fe0;
  --blue-dk: #173f8a;
  --paper: #ffffff;
  --muted: #6d665f;
  --line: #e8e2da;
  --good: #2aa84a;
  --bad: #d9361b;
  --radius: 16px;
  --stencil: Anton, Impact, Haettenschweiler, 'Arial Narrow', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--wood-dk); }
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 90% 70% at 50% 40%, rgba(255, 220, 170, .14), transparent 70%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.38) 0 2px, transparent 2px 72px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(90deg, #6e4528 0, #84552f 140px, #6a4225 260px, #8a5a33 400px, #6e4528 520px);
  background-attachment: fixed;
  color: var(--ink); font-family: Montserrat, system-ui, sans-serif; font-size: 15px; line-height: 1.45;
}
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h2 { font-weight: 800; color: var(--ink); }
p { margin: 0 0 .5rem; }
a { color: var(--red); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center-text { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- logo */
.logo { display: inline-flex; flex-direction: column; align-items: center; line-height: .9; white-space: nowrap; user-select: none; }
.logo-word { display: flex; align-items: flex-end; }
.logo-txt {
  font-family: var(--stencil); font-weight: 400; letter-spacing: .01em; font-size: 1em;
  background: linear-gradient(180deg, #ff7a2e 0%, #e2401c 55%, #a8200d 100%); -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0 .02em;
  -webkit-text-stroke: .035em #1a1210; filter: drop-shadow(.03em .05em 0 rgba(0,0,0,.6)) drop-shadow(0 0 .02em rgba(255,255,255,.4));
}
.logo-txt.logo-y { font-size: 1.3em; background-image: linear-gradient(180deg, #ffd04a, #f28c1b 60%, #c35a0a); transform: rotate(9deg) translate(-.02em, .08em); margin-left: -.03em; }
.logo-dice { display: flex; gap: .07em; margin-top: .06em; font-size: .26em; }
.logo-dice .die { font-size: 1em; --tilt: calc((var(--i) - 1.5) * 9deg); }
.hero-logo { font-size: clamp(3.4rem, 15vw, 6.6rem); }
.brand-logo { font-size: 1.5rem; }
.brand-logo .logo-dice { display: none; }

/* ---------------------------------------------------------------- topbar */
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(20, 12, 6, .72); color: #fff; flex-wrap: wrap; backdrop-filter: blur(6px); }
.topbar a, .topbar .linkbtn { color: #fff; text-decoration: none; font-weight: 600; }
.brand { display: flex; align-items: center; padding: 4px 8px; }
.topbar nav { margin-left: auto; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* ---------------------------------------------------------------- forms */
label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 4px; color: var(--ink); }
input, select { width: 100%; padding: 11px 12px; border: 2px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(245, 196, 0, .35); }
button, .btn { font: inherit; font-weight: 800; border: 0; border-radius: 12px; padding: 11px 18px; cursor: pointer; background: #3a3a3a; color: #fff; text-decoration: none; display: inline-block; box-shadow: 0 3px 0 #161412; transition: transform .08s, filter .15s; }
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(2px); box-shadow: 0 1px 0 #161412; }
button:disabled { opacity: .45; cursor: default; }
.btn-accent { background: var(--red); box-shadow: 0 3px 0 var(--red-dark); }
.btn-accent:active { box-shadow: 0 1px 0 var(--red-dark); }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn-small { padding: 6px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.sso-btn::before { content: '🔑 '; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: auto; }
.code-input { text-transform: uppercase; letter-spacing: .3em; font-weight: 900; font-size: 1.4rem; text-align: center; }

/* ---------------------------------------------------------------- layout */
.panel { background: var(--paper); border-radius: var(--radius); padding: 18px; box-shadow: 0 10px 30px rgba(5, 2, 20, .45), inset 0 -4px 0 rgba(28, 23, 51, .07); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.notice { padding: 12px 14px; border-radius: 10px; background: #fff; border-left: 5px solid var(--blue); }
.notice.err { border-left-color: var(--bad); }
.notice.ok { border-left-color: var(--good); background: #f1faf2; }
.pill { display: inline-block; font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #f1ebe4; color: var(--ink); margin-right: 4px; }
.pill.off { background: #f3f3f3; color: #888; }
.pill.gold { background: var(--yellow); color: var(--ink); }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.15); }
.copybox { display: flex; gap: 6px; }
.copybox input { font-size: .85rem; }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; border-left: 5px solid var(--yellow); z-index: 2000; max-width: calc(100vw - 32px); font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: toast-in .25s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.spinner { width: 14px; height: 14px; border: 3px solid rgba(255,255,255,.35); border-top-color: var(--yellow); border-radius: 50%; display: inline-block; vertical-align: -2px; margin-right: 8px; animation: spin 0.9s linear infinite; }
.panel .spinner { border-color: var(--line); border-top-color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
.wait { color: var(--muted); font-weight: 600; }

/* confetti (ui.js) */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 3000; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 110vh; transform: rotate(720deg) translateX(40px); } }

/* ---------------------------------------------------------------- home */
.hero { text-align: center; margin: 10px 0 26px; color: #fff; }
.hero-dice { display: flex; justify-content: center; gap: 10px; margin: 10px 0 18px; font-size: clamp(34px, 9vw, 58px); }
.hero-dice .die { animation: hero-in .7s cubic-bezier(.2,.8,.3,1.25) backwards; animation-delay: calc(var(--i) * 70ms); }
@keyframes hero-in { from { opacity: 0; transform: translateY(-90px) rotate(200deg); } }
.subtitle { font-size: 1.1rem; font-weight: 600; color: #fbe9d6; margin-top: 14px; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.rules { padding-left: 1.3rem; margin: 0; }
.rules li { margin-bottom: .55rem; }
.rules li::marker { color: var(--red); font-weight: 900; }

/* ---------------------------------------------------------------- dice */
.die {
  --tilt: 0deg;
  position: relative; width: 1em; height: 1em; flex: none; border-radius: .18em; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle at 32% 26%, #ffffff 0%, #f1f1ef 45%, #d6d4d0 100%);
  box-shadow: inset 0 -.05em .03em rgba(0,0,0,.2), inset 0 .03em .02em rgba(255,255,255,.9), 0 .06em .1em rgba(0,0,0,.55);
  transform: rotate(var(--tilt)); transition: background .25s, transform .18s, box-shadow .2s;
  --pip: #141414;
}
.pips { position: absolute; inset: .13em; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); }
.pips i { place-self: center; width: .19em; height: .19em; border-radius: 50%; }
.pips i.on { background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--pip) 70%, #fff), var(--pip) 60%); box-shadow: inset 0 .015em .02em rgba(0,0,0,.6); }
.die[data-pip="1"] .pips i.on { width: .24em; height: .24em; }
.die.sel { --pip: #fff; background: radial-gradient(circle at 32% 26%, #ff7d6b, #e0311c 55%, #9e1a0a); transform: rotate(var(--tilt)) translateY(-.08em); box-shadow: inset 0 -.05em .03em rgba(0,0,0,.25), 0 .12em .16em rgba(0,0,0,.55); }
.die.locked { --pip: #fff; background: radial-gradient(circle at 32% 26%, #7fb0ff, #2f6fe0 55%, #173f8a); }
.die.crazy:not(.wild) { --pip: #0f9a42; }
.die.sel.crazy, .die.locked.crazy { --pip: #b6ffcb; }
.die .mark { position: absolute; inset: 0; pointer-events: none; }
.die.crazy .mark::before { content: '✺'; position: absolute; right: .05em; top: .01em; font-size: .24em; color: #12b04a; text-shadow: 0 0 .1em rgba(0,0,0,.3); }
.die.sel.crazy .mark::before, .die.locked.crazy .mark::before { color: #b6ffcb; }
.wild-face { position: absolute; inset: .1em; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #ffe27a, #f28c1b 60%, #a0480a); box-shadow: inset 0 0 0 .04em #1a1210; }
.wild-face span { font-family: var(--stencil); font-weight: 400; font-size: .5em; color: #1a1210; }
.die.crazy .wild-face { box-shadow: inset 0 0 0 .04em #1a1210, 0 0 0 .03em #12b04a; }
.wild-mark { position: absolute; left: .05em; top: .02em; font-family: var(--stencil); font-weight: 400; font-size: .22em; color: #f28c1b; }
.die.can { cursor: pointer; }
@media (hover: hover) { .die.can:hover { transform: rotate(var(--tilt)) translateY(-.1em) scale(1.05); } }
.die.empty { opacity: .28; }
.die.rolling { animation: tumble .32s linear infinite; animation-delay: calc(var(--d) * -70ms); }
.die.rolling .pips { filter: blur(.4px); }
@keyframes tumble {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(.12em, -.22em) rotate(95deg) scale(1.06); }
  50% { transform: translate(-.08em, -.06em) rotate(185deg); }
  75% { transform: translate(.05em, -.18em) rotate(275deg) scale(1.04); }
  100% { transform: translate(0, 0) rotate(360deg); }
}
.die.land { animation: land .32s cubic-bezier(.3,1.6,.5,1); }
@keyframes land { 0% { transform: rotate(calc(var(--tilt) - 25deg)) scale(1.18); } 100% { transform: rotate(var(--tilt)); } }

/* colour themes (COLOR button) */
.theme-contrast .die.sel { background: radial-gradient(circle at 32% 26%, #ffd28a, #f59e0b 55%, #a35f00); --pip: #1a1210; }
.theme-contrast .die.locked { background: repeating-linear-gradient(45deg, #2a5ad0 0 .07em, #173f8a .07em .14em); }
.theme-contrast .die.sel::after, .theme-contrast .die.locked::after {
  position: absolute; left: 50%; bottom: -.34em; transform: translateX(-50%) rotate(calc(var(--tilt) * -1)); font-size: .26em; font-weight: 900; line-height: 1;
  background: #fff; color: #111; border-radius: 1em; padding: .1em .35em; box-shadow: 0 0 0 .12em #111;
}
.theme-contrast .die.sel::after { content: '✓'; }
.theme-contrast .die.locked::after { content: '■'; }
.theme-onyx .die:not(.sel):not(.locked) { background: radial-gradient(circle at 32% 26%, #5a5a5a, #232323 55%, #0b0b0b); --pip: #f4f4f4; }
.theme-onyx .die.crazy:not(.sel):not(.locked):not(.wild) { --pip: #3ee07a; }

/* ---------------------------------------------------------------- lobby */
.lobby { margin-top: 8px; }
.code-text { font-size: clamp(2.4rem, 10vw, 3.4rem); font-weight: 900; font-style: italic; letter-spacing: .18em; color: var(--orange); -webkit-text-stroke: 3px var(--night); paint-order: stroke fill; text-shadow: 3px 4px 0 var(--red); }
.qr { width: 180px; height: 180px; display: block; margin: 0 auto; border-radius: 12px; border: 6px solid #fff; box-shadow: 0 0 0 3px var(--red); }
.players .tags { margin-top: 2px; }
.lobby-wrap main { padding-bottom: 40px; }

/* ---------------------------------------------------------------- table */
body.in-game { overflow: hidden; overscroll-behavior: none; }
.game { height: 100svh; display: flex; flex-direction: column; align-items: center; padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); gap: 6px; }
.board-wrap { flex: none; display: grid; place-items: center; }
.board { --size: min(calc(100vw - 12px), calc(100svh - 150px)); width: var(--size); height: var(--size); position: relative; container-type: size; }
@media (min-aspect-ratio: 5/4) and (min-width: 760px) {
  .game { flex-direction: row; justify-content: center; align-items: stretch; }
  .board-wrap { flex: none; }
  .board { --size: min(calc(100vw - 360px), calc(100svh - 16px)); }
  .side { width: 320px; flex: none; }
}
.octagon, .rim, .felt { clip-path: polygon(29.3% 0, 70.7% 0, 100% 29.3%, 100% 70.7%, 70.7% 100%, 29.3% 100%, 0 70.7%, 0 29.3%); }
.rim { position: absolute; inset: 9.6%; background: linear-gradient(150deg, #a8a8a8, #5e5e5e 30%, #2c2c2c 70%, #6a6a6a); filter: drop-shadow(0 1cqw 2cqw rgba(0,0,0,.6)); }
.felt {
  position: absolute; inset: 11%; color: #fff;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23000' fill-opacity='.16' font-family='Arial' font-size='34'%3E%3Ctext x='8' y='40'%3E%E2%99%A0%3C/text%3E%3Ctext x='68' y='40'%3E%E2%99%A5%3C/text%3E%3Ctext x='38' y='98'%3E%E2%99%A3%3C/text%3E%3Ctext x='92' y='104'%3E%E2%99%A6%3C/text%3E%3C/g%3E%3C/svg%3E") 0 0 / 15cqw 15cqw,
    radial-gradient(ellipse at 50% 42%, #4a4a4a 0%, var(--felt) 55%, var(--felt-dk) 100%);
  box-shadow: inset 0 0 4cqw rgba(0,0,0,.6);
}
.chair { position: absolute; width: 19cqw; height: 9cqw; border-radius: 2.2cqw 2.2cqw 1cqw 1cqw; background: linear-gradient(180deg, #a26a3a, #7a4a24 60%, #5a341a); box-shadow: inset 0 -1cqw 0 rgba(0,0,0,.25), 0 .8cqw 1.6cqw rgba(0,0,0,.55); }
.chair::before { content: ''; position: absolute; left: 8%; right: 8%; top: 70%; height: 22%; border-radius: 1cqw; background: #5a341a; }

.felt-logo { position: absolute; top: 3.5%; left: 50%; transform: translateX(-50%); font-size: 8cqw; }
.tpts, .twin { position: absolute; left: 21%; right: 21%; display: flex; justify-content: space-between; align-items: baseline; gap: 2cqw; font-family: var(--stencil); font-weight: 400; text-shadow: 0 .3cqw 0 #000; }
.tpts { top: 23.5%; }
.twin { top: 29.5%; }
.tpts .lbl, .twin .lbl { font-size: 2.7cqw; letter-spacing: .05em; }
.tpts .val { font-size: 4.4cqw; color: #fff; }
.twin .val { font-size: 3.2cqw; color: #ffd36b; letter-spacing: .08em; }
.cr { position: absolute; left: 9%; top: 36%; display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.lights { position: absolute; right: 9%; top: 36.5%; display: flex; flex-direction: column; gap: .35cqw; line-height: 1.05; font-family: var(--stencil); font-weight: 400; font-size: 2.1cqw; letter-spacing: .05em; text-shadow: 0 .25cqw 0 #000; }
.light { display: flex; align-items: center; justify-content: flex-end; gap: 1.2cqw; }
.light i { width: 2.2cqw; height: 2.2cqw; border-radius: 50%; background: #1d1d1d; box-shadow: inset 0 0 0 .3cqw #555; }
.light i.on { background: radial-gradient(circle at 40% 35%, #9dffb5, #22c55e 60%, #11752f); box-shadow: 0 0 1.4cqw #22c55e; }
.dice-row { position: absolute; left: 50%; top: 58.6%; transform: translate(-50%, -50%); display: flex; gap: 1.5cqw; font-size: 8cqw; }
.dice-row.stale .die { filter: brightness(.72) saturate(.6); }
.dice-row.shake { animation: shake .55s; }
@keyframes shake { 15% { translate: -1.2cqw 0; } 35% { translate: 1.2cqw 0; } 55% { translate: -.8cqw 0; } 75% { translate: .6cqw 0; } }
.thint { position: absolute; top: 64.3%; left: 9%; right: 9%; text-align: center; font-size: 2cqw; font-weight: 700; color: #d6d6d6; line-height: 1.2; min-height: 3cqw; text-shadow: 0 .2cqw .3cqw #000; }
.thint.mine { color: #ffd36b; }
.thint.ok { color: #8dffa9; }
.controls { position: absolute; top: 71%; left: 7%; right: 7%; display: flex; align-items: center; justify-content: space-between; }
.rs { display: flex; align-items: center; gap: 1.6cqw; }
.tbtn {
  background: none; box-shadow: none; border-radius: 1cqw; padding: .4cqw 1cqw; color: #fff; font-family: var(--stencil); font-weight: 400; line-height: 1;
  letter-spacing: .02em; text-shadow: 0 .4cqw 0 #000, 0 0 1cqw rgba(0,0,0,.6); transform-origin: center; transition: opacity .2s, transform .1s, color .2s;
}
.tbtn:hover { filter: none; color: #ffe2a8; }
.tbtn:active { transform: translateY(.3cqw); box-shadow: none; }
.tbtn.off { opacity: .32; cursor: default; }
.tbtn.off:hover { color: #fff; }
.tbtn-lg { font-size: 6.6cqw; }
.tbtn-md { font-size: 5cqw; padding: .2cqw .4cqw; letter-spacing: .04em; }
.tbtn-sm { font-size: 3.4cqw; letter-spacing: .04em; }
.tbtn.go { animation: go 1.1s ease-in-out infinite alternate; }
@keyframes go { from { text-shadow: 0 .4cqw 0 #000, 0 0 1cqw rgba(242, 140, 27, .2); } to { color: #ffd36b; text-shadow: 0 .4cqw 0 #000, 0 0 3cqw rgba(242, 140, 27, .95); } }
.plus { display: grid; place-items: center; width: 4.6cqw; height: 4.6cqw; border-radius: 50%; background: #fff; color: #222; font-weight: 900; font-size: 4cqw; line-height: 1; box-shadow: 0 .4cqw 0 #000; }
.tbrand { position: absolute; bottom: 6%; left: 0; right: 0; text-align: center; font-size: 2.2cqw; letter-spacing: .3em; color: #9a9a9a; text-transform: uppercase; font-weight: 700; }
.tbrand b { color: #d9d9d9; letter-spacing: .25em; }

.seat {
  position: absolute; z-index: 5; transform: translate(-50%, -50%); min-width: 12cqw; max-width: 17cqw; text-align: center; color: #fff;
  background: linear-gradient(180deg, rgba(36,30,26,.95), rgba(18,14,12,.95)); border: .4cqw solid var(--pc); border-radius: 1.8cqw; padding: .4cqw 1.4cqw .5cqw;
  box-shadow: 0 .8cqw 2cqw rgba(0,0,0,.55); transition: box-shadow .3s, transform .3s;
}
.seat.active { border-color: var(--orange); box-shadow: 0 0 0 .4cqw rgba(242,140,27,.4), 0 0 4cqw rgba(242,140,27,.75); transform: translate(-50%, -50%) scale(1.08); }
.seat.offline { opacity: .55; }
.seat.me .seat-name { color: #ffd36b; }
.seat-name { font-weight: 800; font-size: 2.1cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-score { font-family: var(--stencil); font-weight: 400; font-size: 3.1cqw; letter-spacing: .03em; line-height: 1.1; }
.seat-turn { color: #8dffa9; font-size: 2.6cqw; }
.strikes { color: #ff5a4a; font-weight: 900; font-size: 2.2cqw; letter-spacing: .3em; line-height: 1; }
.crown { position: absolute; top: -2.6cqw; left: 50%; transform: translateX(-50%); color: var(--yellow); font-size: 3.4cqw; text-shadow: 0 .3cqw 0 #000; }

.side { flex: 1 1 auto; min-height: 0; overflow: auto; width: min(100%, 560px); background: rgba(22, 16, 12, .82); color: #eee; border-radius: 14px; padding: 12px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.side h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: #bbb; margin: 0 0 4px; }
.side .list li { border-bottom-color: rgba(255,255,255,.08); padding: 6px 0; }
.board-scores li.active strong { color: var(--yellow); }
.row-between { display: flex; justify-content: space-between; gap: 8px; }
.bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.12); margin-top: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; transition: width .6s; }
.strikes-t { color: #ff8a7a; }
.log { list-style: none; margin: 10px 0 0; padding: 0; font-size: .78rem; }
.log li { opacity: .78; padding: 2px 0; }
.log li:first-child { opacity: 1; }
.final-note { background: var(--orange); color: #1a1210; font-weight: 800; padding: 8px 10px; border-radius: 10px; margin-bottom: 10px; animation: pop .4s; }

/* bubbles */
.fly-layer { position: fixed; inset: 0; pointer-events: none; z-index: 1500; }
.bubble { position: fixed; z-index: 1700; transform: translate(-50%, -50%); font-family: var(--stencil); font-weight: 400; font-size: 2.2rem; color: #fff; white-space: nowrap;
  -webkit-text-stroke: 2px var(--night); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--night); animation: bubble 1.8s ease-out forwards; letter-spacing: .03em; }
.bubble.b-bust { color: #ff4a32; font-size: 3rem; }
.bubble.b-hot { color: var(--yellow); text-shadow: 3px 3px 0 var(--red), 0 0 18px rgba(255, 140, 0, .9); }
.bubble.b-bank { color: #8dffa9; }
.bubble.b-final { color: var(--orange); font-size: 2.6rem; }
.bubble.b-pass { color: #ccc; }
@keyframes bubble { 0% { opacity: 0; scale: .3; } 15% { opacity: 1; scale: 1.15; } 25% { scale: 1; } 75% { opacity: 1; translate: 0 -12px; } 100% { opacity: 0; translate: 0 -34px; } }
@keyframes pop { 0% { scale: 1.18; } 100% { scale: 1; } }
@keyframes fade-in { from { opacity: 0; } }

/* wild die */
.wild-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 14px 0 4px; }
.wild-btn { background: #3a3a3a; box-shadow: inset 0 0 0 3px #222; display: grid; place-items: center; padding: 14px; font-size: 52px; border-radius: 14px; }
.wild-btn:hover { background: #4a4a4a; }

/* menu + overlays */
.menu { position: fixed; right: 12px; top: calc(max(8px, env(safe-area-inset-top)) + 44px); z-index: 1200; background: #fff; border-radius: 14px; padding: 6px; display: flex; flex-direction: column; min-width: 220px; box-shadow: 0 12px 30px rgba(0,0,0,.4); animation: pop .2s; }
.menu button { background: none; box-shadow: none; color: var(--ink); text-align: left; padding: 10px 12px; font-weight: 700; }
.menu button:hover { background: #f5efe8; }
.overlay { position: fixed; inset: 0; z-index: 1300; background: rgba(20, 12, 6, .62); display: grid; place-items: center; padding: 16px; animation: fade-in .3s; backdrop-filter: blur(3px); }
.modal { width: min(480px, 100%); max-height: calc(100svh - 32px); overflow: auto; color: var(--ink); animation: pop .35s; }
.overlay.clear { background: transparent; backdrop-filter: none; }
.over { text-align: center; }
.over h2 { font-size: 2.1rem; font-weight: 400; font-family: var(--stencil); letter-spacing: .02em; color: var(--red); }
.over-dice { display: flex; justify-content: center; gap: 8px; font-size: 44px; margin: 4px 0 12px; }
.over-points { display: inline-block; background: var(--orange); color: var(--ink); font-weight: 900; padding: 4px 14px; border-radius: 999px; margin-bottom: 12px; }
.scores li { text-align: left; }
.scores li.win { background: #fff1d6; border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.score { color: var(--ink); white-space: nowrap; }
.grid-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opts .check { margin: 6px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
