:root {
  color-scheme: dark;
  --bg: #070908;
  --panel: rgba(18, 22, 19, 0.9);
  --panel-strong: #121613;
  --panel-soft: #171c18;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f5f7f2;
  --muted: #8d978e;
  --lime: #c7ff32;
  --lime-soft: rgba(199, 255, 50, 0.14);
  --orange: #ff6b35;
  --red: #ff3d57;
  --cyan: #44d7c5;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(149, 205, 45, 0.08), transparent 34%),
    #070908;
  background-size:
    36px 36px,
    36px 36px,
    auto;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  opacity: 0.13;
}

.ambient-one {
  top: 15%;
  left: -300px;
  background: var(--lime);
}

.ambient-two {
  right: -330px;
  bottom: -120px;
  background: var(--orange);
}

.topbar {
  width: min(1480px, calc(100% - 48px));
  min-height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  padding: 10px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  border: 1px solid rgba(199, 255, 50, 0.35);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(199, 255, 50, 0.16), transparent);
  box-shadow: inset 0 0 20px rgba(199, 255, 50, 0.06);
  transform: skew(-5deg);
}

.brand-mark span {
  width: 5px;
  border-radius: 4px 4px 1px 1px;
  background: var(--lime);
}

.brand-mark span:nth-child(1) {
  height: 8px;
  opacity: 0.5;
}

.brand-mark span:nth-child(2) {
  height: 14px;
  opacity: 0.72;
}

.brand-mark span:nth-child(3) {
  height: 21px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 19px;
  letter-spacing: 0.08em;
}

.brand-copy strong span {
  color: var(--lime);
}

.brand-copy small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.demo-badge,
.connection {
  min-height: 36px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b5bcb6;
  background: rgba(12, 15, 13, 0.72);
  font-size: 12px;
  backdrop-filter: blur(12px);
}

.shield-dot,
.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.shield-dot {
  background: var(--lime);
  box-shadow: 0 0 12px rgba(199, 255, 50, 0.65);
}

.connection-dot {
  background: #d7a63a;
  box-shadow: 0 0 10px rgba(215, 166, 58, 0.5);
}

.connection[data-state="online"] .connection-dot {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(68, 215, 197, 0.6);
}

.connection[data-state="offline"] .connection-dot {
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 61, 87, 0.5);
}

.app-shell {
  width: min(1480px, calc(100% - 48px));
  margin: 18px auto 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 24px;
  align-items: start;
}

.game-column,
.control-column {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}

.game-column {
  display: grid;
  gap: 18px;
}

.control-column {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 16px;
}

.round-heading,
.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.round-heading {
  min-height: 58px;
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(23px, 2.4vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

h2 {
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.round-timer {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.round-timer span {
  color: var(--muted);
  font-size: 11px;
}

.round-timer strong {
  font-variant-numeric: tabular-nums;
  font-size: 19px;
}

.game-stage {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 65% 22%, rgba(199, 255, 50, 0.08), transparent 35%),
    linear-gradient(145deg, rgba(22, 27, 23, 0.96), rgba(9, 12, 10, 0.98));
  box-shadow: var(--shadow);
  isolation: isolate;
}

.game-stage::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.04),
    transparent 26%,
    transparent 72%,
    rgba(199, 255, 50, 0.025)
  );
  pointer-events: none;
}

.game-stage[data-phase="crashed"] {
  background:
    radial-gradient(circle at 62% 23%, rgba(255, 61, 87, 0.14), transparent 38%),
    linear-gradient(145deg, rgba(29, 19, 20, 0.96), rgba(11, 9, 9, 0.98));
}

#flightCanvas,
.stage-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage-grid {
  z-index: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, transparent, #000 26%, #000);
}

#flightCanvas {
  z-index: 1;
}

.stage-center {
  position: absolute;
  z-index: 2;
  top: 44%;
  left: 50%;
  width: min(560px, calc(100% - 42px));
  display: grid;
  justify-items: center;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.phase-pill,
.round-tag,
.disabled-tag,
.history-hint {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(7, 9, 8, 0.68);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.phase-pill {
  min-height: 28px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
}

.game-stage[data-phase="betting"] .phase-pill {
  border-color: rgba(68, 215, 197, 0.24);
  color: var(--cyan);
}

.game-stage[data-phase="flying"] .phase-pill {
  border-color: rgba(199, 255, 50, 0.28);
  color: var(--lime);
}

.game-stage[data-phase="crashed"] .phase-pill {
  border-color: rgba(255, 61, 87, 0.3);
  color: #ff8394;
}

.multiplier {
  margin: 10px 0 3px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 42px rgba(199, 255, 50, 0.2);
}

.multiplier span {
  font-size: clamp(72px, 10vw, 138px);
  font-weight: 850;
  line-height: 0.95;
  letter-spacing: -0.075em;
}

.multiplier small {
  margin-left: 8px;
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 800;
}

.game-stage[data-phase="crashed"] .multiplier {
  color: var(--red);
  text-shadow: 0 0 42px rgba(255, 61, 87, 0.22);
}

#roundMessage {
  max-width: 420px;
  color: #a5aea6;
  font-size: 13px;
  line-height: 1.5;
}

.proof-bar {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 18px;
  left: 18px;
  min-height: 62px;
  padding: 12px 14px 12px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 11, 9, 0.76);
  backdrop-filter: blur(15px);
}

.proof-bar > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.proof-bar span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

code {
  color: #b9c2ba;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.proof-bar code {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proof-info {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.proof-info:hover {
  border-color: rgba(199, 255, 50, 0.4);
  color: var(--lime);
}

.history-card,
.activity-card,
.wallet-card,
.bet-card,
.payment-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(16px);
}

.history-card,
.activity-card {
  padding: 22px;
}

.wallet-card,
.bet-card,
.payment-card {
  padding: 22px;
}

.section-title.compact {
  align-items: center;
}

.section-title.compact .eyebrow {
  margin-bottom: 5px;
}

.history-hint,
.round-tag,
.disabled-tag {
  padding: 7px 10px;
}

.disabled-tag {
  border-color: rgba(255, 107, 53, 0.2);
  color: var(--orange);
}

.history-list {
  min-height: 54px;
  margin-top: 17px;
  display: flex;
  align-items: center;
  gap: 9px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.history-item {
  min-width: 68px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #aab3ab;
  background: #0d100e;
  font-size: 13px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.history-item[data-tier="mid"] {
  border-color: rgba(68, 215, 197, 0.2);
  color: var(--cyan);
}

.history-item[data-tier="high"] {
  border-color: rgba(199, 255, 50, 0.23);
  color: var(--lime);
}

.history-item[data-tier="rare"] {
  border-color: rgba(255, 107, 53, 0.26);
  color: var(--orange);
}

.empty-state {
  color: #697169;
  font-size: 12px;
}

.activity-list {
  max-height: 180px;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
  overflow-y: auto;
  list-style: none;
}

.activity-list li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  color: #a6afa7;
  font-size: 12px;
  line-height: 1.45;
}

.activity-list time {
  color: #5e675f;
  font-variant-numeric: tabular-nums;
}

.activity-list li[data-tone="success"] span {
  color: var(--lime);
}

.activity-list li[data-tone="warning"] span {
  color: var(--orange);
}

.activity-list li[data-tone="error"] span {
  color: #ff7589;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.text-button:hover {
  color: var(--text);
}

.balance-row {
  margin-top: 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.balance-row > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.balance-row strong {
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.balance-row > div span {
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.virtual-chip {
  padding: 6px 8px;
  border-radius: 8px;
  color: #8f978f;
  background: #0b0e0c;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-form {
  margin-top: 21px;
}

.auth-status {
  margin-top: 20px;
  padding: 12px 13px;
  border: 1px solid rgba(68, 215, 197, 0.16);
  border-radius: 11px;
  color: #a6afa7;
  background: rgba(68, 215, 197, 0.05);
  font-size: 11px;
  line-height: 1.5;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #0b0e0c;
}

.inline-field input {
  height: 44px;
  padding: 0 13px;
}

input::placeholder {
  color: #515951;
}

.secondary-button,
.primary-button,
.cashout-button,
.ghost-button {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition:
    transform 150ms ease,
    filter 150ms ease,
    opacity 150ms ease;
}

.secondary-button {
  min-width: 82px;
  padding: 0 14px;
  color: #10140e;
  background: var(--lime);
  font-size: 12px;
  font-weight: 800;
}

.secondary-button:hover,
.primary-button:hover,
.cashout-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  filter: none;
  opacity: 0.42;
  transform: none;
}

.user-line {
  margin-top: 20px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(199, 255, 50, 0.12);
  border-radius: 13px;
  background: var(--lime-soft);
}

.user-avatar {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #11160d;
  background: var(--lime);
  font-size: 13px;
  font-weight: 900;
}

.user-line > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.user-line > div span {
  color: var(--muted);
  font-size: 10px;
}

.user-line strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bet-card form {
  margin-top: 20px;
}

.amount-field {
  height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0b0e0c;
}

.amount-field:focus-within {
  border-color: rgba(199, 255, 50, 0.5);
}

.amount-field input {
  height: 100%;
  padding: 0 15px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  font-size: 25px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  outline: 0;
}

.amount-field span {
  padding-right: 15px;
  color: var(--lime);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.quick-bets {
  margin: 10px 0 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.quick-bets button {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #9ca59d;
  background: #0e120f;
  font-size: 11px;
  cursor: pointer;
}

.quick-bets button:hover {
  border-color: rgba(199, 255, 50, 0.3);
  color: var(--lime);
}

.primary-button,
.cashout-button {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 17px;
  font-weight: 850;
}

.primary-button {
  color: #10140d;
  background: var(--lime);
}

.primary-button small {
  color: rgba(16, 20, 13, 0.63);
  font-size: 10px;
  font-weight: 750;
}

.cashout-button {
  margin-top: 9px;
  color: #fff;
  background: linear-gradient(135deg, #f95c27, #ff784a);
}

.cashout-button strong {
  font-variant-numeric: tabular-nums;
}

.active-bet {
  margin-top: 12px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(68, 215, 197, 0.16);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(68, 215, 197, 0.05);
  font-size: 11px;
}

.active-bet strong {
  color: var(--cyan);
  font-size: 12px;
}

.payment-card p {
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.payment-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ghost-button {
  min-height: 48px;
  padding: 8px 11px;
  display: grid;
  justify-items: start;
  border: 1px solid var(--line);
  color: #c8cec8;
  background: #0d100e;
  font-size: 11px;
}

.ghost-button small {
  color: #626a63;
  font-size: 9px;
}

.ghost-button:hover {
  border-color: rgba(255, 107, 53, 0.3);
  color: var(--orange);
}

.safety-note {
  padding: 4px 10px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #7d867e;
  font-size: 10px;
  line-height: 1.5;
}

.safety-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #11160d;
  background: var(--lime);
  font-size: 10px;
  font-weight: 900;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  width: min(390px, calc(100% - 48px));
  padding: 15px 17px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(199, 255, 50, 0.18);
  border-radius: 15px;
  background: rgba(17, 21, 18, 0.96);
  box-shadow: var(--shadow);
  animation: toast-in 180ms ease-out;
}

.toast[hidden] {
  display: none;
}

.toast strong {
  font-size: 12px;
}

.toast span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.proof-dialog {
  width: min(620px, calc(100% - 32px));
  padding: 27px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  color: var(--text);
  background: #111512;
  box-shadow: var(--shadow);
}

.proof-dialog::backdrop {
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(8px);
}

.proof-dialog h2 {
  margin-bottom: 12px;
  font-size: 24px;
}

.proof-dialog > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.proof-dialog form {
  position: absolute;
  top: 16px;
  right: 16px;
}

.dialog-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: #0b0e0c;
  font-size: 20px;
  cursor: pointer;
}

.proof-dialog dl {
  margin: 22px 0 0;
  display: grid;
  gap: 10px;
}

.proof-dialog dl div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #0b0e0c;
}

.proof-dialog dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.proof-dialog dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.5;
}

noscript {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 30;
  padding: 14px;
  border: 1px solid var(--red);
  border-radius: 12px;
  background: #261015;
  text-align: center;
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .control-column {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bet-card {
    grid-row: span 2;
  }

  .safety-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .topbar,
  .app-shell {
    width: min(100% - 28px, 1480px);
  }

  .topbar {
    min-height: 76px;
  }

  .demo-badge {
    display: none;
  }

  .app-shell {
    margin-top: 8px;
    gap: 16px;
  }

  .control-column {
    grid-template-columns: minmax(0, 1fr);
  }

  .bet-card {
    grid-row: auto;
  }

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

  .multiplier span {
    font-size: clamp(68px, 22vw, 100px);
  }

  .history-card,
  .activity-card,
  .wallet-card,
  .bet-card,
  .payment-card {
    padding: 18px;
  }
}

@media (max-width: 440px) {
  .brand-copy small,
  #connectionText {
    display: none;
  }

  .connection {
    width: 36px;
    justify-content: center;
    padding: 0;
  }

  .round-heading {
    align-items: flex-end;
  }

  .round-heading h1 {
    max-width: 220px;
  }

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

  .proof-bar {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .payment-actions {
    grid-template-columns: 1fr;
  }
}

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