:root { --navy: #0e1a36; --red: #e2372f; --soft: 0 18px 40px -18px rgba(10, 30, 80, .45); }
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-weight: 500; color: var(--navy);
  background: #5fa0ee; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
svg { width: 1.05em; height: 1.05em; fill: currentColor; flex: none; }

#sky, #world { position: fixed; inset: 0; width: 100%; height: 100%; }
#sky { z-index: 0; background: linear-gradient(#5fa0ee, #d3e7ff); }
#world { z-index: 2; image-rendering: pixelated; touch-action: pan-y; display: block; }

#title {
  position: fixed; z-index: 1; left: 0; right: 0; top: 9vh; text-align: center; pointer-events: none;
  font-weight: 800; font-size: min(16.5vw, 21vh); line-height: .86; letter-spacing: -.045em; white-space: nowrap;
  color: #fff; text-shadow: 0 .055em 0 rgba(20, 50, 120, .16);
}

/* ---------- top bar ---------- */
#bar {
  position: fixed; z-index: 5; top: 0; left: 0; right: 0; height: 64px; padding: 0 22px;
  display: flex; align-items: center; gap: 22px; color: #fff; pointer-events: none;
}
#bar > * { pointer-events: auto; }
#bar .mark { font-weight: 800; font-size: 20px; letter-spacing: -.03em; opacity: 0; }
#bar nav { margin-left: auto; display: flex; gap: 22px; font-weight: 600; font-size: 15px; }
#bar nav a { opacity: .9; transition: opacity .2s; text-shadow: 0 1px 8px rgba(10, 30, 80, .25); }
#bar nav a:hover { opacity: 1; }
#bar .pill { opacity: 0; }

/* ---------- pills ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 54px; padding: 0 26px;
  border-radius: 999px; background: #fff; color: var(--navy); font-weight: 700; font-size: 18px; white-space: nowrap;
  box-shadow: var(--soft); transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}
.pill:hover { transform: translateY(-3px); box-shadow: 0 24px 44px -18px rgba(10, 30, 80, .55); }
.pill.red { background: var(--red); color: #fff; }
.pill.icon { padding: 0; width: 54px; font-size: 20px; }
.pill.small { height: 40px; padding: 0 20px; font-size: 15px; }
.row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.ca {
  display: inline-flex; align-items: center; gap: 12px; height: 44px; padding: 0 16px 0 18px; max-width: 92vw;
  border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--navy); font-size: 15px; box-shadow: var(--soft);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.ca:hover { transform: translateY(-2px); }
.ca b { font-weight: 800; color: var(--red); }
.ca span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- panels (one per stop) ---------- */
.panel {
  position: fixed; z-index: 3; left: 0; right: 0; top: 0; padding: 86px 18px 0;
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
  opacity: 0; visibility: hidden; pointer-events: none; will-change: opacity, transform;
}
.panel > * { pointer-events: auto; }
.panel.off > * { pointer-events: none; }
.panel.hero { top: calc(9vh + min(16.5vw, 21vh) * .86 + 3.2vh); padding-top: 0; gap: 2.2vh; }
h2 {
  font-weight: 800; font-size: clamp(32px, 6.2vh, 64px); line-height: 1; letter-spacing: -.035em; color: #fff;
  text-shadow: 0 .05em 0 rgba(20, 50, 120, .18);
}
.sub { color: #fff; font-size: clamp(16px, 2.3vh, 21px); font-weight: 600; max-width: 30em; text-shadow: 0 1px 10px rgba(10, 30, 80, .3); }
.fine { color: rgba(255, 255, 255, .78); font-size: 13px; }
.card { background: #fff; border-radius: 24px; box-shadow: var(--soft); }

.stats { display: flex; padding: 18px 8px; }
.stats > div { padding: 0 30px; display: flex; flex-direction: column; gap: 2px; }
.stats > div + div { border-left: 1px solid #e6ebf5; }
.stats b { font-weight: 800; font-size: clamp(26px, 4.4vh, 44px); letter-spacing: -.03em; line-height: 1.05; }
.stats span { font-size: 14px; color: #62708f; }
.stats .wait, .stats.soon > div { display: none; }
.stats.soon > .wait { display: flex; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 250px)); gap: 14px; }
.step { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px 20px 20px; text-align: left; }
.step i {
  font-style: normal; font-weight: 800; font-size: 18px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--red); color: #fff; display: grid; place-items: center; flex: none;
}
.step b { display: block; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.step span { display: block; margin-top: 4px; font-size: 15px; line-height: 1.3; color: #4d5a78; }
.step b span { display: inline; margin: 0; font-size: inherit; color: inherit; }

.pfp { display: flex; gap: 20px; padding: 16px; align-items: center; text-align: left; max-width: 580px; }
.pfp-view { position: relative; width: min(25vh, 210px); aspect-ratio: 1; border-radius: 18px; overflow: hidden; flex: none; background: var(--red); }
.pfp-view canvas, .pfp-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pfp-view canvas { image-rendering: pixelated; }
.pfp-view[data-state="busy"] img { filter: saturate(.5) brightness(.85); }
.pfp-view[data-state="busy"]::after {
  content: ''; position: absolute; inset: 0; animation: sweep 1.3s linear infinite;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .6) 50%, transparent 70%) 0 0 / 250% 100%;
}
@keyframes sweep { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.opts { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.opts p { font-size: 16px; line-height: 1.3; color: #4d5a78; }
.opts p b { display: block; margin-bottom: 2px; color: var(--navy); font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.pfp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.opts .pill { height: 46px; font-size: 16px; box-shadow: none; }
.opts .pill.ghost { background: #eef2f9; }
.opts .pill:disabled { opacity: .45; pointer-events: none; }
.opts .pfp-note { font-size: 13px; color: #62708f; min-height: 1.3em; }
.flip { transform: rotate(180deg); }
.tpl { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; font-size: 14px; text-shadow: 0 1px 8px rgba(10, 30, 80, .3); }
.tpl-row { display: flex; gap: 8px; }
.tpl-row button { width: 52px; height: 52px; border-radius: 14px; overflow: hidden; box-shadow: var(--soft); transition: transform .25s; }
.tpl-row button:hover { transform: translateY(-3px); }
.tpl-row img { width: 100%; height: 100%; object-fit: cover; display: block; }
[hidden] { display: none !important; }

#hint {
  position: fixed; z-index: 4; left: 50%; bottom: 22px; transform: translateX(-50%); pointer-events: none;
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .9); font-weight: 700; font-size: 14px; box-shadow: var(--soft);
}
#hint svg { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

#modal {
  position: fixed; z-index: 9; inset: 0; display: grid; place-items: center; padding: 20px;
  background: rgba(8, 14, 36, .78); backdrop-filter: blur(8px);
}
#modal[hidden] { display: none; }
#modal video { max-width: 100%; max-height: 86vh; border-radius: 20px; background: #000; }
#modal-x {
  position: absolute; top: 18px; right: 18px; height: 40px; padding: 0 18px; border-radius: 999px;
  background: #fff; font-weight: 700; font-size: 15px;
}

/* ---------- phones (tall screens) ---------- */
@media (max-aspect-ratio: 4/5) {
  #title { font-size: 29vw; top: 8vh; white-space: normal; }
  #title span { display: block; }
  .panel.hero { top: calc(8vh + 29vw * 1.72 + 2.4vh); gap: 1.8vh; }
  #bar nav { display: none; }
  #bar .pill { margin-left: auto; }
  #bar { padding: 0 16px; }
  .panel { padding-top: 74px; gap: 12px; }
  .pill { height: 46px; padding: 0 16px; font-size: 15px; gap: 7px; }
  .pill.icon { width: 46px; font-size: 17px; }
  .row { gap: 8px; flex-wrap: nowrap; }
  h2 { font-size: min(8.6vw, 5vh); }
  .ca { height: 40px; font-size: 14px; }
  .stats > div { padding: 0 14px; }
  .steps { grid-template-columns: 1fr; gap: 8px; width: min(100%, 420px); }
  .step { flex-direction: row; align-items: center; padding: 12px 16px; gap: 14px; }
  .step b { font-size: 17px; } .step span { font-size: 14px; margin-top: 1px; }
  .pfp { gap: 14px; padding: 12px; }
  .pfp-view { width: 34vw; }
  .opts p { font-size: 13.5px; } .opts p b { font-size: 16px; }
  .opts .pill { height: 42px; font-size: 15px; }
  .tpl-row button { width: 44px; height: 44px; }
}
@media (max-height: 620px) and (min-aspect-ratio: 4/5) {
  .panel { padding-top: 64px; gap: 10px; }
  .step span { display: none; }
}
