:root {
  color-scheme: dark;
  --bg: #08131f;
  --bg-2: #111f30;
  --card: rgba(15, 29, 45, 0.86);
  --card-strong: rgba(19, 36, 56, 0.97);
  --text: #f6fbff;
  --muted: #bdd0df;
  --line: rgba(255, 255, 255, 0.14);
  --gold: #ffcb3d;
  --pink: #ff5dab;
  --friend-white: #ffffff;
  --friend-pink: #ff5dab;
  --friend-yellow: #ffcb3d;
  --friend-blue: #8eeaff;
  --friend-green: #67f291;
  --friend-red: #ff4b5f;
  --friend-trail: linear-gradient(90deg, rgba(255,255,255,.72), rgba(142,234,255,.68), rgba(255,203,61,.58), rgba(103,242,145,.48));
  --soft-trail: linear-gradient(90deg, transparent, rgba(142,234,255,.52), rgba(255,203,61,.34), transparent);
  --cyan: var(--friend-blue);
  --green: #67f291;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --radius: 24px;
  --shell: min(1160px, calc(100% - 32px));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8ff;
  --bg-2: #eaf1ff;
  --card: rgba(255, 255, 255, 0.86);
  --card-strong: #ffffff;
  --text: #102034;
  --muted: #53647e;
  --line: rgba(16, 32, 52, 0.14);
  --shadow: 0 22px 70px rgba(61, 90, 130, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -6%, rgba(255,255,255,.11), transparent 25rem),
    radial-gradient(circle at 86% 2%, rgba(255,93,171,.11), transparent 28rem),
    radial-gradient(circle at 54% 12%, rgba(255,203,61,.08), transparent 30rem),
    radial-gradient(circle at 14% 72%, rgba(142,234,255,.09), transparent 29rem),
    radial-gradient(circle at 90% 72%, rgba(103,242,145,.065), transparent 27rem),
    linear-gradient(140deg, var(--bg), var(--bg-2));
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(142,234,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(142,234,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 18px, rgba(255,203,61,.04) 18px 19px, transparent 19px 44px),
    linear-gradient(0deg, transparent 0 26px, rgba(255,255,255,.026) 26px 27px, transparent 27px 58px);
  opacity: .22;
  mix-blend-mode: screen;
}

img, canvas, svg { max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button, .button, .text-button { min-width: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(255,203,61,.78);
  outline-offset: 3px;
}
.skip-link, .sr-only { position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 9999; width: auto; height: auto; padding: .75rem 1rem; border-radius: 999px; background: var(--gold); color: #1c1600; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem;
  width: var(--shell);
  margin: 0 auto;
  padding: .74rem 0;
  isolation: isolate;
  backdrop-filter: blur(18px);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: .32rem -.85rem;
  z-index: -1;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.1), transparent 38%),
    rgba(7,17,31,.7);
  box-shadow: 0 18px 48px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .68rem;
  min-width: 0;
  text-decoration: none;
}
.brand img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  padding: .18rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  filter: drop-shadow(0 12px 22px rgba(0,0,0,.24));
}
.brand strong { display: block; letter-spacing: .1em; line-height: 1; }
.brand small { color: var(--muted); letter-spacing: .14em; }

.site-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  justify-self: center;
  min-width: 0;
  gap: .22rem;
  padding: .33rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 12, 23, 0.46);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 12px 28px rgba(0,0,0,.14);
}
.site-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: .58rem .78rem;
  border-radius: 999px;
  font-weight: 850;
  font-size: .9rem;
  line-height: 1;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.site-nav a:hover, .site-nav a:focus-visible, .site-nav a.active {
  color: var(--text);
  background: rgba(255,255,255,.1);
  outline: none;
  transform: translateY(-1px);
}
.site-nav a[aria-current="true"] {
  color: #201606;
  background: linear-gradient(135deg, #ffe27a, var(--gold));
  box-shadow: 0 8px 18px rgba(255,203,61,.24);
}
.header-actions { display: flex; align-items: center; justify-self: end; gap: .5rem; min-width: 0; }
.nav-toggle { display: none; }
.icon-button, .passport-chip {
  border: 1px solid var(--line);
  background: rgba(15, 29, 45, 0.82);
  color: var(--text);
  border-radius: 999px;
  padding: .6rem .8rem;
  box-shadow: 0 10px 28px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.06);
}
.icon-button, .nav-toggle { width: 44px; height: 44px; padding: 0; place-items: center; }
.icon-button { display: inline-grid; }
.passport-chip { display: flex; align-items: center; gap: .45rem; max-width: 12.5rem; }
.passport-chip b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.passport-chip small { color: var(--muted); }
.nav-icon, .theme-icon { display: block; position: relative; }
.nav-icon, .nav-icon::before, .nav-icon::after { width: 20px; height: 2px; border-radius: 999px; background: currentColor; }
.nav-icon::before, .nav-icon::after { content: ""; position: absolute; left: 0; }
.nav-icon::before { top: -6px; }
.nav-icon::after { top: 6px; }
[data-nav-toggle][aria-expanded="true"] .nav-icon { background: transparent; }
[data-nav-toggle][aria-expanded="true"] .nav-icon::before { top: 0; transform: rotate(45deg); }
[data-nav-toggle][aria-expanded="true"] .nav-icon::after { top: 0; transform: rotate(-45deg); }
.theme-icon { width: 20px; height: 20px; border-radius: 999px; background: var(--gold); box-shadow: 0 0 0 5px rgba(255,203,61,.18); }
html[data-theme="light"] .theme-icon { background: #24344d; box-shadow: inset -7px -3px 0 #f6f8ff, 0 0 0 5px rgba(36,52,77,.12); }
html[data-theme="light"] .site-header::before {
  border-color: rgba(16,32,52,.12);
  background:
    linear-gradient(135deg, rgba(255,255,255,.82), rgba(255,255,255,.5) 38%, rgba(255,255,255,.72)),
    rgba(255,255,255,.72);
}
html[data-theme="light"] .site-nav,
html[data-theme="light"] .icon-button,
html[data-theme="light"] .passport-chip {
  background: rgba(255,255,255,.74);
}

.section { width: var(--shell); margin: 0 auto; padding: 5.25rem 0; position: relative; }
.hero { min-height: calc(100vh - 80px); display: grid; grid-template-columns: 1.05fr .95fr; gap: 2rem; align-items: center; padding-top: 4rem; }
.eyebrow { color: var(--gold); letter-spacing: .15em; font-size: .78rem; font-weight: 950; text-transform: uppercase; margin: 0 0 .45rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(3.2rem, 9vw, 7.6rem); line-height: .9; margin-bottom: 1rem; letter-spacing: 0; }
h1 span { color: var(--friend-blue); text-shadow: 0 0 34px rgba(142,234,255,.18); }
h2 { font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1.02; letter-spacing: 0; margin-bottom: .65rem; }
h3 { font-size: 1.35rem; margin-bottom: .45rem; }
p { color: var(--muted); line-height: 1.65; }
.lede { font-size: clamp(1.05rem, 2vw, 1.35rem); max-width: 66ch; }
.motto { margin-top: 1rem; color: var(--text); font-weight: 850; }
.palette-whisper { display: none; }
.palette-whisper span {
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 38px;
  height: 10px;
  padding: 0;
  background: rgba(255,255,255,.22);
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.palette-whisper span:nth-child(1) { background: rgba(255,255,255,.86); }
.palette-whisper span:nth-child(2) { background: rgba(255,93,171,.78); }
.palette-whisper span:nth-child(3) { background: rgba(255,203,61,.82); }
.palette-whisper span:nth-child(4) { background: rgba(142,234,255,.72); }
.palette-whisper span:nth-child(5) { background: rgba(103,242,145,.76); }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.button, .text-button {
  border: 0;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 950;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 46px;
  padding: .8rem 1.05rem;
  transition: transform .2s ease, filter .2s ease, background .2s ease;
}
.button:hover, .text-button:hover { transform: translateY(-2px); filter: brightness(1.07); }
.button.primary { background: linear-gradient(135deg, var(--friend-yellow), var(--friend-pink)); color: #160b14; }
.button.honk { background: linear-gradient(135deg, var(--friend-white), var(--friend-yellow)); color: #211700; }
.button.ghost { background: rgba(255,255,255,.08); border: 1px solid var(--line); }
.button.danger { background: #ff4f6d; color: white; }
.text-button { background: transparent; color: var(--cyan); padding-left: 0; }

.hero-panel, .module-card, .activity-card, .mission-card, .passport-stat, .idea-list article {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.module-card, .activity-card, .sticker-card, .hunt-card { contain: layout paint; }
.hero-panel {
  min-height: 460px;
  padding: 1.1rem;
  background:
    linear-gradient(135deg, rgba(142,234,255,.07), rgba(255,255,255,.045), rgba(255,203,61,.045)),
    var(--card);
}
.hero-panel::after {
  content: "";
  position: absolute;
  inset: 3.2rem 1.1rem 1.1rem;
  pointer-events: none;
  border-radius: 20px;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(142,234,255,.12) 18% 18.4%, transparent 18.4% 48%, rgba(255,203,61,.1) 48% 48.4%, transparent 48.4%),
    linear-gradient(0deg, transparent 0 34%, rgba(255,255,255,.08) 34% 34.4%, transparent 34.4% 68%, rgba(103,242,145,.09) 68% 68.4%, transparent 68.4%);
  opacity: .34;
  mask-image: linear-gradient(to bottom, transparent, black 22%, transparent 88%);
}
.hero-panel > * { position: relative; z-index: 1; }
.hero-panel::before, .module-card::before, .mission-card::before, .passport-stat::before, .sticker-card::before, .hunt-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--soft-trail);
  opacity: .5;
}
.terminal-top { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .8rem; font-weight: 900; letter-spacing: .08em; }
.terminal-top span { width: 12px; height: 12px; border-radius: 999px; background: rgba(142,234,255,.32); border: 1px solid rgba(255,255,255,.12); display: inline-block; }
.terminal-top span:nth-child(3) { background: rgba(255,203,61,.34); }
.friend-signal { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; margin-top: 1rem; }
.friend-signal span {
  min-height: 9px;
  border-radius: 999px;
  background: rgba(142,234,255,.18);
  border: 1px solid rgba(142,234,255,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.friend-signal span:nth-child(3) { background: rgba(255,203,61,.2); border-color: rgba(255,203,61,.14); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: 2rem 0; }
.hero-stats div, .passport-stat { padding: 1rem; background: rgba(255,255,255,.065); border: 1px solid var(--line); border-radius: 18px; text-align: center; }
.hero-stats strong, .passport-stat b { font-size: 2.1rem; display: block; }
.hero-stats small, .passport-stat span, .progress-wrap span { color: var(--muted); font-weight: 800; text-transform: uppercase; font-size: .75rem; letter-spacing: .08em; }
.mission-card { padding: 1.3rem; background: rgba(255,255,255,.06); }
.quick-launch { display: grid; gap: .6rem; margin-top: 1rem; padding-right: 3.5rem; }
.quick-launch .eyebrow { margin-bottom: 0; }
.quick-link {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: .7rem;
  min-height: 58px;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  text-decoration: none;
}
.quick-link:hover, .quick-link:focus-visible { background: rgba(255,255,255,.1); outline: none; }
.quick-link .quick-icon { font-size: 1.45rem; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,.08); }
.quick-link b { color: var(--text); display: block; }
.quick-link small { color: var(--muted); display: block; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.quick-link .quick-arrow { color: var(--cyan); font-weight: 950; }
.token { border: 2px solid rgba(255,255,255,.25); background: linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,.05)); color: var(--text); border-radius: 999px; width: 52px; height: 52px; display: inline-grid; place-items: center; font-size: 1.45rem; position: absolute; box-shadow: 0 16px 30px rgba(0,0,0,.25); }
.token span { font-size: .75rem; position: absolute; bottom: -2px; right: 3px; background: var(--pink); color: white; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 999px; }
.token.found { opacity: .48; filter: grayscale(.3); }
.hero-token { right: 1.35rem; bottom: 1.35rem; }
.small-token { right: 1rem; bottom: 1rem; width: 42px; height: 42px; font-size: 1.1rem; }
.footer-token { position: static; margin-bottom: 1rem; }

.passport-strip {
  width: var(--shell);
  margin: -2rem auto 1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr)) 2fr;
  gap: .8rem;
  align-items: stretch;
}
.progress-wrap { padding: 1rem; border: 1px solid var(--line); background: var(--card); border-radius: 18px; }
progress { width: 100%; height: 16px; accent-color: var(--gold); }

.quest-section { padding-top: 3rem; }
.quest-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .85fr) minmax(220px, .65fr);
  gap: 1rem;
  align-items: stretch;
}
.daily-board, .play-next-card, .comeback-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 1.15rem;
  position: relative;
  overflow: hidden;
}
.daily-board::before, .play-next-card::before, .comeback-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,.13), transparent 36%),
    radial-gradient(circle at 88% 18%, rgba(255,203,61,.16), transparent 9rem);
}
.daily-board > *, .play-next-card > *, .comeback-card > * { position: relative; z-index: 1; }
.daily-board-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.daily-board-top h3, .play-next-card h3 { font-size: 1.45rem; margin-bottom: .25rem; }
.daily-board-top > span {
  border: 1px solid rgba(255,203,61,.28);
  border-radius: 999px;
  background: rgba(255,203,61,.12);
  color: var(--friend-yellow);
  font-weight: 950;
  padding: .42rem .65rem;
  white-space: nowrap;
}
.quest-list { display: grid; gap: .75rem; }
.quest-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: .75rem;
  align-items: center;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  padding: .75rem;
}
.quest-row.complete {
  border-color: rgba(103,242,145,.5);
  background: linear-gradient(135deg, rgba(103,242,145,.16), rgba(255,255,255,.055));
}
.quest-check {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.08);
  color: var(--friend-green);
  font-weight: 950;
  font-size: 1.35rem;
}
.quest-row b { display: block; color: var(--text); margin-bottom: .2rem; }
.quest-row small { display: block; color: var(--muted); font-weight: 850; margin-bottom: .35rem; }
.quest-row progress { height: 11px; display: block; }
.play-next-card {
  display: grid;
  align-content: space-between;
  gap: .85rem;
  background:
    linear-gradient(150deg, rgba(142,234,255,.13), rgba(255,93,171,.09), rgba(255,203,61,.1)),
    var(--card);
}
.play-next-card .button { justify-self: start; }
.comeback-card {
  display: grid;
  align-content: center;
  gap: .6rem;
  background:
    linear-gradient(150deg, rgba(103,242,145,.15), rgba(142,234,255,.08), rgba(255,255,255,.045)),
    var(--card);
}
.comeback-card strong {
  display: block;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: .95;
  color: var(--friend-green);
  letter-spacing: 0;
}

.legends-section { padding-top: 4.2rem; }
.legends-grid {
  display: grid;
  grid-template-columns: 1.08fr 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}
.global-honk-card, .legend-card, .legend-sign-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 1.15rem;
  position: relative;
  overflow: hidden;
}
.global-honk-card::before, .legend-card::before, .legend-sign-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.11), transparent 38%, rgba(57,215,255,.08));
}
.global-honk-card {
  min-height: 360px;
  grid-row: span 2;
  display: grid;
  align-content: center;
  gap: 1rem;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.22), transparent 9rem),
    radial-gradient(circle at 84% 26%, rgba(255,93,171,.2), transparent 10rem),
    linear-gradient(150deg, rgba(255,203,61,.18), rgba(14,31,56,.86) 52%, rgba(57,215,255,.12));
}
.global-honk-card strong {
  display: block;
  font-size: clamp(3.25rem, 8vw, 6.2rem);
  line-height: .92;
  letter-spacing: 0;
  color: var(--friend-yellow);
  text-shadow: 0 14px 42px rgba(255,203,61,.22);
  overflow-wrap: anywhere;
}
.global-honk-card span { color: var(--muted); font-weight: 900; }
.global-honk-card .button { justify-self: start; }
.global-stat-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}
.global-stat-grid span {
  display: grid;
  gap: .12rem;
  padding: .55rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.065);
}
.global-stat-grid b {
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
}
.global-stat-grid small {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}
.top-games {
  position: relative;
  z-index: 1;
  display: grid;
  gap: .45rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,.16);
}
.top-games > span {
  color: var(--gold);
  font-size: .76rem;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.top-games ol {
  display: grid;
  gap: .35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.top-games li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: center;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 850;
}
.top-games b {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-games small {
  color: var(--gold);
  font-weight: 950;
  white-space: nowrap;
}
.legend-card-title {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .85rem;
}
.legend-card-title h3 { margin: .1rem 0 0; font-size: 1.35rem; }
.legend-card-title > span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem .55rem;
  color: var(--muted);
  background: rgba(255,255,255,.06);
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}
.legend-list {
  position: relative;
  z-index: 1;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .55rem;
}
.legend-row {
  --legend-color: var(--friend-white);
  --legend-soft: rgba(255,255,255,.08);
  min-height: 56px;
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: .65rem;
  border: 1px solid color-mix(in srgb, var(--legend-color) 35%, transparent);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--legend-soft), rgba(255,255,255,.045));
  padding: .7rem;
}
.legend-row b { display: block; overflow-wrap: anywhere; }
.legend-row small { display: block; color: var(--muted); font-weight: 850; margin-top: .1rem; }
.legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--legend-color);
  box-shadow: 0 0 22px color-mix(in srgb, var(--legend-color) 55%, transparent);
}
.legend-white { --legend-color: var(--friend-white); --legend-soft: rgba(255,255,255,.12); }
.legend-pink { --legend-color: var(--friend-pink); --legend-soft: rgba(255,93,171,.14); }
.legend-yellow { --legend-color: var(--friend-yellow); --legend-soft: rgba(255,203,61,.14); }
.legend-blue { --legend-color: var(--friend-blue); --legend-soft: rgba(142,234,255,.13); }
.legend-green { --legend-color: var(--friend-green); --legend-soft: rgba(103,242,145,.13); }
.legend-red { --legend-color: var(--friend-red); --legend-soft: rgba(255,75,95,.14); }
.legend-empty { color: var(--muted); font-weight: 850; padding: .8rem; border: 1px dashed var(--line); border-radius: 16px; }
.legend-sign-card { grid-column: span 2; }
.legend-progress {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .7rem;
  margin-bottom: .8rem;
}
.legend-progress div {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  padding: .85rem;
}
.legend-progress span { color: var(--muted); font-size: .78rem; font-weight: 950; text-transform: uppercase; letter-spacing: .08em; }
.legend-progress b { display: block; margin-top: .15rem; font-size: 1.45rem; }
.legend-progress.complete div { border-color: rgba(103,242,145,.55); background: rgba(103,242,145,.12); }
.legend-eligibility {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-weight: 850;
  margin: 0 0 .85rem;
}
.legend-sign-form {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: .9rem;
}
.legend-sign-card .button { position: relative; z-index: 1; }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.section-heading { max-width: 760px; margin-bottom: 1.5rem; }
.section-heading::after {
  content: "";
  display: block;
  width: min(320px, 70%);
  height: 5px;
  margin-top: 1rem;
  border-radius: 999px;
  background: var(--soft-trail);
  box-shadow: 0 0 28px rgba(142,234,255,.14);
}
.themed-section { padding-left: max(0px, calc((100vw - var(--shell)) / 2)); padding-right: max(0px, calc((100vw - var(--shell)) / 2)); width: 100%; background: rgba(255,255,255,.035); border-block: 1px solid var(--line); }
.themed-section { background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(142,234,255,.03), rgba(255,203,61,.025)); }
.themed-section > * { width: var(--shell); margin-left: auto; margin-right: auto; }
.activity-tools { display: grid; grid-template-columns: minmax(220px, 320px) 1fr auto; gap: .75rem; align-items: center; margin-bottom: 1.1rem; }
.activity-search input { min-height: 48px; border-radius: 999px; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; }
.filter { border: 1px solid var(--line); border-radius: 999px; padding: .65rem .95rem; background: rgba(255,255,255,.06); color: var(--muted); font-weight: 900; }
.filter.active, .filter[aria-pressed="true"] { background: var(--gold); color: #201606; }
.result-count { margin: 0; color: var(--muted); font-weight: 900; white-space: nowrap; }
.activity-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.activity-card {
  --vibe-accent: var(--friend-white);
  --vibe-ink: #102034;
  --vibe-glow: rgba(255,255,255,.095);
  --vibe-border: rgba(255,255,255,.24);
  --vibe-ring: rgba(255,255,255,.34);
  padding: 1.1rem;
  text-decoration: none;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  border-color: var(--vibe-border);
  background: linear-gradient(145deg, var(--vibe-glow), rgba(255,255,255,.055), var(--card));
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.activity-card::before { background: var(--vibe-accent); opacity: .42; height: 2px; }
.activity-card.vibe-goose { --vibe-accent: var(--friend-white); --vibe-ink: #102034; --vibe-glow: rgba(255,255,255,.105); --vibe-border: rgba(255,255,255,.3); --vibe-ring: rgba(255,255,255,.38); }
.activity-card.vibe-sweet { --vibe-accent: var(--friend-pink); --vibe-ink: #210817; --vibe-glow: rgba(255,93,171,.13); --vibe-border: rgba(255,93,171,.28); --vibe-ring: rgba(255,93,171,.38); }
.activity-card.vibe-crumb { --vibe-accent: var(--friend-yellow); --vibe-ink: #201606; --vibe-glow: rgba(255,203,61,.13); --vibe-border: rgba(255,203,61,.3); --vibe-ring: rgba(255,203,61,.38); }
.activity-card.vibe-silly-blue { --vibe-accent: var(--friend-blue); --vibe-ink: #062035; --vibe-glow: rgba(142,234,255,.11); --vibe-border: rgba(142,234,255,.26); --vibe-ring: rgba(142,234,255,.32); }
.activity-card.vibe-spark { --vibe-accent: var(--friend-pink); --vibe-ink: #210817; --vibe-glow: rgba(255,93,171,.1); --vibe-border: rgba(255,93,171,.24); --vibe-ring: rgba(255,93,171,.3); }
.activity-card.vibe-pond { --vibe-accent: var(--friend-green); --vibe-ink: #082514; --vibe-glow: rgba(103,242,145,.09); --vibe-border: rgba(103,242,145,.24); --vibe-ring: rgba(103,242,145,.3); }
.activity-card.vibe-sky { --vibe-accent: var(--friend-blue); --vibe-ink: #082239; --vibe-glow: rgba(142,234,255,.1); --vibe-border: rgba(142,234,255,.25); --vibe-ring: rgba(142,234,255,.31); }
.activity-card.vibe-maker { --vibe-accent: var(--friend-pink); --vibe-ink: #2a0a1c; --vibe-glow: rgba(255,93,171,.1); --vibe-border: rgba(255,93,171,.25); --vibe-ring: rgba(255,93,171,.32); }
.activity-card.vibe-keen { --vibe-accent: var(--friend-green); --vibe-ink: #052314; --vibe-glow: rgba(103,242,145,.12); --vibe-border: rgba(103,242,145,.28); --vibe-ring: rgba(103,242,145,.36); }
.activity-card:hover {
  transform: translateY(-5px);
  border-color: var(--vibe-accent);
  box-shadow: 0 30px 90px rgba(0,0,0,.42), 0 0 0 1px var(--vibe-ring);
}
.activity-card .icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--vibe-border);
  border-radius: 16px;
  background: rgba(255,255,255,.07);
  font-size: 2.15rem;
}
.activity-card .category { align-self: flex-start; font-size: .75rem; font-weight: 950; text-transform: uppercase; letter-spacing: .1em; color: var(--vibe-ink); background: var(--vibe-accent); padding: .28rem .5rem; border-radius: 999px; }
.activity-card .open { margin-top: auto; color: var(--vibe-accent); font-weight: 950; }
.empty-state { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: 20px; padding: 1.4rem; color: var(--muted); background: rgba(255,255,255,.045); font-weight: 850; }

.module-grid { display: grid; gap: 1rem; }
.module-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.module-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wide-card { grid-column: 1 / -1; }
.module-card { padding: 1.15rem; min-height: 260px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.module-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.24); box-shadow: 0 30px 90px rgba(0,0,0,.42); }
.module-title { display: flex; align-items: flex-start; gap: .8rem; margin-bottom: .8rem; }
.module-title > span { font-size: 2rem; width: 52px; height: 52px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(255,255,255,.16), rgba(255,93,171,.12), rgba(255,203,61,.14)); border: 1px solid var(--line); border-radius: 16px; flex: 0 0 auto; }
.module-title b { margin-left: auto; color: var(--gold); white-space: nowrap; }
.play-field, .reactor, .chorus-panel, .sort-panel, .treasure-panel, .stack-panel, .pond-panel, .cloud-panel, .nameplate-preview, .story-output, .bot-output, .maze-wrap { min-height: 220px; border: 1px solid var(--line); border-radius: 20px; background: rgba(0,0,0,.18); margin: 1rem 0; position: relative; overflow: hidden; }
.crumb-field { height: 260px; }
.bubble-field {
  height: 260px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.22), transparent 8rem),
    radial-gradient(circle at 76% 24%, rgba(255,93,171,.2), transparent 9rem),
    radial-gradient(circle at 78% 76%, rgba(255,203,61,.18), transparent 10rem),
    rgba(0,0,0,.18);
}
.moving-target { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; border: 0; border-radius: 999px; background: var(--gold); box-shadow: 0 0 30px rgba(255,203,61,.35); font-size: 1.7rem; transform: translate(-50%, -50%); z-index: 2; }
.bubble-target {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 999px;
  background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.95), rgba(255,93,171,.28) 42%, rgba(255,203,61,.35));
  box-shadow: 0 0 28px rgba(255,93,171,.32), inset 0 -10px 20px rgba(255,255,255,.2);
  font-size: 1.6rem;
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: filter .12s ease;
}
.bubble-target.pop {
  animation: bubble-target-pop .18s ease-out both;
  filter: brightness(1.2) saturate(1.35);
}
.bubble-pop-burst {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, rgba(255,255,255,.92) 0 9%, transparent 10%),
    radial-gradient(circle at 18% 24%, rgba(142,234,255,.9) 0 4px, transparent 5px),
    radial-gradient(circle at 80% 30%, rgba(255,203,61,.88) 0 5px, transparent 6px),
    radial-gradient(circle at 68% 82%, rgba(255,93,171,.84) 0 4px, transparent 5px),
    radial-gradient(circle at 28% 78%, rgba(255,255,255,.88) 0 3px, transparent 4px);
  border: 2px solid rgba(255,255,255,.72);
  box-shadow: 0 0 26px rgba(142,234,255,.45), 0 0 36px rgba(255,93,171,.25);
  animation: bubble-pop-burst .5s ease-out forwards;
}
.chorus-panel, .sort-panel, .treasure-panel, .stack-panel, .pond-panel, .cloud-panel, .groove-panel {
  padding: 1rem;
  display: grid;
  align-content: center;
  gap: .85rem;
  background:
    linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,93,171,.08), rgba(255,203,61,.08)),
    rgba(0,0,0,.18);
}
.chorus-watch, .sort-current {
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.065);
  color: var(--text);
  font-size: 1.45rem;
  font-weight: 950;
  text-align: center;
}
.sort-current span { display: block; font-size: 2.3rem; line-height: 1; }
.sort-current b { display: block; margin-top: .35rem; }
.chorus-pips {
  min-height: 58px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .45rem;
}
.chorus-pips span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  font-weight: 950;
}
.chorus-pips span.white { background: rgba(255,255,255,.92); color: #102034; }
.chorus-pips span.pink { background: rgba(255,93,171,.88); color: #210817; }
.chorus-pips span.yellow { background: rgba(255,203,61,.92); color: #201606; }
.chorus-pips span.blue { background: rgba(142,234,255,.9); color: #062035; }
.chorus-pips span.green { background: rgba(103,242,145,.9); color: #052314; }
.chorus-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: .65rem;
}
.sort-bins {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: .65rem;
}
.chorus-buttons button, .sort-bins button, .treasure-tile {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-weight: 950;
  min-height: 58px;
}
.chorus-buttons button span {
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 auto .35rem;
  border-radius: 999px;
}
.chorus-buttons [data-chorus-color="white"] span { background: var(--friend-white); }
.chorus-buttons [data-chorus-color="pink"] span { background: var(--friend-pink); }
.chorus-buttons [data-chorus-color="yellow"] span { background: var(--friend-yellow); }
.chorus-buttons [data-chorus-color="blue"] span { background: var(--friend-blue); }
.chorus-buttons [data-chorus-color="green"] span { background: var(--friend-green); }
.sort-bins button { display: grid; place-items: center; gap: .25rem; padding: .75rem; }
.sort-bins span { font-size: 1.7rem; }
.treasure-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .55rem;
}
.treasure-tile {
  min-height: 68px;
  font-size: 1.7rem;
  background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
}
.treasure-tile.open { background: rgba(255,255,255,.13); }
.treasure-tile.treasure { background: linear-gradient(145deg, rgba(255,255,255,.25), rgba(255,93,171,.18), rgba(255,203,61,.24)); border-color: rgba(255,203,61,.58); }
.treasure-tile:disabled { cursor: default; opacity: .9; }
.stack-panel { gap: .75rem; }
.stack-lane {
  position: relative;
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,93,171,.08), rgba(255,203,61,.08));
  overflow: hidden;
}
.stack-lane::before {
  content: "";
  position: absolute;
  left: 41%;
  right: 41%;
  top: 0;
  bottom: 0;
  background: rgba(255,203,61,.18);
  border-inline: 1px solid rgba(255,203,61,.36);
}
.stack-basket {
  position: absolute;
  left: 50%;
  bottom: .45rem;
  transform: translateX(-50%);
  font-size: 2rem;
  z-index: 1;
}
.stack-marker {
  position: absolute;
  left: 0%;
  top: .55rem;
  transform: translateX(-50%);
  font-size: 2rem;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.26));
}
.stack-tower {
  min-height: 66px;
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: center;
  align-content: flex-end;
  gap: .18rem;
}
.stack-tower span {
  display: inline-block;
  transform: translateX(var(--stack-offset));
  font-size: 1.55rem;
}
.pond-path {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .45rem;
}
.pond-path span {
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  font-weight: 950;
}
.pond-path span.safe { background: rgba(103,242,145,.22); border-color: rgba(103,242,145,.58); }
.pond-path span.splash { background: rgba(57,215,255,.16); border-color: rgba(57,215,255,.5); }
.pond-choices, .cloud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: .65rem;
}
.pond-choices button, .cloud-grid button {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-weight: 950;
}
.cloud-target {
  min-height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.07);
  font-weight: 950;
  color: var(--text);
  text-align: center;
}
.cloud-grid button { font-size: 2rem; }
.glide-field, .signal-panel, .comet-panel, .egg-panel {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(0,0,0,.18);
  margin: 1rem 0;
  position: relative;
  overflow: hidden;
}
.glide-field {
  height: 270px;
  touch-action: none;
  user-select: none;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.2), transparent 8rem),
    radial-gradient(circle at 78% 26%, rgba(103,242,145,.16), transparent 9rem),
    linear-gradient(180deg, rgba(142,234,255,.16), rgba(57,215,255,.08), rgba(255,203,61,.12)),
    rgba(0,0,0,.18);
}
.glide-field::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4.2rem;
  height: 1px;
  background: rgba(255,255,255,.18);
}
.glide-goose, .glide-crumb {
  position: absolute;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  z-index: 2;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.28));
}
.glide-goose {
  left: 50%;
  bottom: 1.1rem;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  font-size: 2rem;
}
.glide-crumb {
  left: 50%;
  top: 8%;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: rgba(255,203,61,.24);
  border: 1px solid rgba(255,203,61,.45);
  font-size: 1.55rem;
}
.signal-panel, .comet-panel, .egg-panel {
  display: grid;
  align-content: center;
  gap: .8rem;
  padding: 1rem;
  background:
    radial-gradient(circle at 18% 18%, rgba(103,242,145,.16), transparent 8rem),
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(103,242,145,.08), rgba(255,203,61,.08)),
    rgba(0,0,0,.18);
}
.signal-target {
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.075);
  padding: .75rem;
  color: var(--text);
}
.signal-target span { font-size: 2rem; }
.signal-target b { font-size: 1.2rem; }
.signal-target[data-signal="white"] { border-color: rgba(255,255,255,.42); background: rgba(255,255,255,.1); }
.signal-target[data-signal="pink"] { border-color: rgba(255,93,171,.42); background: rgba(255,93,171,.11); }
.signal-target[data-signal="yellow"] { border-color: rgba(255,203,61,.44); background: rgba(255,203,61,.12); }
.signal-target[data-signal="blue"] { border-color: rgba(142,234,255,.42); background: rgba(142,234,255,.11); }
.signal-target[data-signal="green"] { border-color: rgba(103,242,145,.45); background: rgba(103,242,145,.12); }
.signal-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: .65rem;
}
.signal-buttons button, .comet-cell {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-weight: 950;
}
.signal-buttons button span {
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 auto .35rem;
  border-radius: 999px;
}
.signal-buttons [data-signal-choice="white"] span { background: var(--friend-white); }
.signal-buttons [data-signal-choice="pink"] span { background: var(--friend-pink); }
.signal-buttons [data-signal-choice="yellow"] span { background: var(--friend-yellow); }
.signal-buttons [data-signal-choice="blue"] span { background: var(--friend-blue); }
.signal-buttons [data-signal-choice="green"] span { background: var(--friend-green); }
.signal-hud, .comet-hud { position: static; pointer-events: auto; justify-content: center; flex-wrap: wrap; }
.comet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .55rem;
}
.comet-cell {
  min-height: 58px;
  font-size: 1.45rem;
  color: rgba(255,255,255,.42);
}
.comet-cell.target {
  color: #201606;
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,.95), rgba(255,203,61,.74) 50%, rgba(103,242,145,.32)),
    rgba(255,203,61,.24);
  border-color: rgba(255,203,61,.72);
  box-shadow: 0 0 24px rgba(255,203,61,.28);
}
.egg-panel {
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.18), transparent 8rem),
    radial-gradient(circle at 82% 18%, rgba(255,203,61,.18), transparent 8rem),
    linear-gradient(180deg, rgba(142,234,255,.12), rgba(255,203,61,.09), rgba(255,93,171,.07)),
    rgba(0,0,0,.18);
}
.egg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .65rem;
}
.egg-lane {
  min-height: 150px;
  display: grid;
  align-content: space-between;
  justify-items: center;
  gap: .45rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.065);
  color: var(--text);
  padding: .7rem .45rem;
  box-shadow: inset 0 -28px 54px rgba(255,255,255,.035);
}
.egg-lane.goose {
  border-color: rgba(255,255,255,.42);
  background: rgba(255,255,255,.11);
}
.egg-lane.egg {
  border-color: rgba(255,203,61,.64);
  box-shadow: 0 0 28px rgba(255,203,61,.16), inset 0 -28px 54px rgba(255,203,61,.07);
}
.egg-lane.splash {
  border-color: rgba(57,215,255,.58);
  box-shadow: 0 0 26px rgba(57,215,255,.14), inset 0 -28px 54px rgba(57,215,255,.06);
}
.egg-drop {
  min-height: 48px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,.26));
}
.egg-goose {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.28);
  font-size: 1.9rem;
}
.egg-hud { position: static; pointer-events: auto; justify-content: center; flex-wrap: wrap; }
.game-overlay { position: absolute; inset: 0; display: grid; place-items: center; border: 0; color: var(--text); background: rgba(7,17,31,.72); font-size: 1.6rem; font-weight: 950; z-index: 3; }
.game-overlay.hidden { display: none; }
.hud { display: flex; justify-content: space-between; gap: .7rem; position: absolute; left: .65rem; right: .65rem; top: .65rem; z-index: 4; pointer-events: none; }
.hud span { background: rgba(0,0,0,.3); border: 1px solid var(--line); padding: .35rem .5rem; border-radius: 999px; color: var(--text); font-size: .86rem; font-weight: 900; }
.reactor { display: grid; place-items: center; }
.reactor-core { width: 170px; height: 170px; border-radius: 50%; border: 8px solid rgba(255,255,255,.15); position: relative; display: grid; place-items: center; overflow: hidden; background: rgba(255,255,255,.05); }
.reactor-core i { position: absolute; inset: auto 0 0 0; height: 0%; background: linear-gradient(0deg, var(--green), var(--cyan)); transition: height .15s linear; }
.reactor-core span { position: relative; z-index: 2; font-size: 3rem; font-weight: 950; text-shadow: 0 4px 16px rgba(0,0,0,.4); }
.groove-panel {
  min-height: 220px;
  position: relative;
  background:
    radial-gradient(circle at 20% 20%, rgba(142,234,255,.2), transparent 8rem),
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(142,234,255,.09), rgba(255,93,171,.08)),
    rgba(0,0,0,.18);
}
.groove-lane {
  position: relative;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(142,234,255,.12), rgba(255,93,171,.1));
  overflow: hidden;
}
.groove-zone {
  position: absolute;
  left: 43%;
  right: 43%;
  top: 0;
  bottom: 0;
  background: rgba(255,93,171,.26);
  border-inline: 1px solid rgba(255,255,255,.34);
  box-shadow: 0 0 28px rgba(255,93,171,.24);
}
.groove-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.16);
  font-size: 1.7rem;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.3));
}
.groove-hud {
  position: static;
  pointer-events: auto;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin: 1rem 0; }
.memory-card { min-height: 80px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); color: var(--text); font-size: 2rem; font-weight: 950; }
.memory-card.matched { background: rgba(103,242,145,.23); border-color: rgba(103,242,145,.55); }
.flight-canvas, .draw-canvas { width: 100%; border-radius: 20px; border: 1px solid var(--line); background: rgba(0,0,0,.18); display: block; }
.coloring-card {
  background:
    radial-gradient(circle at 14% 18%, rgba(255,255,255,.12), transparent 9rem),
    radial-gradient(circle at 82% 18%, rgba(255,93,171,.13), transparent 10rem),
    linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,93,171,.055), rgba(142,234,255,.055)),
    var(--card);
}
.coloring-card .draw-canvas {
  background:
    linear-gradient(45deg, rgba(255,203,61,.08) 25%, transparent 25%, transparent 75%, rgba(255,203,61,.08) 75%),
    linear-gradient(45deg, rgba(255,93,171,.06) 25%, #ffffff 25%, #ffffff 75%, rgba(255,93,171,.06) 75%);
  background-size: 30px 30px;
  background-position: 0 0, 15px 15px;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.72), 0 24px 58px rgba(0,0,0,.22);
}
.maze-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.18), transparent 8.5rem),
    radial-gradient(circle at 82% 22%, rgba(255,93,171,.22), transparent 9rem),
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,93,171,.08), rgba(255,203,61,.1)),
    rgba(0,0,0,.2);
}
.maze-wrap::before {
  content: "";
  position: absolute;
  inset: .7rem;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  pointer-events: none;
}
.maze-wrap:focus-visible { outline: 3px solid rgba(255,203,61,.8); outline-offset: 3px; }
.maze {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--maze-size, 7), minmax(0, 1fr));
  gap: clamp(2px, .5vw, 5px);
  width: min(100%, 660px);
  aspect-ratio: 1;
  margin: 0 auto;
  padding: clamp(.35rem, 1vw, .75rem);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.02)),
    rgba(6, 12, 22, .46);
  box-shadow: inset 0 0 28px rgba(0,0,0,.24), 0 20px 55px rgba(0,0,0,.24);
  touch-action: manipulation;
}
.maze-cell {
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  border-radius: clamp(5px, .75vw, 12px);
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  font-size: clamp(.78rem, 2.5vw, 1.55rem);
  line-height: 1;
  cursor: pointer;
  user-select: none;
}
.maze-cell.path { background: linear-gradient(145deg, rgba(255,255,255,.18), rgba(255,255,255,.065)); }
.maze-cell.trail { background: linear-gradient(145deg, rgba(255,255,255,.26), rgba(255,203,61,.12)); }
.maze-cell.wall {
  background:
    linear-gradient(145deg, rgba(255,93,171,.68), rgba(255,203,61,.22)),
    rgba(255,93,171,.35);
  border-color: rgba(255,255,255,.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), inset 0 -10px 18px rgba(0,0,0,.14);
  cursor: not-allowed;
}
.maze-cell.goal {
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,.82), rgba(255,203,61,.52) 42%, rgba(255,203,61,.2) 68%),
    rgba(255,203,61,.2);
  border-color: rgba(255,203,61,.7);
  box-shadow: 0 0 22px rgba(255,203,61,.22);
}
.maze-cell.player {
  background:
    radial-gradient(circle at 46% 38%, rgba(255,255,255,.78), rgba(255,93,171,.24) 56%, rgba(255,203,61,.25)),
    rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.62);
  box-shadow: 0 0 24px rgba(255,255,255,.18), 0 0 28px rgba(255,93,171,.18);
}
.maze-goose { display: inline-block; transform: scaleX(-1); filter: drop-shadow(0 3px 6px rgba(0,0,0,.28)); }
.maze-goal { display: inline-block; animation: maze-shine 1.4s ease-in-out infinite alternate; }
.maze-dot { color: rgba(255,255,255,.48); font-weight: 950; }
.maze-side {
  position: relative;
  z-index: 1;
  display: grid;
  gap: .8rem;
  align-content: center;
}
.maze-badge, .maze-status {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,.22);
  padding: .75rem;
}
.maze-badge { display: flex; align-items: center; gap: .55rem; color: var(--text); }
.maze-badge span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,203,61,.18); }
.maze-badge b { font-size: .9rem; line-height: 1.2; }
.maze-status { min-height: 5rem; margin: 0; color: var(--text); font-weight: 850; line-height: 1.45; }
.maze-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; place-self: center; width: 164px; }
.maze-controls button { min-width: 48px; min-height: 48px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.1); color: var(--text); font-weight: 950; font-size: 1.15rem; box-shadow: 0 10px 22px rgba(0,0,0,.16); }
.maze-controls button:hover, .maze-controls button:focus-visible { background: rgba(255,203,61,.22); border-color: rgba(255,203,61,.58); outline: none; }
.maze-controls button:first-child { grid-column: 2; }
.maze-controls button:nth-child(2) { grid-column: 1; }
.maze-controls button:nth-child(3) { grid-column: 3; }
.maze-controls button:nth-child(4) { grid-column: 2; }
.form-grid, .tool-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.maker-advanced {
  margin-top: .75rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,93,171,.06), rgba(255,203,61,.07));
  overflow: hidden;
}
.maker-advanced summary {
  cursor: pointer;
  padding: .8rem .9rem;
  color: var(--text);
  font-weight: 950;
}
.maker-advanced[open] summary { border-bottom: 1px solid var(--line); }
.maker-settings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
  margin-top: .75rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,93,171,.08), rgba(255,203,61,.08));
}
.maker-advanced .maker-settings { margin: 0; border: 0; border-radius: 0; background: transparent; }
.maker-settings label { font-size: .86rem; }
label { color: var(--muted); font-weight: 850; display: grid; gap: .35rem; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.08); color: var(--text); padding: .75rem .85rem; }
input[type="color"] { min-height: 45px; padding: .2rem; }
.maker-select {
  min-height: 48px;
  appearance: none;
  padding-right: 2.5rem;
  border-color: rgba(255,255,255,.22);
  background:
    linear-gradient(45deg, transparent 50%, var(--friend-yellow) 50%) calc(100% - 18px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, var(--friend-yellow) 50%, transparent 50%) calc(100% - 12px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,93,171,.1), rgba(255,203,61,.12));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 12px 26px rgba(0,0,0,.12);
  font-weight: 950;
}
.maker-select:hover, .maker-select:focus-visible {
  border-color: rgba(255,203,61,.62);
  outline: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--friend-white) 50%) calc(100% - 18px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, var(--friend-white) 50%, transparent 50%) calc(100% - 12px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,93,171,.13), rgba(255,203,61,.16));
}
.maker-preview-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 1rem; align-items: stretch; margin: 1rem 0; }
.nameplate-preview { display: grid; place-items: center; padding: 1rem; margin: 0; background-image: linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.06) 75%), linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.06) 75%); background-size: 26px 26px; background-position: 0 0, 13px 13px; }
.nameplate-preview svg { width: 100%; max-height: 240px; }
.model-preview-panel {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 16% 18%, rgba(255,255,255,.14), transparent 7rem),
    linear-gradient(135deg, rgba(255,255,255,.065), rgba(255,93,171,.06), rgba(255,203,61,.08)),
    rgba(0,0,0,.18);
  overflow: hidden;
}
.model-preview-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
  padding: .75rem .9rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.model-preview-head span { color: var(--gold); font-weight: 900; white-space: nowrap; }
.nameplate-model { width: 100%; aspect-ratio: 12 / 7; display: block; cursor: grab; touch-action: none; }
.nameplate-model.dragging { cursor: grabbing; }
.model-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: .45rem;
  padding: .75rem;
  border-top: 1px solid var(--line);
}
.model-stats span {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.07);
  padding: .55rem;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.25;
}
.model-stats b { display: block; color: var(--text); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .18rem; }
.kindness-preview {
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(0,0,0,.18);
  margin: 1rem 0;
  padding: 1rem;
  overflow: hidden;
}
.kindness-card-art {
  width: min(100%, 560px);
  min-height: 230px;
  display: grid;
  align-content: center;
  gap: .7rem;
  padding: 1.4rem;
  border-radius: 22px;
  color: #102034;
  background: linear-gradient(145deg, var(--card-color, var(--friend-pink)), #ffffff 64%, rgba(255,203,61,.58));
  border: 4px solid rgba(16,32,52,.16);
  box-shadow: 0 22px 44px rgba(0,0,0,.22);
}
.kindness-card-art .badge { font-size: 2.4rem; }
.kindness-card-art b { font-size: clamp(1.4rem, 4vw, 2.3rem); line-height: 1; }
.kindness-card-art p { color: #24344d; font-size: 1.08rem; margin: 0; }
.story-output, .bot-output { padding: 1rem; color: var(--text); font-weight: 750; display: grid; align-content: center; }
.joke-bot-card {
  background:
    radial-gradient(circle at 14% 16%, rgba(142,234,255,.13), transparent 8rem),
    radial-gradient(circle at 88% 18%, rgba(255,203,61,.11), transparent 9rem),
    linear-gradient(145deg, rgba(255,255,255,.075), rgba(142,234,255,.07), rgba(255,93,171,.045)),
    var(--card);
}
.joke-prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .9rem;
}
.joke-prompt {
  border: 1px solid rgba(142,234,255,.26);
  border-radius: 999px;
  background: rgba(142,234,255,.09);
  color: var(--text);
  min-height: 40px;
  padding: .48rem .75rem;
  font-weight: 950;
}
.joke-prompt:hover, .joke-prompt:focus-visible {
  border-color: rgba(255,203,61,.58);
  background: rgba(255,203,61,.14);
}
.joke-input-wrap { display: block; }
.joke-input-wrap .wide-input { margin: .85rem 0; }
.joke-output {
  min-height: 250px;
  align-content: start;
  gap: .7rem;
  background:
    linear-gradient(135deg, rgba(255,255,255,.09), rgba(142,234,255,.08), rgba(255,203,61,.07)),
    rgba(0,0,0,.18);
  border-color: rgba(142,234,255,.22);
}
.bot-kicker {
  width: fit-content;
  padding: .34rem .6rem;
  border-radius: 999px;
  background: rgba(142,234,255,.13);
  border: 1px solid rgba(142,234,255,.32);
  color: var(--friend-blue);
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.joke-output h4 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.08;
}
.joke-output p {
  margin: 0;
  color: rgba(247,250,255,.88);
  line-height: 1.55;
}
.story-builder-card {
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.13), transparent 8rem),
    radial-gradient(circle at 88% 14%, rgba(255,203,61,.16), transparent 10rem),
    linear-gradient(145deg, rgba(255,255,255,.08), rgba(83,193,255,.08), rgba(255,93,171,.07)),
    var(--card);
}
.story-inputs label {
  min-width: 0;
}
.story-paper {
  min-height: 300px;
  align-content: start;
  gap: .72rem;
  padding: clamp(1rem, 2.6vw, 1.45rem);
  background:
    linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,203,61,.08), rgba(103,242,145,.06)),
    rgba(0,0,0,.16);
  border-color: rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.story-paper::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: 15px;
  pointer-events: none;
}
.story-kicker {
  width: fit-content;
  padding: .34rem .58rem;
  border-radius: 999px;
  background: rgba(255,203,61,.16);
  border: 1px solid rgba(255,203,61,.34);
  color: var(--gold);
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.story-paper h4 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.35rem, 3.2vw, 2.15rem);
  line-height: 1.05;
}
.story-paper p {
  margin: 0;
  color: rgba(247,250,255,.88);
  font-weight: 750;
  line-height: 1.62;
}
.draw-canvas { touch-action: none; }
.choice-grid { display: grid; gap: .55rem; margin: 1rem 0; }
.choice-grid button, .orbit-list select, .sound-button, .piano-controls select { border: 1px solid var(--line); border-radius: 16px; padding: .75rem; background: rgba(255,255,255,.08); color: var(--text); font-weight: 900; }
.choice-grid button.correct { background: rgba(103,242,145,.22); border-color: var(--green); }
.choice-grid button.wrong { background: rgba(255,93,171,.18); border-color: var(--pink); }
.result { min-height: 1.4rem; color: var(--gold); font-weight: 900; }
.orbit-list { display: grid; gap: .7rem; margin: 1rem 0; }
.orbit-row { display: grid; gap: .35rem; }
.pattern-sequence { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: 2rem; margin: 1rem 0; }
.pattern-sequence span { border: 1px solid var(--line); border-radius: 14px; min-width: 50px; min-height: 50px; display: grid; place-items: center; background: rgba(255,255,255,.08); }
.math-crumbs { min-height: 74px; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .8rem 0; }
.math-crumbs span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,203,61,.16); border: 1px solid rgba(255,203,61,.35); font-size: 1.4rem; }
.sound-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; margin-top: 1rem; }
.sound-button { min-height: 82px; font-size: 1.15rem; }
.piano-card { overflow: visible; }
.piano-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  align-items: center;
  margin: 1rem 0;
}
.piano-controls label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
  font-weight: 900;
}
.piano-controls select { min-height: 44px; color: var(--text); }
.piano-controls input[type="range"] { accent-color: var(--gold); max-width: 150px; }
.piano-loop {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  margin: -.15rem 0 1rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
}
.piano-loop .button-row { gap: .5rem; }
.piano-loop .button { padding: .62rem .82rem; }
.piano-loop-status {
  min-height: 0;
  margin: 0;
  color: var(--gold);
  font-weight: 900;
}
.toggle-row {
  min-height: 44px;
  padding: .55rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
}
.toggle-row input { accent-color: var(--gold); }
.piano-stage {
  margin: 1rem 0;
  padding: clamp(.7rem, 2vw, 1rem);
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 22% 0%, rgba(255,203,61,.16), transparent 12rem),
    radial-gradient(circle at 84% 12%, rgba(255,93,171,.13), transparent 13rem),
    rgba(0,0,0,.2);
  overflow-x: hidden;
  overscroll-behavior-x: contain;
}
.piano-keys {
  --piano-pad: .35rem;
  --white-key: calc((100% - (var(--piano-pad) * 2)) / var(--white-count, 15));
  position: relative;
  width: 100%;
  min-width: 0;
  height: clamp(168px, 24vw, 232px);
  padding: var(--piano-pad);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(0,0,0,.18));
  overflow: hidden;
}
.piano-key {
  border: 1px solid rgba(16,32,52,.24);
  font-weight: 950;
  transition: transform .08s ease, box-shadow .08s ease, background .08s ease;
  touch-action: manipulation;
}
.piano-key b, .piano-key small { pointer-events: none; }
.piano-key small { display: none; }
.piano-key.white {
  position: absolute;
  top: var(--piano-pad);
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: .25rem;
  min-width: 0;
  width: var(--white-key);
  height: calc(100% - (var(--piano-pad) * 2));
  padding: 0 .12rem .7rem;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, #fff, #eaf1ff 72%, #cfd8e8);
  color: #102034;
  box-shadow: inset 0 -10px 16px rgba(16,32,52,.12);
}
.piano-key.black {
  position: absolute;
  z-index: 2;
  top: var(--piano-pad);
  width: calc(var(--white-key) * .62);
  height: 58%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: .16rem;
  padding: 0 .1rem .55rem;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, #29374d, #07111f 82%);
  color: #f6fbff;
  box-shadow: 0 10px 20px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.14);
}
.piano-key.next-note {
  outline: 3px solid rgba(255,203,61,.82);
  outline-offset: -4px;
  box-shadow: 0 0 0 5px rgba(255,203,61,.16), 0 0 26px rgba(255,203,61,.34);
}
.piano-key small {
  color: inherit;
  opacity: .62;
  font-size: .72rem;
}
.piano-key b { font-size: clamp(.68rem, 1.2vw, .92rem); }
.piano-key.active,
.piano-key:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 3px rgba(255,203,61,.22), inset 0 -5px 12px rgba(255,203,61,.22);
}
.piano-key.black.active,
.piano-key.black:active {
  box-shadow: 0 4px 14px rgba(0,0,0,.34), 0 0 0 3px rgba(255,203,61,.24);
}
.black-1 { left: calc(var(--white-key) * .75); }
.black-2 { left: calc(var(--white-key) * 1.75); }
.black-4 { left: calc(var(--white-key) * 3.75); }
.black-5 { left: calc(var(--white-key) * 4.75); }
.black-6 { left: calc(var(--white-key) * 5.75); }
.piano-learn {
  display: grid;
  gap: .75rem;
  margin: 1rem 0 .25rem;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
}
.piano-learn label {
  display: grid;
  gap: .35rem;
  color: var(--muted);
  font-weight: 900;
}
.piano-song-info {
  min-height: 0;
  margin: -.25rem 0 0;
  color: var(--gold);
  font-weight: 900;
}
.piano-learn select {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .7rem;
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-weight: 900;
}
.piano-song-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  min-height: 36px;
  max-height: 124px;
  overflow: auto;
  padding-right: .2rem;
}
.piano-song-strip span {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 32px;
  padding: .25rem .45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: var(--muted);
  font-weight: 950;
}
.piano-song-strip span.active {
  color: #201606;
  border-color: rgba(255,203,61,.7);
  background: var(--gold);
}
.wide-input { margin: 1rem 0; }
.hunt-grid, .sticker-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.hunt-card, .sticker-card { border: 1px solid var(--line); background: var(--card); border-radius: 20px; padding: 1rem; min-height: 190px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hunt-card .big, .sticker-card .big { font-size: 2.4rem; display: block; margin-bottom: .4rem; }
.hunt-card.locked .big, .sticker-card.locked .big { filter: grayscale(1); opacity: .42; }
.hunt-card.found { border-color: rgba(103,242,145,.55); }
.sticker-card.unlocked { border-color: rgba(255,203,61,.55); background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,93,171,.11), rgba(255,203,61,.14), var(--card)); }
.family-section .idea-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.idea-list article { padding: 1rem; }
.idea-list b { display: block; color: var(--gold); margin-bottom: .45rem; }
.idea-list span { color: var(--muted); line-height: 1.55; }
.site-footer { width: var(--shell); margin: 0 auto; padding: 3rem 0 5rem; color: var(--muted); text-align: center; }
.passport-dialog {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  width: min(1120px, calc(100% - 2rem));
  max-height: min(92vh, 920px);
  overflow: auto;
  padding: clamp(1rem, 2vw, 1.35rem);
}
.passport-dialog::backdrop { background: rgba(0,0,0,.62); backdrop-filter: blur(8px); }
.passport-panel { position: relative; display: grid; gap: 1rem; }
.dialog-close { position: absolute; right: 0; top: 0; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.08); color: var(--text); }
.character-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.character-option {
  --character-accent: var(--friend-white);
  text-align: left;
  display: flex;
  gap: .7rem;
  border: 1px solid color-mix(in srgb, var(--character-accent) 24%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--character-accent) 10%, transparent), rgba(255,255,255,.055)),
    rgba(255,255,255,.05);
  color: var(--text);
  padding: .75rem;
  border-radius: 16px;
}
.character-option span { font-size: 2rem; }
.character-option[data-character="deedz"] { --character-accent: var(--friend-white); }
.character-option[data-character="sweet"], .character-option[data-character="spark"], .character-option[data-character="artist"] { --character-accent: var(--friend-pink); }
.character-option[data-character="crumb"] { --character-accent: var(--friend-yellow); }
.character-option[data-character="silly"], .character-option[data-character="astro"] { --character-accent: var(--friend-blue); }
.character-option[data-character="keen"] { --character-accent: var(--friend-green); }
.character-option[data-character="mg"] { --character-accent: var(--friend-red); }
.character-option.active {
  border-color: color-mix(in srgb, var(--character-accent) 68%, white);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--character-accent) 20%, transparent), rgba(255,255,255,.08)),
    rgba(255,255,255,.06);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--character-accent) 28%, transparent), 0 16px 34px rgba(0,0,0,.18);
}
.character-copy {
  display: grid;
  gap: .18rem;
}
.character-copy strong {
  line-height: 1.1;
}
.character-copy small {
  display: block;
  line-height: 1.2;
}
.character-option small, .character-option p { color: var(--muted); margin: 0; }
.passport-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.passport-legends {
  margin-top: .35rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--line);
}
.passport-legends-tab {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,203,61,.08), rgba(103,242,145,.06)),
    rgba(255,255,255,.045);
  box-shadow: 0 14px 34px rgba(0,0,0,.16);
}
.passport-legends-tab::-webkit-details-marker { display: none; }
.passport-legends-tab .eyebrow { display: block; margin-bottom: .18rem; }
.passport-legends-title {
  display: block;
  color: var(--text);
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  line-height: 1.05;
  font-weight: 950;
}
.passport-legends-cue {
  flex: 0 0 auto;
  min-width: 76px;
  text-align: center;
  border: 1px solid rgba(255,203,61,.4);
  border-radius: 999px;
  padding: .48rem .72rem;
  color: var(--gold);
  background: rgba(255,203,61,.12);
  font-weight: 950;
}
.passport-legends[open] .passport-legends-cue::before { content: "Close"; }
.passport-legends:not([open]) .passport-legends-cue::before { content: "Open"; }
.passport-legends-cue { font-size: 0; }
.passport-legends-cue::before { font-size: .85rem; }
.passport-legends-heading {
  margin: .95rem 0 1rem;
}
.passport-legends-heading p {
  max-width: 48ch;
  margin: 0;
  font-weight: 800;
}
.passport-legends-grid {
  grid-template-columns: 1.05fr 1fr 1fr;
}
.passport-legends .global-honk-card {
  min-height: 300px;
}
.passport-legends .legend-list {
  max-height: 280px;
  overflow: auto;
  padding-right: .2rem;
}
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 130%); z-index: 50; max-width: min(540px, calc(100% - 2rem)); background: #101522; color: white; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: .85rem 1.15rem; box-shadow: var(--shadow); transition: transform .25s ease; font-weight: 900; text-align: center; }
.toast.show { transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -1rem; width: 10px; height: 18px; border-radius: 3px; animation: fall 1.8s linear forwards; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
@keyframes maze-shine { to { transform: scale(1.12) rotate(7deg); filter: drop-shadow(0 0 10px rgba(255,203,61,.8)); } }
@keyframes bubble-target-pop {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(.35); opacity: .2; }
}
@keyframes bubble-pop-burst {
  0% { transform: translate(-50%, -50%) scale(.35); opacity: .95; }
  65% { opacity: .9; }
  100% { transform: translate(-50%, -50%) scale(1.75); opacity: 0; }
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "brand actions"
      "nav nav";
    gap: .68rem;
  }
  .site-header::before {
    inset: .25rem -.65rem;
    border-radius: 24px;
  }
  .brand { grid-area: brand; }
  .header-actions { grid-area: actions; }
  .nav-toggle { display: none; }
  .site-nav {
    grid-area: nav;
    display: flex;
    justify-content: center;
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    border-radius: 18px;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex: 0 0 auto; }
  .header-actions { justify-self: end; align-self: center; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .activity-tools { grid-template-columns: 1fr; align-items: stretch; }
  .result-count { white-space: normal; }
  .activity-grid, .hunt-grid, .sticker-grid, .module-grid.three, .family-section .idea-list, .quest-dashboard { grid-template-columns: repeat(2, 1fr); }
  .daily-board { grid-column: 1 / -1; }
  .legends-grid { grid-template-columns: repeat(2, 1fr); }
  .global-honk-card { grid-row: auto; }
  .legend-sign-card { grid-column: 1 / -1; }
  .module-grid.two { grid-template-columns: 1fr; }
  .passport-strip { grid-template-columns: repeat(2, 1fr); }
  .progress-wrap { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root { --shell: min(100% - 22px, 1160px); }
  .section { padding: 3.5rem 0; }
  .hero { padding-top: 2.2rem; gap: 1.2rem; }
  .hero-panel { min-height: auto; }
  h1 { font-size: clamp(2.45rem, 14vw, 3.8rem); line-height: .96; letter-spacing: 0; }
  h2 { font-size: clamp(1.8rem, 10vw, 2.65rem); }
  h3 { line-height: 1.12; }
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "brand actions toggle"
      "nav nav nav";
    gap: .55rem;
    padding: .55rem 0;
  }
  .site-header::before { inset: .18rem -.42rem; border-radius: 22px; }
  .brand { gap: .5rem; }
  .brand img { width: 40px; height: 40px; padding: .12rem; }
  .brand strong { font-size: .98rem; }
  .brand small { font-size: .72rem; }
  .nav-toggle {
    grid-area: toggle;
    display: inline-grid;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 29, 45, 0.82);
    color: var(--text);
    box-shadow: 0 10px 28px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.06);
  }
  html[data-theme="light"] .nav-toggle { background: rgba(255,255,255,.74); }
  .site-nav {
    display: none;
    grid-area: nav;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: .45rem;
    width: 100%;
    margin-top: .05rem;
    padding: .6rem;
    overflow: visible;
    border-radius: 18px;
    background: rgba(7,17,31,.88);
    box-shadow: 0 18px 42px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.08);
  }
  html[data-theme="light"] .site-nav { background: rgba(255,255,255,.94); }
  .site-nav.open { display: grid; }
  .site-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: .72rem .55rem;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.045);
    text-align: center;
  }
  html[data-theme="light"] .site-nav a {
    border-color: rgba(16,32,52,.08);
    background: rgba(16,32,52,.035);
  }
  .icon-button { width: 42px; height: 42px; }
  .button-row { align-items: stretch; }
  .button-row .button { flex: 1 1 100%; }
  .hero-copy .button-row .button { justify-content: center; }
  .module-title { flex-wrap: wrap; }
  .module-title b { width: 100%; margin-left: 0; }
  .hero-stats, .activity-grid, .hunt-grid, .sticker-grid, .legends-grid, .legend-progress, .legend-sign-form, .module-grid.three, .family-section .idea-list, .passport-strip, .quest-dashboard, .form-grid, .tool-row, .maker-settings, .maker-preview-grid, .character-grid { grid-template-columns: 1fr; }
  .daily-board { grid-column: auto; }
  .daily-board-top { display: grid; }
  .daily-board-top > span { justify-self: start; white-space: normal; }
  .quest-row { grid-template-columns: 36px 1fr; min-height: 74px; padding: .65rem; }
  .quest-check { width: 36px; height: 36px; border-radius: 12px; }
  .model-stats { grid-template-columns: repeat(2, 1fr); }
  .passport-chip { max-width: 5.6rem; }
  .passport-chip b { display: none; }
  .passport-dialog { width: calc(100% - 1rem); max-height: 94vh; padding: .85rem; border-radius: 22px; }
  .passport-legends-heading { display: grid; align-items: start; }
  .passport-legends .global-honk-card { min-height: 240px; }
  .passport-legends .legend-list { max-height: none; overflow: visible; padding-right: 0; }
  .quick-launch { padding-right: 0; }
  .quick-link { grid-template-columns: 38px 1fr; }
  .quick-link .quick-arrow { display: none; }
  .activity-card { min-height: auto; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .filter { padding-inline: .65rem; }
  .result-count { text-align: center; }
  .play-field, .reactor, .chorus-panel, .sort-panel, .treasure-panel, .stack-panel, .pond-panel, .cloud-panel, .nameplate-preview, .story-output, .bot-output, .maze-wrap { min-height: 190px; border-radius: 18px; }
  .crumb-field, .bubble-field { height: 240px; }
  .hud { flex-wrap: wrap; justify-content: center; gap: .45rem; }
  .hud span { font-size: .8rem; padding: .3rem .45rem; }
  .game-overlay { padding: 1rem; text-align: center; font-size: 1.25rem; }
  .chorus-buttons, .sort-bins, .pond-choices, .cloud-grid, .signal-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glide-field { height: 250px; }
  .egg-lane { min-height: 128px; }
  .pond-path { grid-template-columns: repeat(3, 1fr); }
  .treasure-tile { min-height: 58px; }
  .maze-wrap { grid-template-columns: 1fr; padding: .8rem; }
  .maze-side { align-content: stretch; }
  .maze-badge, .maze-status { padding: .65rem; }
  .maze-status { min-height: auto; }
  .memory-grid { grid-template-columns: repeat(3, 1fr); }
  .flight-canvas, .draw-canvas { border-radius: 18px; }
  .model-preview-head { display: grid; align-items: start; }
  .model-preview-head span { white-space: normal; }
  .kindness-preview, .joke-output, .story-paper { min-height: 220px; }
  .sound-grid { grid-template-columns: 1fr; }
  .piano-stage { overflow-x: auto; }
  .piano-keys {
    --white-key: 38px;
    width: calc((var(--white-key) * var(--white-count, 15)) + (var(--piano-pad) * 2));
    min-width: calc((var(--white-key) * var(--white-count, 15)) + (var(--piano-pad) * 2));
    height: 190px;
  }
  .toast { border-radius: 18px; }
}

@media (max-width: 420px) {
  .brand strong { letter-spacing: .06em; }
  .brand small { display: none; }
  .site-header { gap: .5rem; }
  .passport-chip, .icon-button, .nav-toggle { min-height: 42px; }
  .passport-chip { padding-inline: .65rem; max-width: none; }
  .passport-chip small { display: none; }
  .hero-stats div, .passport-stat { padding: .85rem; }
  .hero-stats strong, .passport-stat b { font-size: 1.75rem; }
  .module-card { padding: 1rem; }
  .module-title > span { width: 46px; height: 46px; font-size: 1.7rem; }
  .daily-board, .play-next-card, .comeback-card { padding: 1rem; border-radius: 18px; }
  .filters { grid-template-columns: 1fr; }
  .chorus-buttons, .sort-bins, .pond-choices, .cloud-grid, .signal-buttons { grid-template-columns: 1fr; }
  .memory-card { min-height: 68px; }
  .model-stats { grid-template-columns: 1fr; }
  .chorus-pips span { width: 40px; height: 40px; }
  .treasure-grid { gap: .4rem; }
  .treasure-tile { min-height: 52px; font-size: 1.35rem; }
  .stack-lane { min-height: 76px; }
  .pond-path span { min-height: 40px; }
  .math-crumbs span { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
