/* Two Thrones: Storm and Shadow — dual-mode skins.
   Olympus: deep blue / gold, lightning. Hades: black-red
   / flame orange. The mode is a body class; switching it
   reskins instantly (presentation only). Own CSS. */
:root {
  --accent: #f2c230;
  --accent2: #38bdf8;
  --panel: #172554;
  --panel2: #1e3a8a;
  --reel-bg: #1e293b;
  --frame: #0f172a;
  --ink: #eff6ff;
  --glow: #38bdf888;
}
body.hades {
  --accent: #f59e0b;
  --accent2: #ef4444;
  --panel: #1c0a0a;
  --panel2: #450a0a;
  --reel-bg: #292524;
  --frame: #0c0a09;
  --ink: #fef2f2;
  --glow: #ef444488;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, var(--panel2) 0%, var(--panel) 50%, #020617 100%);
  color: var(--ink);
  min-height: 100vh;
  transition: background 0.4s ease;
}
body.hades { background: radial-gradient(1200px 600px at 50% -10%, #7f1d1d 0%, #290b0b 50%, #0c0202 100%); }
#app { max-width: 640px; margin: 0 auto; padding: 10px 12px 28px; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; padding: 6px 2px 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 46px; height: 46px; }
h1 { font-size: 19px; margin: 0; color: var(--accent); text-shadow: 0 0 14px var(--glow), 0 2px 0 #000; letter-spacing: .3px; }
.sub { font-size: 12px; opacity: .85; }
.head-right { display: flex; align-items: center; gap: 8px; }
.badge { font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 999px; background: #111827; border: 1px solid var(--accent); color: var(--accent); }
.badge.real { background: #7f1d1d; border-color: #ef4444; color: #fecaca; }
.ghost { background: var(--frame); color: var(--ink); border: 1px solid var(--accent); border-radius: 10px; padding: 7px 12px; cursor: pointer; font-weight: 700; }
.ghost.on { background: var(--panel2); color: var(--accent); }
.card, .stage-card {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid #ffffff2c;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 10px 24px #00000066;
}
.stage-card { position: relative; flex: 1; }
.stage-wrap { display: flex; gap: 10px; align-items: flex-start; }
.side-panel { display: flex; flex-direction: column; gap: 10px; width: 118px; flex: none; }
.vol-panel { margin: 0; padding: 10px; text-align: center; }
.vol-title { font-size: 10px; font-weight: 900; letter-spacing: .8px; opacity: .85; margin-bottom: 8px; }
.vol-btn { display: block; width: 100%; margin: 6px 0; padding: 9px 4px; border-radius: 10px; border: 2px solid transparent; background: #00000055; color: var(--ink); font-weight: 900; font-size: 12px; cursor: pointer; }
.vol-btn.oly.on { border-color: #38bdf8; box-shadow: 0 0 12px #38bdf888; color: #bae6fd; }
.vol-btn.had.on { border-color: #ef4444; box-shadow: 0 0 12px #ef444488; color: #fecaca; }
.buy-sign {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: linear-gradient(180deg, #92600a, #713f12);
  border: 2px solid #3b1d0d; outline: 1px solid #f2c23066;
  border-radius: 10px; padding: 9px 6px;
  color: #fef08a; font-weight: 900; font-size: 11px; letter-spacing: .4px;
  cursor: not-allowed; opacity: .78; transform: rotate(-2deg);
  box-shadow: 0 4px 10px #00000088;
}
.buy-sign b { font-size: 13px; color: #fff7cc; }
.buy-sign small { font-size: 10px; opacity: .85; }
.mode-emblem { text-align: center; font-size: 22px; line-height: 1; margin-bottom: 6px; filter: drop-shadow(0 0 8px var(--glow)); }
.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  padding: 10px;
  border-radius: 14px;
  background: var(--reel-bg);
  border: 6px solid var(--frame);
  outline: 2px solid var(--accent);
  box-shadow: inset 0 0 0 2px #00000088, inset 0 0 34px #00000088, 0 0 18px var(--glow);
  position: relative;
}
/* Anticipation glow on the final reel (row-major render:
   reel 5 = every 5th child). */
.grid.beam .cell:nth-child(5n) {
  box-shadow: 0 0 22px 6px var(--glow), inset 0 0 12px var(--glow);
  animation: beamPulse .5s ease-in-out infinite alternate;
}
@keyframes beamPulse { from { filter: brightness(1.1); } to { filter: brightness(1.65); } }
.cell {
  aspect-ratio: 1 / 1.02;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid #00000055;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
}
.cell svg { width: 100%; height: 100%; display: block; }
.cell.win { outline: 3px solid var(--accent); outline-offset: -3px; transform: scale(1.05); z-index: 1; box-shadow: 0 0 16px var(--glow); }
.cell.dim { opacity: .45; }
.cell.expanded { box-shadow: inset 0 0 0 3px var(--accent2), 0 0 10px var(--glow); }
.cell.sticky { box-shadow: inset 0 0 0 3px var(--accent), 0 0 12px var(--glow); }
.mult-badge {
  position: absolute; right: 2px; bottom: 2px; z-index: 2;
  background: #7c2d12; color: #fde047; border: 1px solid #fde047;
  border-radius: 999px; padding: 0 5px;
  font-size: clamp(9px, 2.6vw, 13px); font-weight: 900; line-height: 1.5;
}
body.hades .mult-badge { background: #450a0a; color: #fca5a5; border-color: #ef4444; }
.orb-tray { min-height: 22px; text-align: center; font-weight: 800; color: var(--accent); padding-top: 8px; font-size: 14px; }
.bottom-bar { display: flex; justify-content: space-between; gap: 8px; padding-top: 10px; }
.bb-item { display: flex; flex-direction: column; align-items: center; flex: 1; background: #00000066; border: 1px solid #ffffff2c; border-radius: 10px; padding: 6px 4px; font-weight: 800; }
.bb-label { font-size: 10px; font-weight: 700; opacity: .75; letter-spacing: .6px; text-transform: uppercase; }
.win-banner {
  position: absolute; inset: auto 0 64px 0; margin: 0 auto; width: fit-content;
  background: #020617ee; border: 2px solid var(--accent); border-radius: 14px;
  padding: 8px 22px; text-align: center; z-index: 5;
  color: var(--accent); font-weight: 900; font-size: 22px;
  box-shadow: 0 0 24px var(--glow);
}
.wb-label { font-size: 12px; color: var(--accent2); letter-spacing: 2px; }
.hidden { display: none !important; }
.bigwin-overlay {
  position: absolute; inset: 0; z-index: 6;
  background: #020617d9;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 16px;
}
.bw-title { font-size: 40px; font-weight: 900; color: var(--accent); text-shadow: 0 0 22px var(--glow), 0 3px 0 #000; animation: beamPulse .4s ease-in-out infinite alternate; }
.bw-amt { font-size: 30px; font-weight: 900; color: var(--accent2); }
.continue-overlay {
  position: absolute; inset: 0; z-index: 7;
  background: #020617cc;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  border-radius: 16px; text-align: center; padding: 16px;
}
.continue-text { font-size: 20px; font-weight: 900; color: var(--accent); }
.continue-btn { font-size: 22px; width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--accent); background: var(--panel2); color: #fff; cursor: pointer; }
/* Full-screen mode choice on load (witnessed). */
.chooser {
  position: fixed; inset: 0; z-index: 20;
  background: linear-gradient(90deg, #172554 0 50%, #290b0b 50% 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 18px;
}
.chooser-title { font-size: 15px; font-weight: 900; letter-spacing: 2px; color: #f8fafc; text-shadow: 0 2px 8px #000; }
.chooser-cards { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.pick {
  width: 210px; min-height: 170px; border-radius: 16px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: #fff; border: 2px solid #ffffff44; padding: 16px;
}
.pick-oly { background: radial-gradient(circle at 50% 20%, #2563eb, #172554); }
.pick-had { background: radial-gradient(circle at 50% 20%, #991b1b, #1c0a0a); }
.pick:hover { transform: scale(1.03); border-color: var(--accent); }
.pick-emblem { font-size: 40px; }
.pick b { font-size: 15px; letter-spacing: .6px; }
.pick small { font-size: 12px; opacity: .85; text-align: center; }
.controls .bet-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { width: 44px; height: 44px; border-radius: 50%; border: 2px dashed #ffffff66; background: var(--frame); color: var(--ink); font-weight: 800; cursor: pointer; }
.chip.on { background: var(--accent); color: #1c1002; border-color: #fff7cc; }
.bet-input { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.bet-input button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid #ffffff44; background: var(--frame); color: var(--ink); font-size: 18px; cursor: pointer; }
.bet-input input { width: 76px; height: 36px; border-radius: 10px; border: 1px solid #ffffff44; background: var(--frame); color: var(--ink); text-align: center; font-weight: 800; }
.spin-btn {
  width: 100%; padding: 15px; font-size: 20px; font-weight: 900; letter-spacing: 1px;
  border-radius: 50px; border: 2px solid #fff7cc;
  background: linear-gradient(180deg, #2563eb, #1e3a8a);
  color: #fff; cursor: pointer; box-shadow: 0 6px 18px #00000066;
}
body.hades .spin-btn { background: linear-gradient(180deg, #dc2626, #7f1d1d); }
.spin-btn:disabled { opacity: .5; cursor: default; }
.quick-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.msg { min-height: 20px; margin-top: 10px; font-weight: 700; color: var(--accent); text-align: center; }
.msg.err { color: #fca5a5; }
.paytable .prow { padding: 6px 0; border-bottom: 1px solid #ffffff1c; font-size: 13px; }
.note { font-size: 12.5px; line-height: 1.55; opacity: .9; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid #ffffff14; font-size: 13.5px; }
.history .win { color: #4ade80; font-weight: 800; }
.fair-grid { display: grid; gap: 8px; font-size: 12.5px; }
.fair-grid code { word-break: break-all; background: #00000055; padding: 2px 6px; border-radius: 6px; }
.seed-edit { display: flex; gap: 6px; }
.seed-edit input, .fair-actions input { background: var(--frame); border: 1px solid #ffffff44; border-radius: 8px; color: var(--ink); padding: 6px 8px; }
.fair-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.verify-out { white-space: pre-wrap; word-break: break-all; font-size: 11px; background: #00000055; border-radius: 10px; padding: 8px; max-height: 260px; overflow: auto; }
footer { text-align: center; font-size: 12px; opacity: .75; padding: 6px; }
@media (max-width: 560px) {
  h1 { font-size: 16px; }
  .stage-wrap { flex-direction: column; }
  .side-panel { flex-direction: row; width: 100%; align-items: stretch; }
  .vol-panel { flex: 1; }
  .buy-sign { flex: 1; transform: none; justify-content: center; }
  .pick { width: 160px; min-height: 150px; }
}
