:root {
  --night: #0d0b2a;
  --dusk: #1d1250;
  --ink: #f6f1ff;
  --muted: #b9b0dc;
  --gold: #ffd166;
  --gold-soft: #fff4c2;
  --card: rgba(255, 255, 255, 0.06);
  --card-edge: rgba(255, 255, 255, 0.14);
  --display: 'Fraunces', Georgia, serif;
  --body: 'Nunito', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--night); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 16px/1.5 var(--body);
  background: radial-gradient(120% 80% at 50% 0%, var(--dusk) 0%, var(--night) 60%) fixed;
  overflow-x: hidden;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 16px 32px;
}

.hero { text-align: center; }

.north-star {
  width: 132px;
  height: 132px;
  filter: drop-shadow(0 0 24px rgba(255, 209, 102, 0.55));
  animation: twinkle 4.8s ease-in-out infinite, spin 60s linear infinite;
}

@keyframes twinkle {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.88; }
}

@keyframes spin { to { rotate: 360deg; } }

h1 {
  margin: 8px 0 6px;
  font-family: var(--display);
  font-variation-settings: 'SOFT' 100, 'WONK' 1;
  font-weight: 800;
  font-style: italic;
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--gold-soft);
  text-shadow: 0 0 28px rgba(255, 209, 102, 0.35);
}

.sub {
  margin: 0 auto;
  max-width: 34ch;
  color: var(--muted);
  font-size: 1.1rem;
}

.label {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.team { margin: 40px auto 48px; max-width: 720px; }

.marquee {
  position: relative;
  padding: 28px 24px 24px;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 209, 102, 0.12), rgba(255, 126, 182, 0.08));
  border: 2px solid rgba(255, 209, 102, 0.5);
  text-align: center;
}

.marquee::before {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 22px;
  border: 3px dotted var(--gold);
  opacity: 0.75;
  animation: bulbs 1.2s steps(2) infinite;
  pointer-events: none;
}

@keyframes bulbs { 50% { opacity: 0.3; } }

.star-name {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 100;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 4px 0 0;
}

.team .meter { justify-content: center; }
.team .tasks { text-align: left; max-width: 420px; margin-inline: auto; }

.campers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 24px;
  align-items: start;
}

.camper {
  --c: var(--gold);
  position: relative;
  padding: 24px 20px 20px;
  border-radius: 26px;
  background: var(--card);
  border: 1px solid var(--card-edge);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 18px 40px -18px var(--c);
  transition: transform 0.25s ease;
}

.camper:nth-child(3n + 1) { rotate: -0.8deg; }
.camper:nth-child(3n + 2) { rotate: 0.6deg; }
.camper:nth-child(3n + 3) { rotate: -0.3deg; }
.camper:hover { transform: translateY(-4px); }

.camper-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

.mascot {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 45%, transparent), transparent 70%);
  font-size: 2.3rem;
  cursor: pointer;
  animation: bop 1.6s ease-in-out infinite;
}

.camper:nth-child(2) .mascot { animation-delay: -0.53s; }
.camper:nth-child(3) .mascot { animation-delay: -1.06s; }

@keyframes bop {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-5px) rotate(4deg); }
}

.camper h2 {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: 'SOFT' 100, 'WONK' 1;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--c);
}

.star-line {
  margin: 0 0 18px;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.35;
}

.why { margin: -10px 0 18px; color: var(--muted); font-size: 0.95rem; }

.goal {
  margin-top: 12px;
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.goal-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.goal-name { margin: 0; font-weight: 800; line-height: 1.3; }
.measure { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.target { color: var(--muted); font-size: 0.85rem; }

.chip {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.chip.done { background: var(--gold); color: var(--night); }

.meter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  column-gap: 8px;
  row-gap: 2px;
  margin: 10px 0 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.meter > span { white-space: nowrap; }

.stars { display: inline-flex; gap: 2px; font-size: 1rem; letter-spacing: 0; }
.stars .on { color: var(--c, var(--gold)); text-shadow: 0 0 8px var(--c, var(--gold)); }
.stars .off { color: rgba(255, 255, 255, 0.2); }

.tasks { list-style: none; margin: 8px 0 0; padding: 0; }

.tasks li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 4px 0;
  font-size: 0.95rem;
}

.tasks .mark { flex: none; width: 1.1em; text-align: center; color: rgba(255, 255, 255, 0.35); }
.tasks .Done .mark { color: var(--c, var(--gold)); text-shadow: 0 0 10px var(--c, var(--gold)); }
.tasks .Done .task-name { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.3); }
.tasks .Doing .mark { color: var(--c, var(--gold)); animation: pulse 1.4s ease-in-out infinite; }
.tasks .due { margin-left: auto; flex: none; color: var(--muted); font-size: 0.8rem; }

@keyframes pulse { 50% { opacity: 0.35; } }

.empty { margin: 8px 0 0; color: var(--muted); font-style: italic; font-size: 0.92rem; }

.note {
  position: fixed;
  pointer-events: none;
  font-size: 1.4rem;
  z-index: 5;
  animation: float-up 1.1s ease-out forwards;
}

@keyframes float-up {
  to { transform: translate(var(--dx), -90px) rotate(var(--r)); opacity: 0; }
}

.status { text-align: center; color: var(--muted); font-style: italic; }

footer {
  margin-top: 56px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

footer p { margin: 4px 0; }
.updated { font-size: 0.8rem; opacity: 0.75; }

@media (max-width: 600px) {
  main { padding-top: 32px; }
  .north-star { width: 104px; height: 104px; }
  .camper { rotate: 0deg !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}

.tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.tier {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--card-edge);
}

.tier p { margin: 0; }
.tier-label { margin-bottom: 4px !important; font-weight: 800; font-size: 0.85rem; letter-spacing: 0.04em; }
.tier.park { border-color: rgba(255, 209, 102, 0.55); }
.tier.park .tier-label { color: var(--gold); }
.tier.middle .tier-label { color: var(--ink); }
.tier.miss { opacity: 0.8; }
.tier.miss .tier-label { color: var(--muted); }

.ramps, .scoreboard { margin: 0 auto 48px; max-width: 1080px; }

.ramp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.ramp-grid .goal { margin-top: 0; background: var(--card); border-color: var(--card-edge); }

.chart-card {
  position: relative;
  padding: 16px 16px 12px;
  border-radius: 22px;
  background: rgba(20, 16, 47, 0.85);
  border: 1px solid var(--card-edge);
}

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 8px; font-size: 0.92rem; color: var(--muted); }
.legend strong { color: var(--ink); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }

.chart { position: relative; outline: none; }
.chart:focus-visible { box-shadow: 0 0 0 2px var(--gold); border-radius: 8px; }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart .grid { stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; }
.chart .axis { stroke: rgba(255, 255, 255, 0.25); stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 600 11px var(--body); }
.chart .series { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .end-dot, .chart .hover-dot { fill: currentColor; stroke: #14102f; stroke-width: 2; }
.chart .hair { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1; }

.tip {
  position: absolute;
  top: 6px;
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #241b55;
  border: 1px solid var(--card-edge);
  font-size: 0.85rem;
  pointer-events: none;
}

.tip p { margin: 2px 0; display: flex; align-items: center; gap: 6px; }
.tip-day { color: var(--muted); font-size: 0.78rem; }
.tip .gain { color: var(--muted); }

.table-view { margin-top: 8px; color: var(--muted); font-size: 0.85rem; }
.table-view summary { cursor: pointer; }
.table-view table { width: 100%; margin-top: 6px; border-collapse: collapse; }
.table-view th, .table-view td { padding: 4px 6px; text-align: right; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.table-view th:first-child, .table-view td:first-child { text-align: left; }

.game {
  margin: -4px 0 18px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
}

.level-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 0.92rem; }
.level { font-weight: 800; }
.star-count { color: var(--gold-soft); font-weight: 800; }
.streak { color: #ffb27a; font-weight: 700; }
.crown { margin-left: auto; font-size: 1.2rem; animation: bop 1.6s ease-in-out infinite; }

.xp { height: 8px; margin: 10px 0 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.xp-fill { display: block; height: 100%; min-width: 4px; border-radius: 999px; background: var(--c); transition: width 0.6s ease; }
.next { margin: 0; color: var(--muted); font-size: 0.82rem; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  font-size: 1rem;
  filter: grayscale(1);
  opacity: 0.35;
}
.badge.got { filter: none; opacity: 1; background: color-mix(in srgb, var(--c) 30%, transparent); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 50%, transparent); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.tasks .worth { flex: none; color: var(--gold); font-size: 0.78rem; font-weight: 800; }

.team-goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; margin-top: 24px; }
.team-goals:empty { display: none; }

.paths { margin: 0 auto 48px; max-width: 760px; }

.path {
  padding: 22px 20px 18px;
  border-radius: 26px;
  background: var(--card);
  border: 1px solid var(--card-edge);
}

.path + .path { margin-top: 20px; }
.path-head { display: flex; gap: 14px; align-items: flex-start; }
.path-name { margin: 0; font-family: var(--display); font-variation-settings: 'SOFT' 100; font-size: 1.35rem; font-weight: 700; line-height: 1.25; }
.crew { display: flex; flex: none; }
.crew-mate {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border-radius: 50%;
  font-size: 1.5rem;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 55%, transparent), color-mix(in srgb, var(--c) 15%, #14102f) 70%);
  border: 2px solid #14102f;
}
.crew-mate:last-child { margin-right: 6px; }

.road { position: relative; list-style: none; margin: 18px 0 8px; padding: 0; }
.road::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 18px;
  bottom: 18px;
  border-left: 3px dashed rgba(255, 255, 255, 0.18);
}

.station { position: relative; display: flex; gap: 14px; padding: 0 0 18px; }
.station:last-child { padding-bottom: 0; }

.stop {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: none;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.9rem;
  background: #1b1545;
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: var(--muted);
}

.station.done .stop { background: var(--c); border-color: var(--c); color: #14102f; box-shadow: 0 0 14px var(--c); }
.station.here .stop { border-color: var(--c); color: var(--ink); animation: pulse-ring 1.8s ease-in-out infinite; }
.station.destination .stop { background: none; border: 0; font-size: 1.5rem; }

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

.station-body { min-width: 0; flex: 1; padding-top: 6px; }
.station-name { margin: 0; font-weight: 700; line-height: 1.35; }
.station.done .station-name { color: var(--muted); }
.station.destination .station-name { font-family: var(--display); font-style: italic; color: var(--gold-soft); }
.station-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 0; font-size: 0.85rem; }
.owner { color: var(--c); font-weight: 800; }
.here-flag { margin: 0 0 2px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }

.exit {
  position: relative;
  margin: 10px 0 2px 18px;
  padding: 8px 12px 9px;
  border-radius: 14px;
  background: rgba(34, 163, 131, 0.12);
  border: 1px solid rgba(34, 163, 131, 0.45);
  font-size: 0.9rem;
}

.exit::before {
  content: '';
  position: absolute;
  left: -40px;
  top: -14px;
  width: 38px;
  height: 30px;
  border-left: 3px solid rgba(34, 163, 131, 0.55);
  border-bottom: 3px solid rgba(34, 163, 131, 0.55);
  border-bottom-left-radius: 18px;
}

.exit p { margin: 0; }
.exit-label { margin-bottom: 2px !important; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #6fd8b9; }
.station.destination .exit-label { color: var(--gold); }
.path .tiers { margin-top: 16px; }
