:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --yellow: #f7db18;
  --green: #5cff65;
  --green-deep: #10b848;
  --panel: rgba(5, 7, 7, 0.9);
  --panel-soft: rgba(20, 24, 23, 0.82);
  --line: rgba(255, 255, 255, 0.16);
  --muted: #929a97;
}

* { box-sizing: border-box; }

html, body { min-width: 100%; min-height: 100%; margin: 0; background: #090b0d; color: #fff; }

button { border: 0; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(43, 110, 84, 0.2), transparent 34%),
    linear-gradient(145deg, #14181c, #050606 62%);
}

.game {
  position: relative;
  width: min(100vw, 470px);
  height: 100vh;
  height: 100dvh;
  max-height: 920px;
  overflow: hidden;
  isolation: isolate;
  background: #07110e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.72), inset 0 0 0 1px rgba(255,255,255,.03);
  touch-action: none;
}

.match-media, .scene-shade { position: absolute; inset: 0; width: 100%; height: 100%; }

.match-media {
  z-index: -3;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.04) brightness(0.92);
  transition: opacity 220ms ease;
}

.idle-scene { opacity: 1; }
.idle-scene.is-hidden { opacity: 0; }
.match-video { opacity: 0; }
.match-video.is-active { opacity: 1; }

.scene-shade {
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.76) 0, rgba(0, 0, 0, 0.16) 20%, transparent 45%),
    linear-gradient(0deg, rgba(2, 5, 4, 0.96) 0, rgba(2, 5, 4, 0.68) 22%, rgba(0, 0, 0, 0.06) 46%, transparent 58%);
}

.topbar {
  height: 63px;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
  padding: max(9px, env(safe-area-inset-top)) 14px 5px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.98), rgba(0, 0, 0, 0.62), transparent);
}

.game-title { display: grid; justify-items: center; align-content: center; gap: 3px; line-height: 1; }
.title-row { display: flex; align-items: center; justify-content: center; gap: 7px; }
.demo-badge { padding: 3px 6px 2px; border: 1px solid rgba(113,255,137,.52); border-radius: 999px; background: rgba(36,213,75,.16); color: #7dff94; font-size: 7px; font-weight: 1000; font-style: normal; letter-spacing: .8px; box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 0 10px rgba(68,255,101,.12); }
.demo-note { color: rgba(255,255,255,.5); font-size: 6px; font-weight: 900; letter-spacing: 1.7px; }
.topbar h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(16px, 4.2vw, 21px);
  font-weight: 950;
  font-style: italic;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 8px #000;
}

.round-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: linear-gradient(145deg, rgba(36, 41, 40, 0.72), rgba(0, 0, 0, 0.56));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.13), 0 4px 12px rgba(0,0,0,.35);
  font-size: 22px;
}

.menu-icon { gap: 3px; align-content: center; }
.menu-icon span { display: block; width: 14px; height: 2px; border-radius: 9px; background: #fff; }
.game.is-muted .menu-icon span:nth-child(2) { width: 8px; opacity: 0.45; }

.run-progress {
  position: relative;
  height: 79px;
  margin: 2px 12px 0;
  padding: 8px 9px 6px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(46, 53, 51, 0.9), rgba(15, 18, 17, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 20px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(9px);
}

.progress-meta { height: 14px; display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.progress-meta span { color: rgba(255,255,255,.58); font-size: 8px; font-weight: 900; letter-spacing: 1.5px; }
.progress-meta strong { color: #dfe7e3; font-size: 8px; font-weight: 900; letter-spacing: .8px; }
.progress-track { position: relative; height: 50px; display: grid; grid-template-columns: repeat(6, 1fr); align-items: start; padding-top: 2px; }

.progress-rail {
  position: absolute;
  left: 8.4%;
  right: 8.4%;
  top: 14px;
  height: 7px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.5);
}

.progress-rail i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #03c94c, #64ff79);
  box-shadow: 0 0 12px rgba(54,255,102,.86);
  transition: width 500ms cubic-bezier(.2,.8,.2,1);
}

.level { position: relative; z-index: 1; display: grid; justify-items: center; gap: 1px; opacity: 0.57; }
.level b { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: #e6e9e7; filter: grayscale(1); box-shadow: 0 2px 8px #000; transition: .3s ease; }
.level b img { width: 27px; height: 27px; object-fit: contain; }
.level span { margin-top: 1px; color: #e7e9e8; font-size: 9px; font-weight: 950; font-style: italic; letter-spacing: -.2px; text-shadow: 0 2px 4px #000; }
.level.is-complete, .level.is-active { opacity: 1; }
.level.is-complete b { background: #59f774; filter: none; box-shadow: 0 0 12px rgba(63,255,97,.62); }
.level.is-active b { outline: 2px solid var(--yellow); outline-offset: 1px; transform: scale(1.06); filter: none; box-shadow: 0 0 14px rgba(249,219,24,.45); }
.jackpot-level span { color: #fff1a1; }
.run-progress.is-jackpot-complete {
  border-color: rgba(255, 221, 63, .78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 0 30px rgba(255,216,32,.26), 0 8px 20px rgba(0,0,0,.32);
  animation: jackpotProgressPulse 3.25s cubic-bezier(.18,.82,.2,1) both;
}
.run-progress.is-jackpot-complete .progress-rail i { width: 100% !important; background: linear-gradient(90deg, #16d45a, #72ff88 62%, #ffe265); box-shadow: 0 0 18px rgba(255,224,58,.9); }
.run-progress.is-jackpot-complete .level { opacity: 1; }
.run-progress.is-jackpot-complete .level b { background: #62f57b; filter: none; box-shadow: 0 0 13px rgba(74,255,104,.7); }
.run-progress.is-jackpot-complete .jackpot-level b { outline: 2px solid #ffe761; outline-offset: 2px; transform: scale(1.12); box-shadow: 0 0 22px rgba(255,222,55,.8); }
.run-progress.is-jackpot-complete .jackpot-level span { color: #fff6af; text-shadow: 0 0 8px rgba(255,222,55,.7), 0 2px 4px #000; }

.aim-layer {
  position: absolute;
  top: 32.2%;
  left: 6%;
  right: 6%;
  height: 21%;
  transition: opacity 180ms ease, transform 180ms ease;
}

.game:not(.is-aiming) .aim-layer { opacity: 0; transform: scale(0.96); pointer-events: none; }

.target {
  position: absolute;
  width: clamp(74px, 20vw, 94px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 35, 29, 0.14);
  box-shadow: 0 0 24px rgba(78, 255, 109, 0.3);
  animation: targetPulse 1.45s ease-in-out infinite;
  isolation: isolate;
}

.target-ring-art, .target-arrow-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.target-ring-art { opacity: .76; filter: drop-shadow(0 0 8px rgba(74,255,103,.65)); }
.target-arrow-art { inset: 10%; width: 80%; height: 80%; animation: targetRotate 5s linear infinite; }
.target small { position: absolute; top: -17px; color: rgba(255,255,255,.74); font-size: 7px; font-weight: 950; letter-spacing: 1.2px; text-shadow: 0 2px 5px #000; }
.target strong { position: relative; z-index: 2; padding: 5px 8px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; background: rgba(0, 7, 6, 0.74); font-size: 12px; font-weight: 950; font-style: italic; box-shadow: 0 4px 12px rgba(0,0,0,.32); }
.target-left { left: 8%; top: 23%; }
.target-right { right: 8%; top: 23%; animation-delay: -0.45s; }
.target:hover, .target:focus-visible { background: rgba(55, 255, 162, 0.16); transform: scale(1.06); }
.target:active { transform: scale(.96); }

.buy-bonus {
  position: absolute;
  right: 14px;
  bottom: 26.8%;
  min-width: 96px;
  min-height: 44px;
  padding: 8px 12px 7px;
  display: grid;
  justify-items: center;
  gap: 1px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.54);
  background: linear-gradient(165deg, #ffe985, #e4ad00);
  color: #6d5000;
  box-shadow: inset 0 1px 0 #fff9c9, 0 7px 18px rgba(0,0,0,.42), 0 0 18px rgba(240,195,20,.12);
}
.buy-bonus span { font-size: 10px; font-weight: 1000; letter-spacing: .3px; }
.buy-bonus small { color: rgba(83,61,0,.72); font-size: 8px; font-weight: 900; }
.buy-bonus.is-armed { background: linear-gradient(#71ff87, #24b842); color: #073c14; }
.buy-bonus.is-armed small { color: rgba(4,60,19,.72); }

.instruction { position: absolute; left: 50%; bottom: 24.3%; min-width: 210px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 7px 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; background: rgba(3,6,5,.68); box-shadow: 0 8px 18px rgba(0,0,0,.24); transform: translateX(-50%); backdrop-filter: blur(6px); }
.instruction > i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: statusPulse 1.5s ease-in-out infinite; }
.instruction > div { display: grid; justify-items: start; line-height: 1.08; }
.instruction strong { font-size: 10px; font-weight: 1000; letter-spacing: .8px; white-space: nowrap; }
.instruction small { color: #aab0ad; font-size: 8px; font-weight: 750; white-space: nowrap; }

.hud {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: calc(max(44px, 6.2dvh) + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.hud-card, .claim-button {
  position: relative;
  min-height: 66px;
  padding: 9px 12px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 1px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(13,16,15,.94), rgba(2,3,3,.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 4px 14px rgba(0,0,0,.2);
  text-align: left;
}

.hud-card > span, .claim-button > span { color: #858d89; font-size: 8px; font-weight: 950; letter-spacing: .75px; }
.hud-card strong, .claim-button strong { font-size: clamp(17px, 5vw, 23px); font-weight: 1000; line-height: 1.05; }
.hud-card > small, .claim-button > small { color: #69716d; font-size: 7px; font-weight: 850; letter-spacing: .4px; }
.hud-card i { position: absolute; right: 11px; top: 20px; color: #77807c; font-style: normal; font-size: 20px; }
.shot-counter { position: absolute; right: 9px; bottom: 9px; padding: 4px 6px; border-radius: 99px; background: rgba(255,255,255,.07); color: #8e9692 !important; font-weight: 800; }
.shot-counter b { color: #fff; }

.claim-button { align-items: center; justify-items: center; background: linear-gradient(145deg, rgba(29,34,32,.92), rgba(12,14,13,.94)); }
.claim-button:not(:disabled) { border-color: rgba(255,235,120,.58); background: linear-gradient(145deg, #ffe466, #f0b808); color: #211800; box-shadow: inset 0 1px 0 rgba(255,255,255,.66), 0 0 18px rgba(255,208,25,.28); }
.claim-button:not(:disabled) span { color: #5a4300; }
.claim-button:not(:disabled) small { color: rgba(72,53,0,.7); }
.claim-button:disabled { cursor: default; opacity: .62; }

.balance-bar { position: absolute; left: 11px; right: 11px; bottom: max(10px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; font-size: 11px; text-shadow: 0 1px 4px #000; }
.run-live { display: inline-flex; align-items: center; gap: 5px; color: #7d8984; font-size: 8px; font-weight: 900; letter-spacing: .7px; }
.run-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.balance-label { color: #8e9793; font-size: 8px; font-weight: 900; letter-spacing: .6px; }
.balance-bar strong { color: var(--yellow); font-size: 15px; }

.result-card, .dialog {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,.36);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.result-card.is-visible, .dialog.is-visible { opacity: 1; pointer-events: auto; }

.result-card { align-content: center; gap: 18px; background: linear-gradient(180deg, transparent 18%, rgba(0,0,0,.18) 55%, rgba(0,0,0,.82)); }
.result-copy { display: grid; justify-items: center; text-align: center; filter: drop-shadow(0 4px 7px #000); animation: resultPop 450ms cubic-bezier(.2,.9,.2,1) both; }
.result-copy > span { color: #fff; font-size: 20px; font-weight: 950; font-style: italic; }
.result-copy > strong { font-size: clamp(25px, 8vw, 40px); font-weight: 1000; font-style: italic; }
.result-copy > b { color: var(--yellow); font-size: clamp(35px, 11vw, 56px); font-weight: 1000; line-height: .95; }
.result-copy p { max-width: 280px; margin: 10px 0 0; font-size: 13px; }
.result-card.is-miss .result-copy > b { color: #ff5858; }
.result-card.is-grand { z-index: 16; background: radial-gradient(circle at 50% 40%, rgba(34,155,64,.46), transparent 35%), linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.76)); backdrop-filter: blur(3px); }
.result-card.is-grand .result-copy > span { color: #fff3a4; font-size: 22px; }
.result-card.is-grand .result-copy > strong { font-size: clamp(38px, 12vw, 60px); }
.result-card.is-grand .result-copy > b { font-size: clamp(48px, 15vw, 76px); text-shadow: 0 0 20px rgba(255,221,35,.55); }
.result-card > button, .dialog button { min-width: 150px; padding: 13px 24px; border-radius: 999px; background: var(--yellow); color: #201900; font-weight: 950; box-shadow: 0 5px 18px rgba(0,0,0,.38); }

.payout-celebration { display: contents; }
.payout-light-video {
  position: absolute;
  z-index: 15;
  top: 47%;
  left: 50%;
  width: 136%;
  height: auto;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: saturate(1.08) contrast(1.18) brightness(1.04);
  transform: translate(-50%, -50%) scale(.96);
  -webkit-mask-image: radial-gradient(ellipse 5.5% 10% at 90.7% 83.5%, transparent 0 76%, #000 100%);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-image: radial-gradient(ellipse 5.5% 10% at 90.7% 83.5%, transparent 0 76%, #000 100%);
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
}
.payout-celebration.is-active .payout-light-video { animation: payoutLightIn 420ms ease-out both; }
.payout-win-copy {
  position: absolute;
  z-index: 17;
  top: 47.5%;
  left: 50%;
  width: 88%;
  display: grid;
  place-items: center;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1);
  filter: blur(0);
  pointer-events: none;
}
.payout-celebration.is-active .payout-win-copy { animation: payoutCopyIn 420ms 600ms cubic-bezier(.16, .82, .22, 1) both; }
.payout-win-copy h2 {
  margin: 0;
  color: #fff8dd;
  font-size: clamp(20px, 6vw, 26px);
  font-style: italic;
  font-weight: 1000;
  letter-spacing: -.9px;
  line-height: .92;
  text-shadow: 0 3px 12px rgba(0, 0, 0, .62), 0 0 18px rgba(255, 211, 91, .44);
}
.payout-win-copy strong {
  margin-top: 2px;
  color: #ffe052;
  font-size: clamp(29px, 8.7vw, 40px);
  font-style: italic;
  font-weight: 1000;
  letter-spacing: -1.8px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 13px rgba(0, 0, 0, .68), 0 0 25px rgba(255, 209, 45, .58);
}
.payout-celebration.is-leaving .payout-light-video { animation: payoutLightFadeOut 320ms ease-in both; }
.payout-celebration.is-leaving .payout-win-copy { animation: payoutCopyFadeOut 320ms ease-in both; }

.dialog { background: rgba(0,0,0,.76); backdrop-filter: blur(7px); }
.dialog > div { width: min(100%, 320px); display: grid; justify-items: center; padding: 28px 24px; border: 1px solid rgba(255,255,255,.18); border-radius: 20px; background: linear-gradient(145deg, rgba(35,41,39,.98), rgba(9,11,10,.98)); box-shadow: 0 22px 60px #000; text-align: center; }
.dialog-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: #f2f4f3; box-shadow: 0 0 0 5px rgba(255,255,255,.08), 0 8px 20px rgba(0,0,0,.35); }
.dialog-icon img { width: 44px; height: 44px; object-fit: contain; }
.dialog h2 { margin: 5px 0 6px; font-style: italic; }
.dialog p { margin: 0 0 20px; color: #bbb; line-height: 1.5; }

.toast { position: absolute; z-index: 20; left: 50%; top: 20%; max-width: 84%; padding: 11px 17px; border-radius: 99px; background: rgba(8,11,10,.94); border: 1px solid rgba(112,255,138,.24); box-shadow: 0 8px 30px rgba(0,0,0,.45), 0 0 18px rgba(86,255,112,.08); font-size: 11px; font-weight: 850; text-align: center; transform: translate(-50%, -10px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-success { border-color: rgba(101,255,128,.5); color: #d9ffdf; box-shadow: 0 8px 30px rgba(0,0,0,.45), 0 0 22px rgba(86,255,112,.16); }
.toast.is-miss { border-color: rgba(255,111,111,.42); color: #ffd8d8; }
.toast.is-jackpot { border-color: rgba(255,223,65,.68); background: linear-gradient(145deg, rgba(43,35,4,.97), rgba(10,11,7,.96)); color: #fff1a1; font-size: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.5), 0 0 28px rgba(255,218,34,.24); }

/* Payout is the only success feedback shown after Claim. */
.payout-celebration.is-active ~ .toast,
.payout-celebration.is-leaving ~ .toast {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translate(-50%, -10px) !important;
  transition: none !important;
}

.game.is-shooting .buy-bonus { pointer-events: none; opacity: .45; }
.game.is-shooting .instruction { opacity: 0; }

@keyframes targetPulse { 50% { box-shadow: 0 0 31px rgba(78,255,109,.54); } }
@keyframes targetRotate { to { transform: rotate(360deg); } }
@keyframes statusPulse { 50% { opacity: .55; transform: scale(.8); } }
@keyframes resultPop { from { opacity: 0; transform: translateY(18px) scale(.8); } }
@keyframes payoutLightIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.96); }
  38% { opacity: .7; }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes payoutCopyIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(1); filter: blur(0); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); }
}
@keyframes payoutLightFadeOut {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
@keyframes payoutCopyFadeOut {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1); filter: blur(0); }
}
@keyframes jackpotProgressPulse {
  0% { transform: scale(.985); }
  12% { transform: scale(1.012); }
  24%, 82% { transform: scale(1); }
  100% { transform: scale(.995); }
}

@media (min-width: 700px) {
  .game { border-radius: 26px; border: 1px solid rgba(255,255,255,.15); }
}

@media (max-width: 699px) {
  .stage { display: block; }
  .game { width: 100vw; max-width: none; max-height: none; border: 0; border-radius: 0; }
}

@media (orientation: landscape) and (max-height: 600px) {
  .stage { display: grid; }
  .game { width: min(100vw, calc(100dvh * .62)); height: 100dvh; }
}

@media (max-height: 650px) {
  .topbar { height: 51px; }
  .run-progress { height: 69px; }
  .progress-meta { display: none; }
  .hud-card, .claim-button { min-height: 55px; padding-block: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
