/* Fruit Machine — a lacquered one-armed bandit in a dim casino room.
   The machine is laid out on a fixed 392×720 design grid and scaled to fit
   by app.js (--s on #fit); everything inside uses design pixels. Cabinet
   finishes arrive as custom properties (data-finish on <html>). */

:root {
  --room-a: #3a0d26;
  --room-b: #14040d;
  --ink: #fbead0;
  --ink-soft: #cdb698;
  --gold-1: #fff4c6;
  --gold-2: #ffd34d;
  --gold-3: #d48a0a;
  --gold-4: #8a5200;
  --lac-hi: #ff5a68;
  --lac: #cc1530;
  --lac-lo: #7d0818;
  --lac-deep: #3a0209;
  --trim: linear-gradient(180deg, #fff6cf 0%, #ffd149 30%, #b9770a 52%, #ffe28a 70%, #a8670a 100%);
  --chrome: linear-gradient(180deg, #ffffff 0%, #d4d7dc 16%, #8a8f97 44%, #f1f2f4 56%, #a3a7ae 80%, #f6f7f8 100%);
  --chrome-h: linear-gradient(90deg, #7a7f87 0%, #f3f4f6 30%, #b3b7be 55%, #ffffff 70%, #6d7178 100%);
  --paper: #22101b;
  --paper-2: #321a28;
  --sheet-ink: #f8e9d4;
  --sheet-ink-soft: #c6ae94;
  --line: rgba(255, 220, 170, 0.14);
  --backdrop: rgba(8, 2, 6, 0.6);
  --ease-out: cubic-bezier(0.2, 0.8, 0.25, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --display: "Avenir Next", "Arial Black", "Segoe UI Black", "Helvetica Neue", system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  --l1: #ff4040;
  --l2: #ffb31a;
  --l3: #2fc6ff;
  --l4: #3ee08a;
  --l5: #d873ff;
}
:root[data-finish="sapphire"] { --lac-hi: #6d9bff; --lac: #2253c9; --lac-lo: #0f2b7a; --lac-deep: #04103a; }
:root[data-finish="emerald"] { --lac-hi: #4fe39a; --lac: #129a5d; --lac-lo: #075230; --lac-deep: #022414; }
:root[data-finish="onyx"] { --lac-hi: #6a6a78; --lac: #2b2b34; --lac-lo: #131318; --lac-deep: #050507; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--room-b);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  -webkit-touch-callout: none;
}
#sprite-host { position: absolute; width: 0; height: 0; overflow: hidden; }
button { font: inherit; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- room */
.room {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 50% 42%, rgba(255, 120, 160, 0.12), transparent 70%),
    radial-gradient(ellipse 140% 90% at 50% 0%, var(--room-a), var(--room-b) 75%);
}
.room::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -2%;
  height: 34%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 210, 120, 0.07) 0 2px, transparent 3px) 0 0 / 26px 26px,
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
  transform: perspective(400px) rotateX(55deg);
  transform-origin: 50% 100%;
}
.room i {
  position: absolute;
  width: var(--d, 180px);
  height: var(--d, 180px);
  border-radius: 50%;
  background: radial-gradient(circle, var(--c, rgba(255, 196, 80, 0.32)), transparent 68%);
  animation: drift var(--t, 26s) ease-in-out infinite alternate;
  opacity: 0.85;
}
.room i:nth-child(1) { left: 4%; top: 8%; --d: 220px; --c: rgba(255, 190, 70, 0.26); --t: 31s; }
.room i:nth-child(2) { right: 2%; top: 14%; --d: 160px; --c: rgba(255, 70, 140, 0.24); --t: 24s; }
.room i:nth-child(3) { left: 14%; bottom: 18%; --d: 140px; --c: rgba(90, 170, 255, 0.2); --t: 28s; }
.room i:nth-child(4) { right: 12%; bottom: 10%; --d: 240px; --c: rgba(255, 150, 40, 0.18); --t: 35s; }
.room i:nth-child(5) { left: 44%; top: -4%; --d: 300px; --c: rgba(200, 90, 255, 0.14); --t: 40s; }
.room i:nth-child(6) { left: -4%; top: 46%; --d: 120px; --c: rgba(255, 220, 120, 0.3); --t: 22s; }
.room i:nth-child(7) { right: -3%; top: 52%; --d: 110px; --c: rgba(255, 90, 90, 0.3); --t: 20s; }
.room i:nth-child(8) { left: 30%; bottom: -6%; --d: 200px; --c: rgba(80, 220, 170, 0.12); --t: 33s; }
.room i:nth-child(9) { right: 34%; top: 30%; --d: 90px; --c: rgba(255, 240, 180, 0.16); --t: 18s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(30px, -24px) scale(1.15); }
}

/* -------------------------------------------------------------- layout */
.app {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px 0 16px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 38px; height: 38px; flex: 0 0 auto; filter: drop-shadow(0 2px 6px rgba(255, 120, 60, 0.35)); }
.brand span { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(180deg, #fff3c8, #ffcf4a 60%, #f0a020);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand small { font-size: 10.5px; color: var(--ink-soft); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { display: flex; gap: 2px; flex: 0 0 auto; }
.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.icon-btn:hover { background: rgba(255, 230, 200, 0.1); }
.icon-btn:active { transform: scale(0.92); }
@media (max-width: 380px) {
  .brand { gap: 8px; }
  .brand b { font-size: 17px; }
  .brand img { width: 30px; height: 30px; }
  .top { padding-left: 10px; padding-right: 4px; gap: 4px; }
  .menu .icon-btn { width: 40px; }
}

.stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 4px 6px 8px;
}
.fit { position: relative; }
.machine {
  position: absolute;
  left: 0;
  top: 0;
  width: 392px;
  height: 720px;
  transform-origin: 0 0;
}
.app.shake .machine { animation: shake 0.62s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake {
  10%, 90% { translate: -2px 1px; }
  20%, 80% { translate: 4px -2px; }
  30%, 50%, 70% { translate: -7px 2px; }
  40%, 60% { translate: 7px -1px; }
}

/* ------------------------------------------------------------- cabinet */
.cabinet {
  position: absolute;
  left: 0;
  top: 0;
  width: 336px;
  height: 720px;
  border-radius: 48px 48px 24px 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 9%, transparent 88%, rgba(0, 0, 0, 0.35)),
    linear-gradient(90deg, var(--lac-deep) 0%, var(--lac-lo) 5%, var(--lac) 20%, var(--lac-hi) 47%, var(--lac) 72%, var(--lac-lo) 94%, var(--lac-deep) 100%);
  box-shadow:
    0 40px 70px -18px rgba(0, 0, 0, 0.85),
    0 0 0 2px rgba(0, 0, 0, 0.55),
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    inset 0 -8px 14px rgba(0, 0, 0, 0.5);
}
.cabinet::before {
  /* gold pinstripe just inside the edge */
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 44px 44px 20px 20px;
  border: 1.5px solid rgba(255, 214, 110, 0.55);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.cabinet::after {
  /* lacquer sheen */
  content: "";
  position: absolute;
  left: 22%;
  top: 14px;
  width: 14%;
  bottom: 30px;
  border-radius: 40px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.13), transparent);
  pointer-events: none;
}

/* marquee */
.marquee {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 316px;
  height: 116px;
  border-radius: 40px 40px 12px 12px;
  background: var(--trim);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(90, 50, 0, 0.6);
}
.marquee-face {
  position: absolute;
  inset: 14px;
  border-radius: 28px 28px 5px 5px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 80% at 50% 0%, #4c0f62 0%, #1d0430 55%, #0b0114 100%);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.8), inset 0 6px 14px rgba(0, 0, 0, 0.7);
}
.marquee-rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 420px;
  height: 420px;
  margin: -210px 0 0 -210px;
  background: repeating-conic-gradient(from 0deg, rgba(255, 200, 90, 0.11) 0deg 7deg, transparent 7deg 18deg);
  animation: spin 24s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 62%);
  mask: radial-gradient(circle, #000 0%, transparent 62%);
}
.marquee-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 11px;
  text-align: center;
  font: italic 900 29px/1.05 var(--display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #ffd84a;
  background: linear-gradient(180deg, #fffbe2 0%, #ffe066 38%, #f39a0b 56%, #ffd447 78%, #fff1b0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #6b2a00) drop-shadow(0 0 8px rgba(255, 170, 40, 0.65));
  transform-origin: 50% 50%;
}
.marquee-sub {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font: 800 11px var(--display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ffe6a6;
  text-shadow: 0 0 6px rgba(255, 160, 60, 0.7);
}
.marquee-sub span { margin-right: 6px; }
.marquee-sub b { margin-left: 6px; font-size: 13px; letter-spacing: 0.08em; color: #fff; text-shadow: 0 0 8px #ff4d4d, 0 0 2px #ff9a9a; }
.m7 { width: 20px; height: 20px; filter: drop-shadow(0 0 4px rgba(255, 60, 60, 0.7)); }
.machine.jackpot .m7 { animation: hop 0.5s ease-in-out infinite alternate; }
.machine.jackpot .m7:nth-of-type(2) { animation-delay: 0.15s; }
.machine.jackpot .m7:nth-of-type(3) { animation-delay: 0.3s; }
@keyframes hop { to { transform: translateY(-4px) scale(1.15); } }

/* marquee bulbs */
.bulbs { position: absolute; inset: 0; pointer-events: none; }
.bulb {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c9a679 0%, #6e4a1a 60%, #3a2408 100%);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.6);
}
.bulb::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #ffffff 0%, #fff3b8 22%, var(--bulb, #ffb52e) 45%, transparent 72%);
  box-shadow: 0 0 8px 2px var(--bulb, #ffb52e);
  opacity: 0;
}
.lights-idle .bulb:nth-child(odd)::after { animation: blink 1.6s steps(1) infinite; }
.lights-idle .bulb:nth-child(even)::after { animation: blink 1.6s steps(1) -0.8s infinite; }
.lights-spin .bulb::after { animation: chase 0.7s linear infinite; animation-delay: calc(var(--i) * -0.7s / var(--n)); }
.lights-win .bulb::after { animation: chase 0.42s linear infinite; animation-delay: calc(var(--i) * -0.42s / var(--n) * 3); }
.lights-jackpot .bulb::after { animation: strobe 0.18s steps(1) infinite; animation-delay: calc(var(--i) * -0.09s); }
.lights-jackpot .bulb { --bulb: hsl(calc(var(--i) * 37deg) 100% 62%); }
.lights-off .bulb::after { opacity: 0; animation: none; }
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.08; } }
@keyframes chase { 0%, 26% { opacity: 1; } 34%, 100% { opacity: 0.06; } }
@keyframes strobe { 0% { opacity: 1; } 50% { opacity: 0; } }

/* reel bay */
.bay {
  position: absolute;
  left: 8px;
  top: 132px;
  width: 320px;
  height: 278px;
  border-radius: 18px;
  background: var(--chrome);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.8);
}
.bay-inner {
  position: absolute;
  left: 7px;
  top: 7px;
  width: 306px;
  height: 264px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #1a070c, #090204);
  box-shadow: inset 0 0 0 2px #000, inset 0 8px 16px rgba(0, 0, 0, 0.9);
}
.window {
  position: absolute;
  left: 21px;
  top: 12px;
  width: 264px;
  height: 240px;
  display: flex;
  gap: 6px;
  background: linear-gradient(90deg, #2b2e33, #7d828a 50%, #2b2e33);
}
.window::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}
.reel {
  position: relative;
  flex: 0 0 84px;
  height: 240px;
  overflow: hidden;
  background: linear-gradient(90deg, #cfc6b0 0%, #f6f0e0 14%, #fffdf7 40%, #ffffff 52%, #f6f0e0 86%, #c9bfa6 100%);
}
.reel.held::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 3px #ff5a2a, inset 0 0 18px rgba(255, 90, 40, 0.55);
  z-index: 3;
  animation: heldGlow 1.2s ease-in-out infinite alternate;
}
@keyframes heldGlow { from { opacity: 0.6; } to { opacity: 1; } }
.cell {
  position: absolute;
  left: 0;
  top: 0;
  width: 84px;
  height: 80px;
  display: grid;
  place-items: center;
  will-change: transform;
  backface-visibility: hidden;
}
.cell .sym { width: 70px; height: 70px; overflow: visible; transition: opacity 0.3s, filter 0.3s; }
.reel.fast .cell use { filter: url(#vblur); }
.window.dim .cell .sym { opacity: 0.34; filter: saturate(0.4); }
.window.dim .cell.win .sym { opacity: 1; filter: none; }
.cell.win::before {
  content: "";
  position: absolute;
  inset: 5px 4px;
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--wc, #ffd34d) 50%, transparent), transparent 70%);
  box-shadow: inset 0 0 0 2.5px var(--wc, #ffd34d), 0 0 14px var(--wc, #ffd34d);
  animation: winFrame 0.9s ease-in-out infinite alternate;
}
.cell.win .sym { animation: winSym 0.9s ease-in-out infinite alternate; }
.cell.win.big .sym { animation: winBig 0.5s ease-in-out infinite alternate; }
@keyframes winFrame { from { opacity: 0.55; } to { opacity: 1; } }
@keyframes winSym {
  from { transform: scale(1); }
  to { transform: scale(1.13) rotate(-3deg); }
}
@keyframes winBig {
  from { transform: scale(1.02) rotate(3deg); }
  to { transform: scale(1.22) rotate(-4deg); }
}
.drum-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.32) 11%, rgba(0, 0, 0, 0) 25%, rgba(255, 255, 255, 0.07) 45%, rgba(255, 255, 255, 0) 58%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0.32) 89%, rgba(0, 0, 0, 0.8) 100%);
}
.lines {
  position: absolute;
  left: 0;
  top: 12px;
  width: 306px;
  height: 240px;
  overflow: visible;
  pointer-events: none;
  z-index: 3;
}
.lines .payline {
  fill: none;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 3px var(--wc)) drop-shadow(0 0 1px #000);
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 0.45s var(--ease-out) forwards;
}
.lines .payline-core { fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; opacity: 0.85; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.45s var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.lines .scatter-ring { fill: none; stroke: #ffe25a; stroke-width: 3; filter: drop-shadow(0 0 6px #ffcf2a); animation: ring 0.8s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes ring { from { transform: scale(0.92); opacity: 0.7; } to { transform: scale(1.06); opacity: 1; } }
.tab {
  position: absolute;
  width: 17px;
  height: 17px;
  margin-top: -8.5px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font: 800 10.5px/1 var(--display);
  color: #fff;
  background: var(--wc);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -2px 0 rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.5);
  opacity: 0.55;
  z-index: 4;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}
.tab.on { opacity: 1; transform: scale(1.18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 10px 2px var(--wc); }
.glass {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  border-radius: 12px;
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.06) 22%, transparent 23%, transparent 64%, rgba(255, 255, 255, 0.07) 65%, transparent 74%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 12%);
}
.bay.tease .bay-inner { box-shadow: inset 0 0 0 2px #000, inset 0 8px 16px rgba(0, 0, 0, 0.9), 0 0 0 0 transparent; }
.reel.tease { animation: tease 0.5s ease-in-out infinite alternate; }
@keyframes tease { from { box-shadow: inset 0 0 0 0 #ffd84a; } to { box-shadow: inset 0 0 0 3px #ffd84a, inset 0 0 26px rgba(255, 210, 60, 0.85); } }

/* ticker */
.ticker {
  position: absolute;
  left: 18px;
  top: 416px;
  width: 300px;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  background: #070103;
  box-shadow: inset 0 0 0 1px #000, inset 0 2px 6px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.25);
  text-align: center;
  font: 800 11.5px/24px var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #ffcc3d;
  text-shadow: 0 0 6px rgba(255, 180, 40, 0.8);
}
.ticker::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 0.8px, rgba(0, 0, 0, 0.32) 1.4px) 0 0 / 3px 3px;
  pointer-events: none;
}
.ticker span { display: inline-block; }
.ticker span.in { animation: tickIn 0.35s var(--ease-out); }
.ticker.win { color: #fff2a8; }
.ticker.hold { color: #ff9a4a; }
.ticker.scroll span { animation: marquee var(--dur, 8s) linear infinite; padding-left: 45%; }
@keyframes tickIn { from { transform: translateY(100%); opacity: 0; } }
@keyframes marquee { to { transform: translateX(-100%); } }

/* LED displays */
.displays {
  position: absolute;
  left: 14px;
  top: 448px;
  width: 308px;
  height: 56px;
  display: grid;
  grid-template-columns: 1.4fr 1.05fr 0.8fr;
  gap: 6px;
}
.led {
  position: relative;
  min-width: 0;
  border-radius: 9px;
  padding: 5px 9px 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(180deg, #1b0508, #060102);
  box-shadow: inset 0 0 0 1.5px #000, inset 0 3px 10px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.28), 0 0 0 3px rgba(0, 0, 0, 0.18);
  --lc: #ff3a2c;
  --lg: rgba(255, 50, 30, 0.75);
}
.led-win { --lc: #ffb21e; --lg: rgba(255, 170, 20, 0.75); }
.led-spins { --lc: #4dff86; --lg: rgba(60, 255, 120, 0.6); }
.led span {
  font: 800 8px var(--display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--lc) 55%, #fff 10%);
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.led b { position: relative; display: block; text-align: right; font: 700 24px/1.05 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.led .ghost { position: absolute; right: 0; top: 0; font-style: normal; color: var(--lc); opacity: 0.08; }
.led .val { position: relative; font-style: normal; color: var(--lc); text-shadow: 0 0 6px var(--lg), 0 0 16px var(--lg); }
.led.pulse .val { animation: ledPulse 0.5s ease-out; }
.led.up { animation: ledUp 0.7s ease-out; }
@keyframes ledPulse { 40% { color: #fff; text-shadow: 0 0 10px var(--lc), 0 0 22px var(--lc); } }
@keyframes ledUp { 30% { box-shadow: inset 0 0 0 1.5px var(--lc), inset 0 0 18px var(--lg), 0 0 14px var(--lg); } }
.led-spins.low .val { animation: lowBlink 0.9s steps(1) infinite; }
@keyframes lowBlink { 50% { opacity: 0.35; } }

/* hold buttons */
.holds {
  position: absolute;
  left: 36px;
  top: 514px;
  width: 264px;
  height: 38px;
  display: flex;
  gap: 6px;
}
.hold {
  appearance: none;
  flex: 1;
  position: relative;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font: 800 11px/1 var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(40, 24, 0, 0.6);
  background: linear-gradient(180deg, #8a7444 0%, #5e4b22 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 3px 0 #2a1d06, 0 6px 8px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.08s, box-shadow 0.08s;
}
.hold i { width: 7px; height: 7px; border-radius: 50%; background: #3a2a10; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.6); }
.hold:disabled { cursor: default; }
.hold.offer {
  color: #5a3600;
  background: linear-gradient(180deg, #fff6b8 0%, #ffd23a 55%, #e9a400 100%);
  animation: offer 0.9s ease-in-out infinite alternate;
}
.hold.offer i { background: #fff; box-shadow: 0 0 6px #fff, 0 0 10px #ffd23a; }
@keyframes offer { from { filter: brightness(0.82); } to { filter: brightness(1.12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 3px 0 #6a4600, 0 0 16px rgba(255, 210, 60, 0.75); } }
.hold.held {
  color: #fff;
  animation: none;
  background: linear-gradient(180deg, #ff9a6a 0%, #ff4a24 55%, #c8280e 100%);
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 1px 0 #5a1204, 0 0 16px rgba(255, 80, 40, 0.75);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}
.hold.held i { background: #fff; box-shadow: 0 0 8px #fff; }
.hold:not(:disabled):active { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 0 #2a1d06; }

/* control deck */
.deck {
  position: absolute;
  left: 14px;
  top: 562px;
  width: 308px;
  height: 80px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  background:
    radial-gradient(ellipse 60% 120% at 50% 0%, rgba(255, 255, 255, 0.1), transparent 70%),
    linear-gradient(180deg, #2c2c33 0%, #121216 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -3px 8px rgba(0, 0, 0, 0.6), 0 5px 10px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.spin-btn {
  appearance: none;
  position: relative;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  font: 900 14px/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  background: radial-gradient(circle at 50% 30%, #ff8d8d 0%, #f01a34 42%, #a3001a 80%, #6a000f 100%);
  box-shadow:
    0 0 0 4px #cfd3d9,
    0 0 0 6px #5c6067,
    0 5px 0 6px #33363b,
    0 10px 18px 6px rgba(0, 0, 0, 0.55),
    inset 0 -7px 10px rgba(0, 0, 0, 0.35),
    inset 0 5px 8px rgba(255, 255, 255, 0.45);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.2s;
}
.spin-btn::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 8%;
  height: 34%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0));
}
.spin-btn span { position: relative; }
.spin-btn.ready { animation: ready 1.4s ease-in-out infinite; }
@keyframes ready { 50% { filter: brightness(1.18) drop-shadow(0 0 10px rgba(255, 60, 60, 0.9)); } }
.spin-btn:active, .spin-btn.pressed {
  transform: translateY(4px);
  box-shadow:
    0 0 0 4px #cfd3d9,
    0 0 0 6px #5c6067,
    0 1px 0 6px #33363b,
    0 4px 8px 6px rgba(0, 0, 0, 0.5),
    inset 0 -4px 8px rgba(0, 0, 0, 0.4),
    inset 0 5px 8px rgba(255, 255, 255, 0.3);
}
.spin-btn.stop { background: radial-gradient(circle at 50% 30%, #ffe28a 0%, #ffb800 45%, #b06e00 85%, #6a3e00 100%); color: #3a2000; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); }
.spin-btn.again { background: radial-gradient(circle at 50% 30%, #9dffbe 0%, #1fc35a 45%, #0b7a33 85%, #054a1d 100%); }
.spin-btn:disabled { filter: grayscale(0.6) brightness(0.7); cursor: default; }
.round-btn {
  appearance: none;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #f4e6cf;
  background: radial-gradient(circle at 50% 35%, #4a4a55, #17171c 75%);
  box-shadow: 0 0 0 3px #b8bcc3, 0 0 0 4.5px #4c5056, 0 3px 0 4.5px #2a2c30, 0 6px 10px 4px rgba(0, 0, 0, 0.45), inset 0 2px 3px rgba(255, 255, 255, 0.2);
  transition: transform 0.08s;
}
.round-btn:active { transform: translateY(2px); }
.round-btn .ico { width: 21px; height: 21px; }

/* coin tray */
.tray { position: absolute; left: 34px; top: 652px; width: 268px; height: 42px; }
.chute {
  position: absolute;
  left: 92px;
  top: 0;
  width: 84px;
  height: 15px;
  border-radius: 9px 9px 3px 3px;
  background: linear-gradient(180deg, #000 0%, #19191d 100%);
  box-shadow: inset 0 3px 6px #000, 0 0 0 2px #9da1a8, 0 0 0 3px #45484d;
}
.bowl {
  position: absolute;
  left: 0;
  top: 13px;
  width: 268px;
  height: 29px;
  border-radius: 6px 6px 42px 42px / 6px 6px 29px 29px;
  background: linear-gradient(180deg, #2f3237 0%, #e8eaed 34%, #a2a6ad 62%, #4e5157 100%);
  box-shadow: inset 0 7px 10px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.5), 0 5px 8px rgba(0, 0, 0, 0.45);
}
.plate {
  position: absolute;
  left: 0;
  width: 336px;
  top: 698px;
  margin: 0;
  text-align: center;
  font: 800 8.5px/1 var(--display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 236, 200, 0.82);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}

/* lever */
.lever {
  position: absolute;
  left: 330px;
  top: 0;
  width: 62px;
  height: 720px;
  cursor: grab;
  touch-action: none;
  outline: none;
}
.lever svg { width: 100%; height: 100%; overflow: visible; display: block; }
.lever:focus-visible #lever-knob circle:first-child { stroke: #fff; stroke-width: 2; }
.lever.dragging { cursor: grabbing; }
.lever.ready #lever-knob { animation: knobGlow 1.4s ease-in-out infinite; }
@keyframes knobGlow { 50% { filter: drop-shadow(0 0 7px rgba(255, 70, 70, 0.9)); } }

/* --------------------------------------------------------- effects */
.fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 35; pointer-events: none; }
.flash { position: fixed; inset: 0; z-index: 34; background: radial-gradient(circle, #fffbe6, #ffd34d 60%, rgba(255, 160, 0, 0.6)); pointer-events: none; animation: flash 0.7s ease-out forwards; }
@keyframes flash { from { opacity: 0.9; } to { opacity: 0; } }

.banner {
  position: fixed;
  inset: 0;
  z-index: 33;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  background: radial-gradient(circle at 50% 46%, rgba(30, 6, 20, 0.35), rgba(8, 1, 6, 0.78) 70%);
  animation: fade 0.3s;
}
.banner.out { animation: fadeOut 0.35s forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.banner-rays {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 180vmax;
  height: 180vmax;
  margin: -90vmax 0 0 -90vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 210, 80, 0.2) 0deg 6deg, transparent 6deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.6) 22%, transparent 48%);
  mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.6) 22%, transparent 48%);
  animation: spin 16s linear infinite;
}
.banner.jackpot .banner-rays { background: repeating-conic-gradient(from 0deg, rgba(255, 80, 80, 0.26) 0deg 6deg, rgba(255, 220, 90, 0.26) 6deg 12deg, transparent 12deg 18deg); animation-duration: 7s; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner-body { position: relative; text-align: center; padding: 0 16px; }
.banner-title {
  margin: 0;
  font: italic 900 clamp(44px, 14vw, 86px)/1 var(--display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  background: linear-gradient(180deg, #fffbe2 0%, #ffe066 35%, #f08c00 55%, #ffd447 75%, #fff4c2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #7a2c00) drop-shadow(0 0 18px rgba(255, 170, 30, 0.85));
  animation: bannerIn 0.7s var(--spring) both;
}
.banner-title .ch {
  display: inline-block;
  background: linear-gradient(180deg, #fffbe2 0%, #ffe066 35%, #f08c00 55%, #ffd447 75%, #fff4c2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: drop 0.6s var(--spring) both;
  animation-delay: calc(var(--i) * 0.08s + 0.15s);
}
.banner.jackpot .banner-title { animation: none; font-size: clamp(46px, 15vw, 104px); }
.banner.jackpot .banner-title .ch { animation: drop 0.6s var(--spring) both, wobble 0.9s ease-in-out infinite alternate; animation-delay: calc(var(--i) * 0.09s + 0.2s), calc(var(--i) * 0.09s + 0.9s); }
@keyframes bannerIn { from { transform: scale(0.2) rotate(-8deg); opacity: 0; } }
@keyframes drop { from { transform: translateY(-120vh) rotate(-20deg); } }
@keyframes wobble { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-8px) rotate(3deg); } }
.banner-amount {
  margin-top: 8px;
  font: 900 clamp(38px, 11vw, 64px)/1 var(--mono);
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 0 10px #ffb21e, 0 0 26px #ff7a00, 0 3px 0 #6b3500;
  animation: bannerIn 0.6s var(--spring) 0.25s both;
}
.banner-spins { margin-top: 8px; font: 900 22px var(--display); color: #6dff9d; text-shadow: 0 0 10px rgba(60, 255, 120, 0.8); letter-spacing: 0.06em; min-height: 26px; animation: bannerIn 0.6s var(--spring) 0.45s both; }
.banner-tap { display: block; margin-top: 22px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255, 235, 200, 0.6); animation: fade 0.4s 1.2s both; }

.float-gain {
  position: fixed;
  z-index: 36;
  pointer-events: none;
  font: 900 20px var(--display);
  color: #6dff9d;
  text-shadow: 0 0 8px rgba(60, 255, 120, 0.9), 0 2px 0 #054a1d;
  white-space: nowrap;
  translate: -50% -50%;
}
.float-gain.pts { color: #ffe066; text-shadow: 0 0 8px rgba(255, 200, 40, 0.9), 0 2px 0 #6b3500; }

/* ------------------------------------------------------------ dice bonus */
.bonus {
  position: fixed;
  inset: 0;
  z-index: 26;
  display: grid;
  place-items: center;
  padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 40%, rgba(40, 10, 30, 0.7), rgba(6, 1, 4, 0.9));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade 0.35s;
}
.bonus.out { animation: fadeOut 0.4s forwards; }
.bonus-panel {
  position: relative;
  width: min(100%, 520px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 14px;
  border-radius: 26px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(255, 255, 255, 0.08), transparent 70%),
    radial-gradient(circle at 50% 50%, #1f8a55 0%, #0f5a35 60%, #083a22 100%);
  box-shadow: 0 0 0 3px #3b1a05, 0 0 0 7px #d9a43a, 0 0 0 9px #6b3c08, 0 30px 70px rgba(0, 0, 0, 0.7), inset 0 0 40px rgba(0, 0, 0, 0.45);
  animation: bonusIn 0.6s var(--spring);
}
@keyframes bonusIn { from { transform: scale(0.6) rotate(-4deg); opacity: 0; } }
.bonus-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.12) 0.6px, transparent 1px) 0 0 / 4px 4px;
}
.bonus-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 0 4px; }
.bonus-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font: italic 900 24px/1 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fffbe2, #ffd84a 50%, #f39a0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #3b1a05);
}
.bonus-head .hd { width: 34px; height: 34px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4)); }
.bonus-stats { display: flex; gap: 6px; }
.bonus-stats div { min-width: 64px; padding: 4px 9px; border-radius: 10px; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 1px rgba(255, 220, 140, 0.25); text-align: right; }
.bonus-stats span { display: block; font: 800 8.5px var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 236, 200, 0.7); }
.bonus-stats b { display: block; font: 700 18px/1.15 var(--mono); color: #ffe066; text-shadow: 0 0 6px rgba(255, 190, 40, 0.7); font-variant-numeric: tabular-nums; }
.bonus-stats div:last-child b { color: #6dff9d; text-shadow: 0 0 6px rgba(60, 255, 120, 0.6); }
.bonus-stats b.pulse { animation: ledPulse 0.6s ease-out; }
.bonus-stats .rolls-pips { display: inline-flex; gap: 3px; vertical-align: middle; padding: 3px 0 2px; }
.rolls-pips i { display: block; width: 12px; height: 12px; border-radius: 3px; background: #fff; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2); }
.rolls-pips i.used { background: rgba(255, 255, 255, 0.18); box-shadow: none; }

.board-wrap { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: var(--gap, 5px);
}
.sq {
  position: relative;
  border-radius: 12%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font: 900 calc(var(--sq) * 0.21) / 1 var(--display);
  color: #4a2a00;
  background: linear-gradient(180deg, #fff3bf 0%, #f6c94a 60%, #d99a1c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -3px 0 rgba(0, 0, 0, 0.2), 0 3px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s;
}
.sq .ico { width: calc(var(--sq) * 0.32); height: calc(var(--sq) * 0.32); stroke-width: 2; }
.sq .x2 { font-size: calc(var(--sq) * 0.34); }
.sq small { font: 800 calc(var(--sq) * 0.13) / 1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.sq.spins { color: #04304f; background: linear-gradient(180deg, #d8f1ff 0%, #6cc4ff 60%, #2a8fe0 100%); }
.sq.double { color: #fff; background: linear-gradient(180deg, #f0b8ff 0%, #b555f0 55%, #7a22b8 100%); text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); }
.sq.roll { color: #053a1b; background: linear-gradient(180deg, #d8ffe4 0%, #66e08f 60%, #20a552 100%); }
.sq.star { color: #fff; background: linear-gradient(180deg, #ffb0a0 0%, #ff4a3a 50%, #b8100a 100%); text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); }
.sq.start { color: #3a2400; background: linear-gradient(180deg, #ffffff 0%, #f1ead6 60%, #cfc2a0 100%); }
.sq.pass { animation: pass 0.35s ease-out; }
.sq.land { animation: land 0.9s ease-out; z-index: 2; }
@keyframes pass { 40% { transform: scale(1.06); filter: brightness(1.25); } }
@keyframes land {
  20% { transform: scale(1.2); filter: brightness(1.4); box-shadow: 0 0 0 3px #fff, 0 0 22px 6px #ffe066; }
  60% { transform: scale(1.08); box-shadow: 0 0 0 2px #fff, 0 0 16px 4px #ffe066; }
}
.felt {
  position: relative;
  grid-column: 2 / 5;
  grid-row: 2 / 5;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 45%, #1a7a4a 0%, #0b4a2b 75%, #073220 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 220, 140, 0.35), inset 0 6px 20px rgba(0, 0, 0, 0.6);
  perspective: 700px;
  overflow: hidden;
}
.felt::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 230, 160, 0.18);
}
.felt-msg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7%;
  text-align: center;
  font: 900 calc(var(--sq) * 0.24) / 1.1 var(--display);
  color: #fff2b8;
  text-shadow: 0 0 10px rgba(255, 200, 60, 0.7), 0 2px 0 rgba(0, 0, 0, 0.5);
  letter-spacing: 0.04em;
  pointer-events: none;
  z-index: 3;
  padding: 0 6px;
}
.felt-msg.show { animation: msgIn 0.45s var(--spring); }
@keyframes msgIn { from { transform: scale(0.4); opacity: 0; } }
.die-wrap { position: absolute; left: 0; top: 0; width: var(--dz); height: var(--dz); transform-style: preserve-3d; z-index: 2; }
.die-shadow { position: absolute; left: 0; top: 0; width: var(--dz); height: var(--dz); border-radius: 30%; background: radial-gradient(circle, rgba(0, 0, 0, 0.5), transparent 70%); z-index: 1; }
.die { position: absolute; inset: 0; transform-style: preserve-3d; }
.face {
  position: absolute;
  inset: 0;
  border-radius: 18%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #f3f1ea 60%, #d9d4c6 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), inset 0 -3px 6px rgba(0, 0, 0, 0.12);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 14%;
  backface-visibility: hidden;
}
.face i { width: 76%; height: 76%; place-self: center; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #4a4a68, #0d0d1c 70%); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5); visibility: hidden; }
.face.f1 i { width: 120%; height: 120%; background: radial-gradient(circle at 40% 35%, #ff6276, #a8001c 75%); }
.face i.on { visibility: visible; }
.token {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--tk);
  height: var(--tk);
  z-index: 5;
  pointer-events: none;
}
.token i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 52%, rgba(255, 255, 255, 0.0) 53%),
    repeating-conic-gradient(from 0deg, #fff 0deg 12deg, #e01b38 12deg 30deg),
    #e01b38;
  box-shadow: 0 0 0 2px #fff, 0 4px 0 #6a000f, 0 8px 12px rgba(0, 0, 0, 0.55), 0 0 18px rgba(255, 220, 90, 0.7);
}
.token i::after {
  content: "★";
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 900 calc(var(--tk) * 0.4) / 1 var(--display);
  color: #fff3b0;
  background: radial-gradient(circle at 40% 35%, #ff5a6e, #b3001c 80%);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.6);
  text-shadow: 0 0 6px #ffcf2a;
}
.bonus-foot { position: relative; display: flex; gap: 8px; }

/* ------------------------------------------------------------- buttons */
.btn {
  appearance: none;
  flex: 1;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--sheet-ink);
  font: 600 15px var(--sans);
  padding: 11px 12px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  min-height: 46px;
  transition: transform 0.12s, filter 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.primary, .btn.gold {
  border-color: #8a5200;
  color: #3a2000;
  font-weight: 800;
  background: linear-gradient(180deg, #fff2b0 0%, #ffd24a 45%, #e8a312 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 3px 0 #8a5200, 0 6px 14px rgba(0, 0, 0, 0.4);
}
.btn.gold { font: 900 17px var(--display); letter-spacing: 0.06em; text-transform: uppercase; min-height: 54px; }
.btn.gold:not(:disabled) { animation: ready 1.4s ease-in-out infinite; }
.btn.gold:disabled { animation: none; }
.btn.wide { width: 100%; }
.btn.subtle { flex: 0 0 auto; display: flex; margin: 18px auto 0; background: transparent; border-color: transparent; font-size: 14px; }
.setting > .btn { width: 100%; }
.seg.grid2 { display: grid; grid-template-columns: 1fr 1fr; }

/* -------------------------------------------------------- sheets, dialogs */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--backdrop);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade 0.25s;
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  z-index: 41;
  max-width: 580px;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #2a1321, var(--paper) 140px);
  color: var(--sheet-ink);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 210, 120, 0.3);
  padding-bottom: env(safe-area-inset-bottom);
  animation: rise 0.34s var(--ease-out);
  -webkit-user-select: text;
  user-select: text;
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sheet header { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 4px 22px; flex: 0 0 auto; }
.sheet h2, .dialog h2 { font-family: var(--display); font-weight: 800; font-size: 22px; margin: 0; letter-spacing: 0.01em; color: #ffe8a8; }
.sheet .icon-btn { color: var(--sheet-ink); }
.sheet-body { overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 2px 22px 24px; font-size: 15px; line-height: 1.55; touch-action: pan-y; }
.sheet-body h3 { font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; margin: 20px 0 8px; color: #ffd36a; }
.sheet-body h3:first-child { margin-top: 6px; }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin: 5px 0; }
.prose b { font-weight: 700; color: #fff3d6; }
.muted { color: var(--sheet-ink-soft); }
.note { font-size: 13px; color: var(--sheet-ink-soft); margin: 10px 0 0; }
.disclaimer { margin-top: 18px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 210, 120, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 210, 120, 0.25); font-size: 13.5px; color: var(--sheet-ink-soft); }
.disclaimer b { color: #ffe8a8; }
@media (min-width: 700px) and (min-height: 600px) {
  .sheet { bottom: auto; top: 50%; transform: translateY(-50%); border-radius: 24px; max-height: 84dvh; animation: pop 0.3s var(--ease-out); }
}
@keyframes pop { from { opacity: 0; transform: translateY(-50%) scale(0.96); } }

.pay { width: 100%; border-collapse: collapse; margin: 4px 0 8px; }
.pay th { font: 800 10px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--sheet-ink-soft); text-align: right; padding: 0 4px 4px; }
.pay td { padding: 5px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pay td:first-child { white-space: nowrap; }
.pay .sym { width: 32px; height: 32px; vertical-align: middle; margin-right: -4px; }
.pay td.n { text-align: right; font: 700 15px var(--mono); color: #ffe066; white-space: nowrap; }
.pay td.s { text-align: right; font: 700 14px var(--mono); color: #6dff9d; white-space: nowrap; width: 1%; }
.pay td.lbl { color: var(--sheet-ink-soft); font-size: 13.5px; }
.pay tr.jp td.n { color: #ff6b6b; }
.lines-demo { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 6px 0 10px; }
.lines-demo figure { margin: 0; text-align: center; }
.lines-demo svg { width: 100%; max-width: 74px; aspect-ratio: 1; border-radius: 8px; background: #fbf6e9; }
.lines-demo figcaption { font: 800 11px var(--display); color: var(--sheet-ink-soft); margin-top: 3px; }
.board-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.board-legend div { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--sheet-ink-soft); }
.board-legend .sq { --sq: 34px; width: 34px; height: 34px; flex: 0 0 auto; font-size: 9px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 0 rgba(0, 0, 0, 0.2); }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  appearance: none;
  flex: 1 1 auto;
  min-width: 70px;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--sheet-ink);
  font: 600 14px var(--sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 10px;
}
.seg button[aria-pressed="true"] { border-color: #ffcf4a; background: rgba(255, 207, 74, 0.16); color: #fff1c4; box-shadow: inset 0 0 0 1px #ffcf4a; }
.swatch { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.5); }
.setting { margin: 0 0 18px; }
.setting > span { display: block; font: 800 12px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--sheet-ink-soft); margin-bottom: 8px; }
.danger { color: #ff8a7a !important; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 14px; }
.stat-grid div { padding: 10px; border-radius: 14px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); text-align: center; }
.stat-grid b { display: block; font: 700 20px var(--mono); color: #ffe066; }
.stat-grid span { display: block; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sheet-ink-soft); margin-top: 2px; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: baseline; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.history li b { font: 700 16px var(--mono); color: #ffe066; }
.history li small { color: var(--sheet-ink-soft); font-size: 12.5px; }
.history li.best b { color: #6dff9d; }

.dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 42;
  width: min(92vw, 400px);
  max-height: 94dvh;
  overflow: auto;
  background: radial-gradient(ellipse at 50% 0%, #3d1a2e, var(--paper) 60%);
  color: var(--sheet-ink);
  border-radius: 24px;
  padding: 22px 20px 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 210, 120, 0.3);
  text-align: center;
  animation: popc 0.32s var(--ease-out);
}
@keyframes popc { from { opacity: 0; transform: translate(-50%, -50%) scale(0.94); } }
.dialog p { margin: 6px 0 16px; color: var(--sheet-ink-soft); font-size: 15px; line-height: 1.5; }
.dialog .row { display: flex; gap: 10px; }
.result-glow { position: absolute; left: 50%; top: 0; width: 260px; height: 160px; margin-left: -130px; background: radial-gradient(ellipse, rgba(255, 200, 80, 0.3), transparent 70%); pointer-events: none; }
.result-icon { position: relative; width: 64px; height: 64px; margin: 0 auto 4px; animation: hop 0.9s ease-in-out infinite alternate; }
.result-icon svg { width: 100%; height: 100%; }
.score { position: relative; margin: 0 0 14px; }
.score span { display: block; font: 800 11px var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--sheet-ink-soft); }
.score b { display: block; font: 900 46px/1.1 var(--mono); color: #ffe066; text-shadow: 0 0 14px rgba(255, 190, 40, 0.6); }
.score em { display: inline-block; margin-top: 4px; padding: 3px 10px; border-radius: 99px; font: 800 11px var(--display); font-style: normal; letter-spacing: 0.12em; text-transform: uppercase; color: #053a1b; background: #6dff9d; }
.result-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 0 0 16px; }
.result-stats div { padding: 7px 8px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); box-shadow: inset 0 0 0 1px var(--line); }
.result-stats b { display: block; font: 700 17px var(--mono); color: #fff1c4; }
.result-stats span { display: block; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sheet-ink-soft); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 50;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  max-width: min(92vw, 420px);
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(20, 6, 14, 0.94);
  color: #fff3d6;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 210, 120, 0.3);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .room i, .marquee-rays, .banner-rays { animation: none; }
}
:root.calm .room i, :root.calm .marquee-rays { animation: none; }
