:root {
  --gold: #F5B83D;
  --gold2: #FFD98A;
  --flame: #FF7A3D;
  --hot: #E2481A;
  --cream: #FFF6EC;
  --muted: rgba(255, 240, 225, .62);
  --hair: rgba(255, 220, 190, .14);
  --panel-bg: linear-gradient(180deg, rgba(18, 8, 8, .78), rgba(10, 5, 7, .72));
  --panel: #1a0c0c;
  --edge: #4a2418;
  --shadow: #3a1004;
  --f-head: 'Bungee', Impact, 'Arial Black', sans-serif;
  --f-body: 'Outfit', 'Segoe UI', system-ui, sans-serif;
}

html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }

/* The fixed 1080x1920 design canvas; js/stage.js sets transform (translate + scale) to letterbox it on black. */
#stage {
  position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; overflow: hidden;
  transform-origin: 0 0;
  box-sizing: border-box;
  font-family: var(--f-body); color: var(--cream); font-variant-numeric: tabular-nums;
  /* fallback when the background clips are off or still loading */
  background:
    radial-gradient(ellipse 80% 26% at 50% -4%, rgba(255,110,40,.5) 0%, rgba(160,40,10,.22) 45%, transparent 75%),
    linear-gradient(180deg, #170b10 0%, #0d080c 55%, #09060a 100%);
}
#stage *, #stage *::before, #stage *::after { box-sizing: border-box; }
#stage [hidden] { display: none !important; }

/* ---------- animated background (behind all UI) ---------- */
.bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.bg-stage { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bg-sky { position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; }
.bg-fx { position: absolute; inset: 0; width: 1080px; height: 1920px; mix-blend-mode: screen; }
/* the fireball source clip must stay rendered (not display:none) or browsers stop decoding it */
.bg-src { position: absolute; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; }

.state { position: absolute; inset: 0; z-index: 1; }
.top, .jps, .ticker { z-index: 2; }

/* panels over video are solid see-through fills, never backdrop-filter (a per-frame blur of the video) */
.panel { background: var(--panel-bg); border: 1.5px solid var(--hair); box-shadow: 0 20px 50px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06); }

/* ---------- header ---------- */
.top { pointer-events: none; position: absolute; left: 0; right: 0; top: 0; height: 150px; display: flex; align-items: center; justify-content: space-between; padding: 0 44px; }
.pill { height: 64px; min-width: 96px; padding: 0 24px; border-radius: 32px; display: flex; align-items: center; justify-content: center; gap: 14px;
        font-size: 28px; font-weight: 600; background: var(--panel-bg); border: 1.5px solid var(--hair); }
.pill:empty { visibility: hidden; }
.who { color: var(--muted); }
.who::before { content: ""; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--gold2), var(--flame)); }
.tbadge { color: var(--gold); font-weight: 700; letter-spacing: 1px; }
.tbadge::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 10px #4ade80; }
.brandbox { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.brand {
  font-family: var(--f-head); font-size: 46px; line-height: 1;
  background: linear-gradient(180deg, #FFE7A8 0%, #F5B83D 50%, #FF7A3D 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 var(--shadow)) drop-shadow(0 0 22px rgba(255,122,61,.45));
}
.sub { font-size: 24px; font-weight: 600; letter-spacing: 14px; padding-left: 14px; color: var(--cream); opacity: .78; text-shadow: 0 2px 8px #000; }

button { font: inherit; color: inherit; padding: 0; margin: 0; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.abs { position: absolute; left: 0; right: 0; }

/* ---------- jackpots: one card, MEGA hero + a row of three ---------- */
.jps { top: 160px; margin: 0 40px; height: 380px; border-radius: 36px; overflow: hidden; display: grid; grid-template-rows: 1fr 124px; }
.jps .mega { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
             background: radial-gradient(ellipse 70% 90% at 50% 110%, rgba(255,122,61,.3) 0%, transparent 70%); }
.jps .mega .n { display: flex; align-items: center; gap: 16px; font-size: 30px; font-weight: 700; letter-spacing: 12px; padding-left: 12px; color: var(--gold); }
.jps .mega .n::before, .jps .mega .n::after { content: ""; width: 60px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold)); }
.jps .mega .n::after { background: linear-gradient(270deg, transparent, var(--gold)); }
.jps .mega .v { font-size: 128px; font-weight: 800; line-height: 1; letter-spacing: -2px; color: var(--cream); text-shadow: 0 0 28px rgba(255,170,80,.45); }
.jps .minors { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1.5px solid var(--hair); background: rgba(0,0,0,.22); }
.jps .jp { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.jps .jp + .jp { border-left: 1.5px solid var(--hair); }
.jps .jp .n { font-size: 22px; font-weight: 700; letter-spacing: 6px; color: #FF9A5C; }
.jps .jp .v { font-size: 46px; font-weight: 700; }
.ticker { top: 560px; width: max-content; max-width: 1000px; margin: 0 auto; height: 52px; padding: 0 26px; border-radius: 26px; display: flex; align-items: center; gap: 14px;
          font-size: 24px; font-weight: 700; letter-spacing: 1px; color: var(--gold); background: var(--panel-bg); border: 1.5px solid var(--hair); }
.ticker::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--flame); box-shadow: 0 0 10px var(--flame); }

/* ---------- lobby: games header + 3x2 pages + dock ---------- */
.sect { top: 628px; height: 104px; padding: 0 44px; display: flex; align-items: center; justify-content: space-between; }
.sect h5 { margin: 0; font-size: 42px; font-weight: 700; text-shadow: 0 2px 10px #000; }
.sect h5 span { margin-left: 16px; font-size: 32px; font-weight: 500; color: var(--muted); }
.nav { display: flex; gap: 20px; }
.navbtn { width: 100px; height: 100px; border-radius: 50%; display: grid; place-items: center; padding-bottom: 6px;
          font-size: 64px; font-weight: 600; line-height: 1; color: var(--gold); border-color: rgba(245,184,61,.45); }
.navbtn:active { transform: scale(.94); }
.navbtn[disabled] { opacity: .28; cursor: default; }
.gridwrap { top: 740px; height: 860px; overflow: hidden; touch-action: pan-y; }
.track { display: flex; width: 100%; height: 100%; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.page { flex: 0 0 1080px; width: 1080px; padding: 0 40px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 404px);
        gap: 32px 30px; align-content: start; }
.tile { position: relative; display: block; width: 100%; height: 404px; border-radius: 30px; overflow: hidden; background: #000;
        box-shadow: 0 18px 40px rgba(0,0,0,.6), 0 0 0 1.5px rgba(255,220,190,.16); transition: transform .15s ease; }
.tile:active { transform: scale(.965); }
/* the icons have a gold frame + corner stars baked in: zoom past it for a clean rounded tile */
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.16); -webkit-user-drag: none; user-select: none; pointer-events: none; }
.tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(160deg, rgba(255,255,255,.16) 0%, transparent 28%); }
.tile.last { box-shadow: 0 18px 40px rgba(0,0,0,.6), 0 0 0 4px var(--gold), 0 0 30px rgba(245,184,61,.45); }
.tile .tag { position: absolute; left: 16px; bottom: 16px; z-index: 1; height: 44px; padding: 0 16px; border-radius: 22px; background: rgba(10,6,8,.78);
             display: flex; align-items: center; font-size: 22px; font-weight: 700; letter-spacing: 1px; color: var(--gold); }
.empty { grid-column: 1 / -1; align-self: center; text-align: center; font-size: 48px; font-weight: 700; color: var(--muted); padding-top: 300px; }
.dots { top: 1612px; height: 14px; display: flex; justify-content: center; gap: 12px; }
.dot { width: 14px; height: 14px; border-radius: 7px; background: rgba(255,240,225,.25); transition: width .3s, background .3s; }
.dot.on { width: 56px; background: var(--gold); }
.dock { bottom: 34px; margin: 0 40px; height: 200px; border-radius: 40px; padding: 22px; display: grid; gap: 18px;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.55fr) 150px; }   /* minmax(0,..): a long game name can't push SIGN OUT off */
.dock.nores { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 150px; }
.plate { border-radius: 26px; background: rgba(0,0,0,.3); display: flex; flex-direction: column; justify-content: center; padding: 0 28px; }
.plate .l { font-size: 22px; font-weight: 600; letter-spacing: 4px; color: var(--muted); }
.plate .v { font-size: 58px; font-weight: 800; line-height: 1.1; } .plate .v.gold { color: var(--gold); }
.resume { border-radius: 26px; background: linear-gradient(135deg, #FFDB7E 0%, #F5B83D 55%, #FF9440 100%); color: #1a0a00;
          display: flex; align-items: center; gap: 18px; padding: 0 20px; text-align: left; box-shadow: 0 10px 30px rgba(245,150,61,.35); }
.resume img { width: 92px; height: 118px; flex: none; object-fit: cover; border-radius: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.resume span { display: flex; flex-direction: column; min-width: 0; }
.resume small { font-size: 22px; font-weight: 700; letter-spacing: 4px; opacity: .7; }
.resume b { font-size: 28px; font-weight: 800; line-height: 1.08; overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.out { border-radius: 26px; border: 1.5px solid rgba(255,138,102,.45); background: rgba(40,10,6,.5); color: #FF9A7A;
       display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 26px; font-weight: 700; letter-spacing: 1px; }
.out svg { width: 46px; height: 46px; }
.btn { border-radius: 24px; display: grid; place-items: center; text-align: center; font-size: 36px; font-weight: 700; line-height: 1.05; }
.btn.go { background: linear-gradient(135deg, #FFDB7E 0%, #F5B83D 55%, #FF9440 100%); color: #1A0A00; box-shadow: 0 10px 30px rgba(245,150,61,.4); }

/* ---------- attract ---------- */
.reel { top: 640px; height: 1000px; margin: 0 60px; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); gap: 22px;
        opacity: .5; -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 72%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 72%, transparent 100%); }
.reel img { width: 100%; height: 100%; object-fit: cover; border-radius: 26px; transition: opacity 1.2s ease; }
.reel img.fade { opacity: 0; }
.reel video { grid-column: 1 / -1; grid-row: 1 / -1; width: 100%; height: 100%; object-fit: cover; border-radius: 30px; }
.attract-cta { top: 960px; text-align: center; font-family: var(--f-head); font-size: 130px; line-height: 1; color: var(--gold);
               text-shadow: 0 6px 0 var(--shadow), 0 0 50px rgba(255,122,61,.75); }
.attract-cta small { display: block; width: max-content; margin: 34px auto 0; padding: 22px 44px; border-radius: 46px;
                     font-family: var(--f-body); font-size: 36px; font-weight: 600; letter-spacing: 3px; color: var(--cream); text-shadow: none; }
.attract-foot { top: 1700px; text-align: center; font-size: 38px; font-weight: 500; color: var(--cream); padding: 0 60px; text-shadow: 0 2px 10px #000; }
.attract-foot b { color: var(--gold); font-weight: 700; }

/* ---------- phone pad + enroll ---------- */
.dim { position: absolute; inset: 600px 0 0 0; background: rgba(8,4,6,.72); }
.pad { top: 650px; margin: 0 90px; height: 1220px; border-radius: 40px; background: linear-gradient(180deg, #24100e, #140808); border: 2px solid rgba(245,184,61,.55);
       padding: 40px 50px; display: flex; flex-direction: column; align-items: center; gap: 26px; box-shadow: 0 0 60px rgba(0,0,0,.8); }
.pad h4 { margin: 0; font-family: var(--f-head); font-size: 52px; color: var(--gold); font-weight: 400; text-align: center; }
.num { width: 100%; height: 130px; border-radius: 24px; background: rgba(0,0,0,.45); border: 1.5px solid var(--hair); display: flex; align-items: center; justify-content: center;
       font-size: 70px; font-weight: 700; letter-spacing: 4px; }
.num span { color: rgba(255,240,225,.25); }
.keys { display: grid; grid-template-columns: repeat(3, 230px); grid-auto-rows: 140px; gap: 22px; }
.key { border-radius: 26px; background: rgba(255,255,255,.06); border: 1.5px solid var(--hair); display: grid; place-items: center; font-size: 64px; font-weight: 700; }
.key:active { background: rgba(255,255,255,.14); }
.key.del { font-size: 44px; color: #FF9A7A; }
.key.ok { background: linear-gradient(135deg, #FFDB7E 0%, #F5B83D 55%, #FF9440 100%); color: #1A0A00; border-color: transparent; font-size: 50px; }
.key[disabled] { opacity: .35; }
.cancel { font-size: 40px; font-weight: 600; color: var(--muted); text-decoration: underline; padding: 14px 40px; }
.err { min-height: 52px; font-size: 40px; font-weight: 700; color: #FF9A7A; text-align: center; }
.pad.enroll { top: 260px; height: auto; padding-bottom: 50px; gap: 22px; }
.code { font-size: 80px; letter-spacing: 10px; }
.keys.alpha { grid-template-columns: repeat(6, 121px); grid-auto-rows: 118px; gap: 14px; }
.keys.alpha .key { font-size: 56px; }
.pad .row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; width: 100%; height: 130px; }
.pad .row .key { font-size: 50px; }

/* ---------- free play + still playing ---------- */
.scrim { z-index: 3; background: rgba(8,4,6,.6); }
.fp { top: 800px; margin: 0 70px; height: 560px; border-radius: 44px; border: 3px solid var(--gold); text-align: center;
      background: radial-gradient(ellipse at 50% 30%, #7a2408 0%, #200a06 72%); box-shadow: 0 0 80px rgba(245,184,61,.5);
      display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.fp .t { font-family: var(--f-head); font-size: 70px; color: var(--gold); }
.fp .a { font-size: 170px; font-weight: 800; line-height: 1; text-shadow: 0 0 40px rgba(255,180,80,.7); }
.fp .s { font-size: 44px; color: var(--muted); }
.fp .btn { margin: 20px auto 0; width: 460px; height: 110px; font-size: 48px; }
#stillthere .fp { height: 440px; }
#stillthere .fp .btn { width: 560px; }

/* ---------- game overlay + full-screen messages ---------- */
.game { z-index: 10; background: #000; }
.game iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.gameback { position: absolute; top: 14px; left: 14px; z-index: 2; min-width: 190px; height: 100px; border-radius: 24px; background: rgba(0,0,0,.6);
            border: 2px solid var(--gold); color: var(--gold); font-size: 40px; font-weight: 700; letter-spacing: 2px; }
.full { z-index: 20; display: grid; place-items: center; text-align: center; padding: 0 80px;
        background: radial-gradient(ellipse at 50% 40%, rgba(58,18,8,.92) 0%, rgba(13,8,12,.96) 75%); }
.full.over { z-index: 30; background: rgba(12,5,6,.94); }
.msg .t { font-family: var(--f-head); font-size: 80px; line-height: 1.2; color: var(--gold); text-shadow: 0 5px 0 var(--shadow), 0 0 30px rgba(255,122,61,.6); }
.msg .s { margin-top: 30px; font-size: 52px; color: var(--cream); }

/* "In the bonus" badge: under the header in the lobby, just above the game's control bar over a game. Above the game (10), under the
   message screens (20, 30) and the ceremony. It never takes a touch. */
.gbfin { position: absolute; top: 104px; left: 24px; z-index: 12; pointer-events: none; height: 48px; padding: 0 20px 0 16px;
         border-radius: 24px; display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 700; letter-spacing: 2px;
         background: rgba(0,0,0,.62); border: 2px solid rgba(255,255,255,.28); color: rgba(255,255,255,.62); }
.gbfin::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); }
.gbfin.in { border-color: #4ade80; color: #eafff0; }
.gbfin.in::before { background: #4ade80; border-color: #4ade80; box-shadow: 0 0 12px #4ade80; }
.gbfin.ingame { top: auto; bottom: 186px; left: 14px; }   /* over a game: the strip above its control bar, clear of its jackpot plaques */

/* Community bonus ceremony: above a running game (10) and every message screen (20, 30). It takes every touch. */
.gbfbonus { z-index: 40; background: radial-gradient(ellipse at 50% 45%, rgba(90,24,6,.93) 0%, rgba(10,4,5,.97) 78%); overflow: hidden; }
.gbfbonus__fire { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: screen; opacity: .85; pointer-events: none; }
.gbfbonus .msg { position: relative; }
.gbfbonus .k { font-family: var(--f-head); font-size: 58px; letter-spacing: 6px; color: var(--cream); text-shadow: 0 4px 0 var(--shadow); }
.gbfbonus .t { margin-top: 26px; font-size: 104px; }
.gbfbonus .amt { margin-top: 30px; font-family: var(--f-head); font-size: 170px; line-height: 1.05; color: #fff; text-shadow: 0 6px 0 var(--shadow), 0 0 50px rgba(255,160,60,.9); }
.gbfbonus .s { margin-top: 40px; font-size: 64px; font-weight: 700; letter-spacing: 3px; }
.gbfbonus.won .amt { color: var(--gold); animation: gbfwon .7s ease-in-out infinite alternate; }
.gbfbonus.won .s { color: var(--gold); }
@keyframes gbfwon { from { transform: scale(1); } to { transform: scale(1.08); } }

.notice { position: absolute; left: 90px; right: 90px; top: 1560px; z-index: 25; pointer-events: none; padding: 30px 40px; border-radius: 30px; text-align: center;
          background: var(--panel); border: 2px solid var(--gold); box-shadow: 0 0 60px rgba(0,0,0,.8); font-size: 46px; font-weight: 700; color: var(--cream); }

/* ---------- the kiosk lobby's look (config.json background.sky; js/sky.js paints the sky and the balls of fire) ---------- */
/* the sky is brighter than the stage clip, so the see-through panels get a little more body */
#stage.sky { --panel-bg: linear-gradient(180deg, rgba(20, 8, 30, .86), rgba(8, 4, 14, .84)); --hair: rgba(255, 215, 150, .26); }

/* background.jackpotBalls: each jackpot is a glass capsule on its own ball of fire, its name on a chip in the jackpot's colour */
#stage.balls .jps { top: 0; margin: 0; height: 700px; border-radius: 0; overflow: visible; display: block; background: none; border: 0; box-shadow: none; pointer-events: none; }
#stage.balls .jps .minors { display: contents; }
#stage.balls .jps .mega, #stage.balls .jps .jp {
  position: absolute; transform: translate(-50%, -50%); border-radius: 999px; padding: 0; gap: 0; flex-direction: row; border: 0;
  background: linear-gradient(180deg, rgba(34, 18, 44, .95), rgba(6, 3, 10, .97));
  box-shadow: 0 0 0 4px #e9b02e, 0 0 0 5px #fff1a8, 0 10px 26px rgba(0, 0, 0, .75), inset 0 2px 0 rgba(255, 255, 255, .14), inset 0 -10px 18px rgba(0, 0, 0, .6); }
#stage.balls .jps .mega { left: 540px; top: 352px; width: 500px; height: 100px; }
#stage.balls .jps .jp:nth-child(1) { left: 540px; top: 566px; width: 300px; height: 72px; }
#stage.balls .jps .jp:nth-child(2) { left: 188px; top: 492px; width: 282px; height: 70px; }
#stage.balls .jps .jp:nth-child(3) { left: 892px; top: 492px; width: 282px; height: 70px; }
#stage.balls .jps .mega .v { font-size: 78px; letter-spacing: 0; text-shadow: 0 3px 8px #000; }
#stage.balls .jps .jp .v { font-size: 46px; text-shadow: 0 3px 8px #000; }
#stage.balls .jps .n { position: absolute; left: 50%; top: 0; transform: translate(-50%, -62%); padding: 3px 20px 1px; border-radius: 999px; gap: 0;
  font-size: 22px; font-weight: 800; letter-spacing: 5px; color: #1a0700; white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .7), inset 0 2px 0 rgba(255, 255, 255, .55); }
#stage.balls .jps .mega .n { font-size: 28px; letter-spacing: 7px; padding: 4px 26px 2px; background: linear-gradient(180deg, #fff2a6, #ffb21c 60%, #e07a00); }
#stage.balls .jps .mega .n::before, #stage.balls .jps .mega .n::after { display: none; }
#stage.balls .jps .jp:nth-child(1) .n { background: linear-gradient(180deg, #ffd6ff, #f070f0 60%, #b030e0); }
#stage.balls .jps .jp:nth-child(2) .n { background: linear-gradient(180deg, #d6f6ff, #58ccff 60%, #1a7af0); }
#stage.balls .jps .jp:nth-child(3) .n { background: linear-gradient(180deg, #eaffc4, #a2f040 60%, #34b428); }
/* the last-win line sits beside the games heading, out of the balls' way */
#stage.balls .ticker { top: 668px; height: 42px; font-size: 20px; padding: 0 20px; }
