/* 777 Neon Nights — neon cabinet aesthetic */
:root{
  --neon:#ff8c1a; --neon-soft:#ffc37a; --bg:#0d0508; --panel:#160a0e;
  --gold:#ffd34d; --green:#40ff8c; --ink:#f5e9dc; --muted:#b99f8d;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  background:
    radial-gradient(140% 60% at 50% -10%, rgba(255,120,30,.07) 0%, transparent 55%),
    radial-gradient(120% 90% at 50% 0%, #120609 0%, var(--bg) 55%, #030102 100%);
  color:var(--ink); font-family:-apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height:100vh; display:flex; justify-content:center;
}
#app{width:100%; max-width:520px; padding:12px 12px 40px}

/* screen-reader-only: keeps game.js ids/behavior, hides visually */
.sr-only{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;
  overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* canvas cabinet */
.cabinet{padding:0; background:transparent; border:none; box-shadow:none}

/* Brand bar (v8.4): visible CWI brand + song info, first viewport.
   Compact by design: ~64px so reels/Spin/SPINS stay in view on iPhone. */
.brandbar{display:flex; align-items:center; gap:10px; padding:8px 10px;
  background:linear-gradient(180deg,#180b0e,#0e0608);
  border:1px solid #6b3418; border-radius:12px; margin-bottom:8px}
.brandbar-logo{width:44px; height:44px; border-radius:50%; flex:0 0 auto;
  border:2px solid var(--gold); box-shadow:0 0 12px rgba(255,211,77,.35)}
.brandbar-text{min-width:0; flex:1 1 auto}
.brandbar-name{font-size:15px; font-weight:900; letter-spacing:3px; color:var(--gold);
  text-shadow:0 0 10px rgba(255,211,77,.55); white-space:nowrap}
.songstrip{display:block; margin-top:2px; font-size:12.5px; color:var(--neon-soft);
  letter-spacing:.4px; text-decoration:none; white-space:nowrap; overflow:hidden;
  text-overflow:ellipsis}
.songstrip:active{color:#fff}
#cabinetCanvas{display:block; width:100%; height:auto; border-radius:18px; cursor:pointer;
  touch-action:manipulation; outline:none;
  box-shadow:0 18px 60px rgba(0,0,0,.6), 0 0 34px rgba(255,140,26,.12)}
#cabinetCanvas:focus-visible{box-shadow:0 18px 60px rgba(0,0,0,.6), 0 0 0 3px #ffd34d, 0 0 34px rgba(255,140,26,.35)}
.cabinet-toolbar{display:flex; gap:8px; align-items:center; justify-content:center; margin-top:10px}
.winbanner{min-height:30px; text-align:center; font-weight:800; font-size:18px; margin:10px 0 2px;
  color:var(--gold); text-shadow:0 0 12px var(--gold)}

/* marquee */
.marquee{text-align:center; padding:14px 8px 10px; border:2px solid #5a2c12; border-radius:14px;
  background:linear-gradient(180deg,#3a0f10,#1c0708); margin-bottom:10px;
  box-shadow:0 0 18px rgba(255,140,26,.35), inset 0 0 24px rgba(255,140,26,.12)}
.marquee-title{font-size:34px; font-weight:900; letter-spacing:2px; color:#ffe9c9;
  text-shadow:0 0 6px var(--neon), 0 0 18px var(--neon), 0 0 42px var(--neon)}
.marquee-sub{font-size:12px; color:var(--neon-soft); letter-spacing:1px; margin-top:4px}

/* stage bar */
.stagebar{background:linear-gradient(180deg,#180b0e,#0e0608); border:1px solid #6b3418; border-radius:12px;
  padding:10px 12px; margin-bottom:10px; box-shadow:0 0 16px rgba(255,140,26,.14), inset 0 0 18px rgba(255,140,26,.05)}
.stage-name{font-weight:800; font-size:16px; color:var(--neon-soft);
  text-shadow:0 0 10px var(--neon)}
.round-line{font-size:13px; color:var(--muted); margin:2px 0 8px}
.progress{height:8px; background:#241014; border-radius:6px; overflow:hidden}
.progress-fill{height:100%; width:0%; border-radius:6px;
  background:linear-gradient(90deg,var(--neon),var(--gold)); box-shadow:0 0 10px var(--neon);
  transition:width .4s}

/* cabinet shell is 3D-rendered (cabinet3d.js, Three.js). The DOM rules below
   style the screen-reader fallback + modals; the visible cabinet lives
   on #cabinetCanvas. If WebGL is unavailable the fallback becomes VISIBLE
   (.dom-visible) and fully playable — never a blank page. */
.cabinet-fallback .reel{position:absolute}
.spin-btn{font-size:24px; font-weight:900; letter-spacing:3px; color:#2a0d00; padding:14px;
  touch-action:manipulation;
  border:none; border-radius:14px; cursor:pointer;
  background:linear-gradient(180deg,#ffd34d,#ff9a1f); box-shadow:0 0 18px rgba(255,160,40,.6), 0 4px 0 #a35a00}
.spin-btn:active{transform:translateY(3px); box-shadow:0 0 10px rgba(255,160,40,.6), 0 1px 0 #a35a00}
.spin-btn:disabled{filter:grayscale(.7) brightness(.7); cursor:default}
.spin-btn.small{font-size:16px; padding:10px}
.icon-btn{font-size:22px; background:#0a0505; border:1px solid #4a2a16; border-radius:10px;
  padding:8px 10px; cursor:pointer; color:var(--ink)}
.icon-btn.locked{opacity:.35; filter:grayscale(1)}
.icon-btn:not(.locked){box-shadow:0 0 12px var(--gold); animation:encorepulse 1.2s infinite alternate}
@keyframes encorepulse{from{filter:brightness(1)}to{filter:brightness(1.5)}}

.listenbar{display:flex; justify-content:space-between; font-size:12px; color:var(--muted); margin-top:10px}

/* panels */
.panel{background:linear-gradient(180deg,#170b0e,#0f0709); border:1px solid #5a2c14; border-radius:12px;
  padding:12px; margin-top:10px; box-shadow:0 0 14px rgba(255,140,26,.10)}
.panel h2{margin:0 0 6px; font-size:15px; letter-spacing:1px; color:var(--neon-soft)}
.fine{font-size:12px; color:var(--muted); margin:0 0 8px}
#prizeList{list-style:none; margin:0; padding:0}
#prizeList li{display:flex; justify-content:space-between; align-items:center; gap:8px;
  padding:8px; border:1px solid #332016; border-radius:8px; margin-bottom:6px; font-size:13px}
#prizeList li.unlocked{border-color:var(--green); box-shadow:0 0 10px rgba(64,255,140,.25)}
.claim-btn{background:var(--green); border:none; border-radius:8px; font-weight:800; padding:8px 12px; cursor:pointer}
.stats{display:grid; grid-template-columns:1fr 1fr; gap:6px; font-size:13px}
.stats div{background:#0f0809; border-radius:8px; padding:8px}
.stats b{color:var(--gold)}

footer{text-align:center; margin-top:14px}
.disclaimer{font-size:11px; color:var(--muted); line-height:1.5}
.link-btn{background:none; border:none; color:#8fb8ff; text-decoration:underline; cursor:pointer; font-size:13px}

/* modals */
.modal{position:fixed; inset:0; background:rgba(0,0,0,.78); display:flex; align-items:center;
  justify-content:center; z-index:50; padding:16px}
.modal.hidden{display:none}
.modal-card{background:#160a0e; border:2px solid var(--neon); border-radius:16px; padding:20px;
  max-width:420px; width:100%; text-align:center; box-shadow:0 0 30px rgba(255,140,26,.4);
  max-height:88vh; overflow-y:auto}
.modal-card.gold{border-color:var(--gold); box-shadow:0 0 34px rgba(255,211,77,.45)}
.modal-card h2{margin-top:0}
.neon-gold{color:#ffe9a8; text-shadow:0 0 10px var(--gold), 0 0 30px var(--gold)}
.neon-green{color:#c9ffe0; text-shadow:0 0 10px var(--green), 0 0 30px var(--green)}
.link-list{display:flex; flex-direction:column; gap:8px; margin:14px 0}
.link-list a{display:block; padding:12px; border-radius:10px; text-decoration:none; font-weight:800;
  background:linear-gradient(180deg,#1f2a44,#141b2e); color:#cfe2ff; border:1px solid #3a5a9a}
.link-list a small{display:block; font-weight:400; color:#9db4dd; font-size:11px}
.close-btn{background:#2a1610; color:var(--ink); border:1px solid #5a3a24; border-radius:10px;
  padding:10px 18px; cursor:pointer; font-size:14px}
.rules{text-align:left; font-size:13px; line-height:1.6; color:var(--ink)}
.reels.mini{justify-content:center}
.reels.mini .reel{width:130px}

.toast{position:fixed; bottom:24px; left:50%; transform:translateX(-50%); background:#221016;
  border:1px solid var(--neon); color:var(--ink); padding:12px 18px; border-radius:12px; z-index:60;
  box-shadow:0 0 18px rgba(255,140,26,.5); font-size:14px; max-width:90vw; text-align:center}
.toast.hidden{display:none}

/* stage themes */
body[data-theme="magenta"]{--neon:#ff3ec8; --neon-soft:#ff9ade}
body[data-theme="cyan"]{--neon:#27e6ff; --neon-soft:#a5f3ff}

/* language picker + translated how-to */
.lang-picker {
  background: #141428; color: #ffd166; border: 1px solid #ffd16655;
  border-radius: 8px; padding: 6px 4px; font-size: 0.8rem; max-width: 7.5rem;
}
.lang-picker option { background: #141428; }
.howto-title { color: #ffd166; margin: 0.4rem 0 0.2rem; font-size: 1rem; }
ol.howto { margin: 0 0 0.8rem 1.1rem; padding: 0; line-height: 1.45; }
ol.howto li { margin: 0.25rem 0; }
ol.howto[dir="rtl"] { margin: 0 1.1rem 0.8rem 0; }

/* payout screen + high scores */
.payout-score { display: flex; gap: 0.6rem; align-items: center; justify-content: center; flex-wrap: wrap; margin: 0.6rem 0; color: #ffd166; }
.payout-actions { display: flex; justify-content: center; margin-top: 0.4rem; }
.score-board { margin: 0.4rem 0 0.8rem 1.2rem; line-height: 1.6; }
.score-board li { margin: 0.15rem 0; }
#scorePanel .row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.4rem 0; align-items: center; }
#scorePanel input { background: #141428; color: #fff; border: 1px solid #ffd16655; border-radius: 8px; padding: 6px 8px; font-size: 0.85rem; }
#scorePanel #importCode { flex: 1; min-width: 12rem; }

/* ---------- visible DOM fallback (no-WebGL path) ---------- */
.cabinet-fallback.dom-visible{position:relative; overflow:hidden; border-radius:18px;
  background:linear-gradient(180deg,#2a0d0d,#140608 30%,#0a0507);
  border:2px solid #ff8c1a; box-shadow:0 0 26px rgba(255,140,26,.35), inset 0 0 40px rgba(0,0,0,.6);
  padding:14px; margin-bottom:6px}
.cabinet-fallback.dom-visible .jackpot-sign{text-align:center; font-size:30px; font-weight:900;
  letter-spacing:2px; color:#ffb3ab; background:#1c0505; border-radius:10px; padding:8px;
  text-shadow:0 0 8px #ff2a1a, 0 0 24px #ff2a1a; margin-bottom:12px}
.cabinet-fallback.dom-visible .jackpot-sign.flaring{color:#fff;
  text-shadow:0 0 10px #ff2a1a, 0 0 34px #ff2a1a, 0 0 60px #ff2a1a;
  animation:signflare .5s infinite alternate}
@keyframes signflare{from{filter:brightness(1)}to{filter:brightness(1.45)}}
/* Machine-face prize readout (DOM fallback): LED-ticker readout on the
   machine itself — the translated prize name lights up here on every win. */
.cabinet-fallback.dom-visible .prize-display{
  font-family:"Arial Black",Arial,sans-serif; font-weight:900; font-size:19px; line-height:1.35;
  text-align:center; color:#ffd9a0; margin:0 auto 10px; padding:9px 12px; max-width:94%;
  background:linear-gradient(#2a0d0d,#180606); border:2px solid #ffb020; border-radius:10px;
  text-shadow:0 0 12px #ff7a1a, 0 0 30px #ff4d00;
  box-shadow:0 0 18px rgba(255,138,42,.55), inset 0 0 14px rgba(255,122,26,.25)}
.cabinet-fallback.dom-visible .prize-display.hidden{display:none}
/* Jackpot background light-up (no-WebGL path): a gold light sweep washes
   the page behind the cabinet — pure compositor animation, mobile-safe. */
body.jackpot-lights::after{
  content:""; position:fixed; inset:0; pointer-events:none;
  background:radial-gradient(ellipse at 50% 28%, rgba(255,176,32,.42), rgba(255,42,26,.16) 52%, rgba(255,62,200,.10) 68%, transparent 78%);
  animation:nn-jacksweep 2.2s ease-in-out infinite}
@keyframes nn-jacksweep{
  0%,100%{opacity:.35; transform:scale(1)}
  50%{opacity:1; transform:scale(1.18)}}
.cabinet-fallback.dom-visible .reels{display:flex; gap:8px; justify-content:center; margin-bottom:12px}
.cabinet-fallback.dom-visible .reel{position:relative; width:110px; height:216px; overflow:hidden;
  background:linear-gradient(180deg,#efe9db,#fbf7ec 50%,#ddd5c2); border-radius:10px;
  border:2px solid #8a8a92; box-shadow:inset 0 8px 18px rgba(0,0,0,.25)}
.cabinet-fallback.dom-visible .reel .strip{position:absolute; top:0; left:0; width:100%}
.cabinet-fallback.dom-visible .reel .cell{height:72px; display:flex; align-items:center; justify-content:center}
.cabinet-fallback.dom-visible .reel .cell .sym{width:56px; height:56px}
.cabinet-fallback.dom-visible .reel .winline{position:absolute; left:0; right:0; top:50%; height:3px;
  background:#ff2222; box-shadow:0 0 8px #ff2222; transform:translateY(-50%)}
.cabinet-fallback.dom-visible .controls{display:flex; gap:12px; align-items:center; justify-content:center}
.cabinet-fallback.dom-visible .meters{display:flex; gap:10px; color:var(--gold); font-weight:800}
.dom-tokens{position:absolute; inset:0; pointer-events:none; overflow:hidden}
.dom-tokens i{position:absolute; top:-16px; width:12px; height:12px; border-radius:50%;
  background:radial-gradient(circle at 35% 35%, #ffe9a8, #d9a821);
  box-shadow:0 0 8px #ffd34d; animation:domtokenfall 2.6s ease-in forwards}
@keyframes domtokenfall{to{transform:translateY(560px) rotate(540deg); opacity:.9}}

/* ---------- boot-failure retry UI ---------- */
.boot-retry{position:fixed; inset:0; z-index:80; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:12px; text-align:center; padding:24px;
  background:rgba(5,2,3,.96)}
.boot-retry.hidden{display:none}
.boot-retry h2{color:#ffe9c9; margin:0}
.boot-retry p{color:var(--muted); max-width:340px}

/* ---------- 3D canvas sizing ---------- */
#cabinet{position:relative; width:100%; aspect-ratio:480/880}
#cabinetCanvas{display:block; width:100%!important; height:100%!important; border-radius:18px}
.dom-fallback-active{aspect-ratio:auto}
.dom-fallback-active #cabinetCanvas{display:none}

/* ---------- Neon Credits: prize readout score line + claim modal ---------- */
.hidden{display:none}
.prize-display{white-space:pre-line}
.credit-box{border:1px solid var(--gold);border-radius:12px;padding:12px 14px;margin:12px 0;background:rgba(255,211,77,.06);text-align:center}
.credit-earn{font-size:22px;font-weight:900;color:var(--gold)}
.credit-score-line{font-size:15px;font-weight:700;color:#ffe9b0;margin:6px 0}
.credit-ask{font-size:16px;font-weight:800;color:#fff;margin:10px 0 4px}
.payout-actions{display:flex;gap:10px;justify-content:center;margin-top:12px;flex-wrap:wrap}
.spin-btn.small.ghost{background:transparent;border:2px solid var(--neon);color:var(--neon);box-shadow:none}

/* ---- v8.2 GAME OVER / Earn panel ---- */
.earn-title{margin:14px 0 4px; font-size:16px; letter-spacing:2px; color:var(--gold)}
.earn-label{margin:10px 0 6px; font-size:13px; font-weight:800; letter-spacing:1px; color:var(--neon-soft)}
.earn-btns{display:flex; gap:10px; flex-wrap:wrap; justify-content:center}
.earn-btn{display:inline-block; min-width:120px; min-height:52px; padding:14px 20px;
  font-size:17px; font-weight:900; border-radius:14px; text-align:center;
  background:linear-gradient(180deg,#1f6f3a,#14532a); color:#fff; text-decoration:none;
  border:2px solid #2ea050; box-shadow:0 0 14px rgba(46,160,80,.45); cursor:pointer}
.earn-btn:active{transform:translateY(2px)}
.earn-btn.share{background:linear-gradient(180deg,#7a4fd0,#5b34a8); border-color:#9a7bff;
  box-shadow:0 0 14px rgba(154,123,255,.45); width:100%}
#buySpinsNote{min-height:18px; text-align:center}
#gameoverMsg{margin:6px 0}

/* CTA strip (OS retrofit v8.5): value prop + Agent Deck try-link above the fold */
.cta-strip{margin:8px 0 12px; padding:10px 12px; border:1px solid #6b3418; border-radius:12px;
  background:linear-gradient(180deg,#1c0b0d,#120608); text-align:center;
  box-shadow:0 0 14px rgba(255,140,26,.12)}
.cta-value{font-size:14px; color:#ffe9c9; margin:0 0 6px; line-height:1.45}
.cta-value b{color:var(--gold, #ffd34d)}
.cta-neon{font-size:12px; color:#b8a898; margin:0 0 10px; line-height:1.45}
.cta-btn{display:inline-block; font-size:15px; font-weight:800; letter-spacing:.5px;
  color:#140608; background:linear-gradient(180deg,#ffd34d,#ff9a1f); border-radius:12px;
  padding:10px 18px; text-decoration:none;
  box-shadow:0 0 16px rgba(255,160,40,.5), 0 3px 0 #a35a00; touch-action:manipulation}
.cta-btn:active{transform:translateY(2px); box-shadow:0 0 8px rgba(255,160,40,.5), 0 1px 0 #a35a00}
.foot-link{color:#8fb8ff; text-decoration:underline; font-size:12.5px}
