:root {
  --bg: #070b18;
  --lime: #9fd4ff;
  --ink: #eef3ff;
  --muted: #93a4c8;
  --card: #121a33;
  --line: rgba(255, 255, 255, 0.08);
  --shell: 460px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #060812;
  color: var(--ink);
}

body {
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

button, p, h1, h2, h3 { font-family: inherit; }

button:focus { outline: none; }

button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.screen { display: none; }

.screen.active { display: block; }

.shell {
  width: min(var(--shell), 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 50% at 50% -10%, rgba(159, 212, 255, 0.08), transparent 46%),
    var(--bg);
}

.brand {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.brand span { color: var(--lime); }

.kicker.as-written {
  font-size: 15px;
  letter-spacing: 0.01em;
  text-transform: none;
}

.brand.tiny { font-size: 18px; }

.kicker {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 14px 0 0;
  font-size: 44px;
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.stage {
  position: relative;
  height: 348px;
  margin: 10px 0 6px;
}

.astro {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 43%;
  width: min(228px, 62%);
  height: auto;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.4));
}

.card {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 7px;
  border-radius: 16px;
  background: var(--card);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: rotate(var(--rot));
  overflow: hidden;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gemini {
  left: 4px;
  top: 8px;
  background: #10182c;
}

.chatgpt {
  right: 0;
  top: 0;
  background: #10182c;
}

.grok {
  left: 0;
  top: 40%;
  background: #10182c;
}

.qwen {
  right: 0;
  top: 38%;
  background: #16141f;
}

.codex {
  left: 6px;
  bottom: 28px;
  background: #10182c;
}

.claude-float {
  right: 8px;
  bottom: 24px;
  background: #1a140f;
}

.prize-mark {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto;
  object-fit: cover;
  border-radius: 20px;
  background: #10182c;
  box-shadow:
    0 0 0 1px rgba(159, 212, 255, 0.7),
    0 0 22px rgba(159, 212, 255, 0.35);
}

.prize-block { text-align: center; }

.pill {
  display: inline-flex;
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--lime);
  background: rgba(159, 212, 255, 0.06);
  box-shadow:
    0 0 0 1px rgba(159, 212, 255, 0.5),
    0 0 22px rgba(159, 212, 255, 0.35);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.prize-block h2 {
  margin: 14px 0 0;
  font-size: 36px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.35;
}

.subtitle.left { text-align: left; }

.cta {
  width: 100%;
  height: 64px;
  margin-top: 22px;
  border: 0;
  border-radius: 22px;
  background: var(--lime);
  color: #071018;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(159, 212, 255, 0.24);
}

.cta:active { transform: scale(0.985); }

.ghost-btn, .text-btn {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.ghost-btn {
  width: 100%;
  height: 56px;
  margin-top: 10px;
  border-radius: 18px;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(159, 212, 255, 0.35);
  color: var(--lime);
  font-size: 18px;
}

.text-btn {
  padding: 0;
  color: var(--muted);
  font-size: 15px;
}

.text-btn.center {
  display: block;
  width: 100%;
  margin-top: 12px;
  text-align: center;
}

.app { display: none; }

.app.open { display: block; }

body.is-play {
  overflow: hidden;
  background: var(--bg);
}

.tab-panel[hidden] { display: none; }

.play-stage {
  position: fixed;
  inset: 0;
  background: #070d22;
  touch-action: none;
}

@media (min-width: 520px) {
  .play-stage {
    left: 50%;
    width: min(460px, 100%);
    transform: translateX(-50%);
  }
}

.hud {
  position: absolute;
  z-index: 2;
  top: calc(max(10px, env(safe-area-inset-top)) + 64px);
  left: 16px;
  right: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  pointer-events: none;
}

.hud .text-btn { justify-self: start; }

.live-score {
  position: absolute;
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  color: var(--lime);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.hud-best {
  margin: 0;
  justify-self: start;
  color: var(--muted);
  font-size: 13px;
}

canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #070d22;
}

.play-stage.is-brief .hud,
.play-stage.is-brief .goal-card { visibility: hidden; }

.goal-card {
  position: absolute;
  z-index: 3;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  width: min(420px, calc(100% - 24px));
  padding: 9px 12px 11px;
  border-radius: 16px;
  pointer-events: none;
  color: #eef3ff;
  background: rgba(12, 22, 48, 0.78);
  border: 1px solid rgba(159, 212, 255, 0.38);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateX(-50%);
}

.goal-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.goal-card-top p {
  margin: 0;
  color: #b7c9e6;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.goal-card-top p:last-child {
  color: #eef6ff;
  letter-spacing: -0.03em;
  font-size: 14px;
}

.goal-track {
  position: relative;
  height: 10px;
  margin: 8px 30px 2px 0;
  border-radius: 999px;
  background: rgba(7, 13, 34, 0.55);
  box-shadow: inset 0 0 0 1px rgba(159, 212, 255, 0.4);
  overflow: visible;
}

.goal-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6eabf0, #e7f4ff);
  box-shadow: 0 0 12px rgba(159, 212, 255, 0.85);
}

.goal-astro {
  position: absolute;
  right: -30px;
  top: 50%;
  width: 34px;
  height: 38px;
  transform: translateY(-56%);
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}

.goal-overlay {
  display: none;
  position: absolute;
  z-index: 6;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(108px + env(safe-area-inset-bottom));
  background: rgba(6, 12, 28, 0.55);
}

.goal-overlay.show { display: flex; }

.goal-shell {
  width: min(420px, 100%);
  padding: 22px 20px 18px;
  border-radius: 28px;
  text-align: center;
  background: #10182e;
  box-shadow: 0 0 0 1px rgba(159, 212, 255, 0.32), 0 20px 48px rgba(0, 0, 0, 0.4);
}

.goal-shell h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.03em;
}

.goal-shell p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.goal-prize-art,
.prize-logo {
  display: block;
  width: 84px;
  height: 84px;
  object-fit: contain;
  margin: 0 auto 12px;
  padding: 10px;
  border-radius: 20px;
  background: #f4f7fb;
}

.goal-prize-art.stake,
.prize-logo.stake,
.goal-prize-art.astronaut,
.prize-logo.astronaut {
  background: #10182c;
}

.goal-prize-art.ai,
.prize-logo.ai {
  background: #10182c;
}

.goal-prize-art.nft,
.prize-logo.nft {
  padding: 0;
  object-fit: cover;
  background: #10182c;
}

.goal-shell .code,
.prize-card .code {
  margin-top: 8px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.copy-btn,
.goal-shell .ghost-btn {
  margin-top: 12px;
}

.copy-btn {
  width: 100%;
  height: 44px;
  margin-top: 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--lime);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(159, 212, 255, 0.4);
  cursor: pointer;
}

.copy-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.prize-card.expired { opacity: 0.72; }

.prize-card .timer {
  margin-top: 8px;
  color: var(--lime);
  font-weight: 700;
}

.prize-card.expired .timer { color: var(--muted); }

.brief, .pause-overlay {
  display: none;
  position: absolute;
  z-index: 4;
  inset: 0;
  padding: max(24px, env(safe-area-inset-top)) 20px calc(108px + env(safe-area-inset-bottom));
}

.brief.show, .pause-overlay.show { display: flex; }

.brief {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.brief-art {
  width: min(180px, 46vw);
  height: auto;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.35));
}

.brief h2, .pause-card h2 {
  margin: 16px 0 0;
  font-size: 34px;
  letter-spacing: -0.03em;
}

.brief p, .pause-card p {
  max-width: 340px;
  margin: 10px 0 0;
  color: #b7c4d6;
  font-size: 16px;
  line-height: 1.4;
}

.brief .cta, .pause-card .cta {
  max-width: 340px;
}

.pause-overlay {
  align-items: center;
  justify-content: center;
  background: rgba(8, 14, 28, 0.46);
}

.pause-card {
  width: min(360px, 100%);
  padding: 22px 20px 18px;
  border-radius: 28px;
  text-align: center;
  background: rgba(12, 23, 48, 0.92);
  box-shadow: 0 0 0 1px rgba(159, 212, 255, 0.35), 0 18px 40px rgba(0, 0, 0, 0.35);
}

.result-overlay {
  display: none;
  position: absolute;
  z-index: 5;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(108px + env(safe-area-inset-bottom));
  background: rgba(6, 12, 28, 0.55);
}

.result-overlay.show { display: flex; }

.result-shell {
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  margin: 0;
  padding: 22px 20px 18px;
  border-radius: 28px;
  text-align: center;
  background: #10182e;
  box-shadow: 0 0 0 1px rgba(159, 212, 255, 0.32), 0 20px 48px rgba(0, 0, 0, 0.4);
}

.result-shell .stack {
  margin-top: auto;
  padding-top: 28px;
}

.score-label {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.score-value {
  margin: 4px 0 0;
  font-size: 72px;
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.record-line {
  margin: 8px 0 0;
  color: var(--lime);
  font-size: 16px;
  font-weight: 700;
}

.result-card {
  margin-top: 22px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
}

.result-card h3 {
  margin: 0;
  font-size: 22px;
}

.result-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.result-card strong { color: var(--lime); font-weight: 700; }

.stack { margin-top: 8px; }

.collection-title {
  margin: 18px 0 0;
  font-size: 36px;
  letter-spacing: -0.03em;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 18px;
}

.prize-card {
  min-height: 168px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px var(--line);
}

.prize-card.owned {
  box-shadow:
    inset 0 0 0 1px rgba(159, 212, 255, 0.45),
    0 0 22px rgba(159, 212, 255, 0.12);
}

.prize-card.locked { opacity: 0.45; }

.art {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: #172038;
  color: var(--lime);
  font-weight: 800;
}

.art.main {
  background: radial-gradient(circle at 40% 30%, #f4f7fb, #8ea4c4 42%, #1a2744 43%);
  box-shadow: 0 0 16px rgba(159, 212, 255, 0.35);
}

.prize-card h3 {
  margin: 0;
  font-size: 16px;
}

.prize-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.page .shell {
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

.rank-kicker {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.your-place {
  margin-top: 16px;
  padding: 14px 12px 12px;
  border-radius: 22px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(159, 212, 255, 0.14), transparent 46%),
    rgba(12, 22, 48, 0.88);
  box-shadow: inset 0 0 0 1px rgba(159, 212, 255, 0.38);
}

.your-place > p {
  margin: 0 4px 8px;
  color: #9fd4ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.level-line {
  margin: -4px 4px 10px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.rank-list {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
}

.rank-list.compact { margin: 0; }

.rank-row {
  display: grid;
  grid-template-columns: 32px 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 56px;
  padding: 8px 12px;
  border-radius: 18px;
  background: rgba(10, 18, 38, 0.72);
  box-shadow: inset 0 0 0 1px rgba(159, 212, 255, 0.16);
  font-weight: 700;
}

.rank-row.place-1 { box-shadow: inset 0 0 0 1px rgba(240, 197, 110, 0.7); }
.rank-row.place-2 { box-shadow: inset 0 0 0 1px rgba(214, 226, 242, 0.55); }
.rank-row.place-3 { box-shadow: inset 0 0 0 1px rgba(224, 176, 138, 0.6); }

.rank-row.you {
  background: rgba(70, 132, 214, 0.24);
  box-shadow: inset 0 0 0 1px rgba(159, 212, 255, 0.85), 0 0 18px rgba(110, 170, 240, 0.16);
}

.place {
  color: var(--muted);
  font-size: 16px;
  text-align: center;
}

.place-1 .place { color: #f0c56e; }
.place-2 .place { color: #d6e2f2; }
.place-3 .place { color: #e0b08a; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1a2c52;
  color: #d7ecff;
  font-size: 16px;
}

.you .avatar {
  background: #2f74c4;
  color: #f4f8ff;
}

.pilot {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.you .pilot { color: #9fd4ff; }

.height {
  color: var(--ink);
  font-size: 15px;
}

.invite-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
  padding: 16px 8px 16px 16px;
  border-radius: 24px;
  background:
    radial-gradient(90% 80% at 100% 0%, rgba(159, 212, 255, 0.16), transparent 52%),
    linear-gradient(155deg, #16233f 0%, #10182e 58%, #070b18 100%);
  box-shadow: inset 0 0 0 1px rgba(159, 212, 255, 0.55);
}

.invite-kicker {
  margin: 0;
  color: #9fd4ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.invite-copy h2 {
  margin: 8px 0 0;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.invite-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.combo {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.combo a {
  color: #d7ecff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.invite-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 14px;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--lime);
  color: #071018;
  font-weight: 700;
  text-decoration: none;
}

.invite-art {
  width: 112px;
  height: 150px;
  object-fit: contain;
  justify-self: end;
}

.odds-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.odds-card {
  display: grid;
  grid-template-columns: 32px 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 8px 12px;
  border-radius: 18px;
  background: rgba(10, 18, 38, 0.72);
  box-shadow: inset 0 0 0 1px rgba(159, 212, 255, 0.16);
}

.odds-card.glow {
  box-shadow:
    inset 0 0 0 1px rgba(159, 212, 255, 0.85),
    0 0 22px rgba(159, 212, 255, 0.28);
}

.odds-num {
  color: var(--muted);
  font-weight: 700;
}

.odds-card.glow .odds-num,
.odds-card.glow .odds-name { color: #d7ecff; }

.odds-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  padding: 6px;
  border-radius: 14px;
  background: #f4f7fb;
}

.odds-logo.ai { background: #10182c; }

.odds-logo.nft {
  padding: 0;
  object-fit: cover;
  background: #10182c;
}

.odds-name {
  display: grid;
  min-width: 0;
  font-weight: 700;
}

.nft-link {
  color: #9fd4ff;
  font-weight: 700;
}

.odds-name small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.odds-card strong {
  color: var(--ink);
  font-size: 18px;
}

.faq {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.faq details {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 4px 16px;
}

.faq summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
}

.faq summary:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
  border-radius: 8px;
}

.faq details p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.dock {
  position: fixed;
  z-index: 30;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: min(432px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(22, 36, 72, 0.78), rgba(8, 12, 28, 0.88));
  border: 1px solid rgba(150, 190, 255, 0.42);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.dock-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #d5e4f8;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  cursor: pointer;
}

.dock-tab[aria-selected="true"] {
  color: var(--lime);
  background: rgba(159, 212, 255, 0.16);
  border-color: rgba(159, 212, 255, 0.55);
}

@media (max-width: 420px) {
  .invite-banner {
    grid-template-columns: minmax(0, 1fr) 84px;
    gap: 8px;
    padding-right: 4px;
  }

  .invite-copy h2 { font-size: 22px; }

  .invite-art {
    width: 84px;
    height: 118px;
  }
}

@media (max-width: 380px) {
  h1 { font-size: 38px; }
  .prize-block h2 { font-size: 32px; }
  .stage { height: 320px; }
  .dock-tab { font-size: 12px; padding-inline: 4px; }
}
