/* SlotEngine shell — controls bar, modal, toasts. Each game sets the --variables on .slot-app. */
:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
.slot-app {
  --accent: #ffd86b; --accent-2: #e0a52a; --ink: #fff7e0; --muted: rgba(255,247,224,.62);
  --bar: linear-gradient(180deg, #2a1c0c, #120b04); --bar-edge: #6b4a17; --chip: rgba(255,255,255,.06);
  --spin: radial-gradient(circle at 50% 35%, #ffe9a0, #f0b232 45%, #9a5c08 100%); --spin-ink: #3a1d00;
  --font-ui: "Segoe UI", system-ui, -apple-system, sans-serif;
  position: fixed; inset: 0; display: flex; flex-direction: column; color: var(--ink); font-family: var(--font-ui);
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.stage-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.stage { position: absolute; inset: 0; display: block; touch-action: manipulation; cursor: pointer; }
.topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; padding: 4px 10px 4px 4px; border-radius: 999px; background: rgba(0,0,0,.35); }
.back:hover { color: var(--ink); }
.back svg { width: 18px; height: 18px; }
.demo-tag { margin-left: auto; font-size: 11px; letter-spacing: .12em; font-weight: 700; color: var(--muted); background: rgba(0,0,0,.35); padding: 4px 10px; border-radius: 999px; }

.bar {
  flex: none; display: grid; align-items: center; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  grid-template-columns: auto 1fr auto 1fr auto; grid-template-areas: "left bal bet win right";
  background: var(--bar); border-top: 2px solid var(--bar-edge); box-shadow: 0 -8px 30px rgba(0,0,0,.5);
}
.b-left { grid-area: left; display: flex; gap: 8px; }
.m-bal { grid-area: bal; } .m-win { grid-area: win; } .betbox { grid-area: bet; }
.b-right { grid-area: right; display: flex; align-items: center; gap: 10px; }
.meter { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.meter label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.meter b { font-size: clamp(15px, 2.1vw, 22px); font-variant-numeric: tabular-nums; color: var(--accent); white-space: nowrap; text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.m-win b { color: #fff; }
.betbox { display: flex; align-items: center; gap: 8px; background: var(--chip); border-radius: 999px; padding: 4px; }
.betbox .meter { min-width: 76px; }
.ib {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.35); color: var(--ink);
  display: inline-grid; place-items: center; cursor: pointer; padding: 0; position: relative; transition: transform .1s, background .15s, color .15s;
}
.ib svg { width: 20px; height: 20px; }
.ib:hover:not(:disabled) { background: rgba(255,255,255,.1); }
.ib:active:not(:disabled) { transform: scale(.92); }
.ib:disabled { opacity: .35; cursor: default; }
.ib.on { color: var(--spin-ink); background: var(--accent); border-color: var(--accent); }
.auto-n { position: absolute; top: -6px; right: -8px; min-width: 20px; padding: 0 5px; height: 18px; border-radius: 9px; background: #e8382f; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; }
.auto-n:empty { display: none; }
.spin {
  width: 74px; height: 74px; border-radius: 50%; border: 3px solid rgba(255,255,255,.5); background: var(--spin); color: var(--spin-ink);
  display: grid; place-items: center; cursor: pointer; padding: 0; margin: -18px 0 -6px;
  box-shadow: 0 6px 18px rgba(0,0,0,.6), inset 0 -6px 12px rgba(0,0,0,.25), inset 0 4px 8px rgba(255,255,255,.5), 0 0 24px color-mix(in srgb, var(--accent) 50%, transparent);
  transition: transform .12s;
}
.spin svg { width: 40px; height: 40px; transition: transform .5s; }
.spin:hover svg { transform: rotate(60deg); }
.spin:active { transform: scale(.93); }
.spin.busy svg { transform: none; }
.auto-wrap { position: relative; }
.auto-menu { position: absolute; bottom: 52px; right: 0; display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 12px; background: #111; border: 1px solid var(--bar-edge); box-shadow: 0 10px 30px rgba(0,0,0,.6); z-index: 5; }
.auto-menu button { background: rgba(255,255,255,.06); color: var(--ink); border: 0; border-radius: 8px; padding: 8px 18px; font: 700 14px var(--font-ui); cursor: pointer; }
.auto-menu button:hover { background: var(--accent); color: var(--spin-ink); }
.auto-menu[hidden] { display: none; }

.toast { position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); background: rgba(0,0,0,.85); border: 1px solid var(--bar-edge); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 6; }
.toast[hidden] { display: none; }

.modal { position: absolute; inset: 0; background: rgba(0,0,0,.72); display: grid; place-items: center; z-index: 10; padding: 16px; backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }
.sheet { position: relative; width: min(760px, 100%); max-height: min(88vh, 100%); overflow: auto; background: #120d08; border: 1px solid var(--bar-edge); border-radius: 18px; padding: 22px 22px 18px; box-shadow: 0 30px 80px rgba(0,0,0,.7); }
.sheet .close { position: sticky; top: 0; float: right; margin: -6px -6px 0 0; z-index: 2; background: #000; }
.sheet h2 { margin: 0 0 4px; font-size: 26px; color: var(--accent); }
.sheet h3 { margin: 22px 0 10px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sheet h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.sheet .lede { margin: 0; color: var(--muted); }
.sheet p { line-height: 1.5; }
.pays { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pay { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.04); border-radius: 12px; padding: 8px 10px; }
.pay .pv { font-size: 13px; font-variant-numeric: tabular-nums; flex: 1; }
.pay .pv em { display: block; font-style: normal; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.pay .pv div { display: flex; justify-content: space-between; gap: 8px; }
.pay .pv span { color: var(--muted); }
.pay .pv b { color: var(--accent); }
.rules { padding-left: 18px; margin: 0; line-height: 1.55; font-size: 14px; }
.rules li { margin-bottom: 6px; }
.lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.ln { background: rgba(255,255,255,.03); border-radius: 8px; padding: 6px; display: grid; place-items: center; }
.ln svg { max-width: 100%; height: auto; }
.fine { font-size: 12px; color: var(--muted); }
kbd { background: rgba(255,255,255,.1); border-radius: 4px; padding: 1px 5px; font-size: 11px; }
.cta { background: var(--spin); color: var(--spin-ink); border: 0; border-radius: 999px; padding: 12px 22px; font: 800 15px var(--font-ui); cursor: pointer; }
.feat { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.feat > div { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.04); border-radius: 12px; padding: 8px 10px; font-size: 13px; }
.feat b { color: var(--accent); }

@media (max-width: 720px) {
  .bar { grid-template-columns: 1fr auto 1fr; grid-template-areas: "bal bet win" "left right right"; gap: 8px 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .b-right { justify-content: flex-end; }
  .spin { width: 64px; height: 64px; margin: 0; }
  .spin svg { width: 34px; height: 34px; }
  .ib { width: 38px; height: 38px; }
  .betbox .meter { min-width: 60px; }
  .meter b { font-size: 16px; }
  .b-left { align-self: center; }
}
@media (max-height: 460px) and (orientation: landscape) {
  .bar { padding: 6px 12px; } .spin { width: 60px; height: 60px; margin: -10px 0 -4px; } .ib { width: 36px; height: 36px; }
}

/* Boot cover: sits over the whole game (canvas + controls) until the painted art is ready */
.boot { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: radial-gradient(circle at 50% 45%, #1c1426, #07050b 75%); color: #fff7e0; font-family: "Segoe UI", system-ui, sans-serif; transition: opacity .35s ease; }
.boot.done { opacity: 0; pointer-events: none; }
.boot-ring { width: 54px; height: 54px; border-radius: 50%; border: 4px solid rgba(255,255,255,.12); border-top-color: var(--boot, #ffd86b); animation: boot-spin .8s linear infinite; }
.boot-title { font-size: clamp(18px, 4vw, 28px); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--boot, #ffd86b); text-align: center; padding: 0 16px; }
.boot-sub { font-size: 14px; color: rgba(255,255,255,.6); }
@keyframes boot-spin { to { transform: rotate(360deg); } }
