:root {
  --bg-0: #070b14;
  --bg-1: #0e1628;
  --bg-2: #15203b;
  --border: rgba(148, 163, 184, 0.16);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #7c3aed;
  --accent-bright: #a855f7;
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --amber: #f59e0b;
  --danger: #ef4444;
  --cyan: #06b6d4;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: radial-gradient(circle at 15% 0%, #172042 0%, var(--bg-0) 55%);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Top Telemetry & GEO Switcher Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

.geo-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.geo-btn {
  background: var(--bg-1);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.geo-btn.active {
  background: rgba(124, 58, 237, 0.22);
  color: #fff;
  border-color: var(--accent-bright);
}

/* Hero Section */
.hero {
  padding: 28px 0 20px;
}

.hero-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(1.45rem, 3.4vw, 2.25rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}

.hero p {
  color: var(--text-muted);
  max-width: 760px;
  font-size: 0.96rem;
  margin-bottom: 16px;
}

/* Payment Rail Trust Strip */
.rails-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.rail-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.82rem;
}

.rail-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.rail-badge {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Promo Banner Strip */
.promo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.2), rgba(16, 185, 129, 0.16));
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
}

.promo-code-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(7, 11, 20, 0.75);
  border: 1px dashed var(--amber);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 800;
  color: var(--amber);
  font-size: 1rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: #04130d;
  box-shadow: 0 4px 18px var(--emerald-glow);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: #fff;
}

.btn-outline {
  background: var(--bg-2);
  color: var(--text-main);
  border: 1px solid var(--border);
}

/* Main Grid */
.grid-main {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 880px) {
  .grid-main {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.card h2 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.card-sub {
  color: var(--text-muted);
  font-size: 0.84rem;
  margin-bottom: 14px;
}

/* Simulator Canvas & Controls */
.sim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.balance-pill {
  background: var(--bg-0);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 700;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  height: 230px;
  background: radial-gradient(circle at 70% 25%, #23194f 0%, #090d1a 75%);
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.25);
  overflow: hidden;
  margin-bottom: 12px;
}

#jetCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.mult-readout {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.6rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.mult-readout.crashed {
  color: var(--danger);
}

.history-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 12px;
}

.hist-chip {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--bg-2);
}

.hist-chip.high {
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.hist-chip.mid {
  color: var(--emerald);
}

.hist-chip.low {
  color: var(--text-muted);
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 540px) {
  .controls-grid {
    grid-template-columns: 1fr;
  }
}

.field label {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.field input, .field select {
  width: 100%;
  background: var(--bg-0);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.92rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sim-log {
  min-height: 24px;
  font-size: 0.82rem;
  color: var(--emerald);
  margin-top: 8px;
}

/* Metrics Output List */
.metric-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-0);
  border: 1px solid var(--border);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.metric-val {
  font-weight: 800;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.metric-val.highlight {
  color: var(--emerald);
  font-size: 1rem;
}

/* Steps & Footer */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 10px;
}

@media (max-width: 760px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

.step-box {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 0.85rem;
}

.footer {
  margin: 28px 0 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* Conversion Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.82);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

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

.modal {
  background: var(--bg-1);
  border: 1px solid var(--accent-bright);
  border-radius: 16px;
  max-width: 460px;
  width: 100%;
  padding: 22px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
}
