/* Lucky 7s, Starlite Lounge cabinet. */
:root {
  --lacquer: #9e2228;
  --lacquer-hi: #b8333a;
  --oxblood: #5c1114;
  --oxblood-deep: #2a0a0c;
  --room: #170809;
  --cream: #f4ead3;
  --cream-shade: #e6d8b8;
  --ink: #1d1512;
  --ink-soft: #3a2c25;
  --brass: #c9a14a;
  --brass-hi: #e7c876;
  --brass-dark: #7d5f1f;
  --teal: #2e6e68;
  --mint: #9fd2c1;
  --muted: #cdbfa3;
  --line-1: #c62a2a;
  --line-2: #2e6e68;
  --line-3: #8a6a1f;
  --line-4: #6e2a56;
  --line-5: #b5571f;
  --display: 'Limelight', Georgia, serif;
  --ui: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --slots-height: 100vh;
  --slots-width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right));
  --slots-usable-height: calc(var(--slots-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  --cell: clamp(32px, min(calc((var(--slots-width) - 102px) / 3.3), calc((var(--slots-usable-height) - 398px) / 3)), 160px);
  --cab-pad: 10px;
  --reel-w: calc(var(--cell) * 1.1);
  --gap: 6px;
  --radius: 14px;
  color-scheme: dark;
}
@supports (height: 100dvh) {
  :root { --slots-height: 100dvh; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  min-height: 100vh; min-height: 100svh;
  font-family: var(--ui); color: var(--cream);
  background-color: var(--room);
  background-image:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(120, 28, 30, .55), rgba(23, 8, 9, 0) 70%),
    linear-gradient(180deg, rgba(23, 8, 9, 0) 60%, rgba(10, 3, 4, .85)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23431416' stroke-width='1.2'%3E%3Cpath d='M28 4 Q30 26 52 28 Q30 30 28 52 Q26 30 4 28 Q26 26 28 4Z'/%3E%3Cpath d='M0 0 L8 8 M56 0 L48 8 M0 56 L8 48 M56 56 L48 48'/%3E%3C/g%3E%3Ccircle cx='28' cy='28' r='2' fill='%234a1618'/%3E%3C/svg%3E");
  background-size: auto, auto, 56px 56px;
  background-attachment: fixed, fixed, scroll;
  overflow-x: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
button, a, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font-family: var(--mono); font-size: .72em; padding: 0 .35em; border: 1px solid currentColor; border-radius: 4px; opacity: .75; margin-left: .35em; }

/* Header */
.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 10px 16px; width: 100%; max-width: 1180px; margin: 0 auto;
}
.lobby { justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 10px 0 4px; color: var(--cream); text-decoration: none; font-weight: 600; font-size: .95rem; border-radius: 8px; }
.lobby:hover { color: var(--brass-hi); }
.lobby svg { width: 18px; height: 18px; }
.wordmark { text-align: center; line-height: 1.05; }
.wordmark span { display: block; font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.wordmark h1 { font-family: var(--display); font-weight: 400; font-size: 1.35rem; color: var(--cream); letter-spacing: .02em; }
.header-tools { justify-self: end; display: flex; gap: 6px; }
.icon-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--cream); border: 1px solid rgba(201, 161, 74, .45); background: rgba(29, 21, 18, .55); padding: 0 10px; font-weight: 600; font-size: .9rem; }
.icon-btn:hover { border-color: var(--brass); color: var(--brass-hi); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .mute-mark { display: none; }
.icon-btn[aria-pressed="true"] .mute-mark { display: inline; }
.icon-btn[aria-pressed="true"] .sound-wave { display: none; }
.help-label { display: none; }
#session-open, #session-help { display: none; }
#session-dialog .lounge-card { width: auto; margin: 12px; }
#session-dialog #session-h { display: none; }

/* Layout */
.slots-page > .lounge {
  display: flex; flex-direction: column; align-items: safe center; gap: 22px;
  padding: 4px 8px 24px;
}
:root .slots-page > .lounge { max-width: 1450px; margin: 0 auto; }
.slots-page .lounge .machine { position: relative; display: flex; flex: none; justify-content: center; width: auto; max-width: 100%; }
.slots-page .lounge .cabinet { width: max-content; max-width: 100%; }

/* Cabinet */
.cabinet {
  position: relative; width: max-content; max-width: 100%;
  padding: 0 var(--cab-pad) 14px;
  border-radius: 34px 34px 18px 18px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.28), rgba(255,255,255,.07) 18%, rgba(255,255,255,0) 32%, rgba(0,0,0,0) 70%, rgba(255,255,255,.05) 86%, rgba(0,0,0,.3)),
    var(--lacquer);
  box-shadow:
    inset 0 0 0 3px var(--oxblood),
    inset 0 0 0 6px rgba(201,161,74,.55),
    inset 0 0 0 9px var(--oxblood),
    0 2px 0 1px #3b0b0d,
    0 28px 50px rgba(0,0,0,.6),
    0 6px 0 4px #3b0b0d;
}
.cabinet::before { /* chrome-brass edge strip down the sides */
  content: ""; position: absolute; inset: 120px -4px 30px; border-radius: 6px; pointer-events: none; z-index: -1;
  background: linear-gradient(90deg, var(--brass-dark), var(--brass-hi) 50%, var(--brass-dark));
}

/* Marquee topper */
.topper {
  position: relative; margin: 0 calc(var(--cab-pad) * -1); padding: 18px 26px 14px;
  border-radius: 34px 34px 10px 10px;
  background: radial-gradient(ellipse 80% 120% at 50% 0%, #2b0a0c, var(--ink) 80%);
  box-shadow: inset 0 0 0 3px var(--brass-dark), inset 0 0 0 5px var(--brass), inset 0 0 0 7px var(--oxblood), inset 0 -10px 22px rgba(0,0,0,.45);
  text-align: center; overflow: hidden;
}
.bulbs { position: absolute; inset: 9px; pointer-events: none; }
.bulb {
  position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #fff8e2 0 18%, #f6c768 46%, #a8681a 100%);
  box-shadow: 0 0 5px 1px rgba(255, 184, 84, .55);
  animation: bulb-idle 2.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.35s);
}
.bulb:nth-child(odd) { animation-delay: calc(var(--i) * -0.35s - 1.4s); }
@keyframes bulb-idle { 0%, 100% { opacity: 1; } 50% { opacity: .5; box-shadow: 0 0 2px rgba(255,184,84,.25); } }
@keyframes bulb-chase { 0%, 100% { opacity: .28; box-shadow: none; } 12% { opacity: 1; box-shadow: 0 0 9px 3px rgba(255, 190, 96, .75); } 40% { opacity: .45; } }
@keyframes bulb-full { 0%, 100% { opacity: 1; box-shadow: 0 0 10px 3px rgba(255, 196, 104, .8); } 50% { opacity: .62; box-shadow: 0 0 4px 1px rgba(255,190,96,.4); } }
.topper.chase .bulb { animation: bulb-chase .9s linear infinite; animation-delay: calc(var(--i) * .045s); }
.topper.full .bulb { animation: bulb-full .42s ease-in-out infinite; animation-delay: calc(var(--i) % 2 * .21s); }
.marquee-face { position: relative; padding: 4px 34px 2px; }
.marquee-eyebrow { font-size: .62rem; letter-spacing: .3em; text-transform: uppercase; color: var(--mint); font-weight: 600; }
.logo { font-family: var(--display); font-size: clamp(2.1rem, 9vw, 3.4rem); line-height: 1; color: var(--cream); letter-spacing: .02em; text-shadow: 3px 3px 0 var(--lacquer), 5px 5px 0 rgba(0,0,0,.5); margin: 4px 0 2px; }
.logo em { font-style: normal; color: var(--brass-hi); }
.marquee-sub { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--cream-shade); }
.burst { position: absolute; top: 50%; width: 38px; height: 38px; margin-top: -19px; }
.burst-l { left: 0; } .burst-r { right: 0; }

/* Atomic boomerangs on the belly glass */
.belly { display: flex; justify-content: space-between; align-items: center; padding: 8px 6px 2px; }
.belly svg { width: 70px; height: 18px; }

/* Reel window */
.window-frame {
  position: relative; display: flex; align-items: stretch; justify-content: center; gap: 4px;
  margin: 12px 0 0; padding: 9px 6px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--brass-hi), var(--brass) 30%, var(--brass-dark) 100%);
  box-shadow: inset 0 0 0 2px rgba(29,21,18,.65), inset 0 2px 0 3px rgba(255,240,200,.25), 0 3px 0 var(--oxblood);
}
.line-tabs { position: relative; width: 18px; }
.line-tab {
  position: absolute; left: 0; width: 18px; height: 18px; margin-top: -9px;
  display: grid; place-items: center; border-radius: 50%;
  font: 700 .64rem/1 var(--mono); color: var(--cream); background: var(--c, var(--ink));
  box-shadow: 0 0 0 1.5px var(--ink); transition: transform .18s;
}
.line-tab.on { transform: scale(1.22); box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 3px var(--cream); }
.reel-window {
  position: relative; display: flex; gap: var(--gap); padding: 5px;
  border-radius: 10px; background: var(--ink);
  box-shadow: inset 0 0 0 1px #000;
  touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none;
}
.reel {
  position: relative; width: var(--reel-w); height: calc(var(--cell) * 3); overflow: hidden;
  border-radius: 6px; background: var(--cream);
  transition: opacity .16s;
}
.reel::before { /* drum curvature shading */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(29,21,18,.42), rgba(29,21,18,.08) 22%, rgba(255,255,255,0) 40%, rgba(255,255,255,0) 60%, rgba(29,21,18,.08) 78%, rgba(29,21,18,.45));
}
.reel::after { /* anticipation bloom */
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse 90% 60% at 50% 50%, rgba(255, 206, 120, .55), rgba(255, 180, 90, 0) 75%);
  box-shadow: inset 0 0 0 2px rgba(231, 200, 118, .9);
  transition: opacity .35s;
}
.reel.anticipate::after { opacity: 1; animation: bloom 0.6s ease-in-out infinite alternate; }
@keyframes bloom { from { opacity: .55; } to { opacity: 1; } }
.reel.rm-spin { opacity: .45; }
.strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.reel.blur { filter: var(--blur); }
.cell { height: var(--cell); display: grid; place-items: center; }
.cell svg { width: 88%; height: 88%; overflow: visible; }
.cell + .cell { box-shadow: inset 0 1px 0 rgba(29,21,18,.08); }
.cell.pulse svg { animation: sym-pulse .7s ease-in-out infinite alternate; }
@keyframes sym-pulse { from { transform: scale(1); } to { transform: scale(1.09); } }

/* Win overlay */
.hilite { position: absolute; inset: 5px; display: grid; grid-template-columns: repeat(3, var(--reel-w)); grid-template-rows: repeat(3, var(--cell)); column-gap: var(--gap); pointer-events: none; z-index: 4; }
.hilite span { border-radius: 8px; opacity: 0; transition: opacity .18s; box-shadow: inset 0 0 0 3px var(--brass), inset 0 0 0 5px rgba(29,21,18,.5); background: radial-gradient(circle, rgba(255, 240, 200, .0) 40%, rgba(255, 214, 140, .38)); }
.hilite span.on { opacity: 1; }
.paylines { position: absolute; inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); pointer-events: none; z-index: 5; overflow: visible; }
.paylines g { opacity: 0; transition: opacity .2s; }
.paylines g.on { opacity: 1; }
.paylines .under { stroke: var(--ink); stroke-width: 9; fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; opacity: .85; }
.paylines .over { stroke: var(--c); stroke-width: 4.5; fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.paylines .dot { fill: var(--cream); stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }

/* Message strip */
.message {
  margin: 10px 4px 0; min-height: 38px; padding: 8px 12px;
  display: block; align-content: center; text-align: center;
  border-radius: 8px; background: var(--ink); color: var(--mint);
  font-size: .86rem; font-weight: 500; letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px rgba(159, 210, 193, .18), 0 1px 0 rgba(255,255,255,.08);
}
.message.warn { color: #ffd6a0; }
.message.error { color: #ffb4a8; }
.message a { color: var(--brass-hi); }

/* Meters */
.meters { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 6px; margin: 8px 4px 0; }
.meter { padding: 6px 9px 7px; border-radius: 8px; background: var(--ink); box-shadow: inset 0 0 0 1.5px var(--brass-dark), inset 0 0 0 3px rgba(0,0,0,.6); min-width: 0; }
.meter span { display: block; font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: var(--brass); font-weight: 700; }
.meter output, .meter strong { display: block; font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 500; font-size: clamp(.9rem, 3.5vw, 1.4rem); color: var(--cream); overflow-wrap: anywhere; line-height: 1.15; }
.meter.win output { color: var(--brass-hi); }
.meter.win.counting output { color: #ffe3a1; }

/* Deck: bet chips and buttons */
.deck { margin: 10px 4px 0; padding: 10px; border-radius: 12px; background: linear-gradient(180deg, var(--oxblood), #430c0f); box-shadow: inset 0 2px 0 rgba(0,0,0,.35), inset 0 0 0 1px rgba(201,161,74,.3); }
.bet-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bet-label { font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; color: var(--cream-shade); font-weight: 700; }
.bet-label b { color: var(--brass-hi); font-family: var(--mono); letter-spacing: 0; font-weight: 500; font-size: .8rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; width: 100%; min-height: 56px; margin-top: 6px; }
.chip {
  position: relative; flex: 1 1 0; max-width: 64px; aspect-ratio: 1; min-width: 44px; min-height: 44px; border-radius: 50%;
  font: 600 .9rem/1 var(--mono); color: var(--cream);
  background:
    repeating-conic-gradient(from 0deg, var(--cream) 0 12deg, transparent 12deg 45deg),
    var(--ink);
  box-shadow: 0 3px 0 #120c0a, inset 0 0 0 2px var(--brass-dark);
  transition: transform .12s, box-shadow .12s;
}
.chip::before { content: ""; position: absolute; inset: 16%; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--brass); }
.chip span { position: relative; }
.chip[aria-checked="true"] {
  transform: translateY(-3px); color: var(--ink);
  background: repeating-conic-gradient(from 0deg, var(--lacquer) 0 12deg, transparent 12deg 45deg), var(--cream);
  box-shadow: 0 6px 0 #120c0a, inset 0 0 0 2px var(--brass-dark), 0 0 0 2px var(--brass-hi);
}
.chip[aria-checked="true"]::before { background: var(--cream); box-shadow: 0 0 0 2px var(--lacquer); }
.chip:disabled { opacity: .38; transform: none; box-shadow: inset 0 0 0 2px #444; }
.chip:not(:disabled):hover { transform: translateY(-2px); }
.chip[aria-checked="true"]:not(:disabled):hover { transform: translateY(-3px); }

.actions { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 8px; margin-top: 12px; }
.deck-btn {
  min-width: 44px; min-height: 48px; border-radius: 10px; padding: 0 10px;
  font-weight: 700; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  background: var(--ink); color: var(--cream);
  box-shadow: 0 3px 0 #0d0807, inset 0 0 0 1.5px var(--brass-dark);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.deck-btn:hover:not(:disabled) { color: var(--brass-hi); box-shadow: 0 3px 0 #0d0807, inset 0 0 0 1.5px var(--brass); }
.deck-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #0d0807, inset 0 0 0 1.5px var(--brass); }
.deck-btn[aria-pressed="true"] { background: var(--teal); color: var(--cream); box-shadow: 0 3px 0 #0d0807, inset 0 0 0 1.5px var(--mint); }
.deck-btn:disabled { opacity: .45; }
.deck-btn.running { background: var(--cream); color: var(--ink); }
.spin {
  min-height: 56px; border-radius: 30px;
  font-family: var(--display); font-weight: 400; font-size: 1.45rem; letter-spacing: .08em; text-transform: none;
  color: var(--cream); background: radial-gradient(ellipse 80% 70% at 50% 30%, var(--lacquer-hi), var(--lacquer) 60%, #7a171c);
  box-shadow: 0 4px 0 #3b0b0d, inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--brass), inset 0 0 0 6px var(--ink);
}
.spin:hover:not(:disabled) { color: #fff7e4; box-shadow: 0 4px 0 #3b0b0d, inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--brass-hi), inset 0 0 0 6px var(--ink); }
.spin:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #3b0b0d, inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--brass-hi), inset 0 0 0 6px var(--ink); }
.spin kbd { font-family: var(--mono); font-size: .55rem; }
.spin:disabled { opacity: .55; }

.cabinet-foot { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 10px; font-size: .6rem; letter-spacing: .3em; text-transform: uppercase; color: rgba(244, 234, 211, .7); }
.cabinet-foot i { width: 26px; height: 2px; background: var(--brass); border-radius: 2px; }

/* Lever */
.lever { position: absolute; right: 2px; top: 210px; width: 52px; height: 230px; display: none; touch-action: none; }
.lever-base { position: absolute; left: 0; top: 70px; width: 22px; height: 86px; border-radius: 0 10px 10px 0; background: linear-gradient(90deg, var(--brass-dark), var(--brass-hi) 45%, var(--brass) 70%, var(--brass-dark)); box-shadow: 2px 3px 0 rgba(0,0,0,.45), inset 0 0 0 1.5px var(--ink); }
.lever-arm { position: absolute; left: 14px; top: 0; width: 34px; height: 116px; transform-origin: 50% 100%; will-change: transform; }
.lever-rod { position: absolute; left: 13px; top: 18px; width: 8px; bottom: 0; border-radius: 4px; background: linear-gradient(90deg, #8a8478, #f2efe6 45%, #b8b1a1 70%, #6e685d); box-shadow: inset 0 0 0 1px rgba(29,21,18,.6); }
.lever-knob { position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e0464c, var(--lacquer) 55%, #5c1114); box-shadow: inset 0 0 0 2px var(--ink), 0 3px 4px rgba(0,0,0,.5); }
.lever:focus-visible { outline-offset: 0; }
.lever:disabled .lever-knob { filter: saturate(.6) brightness(.85); }

/* Lounge card (session + recent results) */
.lounge-card {
  width: 100%; max-width: 460px; padding: 16px; border-radius: var(--radius);
  background: rgba(29, 21, 18, .82); box-shadow: inset 0 0 0 1px rgba(201, 161, 74, .35);
}
.lounge-card h2 { font-family: var(--display); font-weight: 400; font-size: 1.15rem; color: var(--cream); margin-bottom: 10px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { padding: 8px; border-radius: 8px; background: rgba(0,0,0,.28); min-width: 0; }
.stats dt { font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.stats dd { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1rem; color: var(--cream); margin-top: 2px; overflow-wrap: anywhere; }
.stats dd.up { color: var(--mint); } .stats dd.down { color: #f0a99f; }
.recent-h { margin-top: 16px; font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.recent { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: 8px; list-style: none; }
.recent li { min-height: 34px; border-radius: 6px; display: grid; place-items: center; font: 500 .74rem/1 var(--mono); background: rgba(244, 234, 211, .07); color: var(--muted); box-shadow: inset 0 0 0 1px rgba(244,234,211,.08); }
.recent li.w { background: rgba(46, 110, 104, .5); color: #d9f2ea; box-shadow: inset 0 0 0 1px rgba(159,210,193,.45); }
.recent li.big { background: var(--brass); color: var(--ink); font-weight: 600; }
.recent li.empty { background: transparent; box-shadow: none; border: 1px dashed rgba(244,234,211,.14); }
.note { margin-top: 14px; font-size: .8rem; line-height: 1.45; color: var(--cream-shade); }
.note a { display: inline-flex; align-items: center; min-height: 44px; color: var(--brass-hi); }
.fine { margin-top: 10px; font-size: .74rem; color: var(--muted); line-height: 1.45; }
.fine a { color: var(--cream); }

/* Celebration banner */
.celebrate { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; pointer-events: none; }
.celebrate[hidden] { display: none; }
.celebrate::before { content: ""; position: absolute; inset: -10% -20%; background: radial-gradient(ellipse 50% 40% at 50% 45%, rgba(255, 200, 110, .38), rgba(255,170,80,0) 70%); animation: soft-in .5s ease-out both; }
.ticket {
  position: relative; pointer-events: auto; text-align: center; padding: 18px 30px 16px; min-width: min(300px, 88vw);
  background: var(--cream); color: var(--ink); border-radius: 14px;
  box-shadow: 0 0 0 3px var(--ink), 0 0 0 7px var(--brass), 0 0 0 9px var(--ink), 6px 8px 0 9px rgba(92, 17, 20, .9), 0 30px 60px rgba(0,0,0,.6);
  animation: ticket-in .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
.ticket .t-eyebrow { font-size: .64rem; letter-spacing: .28em; text-transform: uppercase; font-weight: 700; color: var(--teal); }
.ticket .t-title { font-family: var(--display); font-size: clamp(2.2rem, 11vw, 3.6rem); line-height: 1.05; color: var(--lacquer); text-shadow: 2px 2px 0 var(--brass); }
.ticket .t-amount { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: clamp(1.4rem, 7vw, 2rem); font-weight: 500; }
.ticket .t-skip { margin-top: 6px; font-size: .68rem; color: var(--ink-soft); letter-spacing: .06em; }
.ticket svg.t-star { position: absolute; width: 44px; height: 44px; top: -22px; }
.ticket svg.t-star.l { left: -14px; } .ticket svg.t-star.r { right: -14px; }
.celebrate.out .ticket { animation: ticket-out .3s ease-in both; }
.celebrate.out::before { animation: soft-out .3s ease-in both; }
@keyframes ticket-in { from { transform: scale(.6) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ticket-out { to { transform: scale(.9); opacity: 0; } }
@keyframes soft-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes soft-out { to { opacity: 0; } }
#coins { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 30; }

/* Dialogs */
dialog {
  margin: auto; width: min(560px, calc(var(--slots-width) - 24px)); max-height: calc(var(--slots-usable-height) - 24px); overflow: auto;
  border: 0; border-radius: 16px; padding: 0; color: var(--ink); background: var(--cream);
  box-shadow: 0 0 0 3px var(--ink), 0 0 0 6px var(--brass), 0 30px 70px rgba(0,0,0,.7);
}
dialog::backdrop { background: rgba(12, 4, 5, .78); }
.dlg-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 10px 20px; background: var(--cream); border-bottom: 2px solid var(--ink); }
.dlg-head h2 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; color: var(--lacquer); }
.dlg-head .eyebrow { display: block; font-size: .6rem; letter-spacing: .24em; text-transform: uppercase; color: var(--teal); font-weight: 700; }
.dlg-close { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); flex: none; }
.dlg-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.dlg-close:hover { background: var(--ink); color: var(--cream); }
dialog :focus-visible { outline-color: var(--teal); }
.dlg-body { padding: 14px 20px 20px; font-size: .92rem; line-height: 1.5; }
.dlg-body h3 { font-family: var(--display); font-weight: 400; font-size: 1.12rem; color: var(--ink); margin: 18px 0 8px; }
.dlg-body h3:first-child { margin-top: 2px; }
.dlg-body p + p { margin-top: 8px; }
.dlg-body .sub { font-size: .8rem; color: var(--ink-soft); }
.paytable { list-style: none; display: grid; gap: 4px; }
.paytable li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; background: rgba(29,21,18,.06); }
.paytable li:nth-child(1) { background: rgba(201,161,74,.28); }
.paytable .syms { display: flex; gap: 2px; }
.paytable .syms svg { width: 32px; height: 32px; }
.paytable .syms .any { width: 32px; height: 32px; display: grid; place-items: center; font-size: .6rem; font-weight: 700; color: var(--ink-soft); border: 1.5px dashed rgba(29,21,18,.35); border-radius: 6px; }
.paytable .name { font-weight: 600; font-size: .86rem; }
.paytable .name small { display: block; font-weight: 400; font-size: .74rem; color: var(--ink-soft); }
.paytable .pay { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1rem; text-align: right; white-space: nowrap; }
.lines { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; list-style: none; }
.lines li { text-align: center; font-size: .72rem; color: var(--ink-soft); }
.lines svg { width: 100%; max-width: 72px; aspect-ratio: 1; display: block; margin: 0 auto 4px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.facts div { padding: 10px; border-radius: 10px; background: var(--ink); color: var(--cream); }
.facts dt { font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: var(--brass); font-weight: 700; }
.facts dd { font-family: var(--mono); font-size: 1.1rem; }
.facts dd small { display: block; font-family: var(--ui); font-size: .72rem; color: var(--cream-shade); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .84rem; }
.keys dt { font-family: var(--mono); font-weight: 500; white-space: nowrap; }
.dlg-body a { color: var(--lacquer); font-weight: 600; }

/* Autoplay and reality check forms */
fieldset { border: 0; margin-top: 14px; }
legend { font-weight: 700; font-size: .86rem; margin-bottom: 6px; }
legend small { font-weight: 400; color: var(--ink-soft); }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt span { display: grid; place-items: center; min-width: 58px; min-height: 44px; padding: 0 12px; border-radius: 10px; font-family: var(--mono); font-size: .92rem; box-shadow: inset 0 0 0 2px var(--ink); background: var(--cream); }
.opt input:checked + span { background: var(--ink); color: var(--cream); box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 2px var(--brass); }
.opt input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }
.opt input:disabled + span { opacity: .35; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: .9rem; }
.check input { width: 22px; height: 22px; accent-color: var(--teal); }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.btn { min-height: 48px; padding: 0 20px; border-radius: 24px; font-weight: 700; letter-spacing: .06em; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); background: var(--cream); }
.btn.primary { background: var(--lacquer); color: var(--cream); box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--brass); }
.btn:disabled { opacity: .45; }
.form-hint { font-size: .78rem; color: var(--ink-soft); margin-top: 8px; min-height: 1.2em; }
.rc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.rc-stats div { padding: 10px; border-radius: 10px; background: var(--ink); color: var(--cream); text-align: center; }
.rc-stats dt { font-size: .58rem; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); font-weight: 700; }
.rc-stats dd { font-family: var(--mono); font-size: 1.05rem; }

/* Wider screens */
@media (min-width: 560px) {
  :root {
    --gap: 8px; --cab-pad: 16px;
    --cell: clamp(44px, min(calc((var(--slots-width) - 250px) / 3.3), calc((var(--slots-usable-height) - 410px) / 3)), 160px);
  }
  .window-frame { padding: 11px 8px; gap: 6px; }
  .line-tabs, .line-tab { width: 22px; }
  .line-tab { height: 22px; margin-top: -11px; font-size: .72rem; }
  .lever { display: block; }
  .machine { padding-right: 56px; padding-left: 56px; }
  .help-label { display: inline; }
}
@media (min-width: 1040px) {
  .topper { padding: 12px 24px 10px; }
  .logo { font-size: 3rem; }
  .window-frame { margin-top: 8px; }
  .chip { max-width: 52px; }
  .actions { margin-top: 10px; }
  .belly { padding: 4px 6px 0; }
  .belly svg { height: 14px; }
  .cabinet-foot { margin-top: 4px; }
  :root .slots-page > .lounge { flex-direction: row; align-items: flex-start; justify-content: safe center; gap: 28px; padding-top: 6px; }
  .lounge-card { flex: 0 0 300px; margin-top: 40px; }
  .machine { padding-left: 0; }
}
@media (max-width: 380px) {
  :root { --cab-pad: 6px; }
  .topbar { padding: 8px 10px; }
  .wordmark span { display: none; }
  .wordmark h1 { font-size: 1.2rem; }
  .lobby { padding: 0 6px 0 0; }
  .header-tools { gap: 4px; }
  .deck { padding: 8px; }
  .chips { gap: 4px; }
  .marquee-face { padding: 4px 26px 2px; }
  .burst { width: 28px; height: 28px; margin-top: -14px; }
  .meters { grid-template-columns: 1.2fr 1fr 1fr; gap: 4px; }
  .meter { padding: 5px 6px 6px; }
  .dlg-body { padding-inline: 12px; }
  .paytable li { gap: 6px; padding-inline: 6px; }
  .paytable .syms :is(svg, .any) { width: 24px; height: 24px; }
}

/* Allocate the available height between the controls and the reel cells. */
@media (max-height: 1024px) {
  .slots-page .topbar { padding-block: 2px; }
  .slots-page .lounge { gap: 14px; }
  .cabinet { padding-bottom: 9px; }
  .cabinet::before { inset-block-start: 70px; }
  .topper { padding: 10px 13px 8px; }
  .logo { margin-block: 1px; font-size: clamp(1.6rem, 6vw, 2.2rem); }
  .window-frame { margin-top: 6px; padding-block: 5px; }
  .belly { display: none; }
  .lever { top: 90px; }
  .message { margin-top: 6px; min-height: 38px; padding: 3px 8px; font-size: .78rem; }
  .meters { margin-top: 5px; }
  .deck { margin-top: 6px; padding: 7px; }
  .chips { min-height: 44px; margin-top: 4px; }
  .chip { max-width: 44px; }
  .actions { grid-template-columns: repeat(2, minmax(44px, 1fr)) minmax(44px, 1.25fr); gap: 5px; margin-top: 7px; }
  .deck-btn { min-height: 44px; padding-inline: 4px; letter-spacing: .06em; }
  .spin { font-size: 1.15rem; }
  .actions kbd { display: none; }
}

@media (max-height: 570px) and (max-width: 559px) {
  :root {
    --cell: clamp(28px, min(calc((var(--slots-width) - 102px) / 3.3), calc((var(--slots-usable-height) - 366px) / 3)), 90px);
  }
  .marquee-face { padding-block: 0; }
  .marquee-sub { display: none; }
  .meter output { font-size: .9rem; }
}

@media (max-width: 499px) and (max-height: 430px) {
  .cabinet { display: flex; flex-direction: column; }
  .topper { display: none; }
  .message { order: 1; }
}

@media (max-width: 300px) {
  .deck { margin-inline: 0; padding-inline: 3px; }
  .chips { gap: 3px; }
}

/* Put the controls beside the reels when the viewport is short and wide. */
@media (orientation: landscape) and (min-width: 500px) and (max-height: 620px) {
  :root {
    --cab-pad: 10px;
    --cell: clamp(32px, min(calc((var(--slots-width) - 358px) / 3.3), calc((var(--slots-usable-height) - 164px) / 3)), 134px);
  }
  :root .slots-page > .lounge { align-items: safe center; padding: 4px 8px 12px; }
  .slots-page .lounge .machine { padding: 0; }
  .slots-page .lounge .cabinet {
    display: grid;
    grid-template: 'topper topper' auto 'reels meters' auto 'reels controls' auto 'reels message' 1fr / auto minmax(250px, 300px);
    gap: 6px; align-items: start;
  }
  .topper { grid-area: topper; padding-block: 11px; }
  .bulbs { inset-block: 6px; }
  .marquee-face { padding-block: 0; }
  .marquee-eyebrow, .marquee-sub { display: none; }
  .window-frame { grid-area: reels; margin: 0; }
  .meters { grid-area: meters; margin: 0; }
  .meter { padding: 5px 7px; }
  .meter output { font-size: clamp(.92rem, 2vw, 1.25rem); }
  .deck { grid-area: controls; margin: 0; }
  .chips { gap: 4px; }
  .message { grid-area: message; margin: 0; }
  .lever { display: none; }
  .lounge-card { flex: none; margin-top: 0; }
}

@media (max-width: 1039px), (max-height: 620px) {
  .slots-page .lounge > .lounge-card { display: none; }
  #session-help { display: inline-flex; }
}
@media (orientation: landscape) and (min-width: 500px) and (max-height: 620px) {
  #session-open { display: inline-flex; }
  #session-help { display: none; }
}
@media (orientation: landscape) and (min-width: 500px) and (max-width: 899px) and (max-height: 620px) {
  [data-game-viewport] .slots-page .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  [data-game-viewport] .slots-page .lobby { display: none; }
  .help-label { display: none; }
}
@media (orientation: landscape) and (min-width: 500px) and (max-height: 380px) {
  .slots-page .lounge .cabinet {
    grid-template: 'reels meters' auto 'reels controls' auto 'reels message' 1fr / auto minmax(250px, 300px);
  }
  .topper { display: none; }
  .cabinet::before { inset-block-start: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .bulb, .topper.chase .bulb, .topper.full .bulb { animation: none; }
  .cell.pulse svg { animation: none; }
  .reel.anticipate::after { animation: none; }
  .ticket, .celebrate::before, .celebrate.out .ticket, .celebrate.out::before { animation-name: soft-in; animation-duration: .2s; }
  .celebrate.out .ticket, .celebrate.out::before { animation-name: soft-out; }
}
/* Phone: the fixed viewport back/fullscreen buttons take the corners, so drop the duplicate lobby link and keep the header tools clear of them. */
@media (max-width: 520px) {
  [data-game-viewport] .slots-page .topbar { grid-template-columns: minmax(0, 1fr) auto; padding-inline: 52px; }
  [data-game-viewport] .slots-page .lobby { display: none; }
  .wordmark h1 { font-size: clamp(.9rem, 6vw, 1.2rem); }
  .header-tools { gap: 4px; }
}
