:root {
  color-scheme: dark;
  --ink: #f7f3df;
  --muted: rgba(247, 243, 223, 0.72);
  --line: rgba(255, 255, 255, 0.14);
  --panel: rgba(5, 35, 40, 0.84);
  --panel-solid: #082d33;
  --green: #1eb66a;
  --gold: #f4c94e;
  --red: #e64a4f;
  --blue: #2d86d5;
  --cyan: #47c9dd;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 22% 0%, rgba(244, 201, 78, 0.16), transparent 28%),
    linear-gradient(160deg, #061d24 0%, #09363a 48%, #111c30 100%);
  color: var(--ink);
}

body {
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.boot-screen,
.fatal {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
}

.boot-screen img {
  width: 112px;
  height: 112px;
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.boot-screen strong {
  display: block;
  margin-top: 16px;
  font-size: 24px;
}

.app-shell {
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px max(22px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.brand-lockup img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.36);
}

.brand-lockup strong,
.brand-lockup small,
.wallet-pill small,
.wallet-pill strong {
  display: block;
}

.brand-lockup strong {
  font-size: 17px;
  line-height: 1.15;
}

.brand-lockup small,
.wallet-pill small {
  color: var(--muted);
  font-size: 11px;
}

.wallet-pill {
  min-width: 116px;
  padding: 9px 12px;
  border: 1px solid rgba(244, 201, 78, 0.35);
  border-radius: 8px;
  background: rgba(8, 45, 51, 0.78);
  text-align: right;
}

.wallet-pill strong {
  color: var(--gold);
  font-size: 16px;
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0 14px;
}

.view-tabs button,
.mini-tools button,
.screen-map span,
.cooldown-panel button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
}

.view-tabs button.active {
  border-color: rgba(244, 201, 78, 0.72);
  background: rgba(244, 201, 78, 0.16);
  color: var(--ink);
}

.view-body {
  min-height: calc(100vh - 106px);
}

.game-layout,
.mockup-layout,
.prototype-layout,
.wallet-layout,
.limits-layout,
.auth-layout {
  display: grid;
  gap: 14px;
}

.game-layout,
.mockup-layout {
  grid-template-columns: minmax(320px, 440px) minmax(320px, 1fr);
  align-items: start;
  justify-content: center;
}

.game-surface {
  position: relative;
  min-height: 620px;
  aspect-ratio: 9 / 16;
  max-height: calc(100vh - 122px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  overflow: hidden;
  background: #0a3039;
  box-shadow: var(--shadow);
}

.phone-frame {
  display: grid;
  place-items: center;
}

.phone-frame .game-surface {
  width: min(100%, 420px);
}

.hero-bg,
.game-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-bg {
  object-fit: cover;
}

.game-shade {
  background:
    linear-gradient(180deg, rgba(2, 20, 29, 0.42) 0%, rgba(4, 24, 30, 0.1) 42%, rgba(3, 19, 26, 0.86) 100%),
    radial-gradient(circle at 50% 40%, transparent 0%, rgba(0, 0, 0, 0.18) 52%, rgba(0, 0, 0, 0.54) 100%);
}

.game-hud {
  position: absolute;
  top: 16px;
  left: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(244, 201, 78, 0.34);
  border-radius: 8px;
  background: rgba(5, 32, 39, 0.68);
  backdrop-filter: blur(10px);
}

.game-hud span,
.stake-input span,
.fair-grid dt,
.limit-strip span,
.cash-panel small {
  color: var(--muted);
  font-size: 11px;
}

.game-hud strong {
  color: var(--gold);
  font-size: 18px;
}

.history-row {
  position: absolute;
  top: 72px;
  left: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  gap: 6px;
  overflow: hidden;
}

.history-row span {
  flex: 0 0 auto;
  min-width: 48px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  text-align: center;
}

.history-row span.hot {
  background: rgba(244, 201, 78, 0.18);
  color: #ffeeb5;
}

.flight-path {
  position: absolute;
  inset: 118px 18px 170px;
  z-index: 2;
  opacity: 0.7;
}

.flight-path svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.flight-path path {
  fill: none;
  stroke: rgba(255, 242, 186, 0.4);
  stroke-dasharray: 7 10;
  stroke-width: 4;
}

.balloon,
.mock-balloon {
  position: absolute;
  z-index: 4;
  width: 44%;
  left: 0;
  top: 18%;
  transform: translate(18%, 46%) scale(0.78);
  transform-origin: 50% 80%;
  transition: transform 120ms linear;
  filter: drop-shadow(0 22px 22px rgba(0, 0, 0, 0.36));
}

.mock-balloon {
  transform: translate(65%, 22%) scale(1.05);
}

.balloon img,
.mock-balloon img {
  display: block;
  width: 100%;
}

.burst {
  position: absolute;
  z-index: 5;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  left: calc(50% - 80px);
  top: 36%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 238, 164, 0.94), rgba(230, 74, 79, 0.46) 42%, transparent 72%);
}

.burst.show {
  opacity: 1;
  animation: burst 460ms ease-out both;
}

@keyframes burst {
  from { transform: scale(0.3); opacity: 0.9; }
  to { transform: scale(1.35); opacity: 0; }
}

.multiplier-display {
  position: absolute;
  z-index: 6;
  left: 18px;
  right: 18px;
  bottom: 188px;
  min-height: 82px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(5, 30, 36, 0.62);
  color: #fff7c8;
  font-size: 58px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(8px);
}

.mock-x {
  bottom: 178px;
}

.round-status {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 168px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 12px;
}

.play-panel,
.asset-board,
.flow-board,
.screen-map,
.wallet-forms,
.orders-panel,
.limit-card,
.cooldown-panel,
.ops-note,
.fair-panel,
.auth-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
}

.auth-layout {
  grid-template-columns: minmax(320px, 520px) minmax(320px, 1fr);
  align-items: stretch;
}

.auth-hero {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.auth-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 25, 32, 0.24), rgba(4, 20, 28, 0.86));
}

.auth-hero div {
  position: absolute;
  z-index: 1;
  left: 22px;
  right: 22px;
  bottom: 24px;
}

.auth-hero span {
  color: #fff0b7;
  font-weight: 800;
}

.auth-hero h1 {
  margin: 8px 0;
  font-size: 42px;
  line-height: 1;
}

.auth-hero p,
.auth-copy {
  color: var(--muted);
  line-height: 1.48;
}

.auth-panel {
  align-self: center;
  padding: 16px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.auth-tabs button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.auth-tabs button.active {
  border-color: rgba(244, 201, 78, 0.72);
  background: rgba(244, 201, 78, 0.16);
  color: var(--ink);
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.auth-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  padding: 0 12px;
}

.auth-form .check-line {
  grid-template-columns: 22px 1fr;
  align-items: center;
  color: var(--ink);
}

.auth-form .check-line input {
  min-height: 18px;
  height: 18px;
}

.auth-form button {
  min-height: 56px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f4c94e, #dd7c2a);
  color: #08242b;
  font-weight: 900;
}

.play-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.mode-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mode-strip button {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.mode-strip button.active {
  border-color: rgba(244, 201, 78, 0.76);
  background: linear-gradient(180deg, rgba(244, 201, 78, 0.24), rgba(30, 182, 106, 0.12));
}

.mode-strip strong,
.mode-strip small {
  display: block;
}

.mode-strip small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.stake-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stake-input {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.stake-input input,
.money-form input,
.limits-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.chip-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.chip-row button {
  min-height: 62px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.chip-row img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.action-row {
  min-height: 82px;
}

.bet-button,
.cashout-button,
.money-form button,
.limits-form button {
  width: 100%;
  min-height: 78px;
  border-radius: 10px;
  color: #061d24;
  font-weight: 900;
  background-image: url("/assets/button-bet-base.png");
  background-size: 100% 100%;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.cashout-button {
  background-image: url("/assets/button-cashout-base.png");
}

.bet-button span,
.cashout-button span,
.bet-button small,
.cashout-button small {
  display: block;
}

.bet-button span,
.cashout-button span {
  font-size: 26px;
}

.bet-button small,
.cashout-button small {
  margin-top: 3px;
  font-size: 13px;
  color: rgba(5, 28, 27, 0.78);
}

.mini-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.notice-line {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.notice-line.show {
  border-color: rgba(244, 201, 78, 0.22);
  background: rgba(244, 201, 78, 0.08);
  color: #ffeeb5;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-heading span {
  color: var(--muted);
  font-size: 12px;
}

.section-heading strong {
  color: #fff4be;
  font-size: 13px;
}

.fair-panel {
  padding: 12px;
}

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

.fair-grid div {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.fair-grid dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.symbols-row,
.limit-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  overflow: hidden;
}

.symbols-row img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.symbols-row span {
  color: #ffeeb5;
  font-size: 13px;
  margin-left: auto;
}

.limit-strip {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.prototype-layout {
  grid-template-columns: 320px minmax(320px, 1fr);
  align-items: start;
}

.proto-phone {
  min-height: 570px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, #092f36, #071c2b);
  padding: 18px;
  box-shadow: var(--shadow);
}

.wire-status,
.wire-hero,
.wire-multiplier,
.wire-button,
.wire-row span {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.wire-status {
  height: 36px;
  width: 68%;
}

.wire-hero {
  height: 220px;
  margin-top: 22px;
  background:
    linear-gradient(135deg, rgba(30, 182, 106, 0.28), rgba(45, 134, 213, 0.22)),
    rgba(255, 255, 255, 0.1);
}

.wire-multiplier {
  display: grid;
  place-items: center;
  height: 90px;
  margin-top: 22px;
  color: #fff4be;
  font-size: 44px;
  font-weight: 900;
}

.wire-button {
  height: 74px;
  margin-top: 18px;
  background: linear-gradient(180deg, #f4c94e, #dd7c2a);
}

.wire-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.wire-row span {
  height: 54px;
}

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

.flow-step {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 88px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.flow-step b {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: #09262b;
}

.flow-step strong,
.flow-step small {
  display: block;
}

.flow-step small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.screen-map {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.screen-map span {
  display: grid;
  place-items: center;
}

.asset-board {
  padding: 14px;
}

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

.asset-grid figure {
  min-height: 126px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.asset-grid img {
  max-width: 100%;
  max-height: 82px;
  object-fit: contain;
  border-radius: 8px;
}

.asset-grid figcaption {
  color: var(--muted);
  font-size: 11px;
}

.cash-panel {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 28px;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  background: rgba(5, 28, 34, 0.72);
  backdrop-filter: blur(8px);
}

.cash-panel strong {
  display: block;
  margin-top: 3px;
}

.cash-panel img {
  width: 100%;
}

.wallet-layout {
  grid-template-columns: minmax(320px, 420px) minmax(320px, 1fr);
  align-items: start;
}

.wallet-hero {
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(30, 182, 106, 0.28), rgba(244, 201, 78, 0.16)),
    var(--panel-solid);
  box-shadow: var(--shadow);
}

.wallet-hero span,
.wallet-hero small {
  display: block;
  color: var(--muted);
}

.wallet-hero strong {
  display: block;
  margin: 8px 0;
  color: var(--gold);
  font-size: 38px;
}

.wallet-hero img {
  width: 112px;
  height: 112px;
  border-radius: 24px;
}

.wallet-forms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px;
}

.money-form,
.limits-form {
  display: grid;
  gap: 10px;
}

.money-form h2,
.limit-card h2,
.cooldown-panel h2 {
  margin: 0 0 2px;
  font-size: 18px;
}

.money-form label,
.limits-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.money-form button,
.limits-form button {
  min-height: 52px;
  color: #061d24;
}

.orders-panel {
  grid-column: 1 / -1;
  padding: 14px;
}

.order-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.order-row span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.order-row em {
  font-style: normal;
  color: #fff4be;
  font-size: 12px;
}

.order-row button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(30, 182, 106, 0.2);
}

.limits-layout {
  grid-template-columns: minmax(320px, 520px) minmax(300px, 1fr);
  align-items: start;
}

.limit-card,
.cooldown-panel,
.ops-note {
  padding: 14px;
}

.cooldown-panel {
  display: grid;
  gap: 10px;
}

.cooldown-panel button {
  background: rgba(45, 134, 213, 0.18);
  color: var(--ink);
}

.cooldown-panel p,
.ops-note span,
.empty-copy {
  color: var(--muted);
  line-height: 1.45;
}

.ops-note {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

code {
  color: #fff4be;
}

@media (max-width: 880px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .game-layout,
  .mockup-layout,
  .prototype-layout,
  .wallet-layout,
  .limits-layout,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    min-height: 330px;
  }

  .game-surface {
    width: 100%;
    max-height: none;
    height: clamp(350px, 44vh, 430px);
    min-height: 350px;
    aspect-ratio: auto;
  }

  .play-panel {
    margin-bottom: 18px;
  }

  .flow-board,
  .wallet-forms {
    grid-template-columns: 1fr;
  }

  .screen-map,
  .asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .brand-lockup small {
    display: none;
  }

  .wallet-pill {
    min-width: 104px;
  }

  .view-tabs {
    gap: 4px;
  }

  .view-tabs button {
    font-size: 11px;
    padding: 0 2px;
  }

  .multiplier-display {
    min-height: 60px;
    font-size: 42px;
    bottom: 70px;
  }

  .round-status {
    bottom: 54px;
  }

  .game-hud {
    top: 10px;
    min-height: 38px;
  }

  .history-row {
    top: 58px;
  }

  .history-row span {
    min-width: 44px;
    padding: 5px 7px;
  }

  .flight-path {
    inset: 90px 22px 88px;
  }

  .balloon {
    width: 34%;
    top: 12%;
  }

  .play-panel {
    gap: 9px;
    padding: 10px;
  }

  .mode-strip button {
    min-height: 48px;
  }

  .stake-input input {
    min-height: 42px;
  }

  .chip-row button {
    min-height: 50px;
  }

  .chip-row img {
    width: 44px;
    height: 44px;
  }

  .action-row {
    min-height: 68px;
  }

  .bet-button,
  .cashout-button {
    min-height: 66px;
  }

  .bet-button span,
  .cashout-button span {
    font-size: 22px;
  }

  .game-hud strong {
    font-size: 15px;
  }

  .stake-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mini-tools {
    grid-template-columns: repeat(2, 1fr);
  }

  .order-row {
    grid-template-columns: 1fr auto;
  }

  .order-row em,
  .order-row button {
    grid-column: span 1;
  }
}
