/* =========================================================
   Sprinklin' Light Worldwide: All Portals
   Stacie's glass orbs orbiting a spinning globe like a solar system,
   in a deep night cosmos. Same spirit as the Treehouse, built
   with game-studio polish: one light source, calm motion, crisp type.
   ========================================================= */

:root {
  --night: #04061a;
  --night-2: #0a0f33;
  --ink: #eef2ff;
  --soft: #aab3dd;
  --gold: #ffd36a;
  --gold-2: #ffb02e;
  --blue: #3fb6ff;
  --violet: #9b6bff;
  --pink: #ff4fd8;
  --f-title: "Bungee", "Luckiest Guy", system-ui, sans-serif;
  --f-body: "Exo 2", "Trebuchet MS", system-ui, sans-serif;
  --f-script: "Kaushan Script", cursive;
  --chrome: linear-gradient(180deg, #ffffff 0%, #eaf0ff 28%, #a7b2d6 47%, #4d5680 52%, #cdd6f2 68%, #ffffff 100%);
  --gold-chrome: linear-gradient(180deg, #fff8cf 0%, #ffe27a 34%, #ffb52e 51%, #c76d00 55%, #ffd45c 76%, #fff6c2 100%);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.3, 1.5, .5, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; background: var(--night); }
body { margin: 0; color: var(--ink); font-family: var(--f-body); background: var(--night); overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
body.is-entering { overflow: hidden; height: 100svh; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 12px; box-shadow: 0 0 0 6px rgba(63, 182, 255, .45); }

/* ---------- the sky behind everything ---------- */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.nebula {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 50% 45% at 50% 50%, rgba(0, 0, 0, .35), transparent 80%),
    url("../img/space.jpg") center / cover no-repeat,
    #000;
}

/* ---------- small fixed controls ---------- */
.mute {
  position: fixed; z-index: 90; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right));
  width: 50px; height: 50px; border-radius: 50%; padding: 0; cursor: pointer; display: grid; place-items: center; color: #dff3ff;
  background: radial-gradient(circle at 50% 30%, rgba(60, 80, 170, .92), rgba(8, 10, 40, .94));
  border: 1.5px solid rgba(140, 210, 255, .75);
  box-shadow: 0 0 16px rgba(63, 182, 255, .55), inset 0 0 10px rgba(63, 182, 255, .4);
  transition: transform .2s var(--ease), box-shadow .2s ease;
}
.mute:hover { transform: scale(1.06); box-shadow: 0 0 24px rgba(63, 182, 255, .85), inset 0 0 12px rgba(63, 182, 255, .55); }
.mute svg { width: 24px; height: 24px; fill: currentColor; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.mute svg path:first-child { stroke-width: 1; }
.mute .off { display: none; }
.mute[aria-pressed="true"] .on { display: none; }
.mute[aria-pressed="true"] .off { display: block; }

/* ---------- entrance ---------- */
.entrance {
  position: fixed; inset: 0; z-index: 80; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; overflow: hidden; text-align: center;
  background: radial-gradient(ellipse at 50% 45%, rgba(20, 24, 80, .55), rgba(3, 4, 15, .96) 70%);
  transition: opacity .9s ease .35s, visibility 0s linear 1.3s;
}
/* top to bottom: title, earth, tagline, then the way in */
.entrance__inner { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; min-width: 0; max-height: 100%; padding: 16px; }
.entrance__top { position: relative; z-index: 2; }
.entrance__earth {
  position: relative; z-index: 1; flex: none; height: clamp(200px, 50svh, 560px); aspect-ratio: 1536 / 1024; margin: -7svh 0 -9svh;
  background: url("../img/cosmic-earth.jpg") center / cover no-repeat;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 45%, transparent 72%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 45%, transparent 72%);
  opacity: .9; animation: earthBreath 8s ease-in-out infinite; transition: transform 1.3s var(--ease), opacity 1.1s ease;
}
/* the earth in the picture turns: a night map of the world slides round inside its globe */
.entrance__spin { position: absolute; left: 49.6%; top: 48.45%; width: 41.4%; height: 54.4%; transform: translate(-50%, -50%); border-radius: 50%;
  background: url("../img/night-map.webp") repeat-x; background-size: 200% 112%; background-position: 200% 50%; animation: earthSpin 40s linear infinite;
  -webkit-mask-image: radial-gradient(closest-side, #000 95%, transparent 100%); mask-image: radial-gradient(closest-side, #000 95%, transparent 100%); }
.entrance__spin::after { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, rgba(140, 170, 255, .14), transparent 50%), radial-gradient(closest-side, transparent 70%, rgba(0, 0, 12, .45) 92%, rgba(150, 190, 255, .35) 100%); }
@keyframes earthSpin { from { background-position: 200% 50%; } to { background-position: 0% 50%; } }
@media (prefers-reduced-motion: reduce) { .entrance__spin { animation-duration: 90s; } }
@keyframes earthBreath { 50% { transform: scale(1.03); filter: brightness(1.12); } }
.entrance__kicker { margin: 0 0 1.4svh; font-weight: 600; font-size: clamp(12px, 2.6vw, 15px); letter-spacing: .4em; text-transform: uppercase; color: var(--gold); text-shadow: 0 0 12px rgba(255, 190, 60, .7); }
.entrance__title { margin: 0; line-height: .92; }
.entrance__sub { position: relative; z-index: 2; margin: 0 0 3svh; font-family: var(--f-script); font-size: clamp(20px, 5vw, 32px); color: #ffe7a6; text-shadow: 0 0 14px rgba(255, 180, 60, .75); }
.entrance__actions { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.enter-btn {
  position: relative; cursor: pointer; border: 0; padding: 0; background: none; min-height: 64px;
  font-family: var(--f-title); font-size: clamp(17px, 4.8vw, 32px); letter-spacing: .06em; white-space: nowrap;
}
.enter-btn span {
  position: relative; display: block; padding: .62em 1.7em .55em; border-radius: 999px; color: #fff; overflow: hidden;
  background: linear-gradient(180deg, rgba(70, 40, 190, .92), rgba(16, 10, 70, .96));
  border: 2px solid rgba(190, 240, 255, .9);
  box-shadow: 0 0 0 3px rgba(255, 79, 216, .75), 0 0 28px 6px rgba(255, 79, 216, .55), 0 0 60px 16px rgba(63, 182, 255, .35), inset 0 0 22px rgba(63, 182, 255, .75);
  text-shadow: 0 0 12px #9be9ff, 0 0 24px #3fb6ff, 0 3px 0 #2a1170;
  transition: transform .2s var(--ease);
  animation: enterPulse 2.4s ease-in-out infinite;
}
.enter-btn span::after { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; left: -50%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); transform: skewX(-20deg); animation: btnSheen 3.2s ease-in-out infinite; }
@keyframes btnSheen { 0%, 55% { left: -50%; } 100% { left: 130%; } }
@keyframes enterPulse { 50% { box-shadow: 0 0 0 3px rgba(255, 79, 216, .95), 0 0 40px 10px rgba(255, 79, 216, .7), 0 0 80px 22px rgba(63, 182, 255, .45), inset 0 0 26px rgba(63, 182, 255, .9); } }
.enter-btn:hover span { transform: scale(1.05); }
.enter-btn:active span { transform: scale(.95, .92); }
.entrance__hint { margin: 2.2svh 0 0; font-size: 14px; color: var(--soft); }
.entrance.is-opening .entrance__earth { transform: scale(2.6); opacity: 0; }
.entrance.is-opening .entrance__top, .entrance.is-opening .entrance__sub, .entrance.is-opening .entrance__actions { opacity: 0; transform: scale(.92); transition: opacity .4s ease, transform .5s var(--ease); }
.entrance.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- chrome titles ---------- */
.chrome, .chrome-gold {
  display: inline-block; font-family: var(--f-title); font-weight: 400; text-transform: uppercase; letter-spacing: .03em;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: .016em rgba(20, 24, 70, .9);
  filter: drop-shadow(0 .045em 0 #151a48) drop-shadow(0 0 .14em rgba(150, 200, 255, .85));
  padding: .12em .06em .06em; margin: -.12em -.06em -.06em;
}
.chrome-gold { background-image: var(--gold-chrome); -webkit-text-stroke-color: rgba(70, 30, 0, .9); filter: drop-shadow(0 .045em 0 #3c1a00) drop-shadow(0 0 .16em rgba(255, 190, 60, .8)); }
.entrance__title .chrome { font-size: clamp(26px, 7.6vw, 84px); }
.entrance__title .chrome-gold { display: block; font-size: clamp(26px, 6.2vw, 56px); margin-top: .06em; }

/* progress: portals discovered */
.progress {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 28px; padding: 10px 18px 10px 14px; border-radius: 999px;
  background: rgba(8, 10, 40, .72); border: 1px solid rgba(255, 211, 106, .55);
  box-shadow: 0 0 20px rgba(255, 190, 60, .2), inset 0 0 12px rgba(255, 190, 60, .12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.progress__star { width: 26px; height: 26px; color: var(--gold); filter: drop-shadow(0 0 6px rgba(255, 190, 60, .9)); }
.progress__text { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #ffe9b0; white-space: nowrap; }
.progress__text b { font-family: var(--f-title); font-weight: 400; font-size: 17px; letter-spacing: .04em; color: #fff; }
.progress__bar { width: clamp(80px, 18vw, 160px); height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.progress__bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #ffb02e, #ffe27a, #fff); box-shadow: 0 0 10px #ffd36a; transition: width .9s var(--spring); }
.progress.is-bump { animation: bump .6s var(--spring); }
@keyframes bump { 40% { transform: scale(1.08); } }

/* ---------- portal preview window ---------- */
.portal-modal { width: min(560px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 28px; background: transparent; color: var(--ink); overflow: visible; }
.portal-modal::backdrop { background: radial-gradient(ellipse at 50% 40%, rgba(30, 30, 110, .55), rgba(2, 3, 12, .88)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.portal-modal[open] { animation: modalIn .55s var(--spring); }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.9); } }
.portal-modal__card {
  position: relative; padding: 34px 28px 30px; text-align: center; border-radius: 28px;
  background: linear-gradient(180deg, rgba(22, 26, 78, .94), rgba(8, 10, 38, .97));
  border: 1px solid rgba(170, 210, 255, .35);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px var(--accent-soft, rgba(63, 182, 255, .35)), inset 0 0 40px rgba(63, 182, 255, .08);
}
.portal-modal__orb { width: min(280px, 64vw); margin: -110px auto 0; animation: modalOrb 7s ease-in-out infinite; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .6)); }
@keyframes modalOrb { 50% { transform: translateY(-8px) rotate(2deg); } }
.portal-modal__title { margin: 14px 0 0; font-family: var(--f-title); font-weight: 400; font-size: clamp(22px, 5vw, 30px); letter-spacing: .03em; text-transform: uppercase; line-height: 1.05; }
.portal-modal__text { margin: 12px auto 0; max-width: 420px; font-size: 16px; line-height: 1.55; color: #cfd7ff; }
.portal-modal__soon { display: inline-block; margin-top: 16px; padding: 7px 16px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: #1a1030; background: var(--gold-chrome); box-shadow: 0 0 18px rgba(255, 190, 60, .6); }
.portal-modal__close {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; margin-top: 22px; padding: 0 28px; border-radius: 999px; cursor: pointer;
  font-weight: 700; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: #fff;
  background: linear-gradient(180deg, rgba(70, 40, 190, .9), rgba(20, 10, 80, .95)); border: 1.5px solid rgba(190, 240, 255, .8);
  box-shadow: 0 0 0 2px rgba(255, 79, 216, .6), 0 0 20px rgba(255, 79, 216, .45);
}
.portal-modal__close:hover { filter: brightness(1.2); }

/* ---------- footer ---------- */
.finale { position: relative; z-index: 1; text-align: center; padding: 90px 20px 110px; }
.finale__cta { margin: 0; font-size: clamp(34px, 9vw, 92px); line-height: 1; }
.finale__cta .sep { color: var(--gold); -webkit-text-fill-color: var(--gold); text-shadow: 0 0 14px rgba(255, 190, 60, .9); padding: 0 .12em; }
.finale__script { margin: 14px 0 0; font-family: var(--f-script); font-size: clamp(22px, 5vw, 38px); color: #ffd36a; text-shadow: 0 0 12px rgba(255, 176, 46, .85); }
.finale__small { margin: 26px 0 0; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--soft); }

/* celebration toast */
.toast {
  position: fixed; left: 50%; bottom: 30px; z-index: 95; transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  padding: 14px 24px; border-radius: 999px; font-weight: 700; font-size: 14px; letter-spacing: .06em; color: #1a1030;
  background: var(--gold-chrome); box-shadow: 0 0 30px rgba(255, 190, 60, .7), 0 12px 30px rgba(0, 0, 0, .45);
  transition: opacity .3s ease, transform .45s var(--spring);
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.burst { position: fixed; inset: 0; z-index: 70; pointer-events: none; }


/* ---------- page ---------- */
.world { position: relative; z-index: 1; transition: opacity .9s ease; }
.is-entering .world { opacity: 0; }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }

.system { position: relative; padding: 78px 0 10px; text-align: center; }
.system__head { position: relative; z-index: 3; padding: 0 16px; }
.kicker { margin: 0 0 10px; font-weight: 600; font-size: 13px; letter-spacing: .42em; text-transform: uppercase; color: var(--gold); text-shadow: 0 0 12px rgba(255, 190, 60, .7); }
.title { margin: 0; line-height: 1; font-size: clamp(30px, 5.4vw, 66px); }
.title .chrome, .title .chrome-gold { font-size: inherit; }
.progress { margin-top: 20px; }

/* the solar system */
.stage { position: relative; width: 100%; height: var(--stage-h, 760px); margin: 0 auto; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.stage.is-dragging { cursor: grabbing; }
/* a finger on a portal turns the dial instead of scrolling the page */
.orbits a, .orbits button, .orb { touch-action: none; }
.corona { position: absolute; left: 50%; top: 50%; width: calc(var(--globe, 400px) * 2.4); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(120, 170, 255, .2), rgba(150, 90, 255, .1) 35%, transparent 62%); animation: coronaPulse 6s ease-in-out infinite; }
@keyframes coronaPulse { 50% { transform: translate(-50%, -50%) scale(1.06); opacity: .8; } }
.rings { display: none; } /* orbit lines removed: the orbs float freely */
.rings path { fill: none; stroke-linecap: round; }
.rings .ring { stroke: rgba(150, 200, 255, .28); stroke-width: 1.4; }
.rings .ring-glow { stroke: rgba(120, 170, 255, .12); stroke-width: 10; }
.rings .ring-dots { stroke: rgba(220, 235, 255, .55); stroke-width: 2; stroke-dasharray: 1.5 14; animation: ringDots 40s linear infinite; }
@keyframes ringDots { to { stroke-dashoffset: -600; } }
.rings--back { z-index: 1; }
.rings--front { z-index: 60; }

.globe { position: absolute; z-index: 50; left: 50%; top: 50%; width: calc(var(--globe, 400px) / .74); aspect-ratio: 1; transform: translate(-50%, -50%); padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.globe canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.globe__fallback { display: none; position: absolute; left: 13%; top: 13%; width: 74%; height: 74%; border-radius: 50%; object-fit: cover; animation: fallbackSpin 120s linear infinite; }
.no-gl .globe__fallback { display: block; }
@keyframes fallbackSpin { to { transform: rotate(360deg); } }
.globe:focus-visible { outline-offset: -12%; }

/* Goofin pops up from behind the globe now and then */
.peek { position: absolute; z-index: 45; left: 50%; top: 50%; width: calc(var(--globe, 400px) * .3); transform: translate(-50%, 0) rotate(-6deg); transition: transform .7s cubic-bezier(.3, 1.5, .5, 1); pointer-events: none; }
.peek.is-up { transform: translate(-50%, calc(var(--globe, 400px) * -.5 - 92%)) rotate(-6deg); pointer-events: auto; cursor: pointer; }
.peek img { width: 100%; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .6)); }

/* orbiting portals: position, size and stacking are set every frame by galaxy.js */
.orbits { position: absolute; inset: 0; }
.orb {
  position: absolute; left: 0; top: 0; width: var(--orb, 140px); aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 50%; text-decoration: none; will-change: transform; -webkit-touch-callout: none;
}
.orb__tilt { position: absolute; inset: 0; border-radius: 50%; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--hs, 1)); transition: transform .4s var(--spring), filter .3s ease; }
.orb__img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 12, .55)); pointer-events: none; }
.orb__sheen { position: absolute; inset: 4%; border-radius: 50%; pointer-events: none; mix-blend-mode: screen; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(circle at var(--mx, 35%) var(--my, 25%), rgba(255, 255, 255, .55), rgba(255, 255, 255, .06) 30%, transparent 55%); }
.orb__ring { position: absolute; inset: -5%; border-radius: 50%; pointer-events: none; opacity: 0; box-shadow: 0 0 30px 6px var(--accent), inset 0 0 22px 3px var(--accent); transition: opacity .3s ease; }
.orb__label {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, 6px); width: max-content; max-width: 220px; padding: 6px 12px 5px; border-radius: 999px; pointer-events: none;
  font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #fff; text-align: center; line-height: 1.2;
  background: rgba(6, 8, 34, .9); border: 1px solid var(--accent); box-shadow: 0 0 14px var(--accent);
  opacity: 0; transition: opacity .25s ease, transform .3s var(--spring);
}
.orb__badge { position: absolute; top: 0; right: 4%; width: 24%; color: var(--gold); filter: drop-shadow(0 0 6px rgba(255, 190, 60, .95)); transform: scale(0); transition: transform .5s var(--spring); }
.orb.is-found .orb__badge { transform: scale(1); }
.orb:hover .orb__tilt, .orb:focus-visible .orb__tilt { --hs: 1.14; filter: brightness(1.15) saturate(1.1); }
.orb:hover .orb__sheen, .orb:focus-visible .orb__sheen, .orb:hover .orb__ring, .orb:focus-visible .orb__ring { opacity: 1; }
.orb:hover .orb__label, .orb:focus-visible .orb__label { opacity: 1; transform: translate(-50%, 10px); }
.orb.is-launching .orb__tilt { --hs: 1.3; filter: brightness(1.7); }


.hint { position: relative; z-index: 3; margin: 0; padding: 0 16px; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: rgba(200, 215, 255, .6); }

/* ---------- characters running across the screen ---------- */
.runners { position: fixed; inset: 0; z-index: 75; pointer-events: none; overflow: hidden; }
.runner { position: absolute; left: 0; top: 0; width: var(--rw, 190px); padding: 0; border: 0; background: none; pointer-events: auto; cursor: pointer; will-change: transform; }
.runner__body { display: block; transform-origin: 50% 100%; animation: gallop .42s ease-in-out infinite alternate; }
.runner.is-goofin .runner__body { animation: hopRun .5s cubic-bezier(.3, .6, .4, 1) infinite; }
@keyframes gallop { from { transform: translateY(0) rotate(-3deg) scaleX(var(--face, 1)); } to { transform: translateY(-10%) rotate(3deg) scaleX(var(--face, 1)); } }
@keyframes hopRun { 0%, 100% { transform: translateY(0) scale(1.04, .94) scaleX(var(--face, 1)); } 45% { transform: translateY(-24%) scale(.96, 1.04) scaleX(var(--face, 1)); } }
.runner img { width: 100%; filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .55)); pointer-events: none; }
.runner__shadow { position: absolute; left: 18%; right: 18%; bottom: -2%; height: 7%; border-radius: 50%; background: rgba(0, 0, 0, .45); filter: blur(6px); }
.dust { position: absolute; z-index: -1; width: 26px; height: 26px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(255, 230, 190, .55), rgba(255, 230, 190, 0) 70%); animation: dust .9s ease-out forwards; }
@keyframes dust { to { transform: scale(2.6) translateY(-14px); opacity: 0; } }
.runner .bubble { position: absolute; left: 30%; bottom: 100%; width: max-content; padding: 8px 12px; border-radius: 14px; font-weight: 700; font-size: 14px; color: #1a0f3a; background: #fff; box-shadow: 0 0 0 2.5px #3dff6e, 0 0 16px rgba(61, 255, 110, .6); }

/* ---------- footer ---------- */
.finale { position: relative; z-index: 1; text-align: center; padding: 70px 20px 110px; }
.finale__cta { margin: 0; font-size: clamp(34px, 9vw, 92px); line-height: 1; }
.finale__cta .sep { color: var(--gold); -webkit-text-fill-color: var(--gold); text-shadow: 0 0 14px rgba(255, 190, 60, .9); padding: 0 .12em; }
.finale__script { margin: 14px 0 0; font-family: var(--f-script); font-size: clamp(22px, 5vw, 38px); color: #ffd36a; text-shadow: 0 0 12px rgba(255, 176, 46, .85); }
.finale__small { margin: 26px 0 0; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--soft); }

.toast { position: fixed; left: 50%; bottom: 30px; z-index: 95; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; padding: 14px 24px; border-radius: 999px; font-weight: 700; font-size: 14px; letter-spacing: .06em; color: #1a1030; background: var(--gold-chrome); box-shadow: 0 0 30px rgba(255, 190, 60, .7), 0 12px 30px rgba(0, 0, 0, .45); transition: opacity .3s ease, transform .45s var(--spring); }
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.burst { position: fixed; inset: 0; z-index: 85; pointer-events: none; }

@media (max-width: 640px) {
  .mute { top: auto; bottom: max(14px, env(safe-area-inset-bottom)); }
  .system { padding-top: 58px; }
  .progress { flex-wrap: wrap; justify-content: center; gap: 8px 10px; max-width: 100%; padding: 10px 16px; border-radius: 22px; }
  .progress__bar { width: 100%; }
  .progress__text { font-size: 11.5px; letter-spacing: .1em; }
  .orb__label { display: none; }
  .hint { font-size: 11px; letter-spacing: .14em; }
}

.is-offscreen *, .is-offscreen *::before, .is-offscreen *::after { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .15s !important; }
  .runners, .peek { display: none; }
}

/* ---------- order, visited and not yet ---------- */
.orb__num {
  position: absolute; top: 2%; left: 4%; z-index: 2; min-width: 26%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--f-title); font-size: calc(var(--orb, 130px) * .13); line-height: 1; color: #fff;
  background: radial-gradient(circle at 35% 30%, #3b4bb8, #0b1040 75%); border: 2px solid rgba(190, 220, 255, .85);
  box-shadow: 0 0 10px rgba(80, 150, 255, .8);
}
.orb.is-found .orb__num { color: #2a1700; background: var(--gold-chrome); border-color: #fff3c0; box-shadow: 0 0 12px rgba(255, 190, 60, .9); }
.orb__badge { top: auto; bottom: 2%; right: 2%; width: 28%; }
/* not visited yet: a soft gold "come find me" pulse */
.orb:not(.is-found) .orb__tilt::after {
  content: ""; position: absolute; inset: -3%; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(255, 215, 110, .55), 0 0 22px 4px rgba(255, 200, 80, .45);
  animation: invite 2.6s ease-in-out infinite;
}
@keyframes invite { 0%, 100% { opacity: .25; transform: scale(.98); } 50% { opacity: 1; transform: scale(1.04); } }

.progress__rank {
  padding: 4px 12px 3px; border-radius: 999px; font-family: var(--f-title); font-size: 13px; letter-spacing: .06em; color: #1b1030;
  background: var(--gold-chrome); box-shadow: 0 0 12px rgba(255, 190, 60, .6); white-space: nowrap;
}

/* ---------- your journey ---------- */
.journey { position: relative; z-index: 3; width: min(100% - 28px, 980px); margin: 34px auto 0; padding: 26px 20px 22px; border-radius: 26px;
  background: linear-gradient(180deg, rgba(20, 24, 74, .72), rgba(6, 8, 30, .82)); border: 1px solid rgba(160, 200, 255, .28);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45), inset 0 0 30px rgba(63, 182, 255, .08); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.journey__title { margin: 0; font-family: var(--f-title); font-weight: 400; font-size: clamp(20px, 3vw, 28px); letter-spacing: .06em; color: #fff; text-transform: uppercase; }
.journey__next { margin: 6px 0 18px; font-size: 15px; color: #ffe39a; }
.journey__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 14px 10px; }
.jitem { position: relative; }
.jitem button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 4px 0; border: 0; background: none; cursor: pointer; color: var(--soft); }
.jitem__orb { position: relative; width: min(64px, 100%); aspect-ratio: 1; border-radius: 50%; }
.jitem__orb img { width: 100%; height: 100%; object-fit: contain; filter: grayscale(.85) brightness(.55); transition: filter .4s ease, transform .3s var(--spring); }
.jitem__num { position: absolute; top: -4px; left: -4px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-family: var(--f-title); font-size: 11px; color: #fff; background: #1b2470; border: 1.5px solid rgba(180, 210, 255, .7); }
.jitem__check { position: absolute; right: -4px; bottom: -2px; width: 24px; height: 24px; color: #2a1700; opacity: 0; transform: scale(0); transition: transform .5s var(--spring), opacity .3s ease; }
.jitem__name { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2; text-align: center; }
.jitem.is-found .jitem__orb img { filter: none; }
.jitem.is-found .jitem__num { color: #2a1700; background: var(--gold-chrome); border-color: #fff3c0; }
.jitem.is-found .jitem__check { opacity: 1; transform: scale(1); }
.jitem.is-found .jitem__name { color: #ffe39a; }
.jitem button:hover .jitem__orb img, .jitem button:focus-visible .jitem__orb img { filter: none; transform: scale(1.1); }
.jitem.is-new .jitem__orb { animation: justFound 1.2s var(--spring); }
@keyframes justFound { 30% { transform: scale(1.35); filter: drop-shadow(0 0 16px #ffd36a); } }
.journey__reset { margin-top: 18px; padding: 8px 14px; border: 0; background: none; cursor: pointer; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: rgba(200, 215, 255, .5); text-decoration: underline; text-underline-offset: 3px; }
.journey__reset:hover { color: #fff; }

/* ---------- rewards ---------- */
.portal-modal__medal { display: none; width: min(150px, 40vw); margin: -96px auto 0; filter: drop-shadow(0 0 26px rgba(255, 190, 60, .85)); animation: medalIn 1s var(--spring); }
.portal-modal.is-reward .portal-modal__medal { display: block; }
.portal-modal.is-reward .portal-modal__orb, .portal-modal.is-reward .portal-modal__soon { display: none; }
.portal-modal.is-reward .portal-modal__title { background: var(--gold-chrome); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 10px rgba(255, 190, 60, .7)); }
@keyframes medalIn { from { transform: scale(.2) rotate(-30deg); opacity: 0; } }
.stage.is-complete .corona { background: radial-gradient(circle, rgba(255, 210, 110, .38), rgba(255, 170, 60, .14) 38%, transparent 64%); }

@media (max-width: 760px) { .journey__list { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) {
  .journey { padding: 22px 12px 18px; }
  .jitem__name { font-size: 9.5px; letter-spacing: .03em; }
  .progress__rank { font-size: 12px; }
}

/* beams of light layer on the globe; blue nebula wisps behind it (like the reference) */
.globe .globe__beams { pointer-events: none; }
.corona {
  width: calc(var(--globe, 400px) * 3.2);
  background:
    radial-gradient(ellipse 34% 22% at 18% 46%, rgba(70, 130, 255, .22), transparent 70%),
    radial-gradient(ellipse 30% 26% at 82% 52%, rgba(70, 130, 255, .2), transparent 70%),
    radial-gradient(ellipse 22% 30% at 70% 22%, rgba(120, 170, 255, .14), transparent 70%),
    radial-gradient(circle, rgba(60, 110, 255, .2), transparent 42%);
  filter: blur(6px);
}

/* back to the front page */
.home {
  position: fixed; z-index: 90; top: max(14px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left));
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #dff3ff;
  background: radial-gradient(circle at 50% 30%, rgba(60, 80, 170, .92), rgba(8, 10, 40, .94));
  border: 1.5px solid rgba(140, 210, 255, .75); box-shadow: 0 0 16px rgba(63, 182, 255, .55), inset 0 0 10px rgba(63, 182, 255, .4);
  transition: transform .2s var(--ease);
}
.home:hover { transform: scale(1.06); }
.home svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.globe .globe__beams { position: absolute; inset: 0; width: 100%; height: 100%; }

@media (max-width: 760px) { .nebula { background: radial-gradient(ellipse 50% 45% at 50% 50%, rgba(0, 0, 0, .35), transparent 80%), url("../img/space-sm.jpg") center / cover no-repeat, #000; } }
