:root {
  --bg: #050607;
  --panel: rgba(12, 15, 18, 0.82);
  --panel-strong: rgba(17, 21, 26, 0.94);
  --line: rgba(142, 255, 223, 0.18);
  --line-strong: rgba(142, 255, 223, 0.36);
  --text: #f3fbf8;
  --muted: #8b9996;
  --mint: #61ffd6;
  --mint-deep: #14bd93;
  --violet: #a160ff;
  --violet-soft: rgba(161, 96, 255, 0.25);
  --danger: #ff5f8f;
  --shadow: rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(97, 255, 214, 0.1), transparent 34rem),
    radial-gradient(circle at 86% 20%, rgba(161, 96, 255, 0.14), transparent 30rem),
    linear-gradient(145deg, #050607 0%, #0a0d10 52%, #050607 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.ambient {
  position: fixed;
  inset: auto;
  pointer-events: none;
  filter: blur(40px);
  opacity: 0.46;
  z-index: 0;
}

.ambient-a {
  width: 26rem;
  height: 26rem;
  left: -10rem;
  bottom: 8vh;
  background: rgba(97, 255, 214, 0.14);
}

.ambient-b {
  width: 22rem;
  height: 22rem;
  right: -8rem;
  top: 8vh;
  background: rgba(161, 96, 255, 0.16);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(97, 255, 214, 0.22));
}

.brand-word {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 900;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.network-pill,
.ghost-button {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 15px;
  font-weight: 800;
  font-size: 0.86rem;
  white-space: nowrap;
}

.ghost-button {
  color: var(--mint);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 6px rgba(97, 255, 214, 0.12);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  align-items: stretch;
  gap: 18px;
  min-height: min(760px, calc(100vh - 134px));
}

.stage-panel,
.control-panel,
.claim-modal {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 20, 24, 0.9), rgba(8, 10, 12, 0.9));
  box-shadow: 0 28px 90px var(--shadow);
  backdrop-filter: blur(18px);
}

.stage-panel {
  position: relative;
  min-width: 0;
  border-radius: 8px;
  padding: 20px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
}

.stage-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 82%);
  pointer-events: none;
}

.stage-topline {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.eyebrow,
.label,
.modal-kicker {
  margin: 0 0 8px;
  color: var(--mint);
  text-transform: uppercase;
  font-size: 0.73rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.14em;
}

h1 {
  max-width: 740px;
  margin: 0;
  font-size: clamp(2.25rem, 5.5vw, 5.6rem);
  line-height: 0.91;
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.round-chip {
  height: 38px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(161, 96, 255, 0.34);
  color: #d7c3ff;
  background: rgba(161, 96, 255, 0.1);
  font-size: 0.82rem;
  font-weight: 900;
}

.game-stage {
  position: relative;
  min-height: 420px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at 70% 18%, rgba(97, 255, 214, 0.14), transparent 24rem),
    radial-gradient(circle at 22% 72%, rgba(161, 96, 255, 0.16), transparent 22rem),
    linear-gradient(180deg, rgba(2, 4, 6, 0.6), rgba(0, 0, 0, 0.42));
}

#arcCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stars {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.7) 0 1px, transparent 1px),
    radial-gradient(circle, rgba(97, 255, 214, 0.5) 0 1px, transparent 1px);
  background-size: 86px 86px, 132px 132px;
  background-position: 10px 24px, 42px 8px;
  animation: drift 16s linear infinite;
}

.multiplier-wrap {
  position: absolute;
  left: clamp(18px, 5vw, 54px);
  bottom: clamp(24px, 7vw, 68px);
  z-index: 6;
}

.multiplier-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 800;
}

.multiplier {
  display: block;
  min-width: 6ch;
  color: var(--mint);
  font-size: clamp(3.1rem, 10vw, 8.5rem);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: 0;
  text-shadow: 0 0 32px rgba(97, 255, 214, 0.36);
}

.rocket {
  --x: 10%;
  --y: 78%;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 4;
  width: 38px;
  height: 98px;
  transform: translate(-50%, -50%) rotate(42deg);
  transition: filter 180ms ease;
  filter: drop-shadow(0 0 24px rgba(97, 255, 214, 0.42));
}

.rocket-nose,
.rocket-body,
.rocket-fin,
.rocket-flame {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.rocket-nose {
  top: 0;
  width: 28px;
  height: 32px;
  border-radius: 50% 50% 40% 40%;
  background: linear-gradient(180deg, #ffffff, #91fff0 62%, #23c7a4);
}

.rocket-body {
  top: 25px;
  width: 32px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(90deg, #172025, #f7fffe 47%, #1b2a31);
  border: 1px solid rgba(255, 255, 255, 0.36);
}

.rocket-body::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: var(--violet);
  box-shadow: 0 0 18px rgba(161, 96, 255, 0.85);
}

.rocket-fin {
  top: 57px;
  width: 15px;
  height: 24px;
  background: #22d2ae;
}

.rocket-fin-left {
  left: 8px;
  transform: skewY(28deg);
  border-radius: 8px 2px 6px 8px;
}

.rocket-fin-right {
  left: auto;
  right: 0;
  transform: skewY(-28deg);
  border-radius: 2px 8px 8px 6px;
}

.rocket-flame {
  top: 67px;
  width: 20px;
  height: 34px;
  border-radius: 0 0 50% 50%;
  background: linear-gradient(180deg, #ffffff, var(--mint) 35%, var(--violet));
  animation: flame 190ms infinite alternate ease-in-out;
}

.rocket.is-idle {
  animation: idleFloat 2.8s ease-in-out infinite;
}

.rocket.is-crashed {
  filter: drop-shadow(0 0 34px rgba(255, 95, 143, 0.9));
}

.crash-flare {
  position: absolute;
  z-index: 5;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle, #fff, var(--danger) 35%, rgba(161, 96, 255, 0.4) 58%, transparent 72%);
  opacity: 0;
  pointer-events: none;
}

.crash-flare.show {
  animation: flare 680ms ease-out forwards;
}

.ticker-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.ticker-row span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  color: rgba(243, 251, 248, 0.78);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.84rem;
  font-weight: 900;
}

.control-panel {
  border-radius: 8px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.balance-block {
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(97, 255, 214, 0.16), transparent 12rem),
    rgba(255, 255, 255, 0.04);
}

.balance-block strong {
  display: block;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-grid div {
  min-height: 82px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
}

.stat-grid span,
.modal-prize span {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.06rem;
}

.primary-button {
  position: relative;
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  color: #02130f;
  background: linear-gradient(135deg, #f8fffe, var(--mint) 46%, #25d4ad);
  box-shadow: 0 18px 42px rgba(97, 255, 214, 0.22);
  font-weight: 900;
  letter-spacing: 0;
  overflow: hidden;
}

.primary-button::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
  transition: transform 500ms ease;
}

.primary-button:hover::after {
  transform: translateX(120%);
}

.primary-button:disabled {
  cursor: default;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.primary-button.is-cashout {
  color: #fff;
  background: linear-gradient(135deg, #a160ff, #ff5f8f 54%, #ffbf6b);
  box-shadow: 0 18px 42px rgba(255, 95, 143, 0.24);
}

.fine-print {
  margin: -4px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.93rem;
}

.status-card {
  margin-top: auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(161, 96, 255, 0.23);
  background: rgba(161, 96, 255, 0.075);
}

.status-card p {
  margin: 0;
  color: rgba(243, 251, 248, 0.82);
  line-height: 1.45;
  font-weight: 700;
  font-size: 0.91rem;
}

.status-orb {
  width: 11px;
  height: 11px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 0 7px rgba(161, 96, 255, 0.12);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px);
}

.modal-backdrop.show {
  display: flex;
}

.claim-modal {
  width: min(430px, 100%);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  animation: modalIn 340ms cubic-bezier(.2,.9,.25,1) both;
}

.modal-logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(97, 255, 214, 0.36));
}

.claim-modal h2 {
  margin: 8px 0 10px;
  font-size: clamp(2rem, 7vw, 3.1rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.claim-modal p {
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.55;
}

.modal-prize {
  margin: 22px 0 16px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(97, 255, 214, 0.06);
}

.modal-prize strong {
  display: block;
  color: var(--mint);
  font-size: 2rem;
  line-height: 1;
}

.claim-button {
  margin-top: 4px;
}

@keyframes drift {
  to {
    background-position: 96px 110px, 174px 140px;
  }
}

@keyframes idleFloat {
  0%, 100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -8px;
  }
}

@keyframes flame {
  from {
    transform: translateX(-50%) scaleY(0.88);
    opacity: 0.72;
  }
  to {
    transform: translateX(-50%) scaleY(1.18);
    opacity: 1;
  }
}

@keyframes flare {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  34% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(12);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: min(680px, calc(100% - 22px));
    padding: 14px 0 18px;
  }

  .game-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .stage-panel {
    padding: 14px;
  }

  .game-stage {
    min-height: 430px;
  }

  .control-panel {
    padding: 16px;
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
  }

  .header-actions {
    flex-direction: column;
    align-items: flex-end;
  }

  .ghost-button {
    display: none;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .stage-topline {
    flex-direction: column;
  }

  h1 {
    font-size: clamp(2.05rem, 10vw, 2.7rem);
    line-height: 0.96;
  }

  .round-chip {
    height: 34px;
  }

  .ticker-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .game-stage {
    min-height: 360px;
  }

  .rocket {
    width: 31px;
    height: 82px;
  }
}

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