:root {
  --mint: #7dffd0;
  --mint-deep: #0a2e2a;
  --mint-mid: #146b5e;
  --gold: #f5c842;
  --gold-soft: #ffe9a0;
  --ink: #041816;
  --panel: rgba(8, 42, 38, 0.88);
  --line: rgba(125, 255, 208, 0.22);
  --danger: #ff6b7a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Segoe UI", "Avenir Next", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, #1a6b5c 0%, transparent 55%),
    radial-gradient(90% 60% at 100% 100%, #0e3d36 0%, transparent 50%),
    linear-gradient(180deg, #06352f 0%, var(--mint-deep) 45%, #021816 100%);
  color: #e8fff7;
  touch-action: manipulation;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; opacity: 0.35;
  background-image:
    radial-gradient(2px 2px at 12% 20%, #fff8, transparent),
    radial-gradient(1.5px 1.5px at 70% 35%, #fff6, transparent),
    radial-gradient(2px 2px at 40% 70%, #fff5, transparent),
    radial-gradient(1px 1px at 85% 80%, #fff4, transparent);
}

#app {
  max-width: 430px; margin: 0 auto; height: 100%;
  display: flex; flex-direction: column;
  padding: calc(10px + var(--safe-top)) 16px calc(14px + var(--safe-bottom));
  position: relative;
}

.topbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px;
  object-fit: cover; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.05rem; letter-spacing: 0.02em; }
.brand-text span { font-size: 0.78rem; color: var(--mint); opacity: 0.9; }

.screen { display: none; flex: 1; flex-direction: column; min-height: 0; }
.screen.active { display: flex; animation: rise 0.35s ease; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.hero { text-align: center; margin: 8px 0 18px; }
.hero-rocket {
  width: 132px; height: 132px; object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,.45));
  animation: floaty 3.2s ease-in-out infinite;
}
@keyframes floaty {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.hero h1 {
  margin: 10px 0 6px; font-size: 1.7rem;
  background: linear-gradient(90deg, var(--mint), var(--gold-soft));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 0 auto; max-width: 28ch; color: #b7e8da; font-size: 0.95rem; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 8px; text-align: center;
}
.stat em { display: block; font-style: normal; font-size: 1.25rem; color: var(--gold); font-weight: 700; }
.stat span { font-size: 0.7rem; color: #9fd9cb; text-transform: uppercase; letter-spacing: 0.04em; }

.btn {
  border: 0; border-radius: 16px; padding: 14px 18px; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: linear-gradient(135deg, var(--mint) 0%, #3ad4b0 45%, var(--gold) 120%);
  color: var(--ink); box-shadow: 0 10px 28px rgba(61, 214, 176, 0.35);
  margin-bottom: 14px;
}
.btn.ghost {
  background: transparent; color: var(--mint); border: 1px solid var(--line);
}
.btn.danger {
  background: rgba(255,107,122,.12); color: var(--danger); border: 1px solid rgba(255,107,122,.35);
  margin: 12px 0;
}

.dock { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; }
.dock button {
  background: var(--panel); border: 1px solid var(--line); color: #dffaf0;
  border-radius: 14px; padding: 12px 8px; font-weight: 600; cursor: pointer;
}

.thanks {
  margin-top: 14px; font-size: 0.78rem; color: #7fb8ab; text-align: center; line-height: 1.4;
}

#screen-flight { position: relative; }
.hud {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px;
}
.hud > div {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px; text-align: center;
}
.hud span { display: block; font-size: 0.65rem; color: #8fcabb; text-transform: uppercase; }
.hud strong { font-size: 1.05rem; color: var(--gold-soft); }

#game {
  width: 100%; flex: 1; min-height: 0;
  border-radius: 20px; background: linear-gradient(180deg, #06201c, #031412);
  border: 1px solid var(--line); touch-action: none; display: block;
}
.flight-hint {
  position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%);
  background: rgba(0,0,0,.45); padding: 8px 12px; border-radius: 999px;
  font-size: 0.78rem; color: #cfeee4; pointer-events: none;
  transition: opacity .4s ease;
}
.flight-hint.hide { opacity: 0; }
.abs-back { position: absolute; top: 58px; left: 8px; z-index: 3; padding: 8px 12px; font-size: 0.85rem; }

.overlay {
  position: absolute; inset: 48px 0 0; display: grid; place-items: center;
  background: rgba(2, 16, 14, 0.72); border-radius: 20px; z-index: 4;
}
.overlay[hidden] { display: none !important; }
.card {
  width: min(92%, 320px); background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 22px 18px; text-align: center;
}
.card h2 { margin: 0 0 8px; }
.card .btn { width: 100%; margin-top: 8px; }
.muted { color: #8fcabb; font-size: 0.85rem; }
.ver { margin: 8px 0 16px; }

h2 { margin: 4px 0 14px; font-size: 1.35rem; }
.list { list-style: none; margin: 0 0 16px; padding: 0; overflow: auto; }
.list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
}
.list li span:last-child { color: var(--gold); font-weight: 700; }

.badge-grid {
  list-style: none; margin: 0 0 16px; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; overflow: auto;
}
.badge-grid li {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 12px; min-height: 108px;
}
.badge-grid li.locked { opacity: 0.45; filter: grayscale(0.4); }
.badge-grid .tag {
  display: inline-block; font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--mint); margin-bottom: 6px;
}
.badge-grid strong { display: block; margin-bottom: 4px; }
.badge-grid p { margin: 0; font-size: 0.8rem; color: #9fd9cb; }

.toggle {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 10px;
}
.toggle input { width: 22px; height: 22px; accent-color: var(--mint); }
