:root {
  color-scheme: dark;
  --bg: #090f1b;
  --surface: #111c2d;
  --text: #f3f5f1;
  --muted: #9cabbc;
  --mint: #a2f2d0;
  --gold: #f1cf87;
  --line: #ffffff12;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; background: var(--bg); color: var(--text); }
body { touch-action: none; }
button, select, input { font: inherit; }
button { cursor: pointer; }
button, select { -webkit-user-select: none; user-select: none; }
button:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
button:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
button:active:not(:disabled) { transform: scale(.98); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.mobile-game { width: 100%; max-width: 430px; height: 100svh; height: 100dvh; margin: auto; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-rows: 76px minmax(0, 1fr) auto; position: relative; overflow: hidden; isolation: isolate; background: var(--bg); }
.hud { height: 76px; padding: 8px 14px 10px; display: grid; grid-template-columns: .86fr 1.3fr 1fr 44px; grid-template-rows: 44px 4px; align-items: center; gap: 8px 7px; border-bottom: 1px solid var(--line); z-index: 6; background: #0d1523; }
.hud-stat, .hud-next { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.hud-stat > span, .hud-next > span { font-size: 8px; letter-spacing: 1.2px; color: var(--muted); font-weight: 650; }
.hud strong { font-size: clamp(12px, 3.6vw, 15px); font-weight: 650; letter-spacing: -.4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hud-score strong { font-size: clamp(17px, 4.9vw, 21px); color: var(--mint); }
.hud-next strong { color: var(--gold); }
.hud-next small { font-size: 8px; color: var(--gold); letter-spacing: 0; }
.progress-bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; overflow: hidden; background: #243044; }
.progress-bar span { height: 100%; width: 0; display: block; border-radius: inherit; background: linear-gradient(90deg, #67bfa9, var(--mint)); transition: width .3s ease-out; }
.icon-btn { flex-shrink: 0; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #ffffff16; border-radius: 14px; color: var(--text); background: #ffffff05; font-size: 19px; transition: transform .12s; }
.pause-btn span { letter-spacing: -3px; transform: translateX(-1px); }
.game-stage { min-height: 0; position: relative; overflow: hidden; }
.game-playfield { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: calc(100% - 24px); box-sizing: border-box; overflow: hidden; pointer-events: none; }
canvas { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.board-chrome { position: absolute; top: 9px; left: 18px; right: 18px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; font-size: 8px; letter-spacing: 1.8px; color: #8193a7; }
.board-chrome b { font-weight: 400; color: #bdc9d6; margin-left: 3px; }
.state-pill { letter-spacing: .9px; font-size: 8px; padding: 5px 8px; border-radius: 20px; background: #a2f2d00b; color: var(--mint); }
.state-pill::before { content: ''; display: inline-block; width: 4px; height: 4px; margin-right: 5px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
[data-state='AIMING'] .state-pill { color: #cbdfff; background: #cbdfff10; }
[data-state='SHOOTING'] .state-pill, [data-state='RESOLVING'] .state-pill { color: var(--gold); background: #f1cf8710; }
[data-state='LOST'] .state-pill { color: #ee9f9c; }
.game-controls { min-height: 67px; display: grid; grid-template-columns: 1fr auto 44px; align-items: center; gap: 8px; padding: 10px 14px 11px; border-top: 1px solid var(--line); background: #0d1523; z-index: 6; }
.next-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 8px; letter-spacing: 1.1px; }
.next-orbit { width: 42px; height: 42px; border: 1px solid #ffffff10; border-radius: 50%; display: grid; place-items: center; background: #090f1b; }
.next-bubble { --bubble-color: #ed6792; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(ellipse at 32% 22%, #fff9 0 5%, transparent 28%), radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--bubble-color), white 22%), var(--bubble-color) 53%, color-mix(in srgb, var(--bubble-color), #192037 65%) 100%); box-shadow: inset 0 0 0 1px #ffffff30, 0 3px 5px #0005; }
.control-hint { font-size: 9px; line-height: 1.6; color: var(--muted); text-align: center; max-width: 145px; }
.control-hint strong { color: #c5d0dc; font-weight: 500; }
.ready-hint { display: none; position: absolute; bottom: 36%; left: 20px; right: 20px; text-align: center; pointer-events: none; }
[data-opening='true'][data-state='ACTIVE'] .ready-hint { display: block; animation: arrive .3s ease-out; }
.ready-hint span { color: #a2f2d07a; font-size: 8px; letter-spacing: 1.6px; }
.ready-hint strong { display: block; color: #bdcbd8; margin: 9px 0 6px; font-size: 18px; font-weight: 500; letter-spacing: -.4px; }
.ready-hint small { color: #8d9faf; font-size: 10px; }
.is-home .hud, .is-home .game-controls { visibility: hidden; }
.is-home .board-chrome { display: none; }
.primary-btn, .menu-btn, .secondary-btn { min-height: 48px; border-radius: 16px; transition: transform .12s, background .2s; }
.primary-btn { width: 100%; padding: 0 18px; border: 1px solid #d1ffe44d; color: #112e27; background: linear-gradient(120deg, #b6f7d9, #8ce2c0); font-size: 12px; font-weight: 800; letter-spacing: 1px; box-shadow: inset 0 1px #e6ffed80, 0 8px 22px #6fcea214; }
.menu-btn { width: 100%; border: 1px solid var(--line); color: #c2cfdb; background: #ffffff04; font-size: 10px; font-weight: 650; letter-spacing: .9px; }
.secondary-btn { border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 0 12px; }
.sound-icon { color: var(--mint); margin-right: 6px; font-size: 15px; }
.sound-toggle[aria-pressed='false'] { color: #7e8b9b; }
#cashoutBtn { grid-column: 1 / -1; min-height: 48px; background: linear-gradient(115deg, #ffe4a4, #e8c075); color: #392b15; border-color: #fff4cc6b; box-shadow: 0 4px 22px #efc87d15; animation: cashout-arrive .32s ease-out both; }
[data-state='CASHOUT_READY'] .progress-bar span { background: var(--gold); }
[data-state='CASHOUT_READY'] .state-pill { color: var(--gold); }
.target-banner { display: none; pointer-events: none; position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%); width: 260px; padding: 28px 18px; flex-direction: column; align-items: center; text-align: center; gap: 12px; border-radius: 28px; border: 1px solid #edcc812c; background: #0e1828f2; box-shadow: 0 24px 50px #0003; }
[data-state='CASHOUT_READY'] .target-banner { display: flex; animation: arrive .4s ease-out; }
.target-banner strong { font-size: 27px; letter-spacing: -1px; }
.target-banner > span:last-child { font-size: 12px; line-height: 1.7; color: var(--muted); }
.target-seal { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; color: var(--gold); background: #efcc8510; border: 1px solid #efcc854d; font-size: 27px; box-shadow: 0 0 0 8px #efcc8505; }
.screen-overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: max(22px, env(safe-area-inset-top)) 24px max(20px, env(safe-area-inset-bottom)); overflow: hidden; animation: arrive .28s ease-out both; }
.home-screen { background: radial-gradient(ellipse at 48% 25%, #243b463b, transparent 50%), var(--bg); }
.home-content { width: 100%; height: 100%; max-height: 830px; display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.home-topline { display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
.wordmark { display: flex; align-items: center; gap: 9px; font-size: 9px; font-weight: 650; letter-spacing: 1.7px; }
.brand-mark { width: 21px; height: 21px; border: 2px solid var(--mint); border-radius: 50%; position: relative; display: inline-block; }
.brand-mark::after { content: ''; position: absolute; width: 7px; height: 7px; right: -4px; bottom: -2px; border-radius: 50%; background: var(--mint); border: 2px solid var(--bg); }
.demo-pill { font-size: 8px; letter-spacing: 1.5px; color: var(--muted); border: 1px solid #ffffff17; border-radius: 5px; padding: 5px 7px; }
.home-hero { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.orb-composition { width: 244px; height: clamp(125px, 20dvh, 185px); position: relative; margin-bottom: 18px; }
.orbit-line { width: 220px; height: 125px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-25deg); border: 1px solid #a2f2d016; border-radius: 50%; }
.orbit-line::after { content: ''; position: absolute; inset: -22px 14px; border: 1px solid #a2f2d008; border-radius: 50%; transform: rotate(58deg); }
.hero-orb { position: absolute; border-radius: 50%; border: 1px solid #ffffff30; background: radial-gradient(ellipse at 33% 23%, #ffffffe0 0, #ffffff40 10%, transparent 31%), radial-gradient(circle at 38% 30%, var(--orb), color-mix(in srgb, var(--orb), #101c30 15%) 56%, #111d30 100%); box-shadow: inset -4px -6px 16px #08132350, 0 18px 28px #0003; }
.orb-a { --orb: #a2efcd; width: 92px; height: 92px; left: 65px; top: calc(50% - 42px); z-index: 3; }
.orb-b { --orb: #ad9feb; width: 64px; height: 64px; left: 139px; top: calc(50% - 66px); z-index: 2; }
.orb-c { --orb: #f0c982; width: 60px; height: 60px; left: 146px; top: calc(50% + 1px); z-index: 4; }
.orb-d { --orb: #70bbd8; width: 35px; height: 35px; left: 32px; top: calc(50% - 57px); }
.orb-e { --orb: #ec7994; width: 22px; height: 22px; left: 50px; top: calc(50% + 39px); }
.orbit-spark { position: absolute; color: var(--gold); font-size: 19px; font-weight: 200; }
.spark-one { right: 16px; top: 51%; }.spark-two { left: 53px; top: 11%; font-size: 12px; color: var(--mint); }
.eyebrow { margin: 0; color: var(--mint); font-size: 8px; letter-spacing: 1.8px; font-weight: 650; }
.home-hero h1 { font-size: clamp(36px, 10.2vw, 44px); margin: 11px 0 0; font-weight: 700; letter-spacing: -2px; line-height: 1.08; }
.home-hero h1 span { color: var(--mint); }
.home-tagline { font-size: 11px; color: var(--muted); line-height: 1.6; margin: 12px 0 0; }
.round-card { padding: 18px; border: 1px solid #c7dfeb16; border-radius: 23px; background: linear-gradient(135deg, #182536, #111c2c); }
.home-balance { display: flex; align-items: center; justify-content: space-between; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.field-label { display: block; font-size: 8px; letter-spacing: 1.3px; color: var(--muted); }
.home-balance strong { display: block; font-size: 27px; letter-spacing: -.8px; margin-top: 6px; font-variant-numeric: tabular-nums; font-weight: 650; }
.credit-icon { width: 40px; height: 40px; border-radius: 13px; border: 1px solid #b8cdbb18; display: grid; place-items: center; color: var(--mint); background: #a2f2d008; font-size: 25px; }
.entry-row { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; gap: 8px; }
.entry-label { font-size: 12px; font-weight: 500; }
.entry-label small { display: block; font-size: 9px; color: var(--muted); margin-top: 5px; font-weight: 400; }
.select-wrap { position: relative; }
.select-wrap::after { content: '⌄'; position: absolute; right: 13px; top: 11px; color: var(--mint); pointer-events: none; font-size: 15px; }
#betSelect { appearance: none; width: 111px; min-height: 46px; padding: 0 26px 0 12px; border: 1px solid #b7d1cd26; border-radius: 12px; color: var(--text); background: #0c1725; font-size: 14px; font-weight: 600; }
.target-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 16px; color: var(--muted); font-size: 10px; }
.target-row b { display: inline-block; padding: 4px 6px; margin-right: 5px; border-radius: 5px; color: var(--gold); background: #f1cf8712; font-size: 10px; }
.target-row strong { color: var(--gold); font-size: 13px; font-weight: 600; }
.play-btn { min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 23px; }
.play-btn > span:last-child { font-size: 23px; font-weight: 400; }
.home-bottom { text-align: center; }
.home-bottom .secondary-btn { min-height: 44px; }
.dev-note { margin: 0; font-size: 9px; line-height: 1.7; color: var(--muted); font-weight: 400; }
.menu-screen { background: #090f1bf5; }
.menu-card { width: 100%; max-width: 350px; text-align: center; padding: 26px 22px; background: linear-gradient(155deg, #172537, #101a2a); border: 1px solid #c7dfeb18; border-radius: 28px; }
.menu-card h2 { font-size: 29px; letter-spacing: -1.2px; margin: 12px 0 8px; line-height: 1.1; }
.menu-description { color: var(--muted); font-size: 11px; line-height: 1.7; margin: 0 0 24px; }
.menu-card .primary-btn, .menu-card .menu-btn { margin-top: 10px; }
.pause-emblem { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 20px; color: var(--mint); background: #a2f2d009; border: 1px solid #a2f2d025; margin: 0 auto 24px; font-size: 24px; }
.result-card { background: transparent; border: none; padding: 0; }
.result-emblem { width: 94px; height: 94px; display: grid; place-items: center; margin: 0 auto 31px; border: 1px solid #a2f2d050; color: var(--mint); border-radius: 50%; position: relative; background: radial-gradient(circle at 35% 20%, #a2f2d023, #a2f2d005); box-shadow: 0 0 0 9px #a2f2d005, 0 0 0 10px #a2f2d00b; font-size: 38px; }
.win-symbol { display: none; }
.result-emblem i { display: none; }
.result-card .eyebrow { color: #c39c9a; }
.payout-hero { padding: 25px 8px; margin-bottom: 16px; border: 1px solid #c7dfeb15; border-radius: 23px; background: #ffffff03; }
.payout-hero > span { font-size: 8px; color: var(--muted); letter-spacing: 1.7px; }
.payout-hero strong { display: block; font-size: clamp(36px, 10.7vw, 46px); letter-spacing: -1.7px; font-weight: 600; margin: 8px 0 10px; font-variant-numeric: tabular-nums; }
.payout-hero small { font-size: 7px; letter-spacing: 1.7px; color: #8d9bac; }
.result-grid { display: grid; grid-template-columns: 1fr 1.3fr; margin-bottom: 22px; text-align: left; }
.result-grid > div { padding: 0 13px; }
.result-grid > div + div { border-left: 1px solid var(--line); }
.result-grid span { display: block; color: var(--muted); font-size: 9px; }
.result-grid strong { display: block; font-size: 16px; font-weight: 550; margin-top: 7px; font-variant-numeric: tabular-nums; }
.result-card > .dev-note { margin-top: 22px; }
[data-state='LOST'] .result-emblem { color: #d9a3a0; border-color: #d9a3a03d; background: #d9a3a009; box-shadow: 0 0 0 10px #d9a3a005; }
[data-state='LOST'] .result-screen { animation: loss-arrive .4s ease-out both; }
[data-state='CASHED_OUT'] .result-screen { background: radial-gradient(ellipse at 50% 20%, #a2f2d015, transparent 55%), #090f1bf8; }
[data-state='CASHED_OUT'] .win-symbol { display: block; }
[data-state='CASHED_OUT'] .loss-symbol { display: none; }
[data-state='CASHED_OUT'] .result-card .eyebrow { color: var(--mint); }
[data-state='CASHED_OUT'] .payout-hero strong { color: var(--gold); }
[data-state='CASHED_OUT'] .payout-hero { border-color: #f1cf8727; background: #f1cf8705; }
[data-state='CASHED_OUT'] .result-emblem { animation: seal-arrive .5s ease-out both; }
[data-state='CASHED_OUT'] .result-emblem i { display: block; position: absolute; width: 4px; height: 8px; border-radius: 1px; background: var(--gold); left: calc(50% + var(--x)); top: calc(50% + var(--y)); transform: rotate(var(--r)); animation: confetti-arrive .75s ease-out both; }
.result-emblem i:nth-of-type(1) { --x: -79px; --y: -20px; --r: -30deg; }.result-emblem i:nth-of-type(2) { --x: 77px; --y: -38px; --r: 25deg; }.result-emblem i:nth-of-type(3) { --x: -46px; --y: -68px; --r: 52deg; }.result-emblem i:nth-of-type(4) { --x: 32px; --y: -76px; --r: -18deg; }.result-emblem i:nth-of-type(5) { --x: 68px; --y: 35px; --r: 45deg; }.result-emblem i:nth-of-type(6) { --x: -66px; --y: 39px; --r: 10deg; }
#statusMessage { position: fixed; bottom: calc(10px + env(safe-area-inset-bottom)); left: 12px; right: 12px; z-index: 60; background: #26384a; padding: 12px; border-radius: 12px; font-size: 12px; pointer-events: none; }
#statusMessage:empty { display: none; }
#debugPanel { position: fixed; top: calc(110px + env(safe-area-inset-top)); right: 8px; z-index: 50; max-width: 290px; padding: 6px; background: #091525ef; font-size: 10px; }
#debugPanel button, #debugPanel input { min-height: 44px; max-width: 180px; }
.landscape-lock { display: none; }
@keyframes arrive { from { opacity: 0; } to { opacity: 1; } }
@keyframes loss-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes seal-arrive { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
@keyframes confetti-arrive { from { opacity: 0; translate: 0 14px; } to { opacity: .85; translate: 0 0; } }
@keyframes cashout-arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-height: 740px) and (orientation: portrait) { .screen-overlay { padding-block: max(14px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-bottom)); } .home-content { gap: 10px; } .orb-composition { height: 100px; margin-bottom: 10px; transform: scale(.82); } .home-hero h1 { font-size: 32px; } .home-tagline { margin-top: 8px; } .round-card { padding: 14px; } .home-balance { padding-bottom: 12px; } .home-balance strong { font-size: 24px; } .entry-row { margin-top: 10px; } .target-row { margin-top: 10px; } .result-emblem { width: 72px; height: 72px; margin-bottom: 24px; } .payout-hero { padding-block: 17px; } .result-grid { margin-bottom: 12px; } }
@media (orientation: landscape) { .mobile-game { display: none; } .landscape-lock { height: 100dvh; padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; text-align: center; background: var(--bg); } .rotate-phone { width: 42px; height: 68px; border: 2px solid var(--mint); border-radius: 10px; transform: rotate(90deg); margin-bottom: 15px; } .landscape-lock > span { color: var(--muted); font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
