:root{
  --bg:#0b0f14; --panel:#121822; --accent:#1dd1a1; --muted:#7f8fa6; --win:#feca57; --lose:#ee5253;
  --pad:16px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif; color:#e6edf3;
  background:radial-gradient(1200px 700px at 50% -10%, #1b2330 0%, #0b0f14 60%);
  display:flex; flex-direction:column; min-height:100svh;
}
.site-header{ padding: var(--pad); text-align:center }
.site-header h1{ margin:0 0 6px 0; font-weight:700; letter-spacing:.5px }
.sub{ color:var(--muted); margin:0 auto; max-width:900px }

.viewport-center{ flex:1; display:grid; place-items:center; padding: var(--pad); }

#scale-wrap{ transform-origin: top center; will-change: transform; }

.machine{ background:linear-gradient(180deg,#15202b 0%,#0e141b 100%); border:1px solid #263243; border-radius:18px; padding:14px; box-shadow:0 10px 30px rgba(0,0,0,.35) }
.status{ display:flex; gap:12px; justify-content:space-between; align-items:center; margin-bottom:10px; flex-wrap:wrap }
.status .left{ display:flex; gap:12px; align-items:center; flex-wrap:wrap }
.chip{ background:#0e1520; border:1px solid #1e2b3c; padding:8px 10px; border-radius:12px; min-width:110px }
.chip strong{ display:block; font-size:14px }
.chip span{ color:var(--muted); font-size:12px }

.stage{ position:relative; }
.reels{ display:grid; grid-template-columns: repeat(5,1fr); gap:6px; padding:8px; border-radius:16px; background:#0b121b; border:1px solid #1f2a3a; width:520px; margin-inline:auto }
.reel{ height:180px; overflow:hidden; position:relative; border-radius:10px; background:#0a1018; border:1px solid #1c2736; box-shadow:inset 0 8px 18px rgba(0,0,0,.35) }
.reel::after{ content:""; position:absolute; top:0; bottom:0; right:-3px; width:3px; background: linear-gradient(180deg,transparent, rgba(255,255,255,.06), transparent); }
.symbols{ position:absolute; left:0; right:0; will-change:transform; backface-visibility:hidden; transform:translateZ(0) }
.symbol{ height:60px; display:flex; align-items:center; justify-content:center; border-bottom:1px solid #0f1824; contain:content }
.symbol:nth-child(odd){ background:rgba(255,255,255,.02) }
.symbol img.glyph{ width:44px; height:44px; image-rendering:auto; object-fit:contain; }

/* Overlay */
.hit-overlay{ position:absolute; inset:8px; display:grid; grid-template-rows: repeat(3, 60px); grid-template-columns: repeat(5, 1fr); gap:6px; pointer-events:none; }
.hit-overlay .hit{ border-radius:10px; box-shadow: inset 0 0 0 0 rgba(29,209,161,0); transition: box-shadow .15s ease; }
.hit-overlay .hit.active{ box-shadow: inset 0 0 0 3px rgba(29,209,161,.85), 0 0 12px rgba(29,209,161,.35); }
.hit-overlay .hit.sym-SIEBEN.active{ box-shadow: inset 0 0 0 3px rgba(230,126,34,.95), 0 0 14px rgba(230,126,34,.45); }
.hit-overlay .hit.sym-KLEE.active{   box-shadow: inset 0 0 0 3px rgba(46,204,113,.95), 0 0 14px rgba(46,204,113,.45); }
.hit-overlay .hit.sym-HUF.active{    box-shadow: inset 0 0 0 3px rgba(149,165,166,.95), 0 0 14px rgba(149,165,166,.45); }
.hit-overlay .hit.sym-ZIT.active{    box-shadow: inset 0 0 0 3px rgba(241,196,15,.95), 0 0 14px rgba(241,196,15,.45); }
.hit-overlay .hit.sym-KIR.active{    box-shadow: inset 0 0 0 3px rgba(231,76,60,.95), 0 0 14px rgba(231,76,60,.45); }

.controls{ display:flex; gap:10px; align-items:center; justify-content:space-between; margin-top:12px; flex-wrap:wrap }
.left-ctrl{ display:flex; gap:10px; align-items:center }
.btn{ cursor:pointer; user-select:none; padding:10px 14px; border-radius:12px; border:1px solid #1e2b3a; background:#0e1622; color:#e6edf3; font-weight:700; letter-spacing:.4px; transition:.15s transform,.15s background }
.btn:disabled{ opacity:.5; cursor:not-allowed }
.btn.primary{ background:linear-gradient(180deg,#17b890 0%, #119a7b 100%); border-color:#0d6f5a; color:#02130f }
.btn.primary:hover{ transform:translateY(-1px) }

.bet{ display:flex; align-items:center; gap:8px }
.bet input{ width:90px; padding:10px; border-radius:10px; border:1px solid #263243; background:#0b111a; color:#e6edf3; font-weight:700 }

.log{ margin-top:10px; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; background:#0b111a; border:1px solid #1f2a3a; padding:10px 12px; border-radius:12px; color:#aab8c2; height:92px; overflow:auto }
.log b{ color:#e6edf3 }
.flash-win{ animation:flash 800ms ease-in-out }
@keyframes flash{ 0%{box-shadow:0 0 0 0 rgba(254,202,87,.0)} 50%{box-shadow:0 0 0 6px rgba(254,202,87,.3)} 100%{box-shadow:0 0 0 0 rgba(254,202,87,.0)} }

.payouts{ margin-top:12px; color:#c8d1dc; font-size:14px }
.payouts table{ width:100%; border-collapse:collapse; border:1px solid #223045; border-radius:12px; overflow:hidden }
.payouts th, .payouts td{ padding:8px 10px; border-bottom:1px solid #1b2637; text-align:left }
.payouts tr:nth-child(odd){ background:#0c131c }

#prebuffer{ position:fixed; left:-10000px; top:-10000px; width:0; height:0; overflow:hidden; white-space:nowrap; }
