@font-face { font-family: "Orbitron"; src: url("assets/fonts/orbitron_medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("assets/fonts/orbitron_semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("assets/fonts/orbitron_bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("assets/fonts/outfit_regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --midnight: #1A0B2E;
  --navy: #0B1026;
  --violet: #7B2CFF;
  --magenta: #FF2FA0;
  --cyan: #2DE2E6;
  --lavender: #D7C4FF;
  --white: #F7F4FF;
  --panel: rgba(58, 32, 96, 0.82);
  --stroke: rgba(230, 214, 255, 0.33);
  --warning: #FFC857;
  --scrim: rgba(7, 4, 18, 0.8);
  --orbitron: "Orbitron", "Segoe UI", system-ui, sans-serif;
  --outfit: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--navy); color: var(--white); }
body { font-family: var(--outfit); font-size: 16px; line-height: 1.5; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; user-select: none; -webkit-user-drag: none; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }

.app {
  position: relative; margin: 0 auto; max-width: 520px; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden; background: var(--navy);
}
.backdrop { position: absolute; inset: 0; z-index: 0; }
.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.bg.is-on { opacity: 1; }
.scrim { position: absolute; inset: 0; background: rgba(11, 16, 38, 0.4); }
.backdrop.dim .scrim { background: rgba(11, 16, 38, 0.8); }

.screen {
  position: relative; z-index: 1; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; padding-top: env(safe-area-inset-top);
}
.col { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; }
.col.center { align-items: center; }
.col.g8 { gap: 8px; padding: 8px 16px 16px; }
.col.g10 { gap: 10px; padding: 8px 16px 20px; }
.col.s20 { gap: 10px; padding: 20px; }

/* Typography */
.t-display { font-family: var(--orbitron); font-weight: 700; font-size: 24px; line-height: 30px; letter-spacing: 1.4px; }
.t-headline { font-family: var(--orbitron); font-weight: 600; font-size: 20px; line-height: 26px; letter-spacing: 1.2px; }
.t-title-l { font-family: var(--orbitron); font-weight: 600; font-size: 18px; line-height: 24px; letter-spacing: 1.1px; }
.t-title-m { font-family: var(--orbitron); font-weight: 500; font-size: 15px; line-height: 21px; letter-spacing: .8px; }
.t-label-l { font-family: var(--orbitron); font-weight: 600; font-size: 13px; line-height: 17px; letter-spacing: 1px; }
.t-label-s { font-family: var(--orbitron); font-weight: 500; font-size: 10px; line-height: 13px; letter-spacing: .6px; color: var(--lavender); }
.t-body-l { font-family: var(--outfit); font-size: 16px; line-height: 24px; }
.t-body-m { font-family: var(--outfit); font-size: 14px; line-height: 20px; color: var(--lavender); }
.c-lav { color: var(--lavender); }
.c-cyan { color: var(--cyan); }
.c-warn { color: var(--warning); }
.tc { text-align: center; }

/* Brand */
.brand { width: 100%; display: flex; flex-direction: column; align-items: center; filter: drop-shadow(0 0 9px rgba(123, 44, 255, .67)); }
.brand span {
  font-family: var(--orbitron); font-weight: 700; font-size: 40px; line-height: 44px; letter-spacing: 5px;
  background: linear-gradient(135deg, #FFFFFF, #E7D7FF 35%, #B48CFF 70%, #FFFFFF);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand.compact span { font-size: 22px; line-height: 26px; letter-spacing: 3px; }

/* Premium card */
.card {
  position: relative; display: flex; align-items: center; justify-content: center; width: 100%;
  background: var(--panel); border: 1px solid var(--stroke); border-radius: 32px; overflow: hidden; text-align: center;
}
button.card::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .08s; }
button.card:active:not(:disabled)::after { opacity: .1; }
.h48 { height: 48px; } .h52 { height: 52px; } .h56 { height: 56px; } .h58 { height: 58px; }
.row { display: flex; gap: 10px; width: 100%; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.card.sq { width: 56px; height: 56px; flex: 0 0 56px; }
.icon-row { justify-content: flex-start; gap: 12px; padding: 12px 16px; text-align: left; }
.icon-row.p16 { padding: 16px; }
.icon-row img { width: 52px; height: 52px; object-fit: contain; flex: 0 0 52px; }
.icon-row .txt { display: flex; flex-direction: column; min-width: 0; }
.pad16 { padding: 16px; }
.text-link { color: var(--lavender); cursor: pointer; }

/* Pulse meter */
.meter { position: relative; width: 100%; height: 14px; border-radius: 7px; background: rgba(11, 16, 38, .45); overflow: hidden; flex: 0 0 14px; }
.meter-fill {
  position: absolute; left: 0; top: 0; bottom: 0; min-width: 3%;
  background: linear-gradient(90deg, var(--magenta), var(--violet), var(--cyan)); transition: width .35s ease-out;
}
.meter-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--orbitron); font-weight: 500; font-size: 10px; letter-spacing: .6px; color: var(--white); }

/* Reels */
.reel-wrap { width: 100%; display: flex; justify-content: center; }
.reel-well {
  position: relative; width: 88%; height: 252px; padding: 8px; border-radius: 22px; overflow: hidden;
  background: rgba(11, 16, 38, .62);
  border: 1.6px solid transparent;
  background-image: linear-gradient(rgba(11, 16, 38, .62), rgba(11, 16, 38, .62)), linear-gradient(135deg, var(--violet), var(--cyan), var(--magenta));
  background-origin: border-box; background-clip: padding-box, border-box;
}
.reel-well.neon { background-image: linear-gradient(rgba(11, 16, 38, .55), rgba(11, 16, 38, .55)), linear-gradient(135deg, var(--violet), var(--cyan), var(--magenta)); }
.reels { display: flex; width: 100%; height: 100%; }
.reel { position: relative; flex: 1; height: 100%; overflow: hidden; }
.strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.cell { height: 33.3333%; display: flex; align-items: center; justify-content: center; padding: 7px; transition: transform .2s; }
.strip .cell { height: auto; }
.cell img { width: 100%; height: 100%; object-fit: contain; }
.cell.win { transform: scale(1.08); }
.payline { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); pointer-events: none; }
.payline polyline { fill: none; stroke: var(--cyan); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 3px var(--cyan)); }

/* Controls */
.stack { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.spheres { display: flex; width: 100%; height: 92px; align-items: center; }
.sphere-btn { flex: 1; height: 100%; display: flex; align-items: center; justify-content: center; }
.sphere-btn:disabled { opacity: .42; }
.sphere {
  position: relative; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 31% 19%, #E56BFF 0%, #7B2CFF 50%, #3A0E6E 100%);
  background-size: 100% 100%;
  transition: transform .08s;
}
.sphere::before { content: ""; position: absolute; left: 8%; top: 4%; width: 22%; height: 22%; border-radius: 50%; background: rgba(255, 255, 255, .4); }
.sphere::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; padding: 3.5%;
  background: conic-gradient(from 90deg, #5CFFF6, #FF4DDC, #5CFFF6);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.sphere-btn:active:not(:disabled) .sphere { box-shadow: inset 0 0 0 999px rgba(255, 255, 255, .14); }
.sphere.s58 { width: 58px; height: 58px; }
.sphere.s92 { width: 92px; height: 92px; }
.sphere .ring { position: absolute; inset: 3%; border-radius: 50%; border: 4.6px solid rgba(92, 255, 246, .67); display: none; }
.sphere.spinning .ring { display: block; animation: pulse-ring .8s ease-in-out infinite alternate; }
@keyframes pulse-ring { from { opacity: .55; } to { opacity: 1; } }
.sphere .glyph { position: relative; z-index: 1; font-family: var(--orbitron); font-weight: 700; font-size: 16px; color: var(--white); }
.sphere .bar { position: absolute; z-index: 1; width: 34%; height: 6%; min-height: 3px; border-radius: 3px; background: #fff; }
.sphere .bar.v { width: 6%; height: 34%; min-width: 3px; }

/* Bottom navigation */
.tabbar {
  position: relative; z-index: 2; display: flex; justify-content: space-evenly; align-items: center;
  background: var(--navy); padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
}
.tabbar[hidden] { display: none; }
.tab { flex: 1; min-height: 64px; display: flex; flex-direction: column; align-items: center; padding: 4px 0; }
.tab .bubble { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.tab.on .bubble { background: rgba(255, 255, 255, .1); }
.tab:active .bubble { background: rgba(255, 255, 255, .2); }
.tab img { width: 40px; height: 40px; object-fit: contain; opacity: .62; }
.tab.on img { opacity: 1; }
.tab .t-label-s { margin-top: 4px; }
.tab.on .t-label-s { color: var(--white); }

/* Top bar for sub screens */
.topbar { display: flex; align-items: center; gap: 4px; padding: 4px 8px 0; }
.topbar .t-headline { flex: 1; padding-left: 8px; }
.text-btn { padding: 10px 12px; border-radius: 20px; color: var(--cyan); }
.text-btn:active { background: rgba(255, 255, 255, .1); }
.back-btn { display: flex; align-items: center; gap: 6px; }
.back-btn svg { width: 20px; height: 20px; }

/* Switch */
.toggle { justify-content: space-between; padding: 0 18px; text-align: left; }
.switch { position: relative; width: 52px; height: 32px; border-radius: 16px; background: rgba(11, 16, 38, .6); border: 2px solid #938F99; flex: 0 0 52px; transition: background .2s, border-color .2s; }
.switch::after { content: ""; position: absolute; top: 6px; left: 6px; width: 16px; height: 16px; border-radius: 50%; background: #938F99; transition: all .2s; }
.switch.on { background: #D0BCFF; border-color: #D0BCFF; }
.switch.on::after { top: 2px; left: 22px; width: 24px; height: 24px; background: #381E72; }

/* Overlays */
.overlay { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--scrim); }
.overlay.paytable { display: block; padding: 0; background: var(--navy); }
.overlay.paytable .screen { height: 100%; }
.overlay.paytable .backdrop .scrim { background: rgba(11, 16, 38, .8); }
.bonus-card { flex-direction: column; gap: 16px; padding: 24px 20px; border-radius: 28px; animation: pop .25s ease-out; }
.boxes { display: flex; width: 100%; justify-content: space-evenly; }
.box-btn { display: flex; flex-direction: column; align-items: center; transition: transform .12s; }
.box-btn:active { transform: scale(.94); }
.box-btn img { width: 96px; height: 96px; object-fit: contain; animation: bob 1.8s ease-in-out infinite alternate; }
.box-btn:nth-child(2) img { animation-delay: .3s; }
.box-btn:nth-child(3) img { animation-delay: .6s; }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.win-banner {
  position: absolute; left: 0; right: 0; top: calc(72px + env(safe-area-inset-top)); z-index: 5; padding: 24px; text-align: center;
  text-shadow: 0 0 16px rgba(123, 44, 255, .9), 0 0 4px rgba(45, 226, 230, .8); cursor: pointer; animation: pop .3s ease-out;
}
.dialog { flex-direction: column; align-items: stretch; gap: 16px; padding: 24px; border-radius: 28px; max-width: 360px; text-align: left; background: #2B2930; border-color: transparent; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }
.dialog .text-btn { color: #D0BCFF; font-family: var(--outfit); font-weight: 400; font-size: 14px; letter-spacing: .1px; }

.reduced *, .reduced *::before, .reduced *::after { animation: none !important; transition: none !important; }
.noscript { padding: 24px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .box-btn img { animation: none; }
}
@media (max-height: 640px) {
  .reel-well { height: 220px; }
}
@media (max-width: 340px) {
  .brand span { font-size: 34px; line-height: 38px; }
  .t-title-m { font-size: 13px; }
}
