/* Self-hosted so Vietnamese and English render consistently in both the UI
   and the canvas-based gameplay labels. */
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-400-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-500-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-600-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-700-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-800-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-900-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-900-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Loaded only when a lesson uses extended Latin characters (for example,
   Polish, Czech, Romanian, or Turkish). */
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-600-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-800-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro/be-vietnam-pro-900-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --ink: #f7fbf4;
  --muted: #a5bac0;
  --night: #061017;
  --panel: rgba(7, 24, 31, 0.86);
  --line: rgba(167, 255, 226, 0.24);
  --mint: #63ffd0;
  --cyan: #54d8ff;
  --sun: #ffd35a;
  --coral: #ff684f;
  --danger: #ff476f;
  --safe-top: max(16px, env(safe-area-inset-top));
  --safe-right: max(16px, env(safe-area-inset-right));
  /* A hardware home-indicator inset is at most 34 CSS px in portrait. Some
     iOS browser states incorrectly include their whole bottom toolbar here. */
  --safe-bottom-inset: min(34px, env(safe-area-inset-bottom, 0px));
  --safe-bottom: max(16px, var(--safe-bottom-inset));
  --safe-left: max(16px, env(safe-area-inset-left));
  /* Keep the app tied to the currently visible viewport. The 100vh fallback is
     for older WebKit; modern iOS browsers use the dynamic viewport value. */
  --app-height: 100vh;
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
}

html.is-crios-tab {
  /* Chrome's regular tab viewport already excludes its bottom toolbar. */
  --safe-bottom-inset: 0px;
}

@supports (height: 100dvh) {
  :root { --app-height: 100dvh; }
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: var(--app-height);
  min-height: var(--app-height);
  margin: 0;
  overflow: hidden;
  background: var(--night);
  color: var(--ink);
}

html,
body,
#game-shell,
#scene,
#scene canvas,
.hud,
.touch-controls,
.touch-controls button {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#game-shell {
  /* A viewport-sized fixed root can be composited at a stale height by
     WebKit/WKWebView on first navigation, leaving a strip below it. Anchor the
     non-scrolling app to the document instead; dvh supplies the live height. */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--app-height);
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--night);
}

button { font: inherit; }

#scene,
.vignette,
.overlay,
.loading {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#scene canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.vignette {
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 9, 15, 0.3) 0%, transparent 24%, transparent 62%, rgba(2, 8, 12, 0.58) 100%),
    radial-gradient(circle at 50% 44%, transparent 32%, rgba(2, 7, 11, 0.45) 100%);
  z-index: 2;
}

.is-hidden { display: none !important; }

.hud {
  position: fixed;
  z-index: 5;
  inset: var(--safe-top) var(--safe-right) auto var(--safe-left);
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(320px, 1.5fr) minmax(250px, 1fr);
  align-items: start;
  gap: clamp(14px, 2vw, 30px);
  pointer-events: none;
}

.hud__brand,
.hud__score,
.song-progress {
  min-width: 0;
}

.hud__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: #041914;
  background: var(--mint);
  border-radius: 12px 5px 12px 5px;
  box-shadow: 0 0 22px rgba(99, 255, 208, 0.35);
  font-weight: 1000;
  letter-spacing: -0.08em;
}

.hud__brand div { display: grid; gap: 2px; min-width: 0; }
.hud__brand strong { font-size: 12px; letter-spacing: 0.13em; white-space: nowrap; }
.hud__brand div span { color: var(--sun); font-size: 11px; letter-spacing: 0.09em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.song-progress {
  padding: 9px 14px 10px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 16px 16px;
  background: linear-gradient(180deg, rgba(5, 20, 27, 0.88), rgba(8, 31, 38, 0.68));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.song-progress__meta {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

#lyric-line {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-progress__track {
  height: 4px;
  overflow: hidden;
  background: rgba(172, 223, 219, 0.15);
  border-radius: 999px;
}

.song-progress__track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--sun));
  box-shadow: 0 0 14px var(--mint);
  transition: width 0.15s linear;
}

.hud__score {
  justify-self: end;
  display: flex;
  align-items: stretch;
  gap: 7px;
  pointer-events: auto;
}

.lives-badge,
.stat-readout {
  display: grid;
  align-content: center;
  padding: 5px 11px;
  border: 1px solid var(--line);
  background: rgba(5, 20, 27, 0.78);
  backdrop-filter: blur(9px);
}

.lives-badge { border-radius: 14px 5px 5px 14px; min-width: 52px; text-align: center; padding: 5px 10px; }
.stat-readout { min-width: 64px; text-align: center; }
.lives-badge span,
.stat-readout span { color: var(--muted); font-size: 8px; letter-spacing: 0.14em; }
.lives-count-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1;
}
.lives-heart {
  font-style: normal;
  font-size: 16px;
  color: #ff476f;
  text-shadow: 0 0 8px rgba(255, 71, 111, 0.45);
}
.lives-heart::before { content: "♥"; }
.lives-count-row b {
  color: var(--sun);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.lives-badge.is-pulsing {
  border-color: #ff476f;
  box-shadow: 0 0 22px rgba(255, 71, 111, 0.28);
  animation: combo-pulse 0.32s ease-out;
}
.stat-readout strong { color: var(--sun); font-size: 15px; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.stat-readout.is-pulsing {
  border-color: var(--sun);
  box-shadow: 0 0 22px rgba(255, 211, 90, 0.28);
  animation: combo-pulse 0.32s ease-out;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(5, 20, 27, 0.82);
  cursor: pointer;
  transition: 0.15s ease;
}
.icon-button:hover,
.icon-button:focus-visible { border-color: var(--mint); color: var(--mint); transform: translateY(-1px); }
.icon-button:active { transform: translateY(1px); }

.feedback {
  position: fixed;
  z-index: 8;
  left: 50%;
  top: 39%;
  transform: translate(-50%, -50%);
  color: var(--sun);
  font-weight: 1000;
  font-size: clamp(24px, 4vw, 54px);
  letter-spacing: 0.04em;
  text-shadow: 0 0 24px currentColor, 0 4px 0 rgba(0, 0, 0, 0.22);
  pointer-events: none;
  animation: feedback-pop 0.7s ease-out forwards;
}

.pickup-feedback {
  position: fixed;
  z-index: 7;
  left: 50%;
  bottom: clamp(170px, 28vh, 270px);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  transform: translateX(-50%);
  border: 1px solid rgba(99, 255, 208, 0.52);
  border-radius: 999px;
  background: rgba(5, 28, 33, 0.82);
  box-shadow: 0 0 24px rgba(99, 255, 208, 0.22);
  pointer-events: none;
  animation: pickup-rise 0.5s ease-out forwards;
}
.pickup-feedback strong { color: var(--mint); font-size: 17px; line-height: 1; }
.pickup-feedback span { max-width: 180px; overflow: hidden; color: var(--ink); font-size: 10px; font-weight: 900; letter-spacing: 0.09em; text-overflow: ellipsis; white-space: nowrap; }
.pickup-feedback.is-target { border-color: rgba(255, 211, 90, 0.65); box-shadow: 0 0 26px rgba(255, 211, 90, 0.3); }
.pickup-feedback.is-target strong { color: var(--sun); }

.overlay {
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  background:
    radial-gradient(circle at 50% 35%, rgba(33, 116, 108, 0.2), transparent 38%),
    linear-gradient(90deg, rgba(3, 11, 16, 0.94), rgba(3, 14, 19, 0.72), rgba(3, 11, 16, 0.94));
  backdrop-filter: blur(5px);
}

.overlay--menu { justify-content: center; gap: clamp(14px, 2.2vh, 24px); }
.menu-emblem {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(99, 255, 208, 0.45);
  border-radius: 50%;
  color: var(--mint);
  box-shadow: inset 0 0 20px rgba(99, 255, 208, 0.12), 0 0 30px rgba(99, 255, 208, 0.1);
}
.menu-emblem::before { content: ""; position: absolute; width: 74px; height: 74px; border: 1px dashed rgba(255, 211, 90, 0.28); border-radius: 50%; animation: spin 12s linear infinite; }
.menu-emblem span { font-size: 25px; }
.menu-copy { max-width: 720px; text-align: center; }
.eyebrow { color: var(--mint); font-size: 10px; letter-spacing: 0.26em; font-weight: 900; }
.menu-copy h1 {
  margin: 6px 0 8px;
  font-size: clamp(46px, 7vw, 84px);
  line-height: 0.78;
  letter-spacing: -0.065em;
  font-style: italic;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.28);
}
.menu-copy h1 span { color: var(--sun); }
.menu-copy h1 b { font: inherit; }
.menu-copy p { max-width: 610px; margin: 0 auto; color: var(--muted); font-family: "Be Vietnam Pro", system-ui, sans-serif; font-size: clamp(13px, 1.6vw, 16px); line-height: 1.5; }

.track-ticket {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(560px, calc(100vw - 32px));
  padding: 9px 14px 9px 9px;
  border: 1px solid var(--line);
  border-radius: 12px 5px 12px 5px;
  background: linear-gradient(100deg, rgba(9, 36, 41, 0.9), rgba(8, 23, 31, 0.82));
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.25);
}
.track-ticket__art { position: relative; display: grid; place-items: center; width: 54px; height: 54px; overflow: hidden; border-radius: 9px 3px 9px 3px; background: #183c41; }
.track-ticket__art i { position: absolute; width: 80px; height: 16px; background: var(--sun); transform: rotate(-35deg); box-shadow: 0 22px 0 var(--coral), 0 -22px 0 var(--mint); }
.track-ticket__art span { z-index: 1; font-size: 20px; color: #041310; text-shadow: 0 1px rgba(255,255,255,.3); }
.track-ticket__copy { display: grid; gap: 1px; min-width: 0; }
.track-ticket__copy span { color: var(--mint); font-size: 8px; letter-spacing: 0.19em; }
.track-ticket__copy strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 18px; }
.track-ticket__copy small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: "Be Vietnam Pro", system-ui, sans-serif; font-size: 10px; }
.track-ticket__duration { color: var(--sun); font-size: 13px; font-variant-numeric: tabular-nums; }

.track-picker { display: grid; gap: 7px; width: min(840px, calc(100vw - 32px)); }
.track-picker > .selector-label { width: 100%; }
.selector-label { width: min(560px, calc(100vw - 32px)); margin-bottom: -8px; color: rgba(202, 221, 222, .68); font-size: 8px; font-weight: 900; letter-spacing: .18em; }
.track-search {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(167, 255, 226, .18);
  border-radius: 8px 3px 8px 3px;
  background: rgba(4, 17, 23, .82);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
.track-search span { display: grid; place-items: center; color: var(--sun); font-size: 16px; }
.track-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: 12px/1.2 "Be Vietnam Pro", system-ui, sans-serif;
}
.track-search input::placeholder { color: rgba(202, 221, 222, .48); }
.track-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: min(38vh, 360px);
  overflow-y: auto;
  padding: 3px 6px 3px 0;
  scrollbar-color: rgba(99, 255, 208, .5) rgba(4, 17, 23, .55);
}
.track-group-label {
  grid-column: 1 / -1;
  margin: 5px 0 -2px;
  color: rgba(255, 211, 90, .78);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .18em;
}
.track-empty {
  grid-column: 1 / -1;
  padding: 15px;
  border: 1px dashed rgba(167, 255, 226, .2);
  color: var(--muted);
  text-align: center;
  font: 12px/1.4 "Be Vietnam Pro", system-ui, sans-serif;
}
.track-choice {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 6px 9px 6px 6px;
  border: 1px solid rgba(167, 255, 226, .2);
  border-radius: 9px 4px 9px 4px;
  color: var(--muted);
  background: rgba(5, 20, 27, .74);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.track-choice:hover,
.track-choice:focus-visible { border-color: var(--mint); color: var(--ink); transform: translateY(-1px); }
.track-choice.is-selected { border-color: var(--sun); color: var(--ink); background: rgba(23, 58, 61, .92); box-shadow: inset 3px 0 var(--sun), 0 0 20px rgba(255, 211, 90, .09); }
.track-choice > i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px 3px 7px 3px; color: #041310; background: linear-gradient(145deg, var(--sun), var(--mint)); font-size: 12px; font-style: normal; }
.track-choice > span { display: grid; gap: 2px; min-width: 0; }
.track-choice strong,
.track-choice small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-choice strong { font-size: 10px; letter-spacing: .035em; }
.track-choice small { color: var(--muted); font: 8px/1.2 "Be Vietnam Pro", system-ui, sans-serif; }
.track-choice > b { color: var(--sun); font-size: 10px; font-variant-numeric: tabular-nums; }

.character-picker { display: grid; gap: 6px; width: min(560px, calc(100vw - 32px)); }
.character-picker > .selector-label { width: 100%; }
.character-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.character-choice {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 7px 9px;
  border: 1px solid rgba(167, 255, 226, .2);
  border-radius: 9px 4px 9px 4px;
  color: var(--muted);
  background: rgba(5, 20, 27, .74);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.character-choice:hover,
.character-choice:focus-visible { border-color: var(--mint); color: var(--ink); transform: translateY(-1px); }
.character-choice.is-selected { border-color: var(--sun); color: var(--ink); background: rgba(23, 58, 61, .92); box-shadow: inset 3px 0 var(--sun), 0 0 20px rgba(255, 211, 90, .09); }
.character-choice > span { display: grid; gap: 2px; min-width: 0; }
.character-choice strong,
.character-choice small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.character-choice strong { font-size: 10px; letter-spacing: .06em; }
.character-choice small { color: var(--muted); font: 8px/1.2 "Be Vietnam Pro", system-ui, sans-serif; }
.character-choice__avatar {
  --avatar-skin: #c98257;
  --avatar-hair: #2b1715;
  --avatar-shirt: var(--mint);
  --avatar-accent: var(--coral);
  position: relative;
  display: block;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(99,255,208,.34);
  border-radius: 10px 4px 10px 4px;
  background: rgba(2, 14, 20, .7);
}
.character-choice__avatar::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 11px;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 48% 48% 44% 44%;
  background: var(--avatar-skin);
}
.character-choice__avatar::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 19px;
  width: 20px;
  height: 13px;
  border-radius: 8px 8px 4px 4px;
  background: var(--avatar-shirt);
  box-shadow: inset 0 -3px var(--avatar-accent);
}
.character-choice__avatar b { position: absolute; z-index: 2; display: block; }
.character-choice__avatar--maya b { left: 10px; top: 3px; width: 16px; height: 8px; border-radius: 9px 9px 4px 4px; background: var(--avatar-hair); }
.character-choice__avatar--maya b::after { content: ""; position: absolute; right: -5px; top: 4px; width: 7px; height: 12px; border-radius: 50% 50% 60% 40%; background: var(--avatar-hair); transform: rotate(-18deg); }
.character-choice__avatar--leo { --avatar-skin: #9b5e3c; --avatar-hair: #12151c; --avatar-shirt: var(--cyan); --avatar-accent: var(--sun); }
.character-choice__avatar--leo b { left: 9px; top: 2px; width: 18px; height: 7px; border-radius: 8px 8px 2px 2px; background: var(--avatar-accent); }
.character-choice__avatar--leo b::after { content: ""; position: absolute; right: -5px; bottom: -2px; width: 11px; height: 3px; border-radius: 2px; background: var(--avatar-accent); }
.character-choice__avatar--zoe { --avatar-skin: #e0a077; --avatar-hair: #6d2b26; --avatar-shirt: var(--coral); --avatar-accent: var(--sun); }
.character-choice__avatar--zoe b { left: 10px; top: 3px; width: 16px; height: 7px; border-radius: 9px 9px 2px 2px; background: var(--avatar-hair); }
.character-choice__avatar--zoe b::before,
.character-choice__avatar--zoe b::after { content: ""; position: absolute; top: -2px; width: 7px; height: 7px; border-radius: 50%; background: var(--avatar-hair); }
.character-choice__avatar--zoe b::before { left: -5px; }
.character-choice__avatar--zoe b::after { right: -5px; }

.experience-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(560px, calc(100vw - 32px));
  max-height: 132px;
  padding-right: 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--mint) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}
.experience-choice {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 7px 10px;
  border: 1px solid rgba(167, 255, 226, 0.2);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(5, 20, 27, 0.74);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.experience-choice:hover,
.experience-choice:focus-visible { border-color: var(--mint); color: var(--ink); transform: translateY(-1px); }
.experience-choice.is-selected { border-color: var(--sun); color: var(--ink); background: rgba(23, 58, 61, 0.92); box-shadow: inset 3px 0 var(--sun), 0 0 20px rgba(255, 211, 90, 0.09); }
.experience-choice span { display: grid; gap: 2px; min-width: 0; }
.experience-choice strong { font-size: 11px; letter-spacing: .1em; }
.experience-choice small { overflow: hidden; color: var(--muted); font: 9px/1.2 "Be Vietnam Pro", system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.experience-choice__icon { position: relative; display: block; width: 34px; height: 34px; border: 1px solid rgba(99,255,208,.32); border-radius: 50%; }
.experience-choice__icon--runner::before { content: ""; position: absolute; left: 10px; top: 6px; width: 12px; height: 13px; border: 2px solid var(--mint); border-radius: 7px 7px 4px 4px; box-shadow: 0 14px 0 -4px var(--sun); }
.experience-choice__icon--runner::after { content: ""; position: absolute; left: 13px; top: 11px; width: 6px; height: 2px; background: var(--sun); box-shadow: -6px 13px 0 -1px var(--mint), 6px 13px 0 -1px var(--mint); }
.experience-choice__icon--random { border-color: rgba(255, 211, 90, .62); box-shadow: inset 0 0 0 5px rgba(255, 211, 90, .1); }
.experience-choice__icon--random::before { content: "?"; position: absolute; inset: 0; color: var(--sun); font: 900 19px/34px "Be Vietnam Pro", system-ui, sans-serif; text-align: center; }
.experience-choice__icon--random::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--mint); box-shadow: -18px -18px 0 -1px var(--coral); }
.experience-choice__icon--tunnel { border-color: rgba(255, 84, 214, .58); box-shadow: inset 0 0 0 5px rgba(150, 86, 255, .12); }
.experience-choice__icon--tunnel::before { content: ""; position: absolute; left: 8px; top: 7px; width: 16px; height: 18px; background: linear-gradient(180deg, #ffb32d, #ff54d6); clip-path: polygon(50% 0, 100% 100%, 50% 72%, 0 100%); }
.experience-choice__icon--tunnel::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(255,179,45,.6); border-radius: 50%; }
.experience-choice__icon--desert { border-color: rgba(255, 209, 129, .7); border-radius: 8px 8px 13px 13px; background: linear-gradient(180deg, rgba(255, 173, 101, .12), rgba(181, 95, 40, .2)); }
.experience-choice__icon--desert::before { content: ""; position: absolute; left: 4px; right: 4px; bottom: 5px; height: 15px; background: linear-gradient(145deg, #ffd181 0 49%, #b85f2e 51%); clip-path: polygon(0 100%, 30% 35%, 48% 70%, 72% 12%, 100% 100%); }
.experience-choice__icon--desert::after { content: ""; position: absolute; right: 5px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: #fff1b5; box-shadow: -13px 21px 0 -2px #4bb9a0; }
.experience-choice__icon--forest { border-color: rgba(184,255,159,.68); background: rgba(29,82,59,.24); }
.experience-choice__icon--forest::before { content: ""; position: absolute; left: 8px; bottom: 5px; width: 17px; height: 23px; background: linear-gradient(90deg, #65a94e, #b8ff9f); clip-path: polygon(50% 0, 100% 48%, 72% 48%, 100% 78%, 59% 78%, 59% 100%, 41% 100%, 41% 78%, 0 78%, 28% 48%, 0 48%); }
.experience-choice__icon--forest::after { content: ""; position: absolute; right: 4px; top: 5px; width: 5px; height: 5px; border-radius: 50%; background: #ffdc72; box-shadow: -22px 12px 0 -1px #b8ff9f; }
.experience-choice__icon--arctic { border-color: rgba(202,248,255,.72); background: rgba(67,127,163,.22); }
.experience-choice__icon--arctic::before { content: ""; position: absolute; left: 6px; right: 6px; bottom: 5px; height: 23px; background: linear-gradient(145deg, #e8ffff, #79f4db 55%, #8ea8ff); clip-path: polygon(50% 0, 68% 35%, 100% 100%, 54% 78%, 20% 100%, 34% 43%); }
.experience-choice__icon--arctic::after { content: ""; position: absolute; left: 5px; top: 5px; width: 22px; height: 6px; border: 2px solid #79f4db; border-color: #79f4db transparent transparent; border-radius: 50%; transform: rotate(-9deg); }
.experience-choice__icon--coast { border-color: rgba(255,239,208,.72); background: linear-gradient(#318aa0 0 55%, #e5b65f 56%); }
.experience-choice__icon--coast::before { content: ""; position: absolute; left: 15px; bottom: 4px; width: 3px; height: 21px; border-radius: 2px; background: #795137; transform: rotate(9deg); }
.experience-choice__icon--coast::after { content: ""; position: absolute; left: 7px; top: 5px; width: 20px; height: 11px; background: #79d58b; clip-path: polygon(50% 45%, 0 10%, 38% 55%, 12% 100%, 48% 67%, 75% 100%, 60% 56%, 100% 20%); }
.experience-choice__icon--savanna { border-color: rgba(255,228,155,.72); background: linear-gradient(#9a6038 0 58%, #9b853d 59%); }
.experience-choice__icon--savanna::before { content: ""; position: absolute; left: 14px; bottom: 4px; width: 4px; height: 18px; background: #513622; }
.experience-choice__icon--savanna::after { content: ""; position: absolute; left: 5px; top: 7px; width: 23px; height: 11px; border-radius: 50%; background: #536b32; box-shadow: 17px -5px 0 -7px #ffd56b; }
.experience-choice__icon--sakura { border-color: rgba(255,215,232,.76); background: rgba(116,74,104,.32); }
.experience-choice__icon--sakura::before { content: ""; position: absolute; left: 14px; bottom: 4px; width: 4px; height: 20px; background: #68433a; transform: rotate(7deg); }
.experience-choice__icon--sakura::after { content: ""; position: absolute; left: 5px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #ffa8c7; box-shadow: 8px 2px #ffe1ec, 15px -1px #ffa8c7, 5px 8px #f7bdd4, 14px 9px #ffe1ec; }
.experience-choice__icon--moon { border-color: rgba(219,230,255,.72); background: #171b35; }
.experience-choice__icon--moon::before { content: ""; position: absolute; left: 7px; top: 5px; width: 20px; height: 20px; border-radius: 50%; background: #dbe6ff; box-shadow: inset -6px -3px #8f98b5; }
.experience-choice__icon--moon::after { content: ""; position: absolute; left: 11px; top: 10px; width: 4px; height: 4px; border-radius: 50%; background: #858fa9; box-shadow: 8px 5px 0 1px #9aa4bd, 2px 9px #768099; }
.experience-choice__icon--cloud { border-color: rgba(255,255,255,.8); background: #6095b4; }
.experience-choice__icon--cloud::before { content: ""; position: absolute; left: 5px; bottom: 6px; width: 24px; height: 10px; border-radius: 10px; background: #f5ffff; box-shadow: 5px -6px 0 -1px #fff, 12px -4px 0 #dcecef; }
.experience-choice__icon--cloud::after { content: ""; position: absolute; right: 5px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: #ffe8a6; }

.control-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; color: var(--muted); font-size: 11px; }
.control-strip span { display: flex; align-items: center; gap: 5px; }
kbd { min-width: 24px; padding: 4px 7px; border: 1px solid rgba(255,255,255,.22); border-bottom-width: 3px; border-radius: 5px; color: var(--ink); background: rgba(255,255,255,.06); font: 800 10px/1 "Be Vietnam Pro", system-ui, sans-serif; text-align: center; }

.primary-button,
.secondary-button {
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(330px, calc(100vw - 42px));
  min-height: 58px;
  padding: 0 8px 0 24px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  color: #031511;
  background: linear-gradient(90deg, var(--mint), #8fffdc);
  box-shadow: 0 14px 35px rgba(99, 255, 208, 0.18);
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: 0.1em;
}
.primary-button i { display: grid; place-items: center; width: 44px; height: 44px; background: rgba(2, 21, 16, 0.12); clip-path: polygon(0 0, 100% 0, 100% 100%, 11px 100%, 0 calc(100% - 11px)); font-style: normal; font-size: 18px; }
.primary-button:hover,
.primary-button:focus-visible { filter: brightness(1.08); transform: translateY(-2px); }
.primary-button:active { transform: translateY(1px); }
.secondary-button { padding: 10px 16px; color: var(--muted); background: transparent; font-size: 11px; letter-spacing: 0.1em; }
.secondary-button:hover,
.secondary-button:focus-visible { color: var(--ink); }
.menu-note { margin: -9px 0 0; color: rgba(202, 221, 222, 0.62); font: 10px/1.4 "Be Vietnam Pro", system-ui, sans-serif; }

#passport-intro.overlay--passport {
  z-index: 12;
  align-items: flex-start;
  justify-content: center;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  overflow: hidden;
  height: 100%;
  max-height: 100%;
  box-sizing: border-box;
  background:
    linear-gradient(90deg, rgba(2, 11, 17, .93) 0%, rgba(3, 16, 22, .78) 34%, rgba(3, 16, 22, .28) 58%, transparent 82%);
  backdrop-filter: none;
}
#passport-intro.overlay--passport::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(2,8,12,.32), transparent 28%, transparent 66%, rgba(2,8,12,.45)),
    radial-gradient(circle at 70% 48%, transparent 22%, rgba(2,8,12,.16) 82%);
}
.vocab-preview {
  --preview-progress: 0%;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(16px, 2.2vh, 24px);
  align-self: center;
  width: min(520px, 44vw);
  max-height: min(760px, calc(100dvh - var(--safe-top) - var(--safe-bottom)));
  min-height: 0;
  overflow: hidden;
  margin-right: auto;
  padding: clamp(22px, 3vw, 38px);
  border-left: 3px solid var(--mint);
  background: linear-gradient(90deg, rgba(3,18,24,.78), rgba(3,18,24,.42) 76%, transparent);
  box-shadow: -24px 0 80px rgba(0,0,0,.18);
  text-shadow: 0 2px 14px rgba(0,0,0,.74);
  box-sizing: border-box;
}
.vocab-preview::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 0;
  width: 3px;
  height: var(--preview-progress);
  background: var(--sun);
  box-shadow: 0 0 18px var(--sun);
  transition: height .45s ease;
}
.vocab-preview__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(109,220,255,.2);
}
.vocab-preview__header > div { display: grid; gap: 4px; }
.vocab-preview__header span {
  color: var(--mint);
  font: 1000 8px/1 "Be Vietnam Pro", system-ui, sans-serif;
  letter-spacing: .22em;
}
.vocab-preview__header h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1;
  letter-spacing: -.025em;
}
.vocab-preview__header > strong {
  min-width: 58px;
  color: var(--sun);
  font: 1000 13px/1 "Be Vietnam Pro", system-ui, sans-serif;
  letter-spacing: .08em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.vocab-list {
  display: grid;
  align-content: center;
  gap: 7px;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
#passport-intro.is-long-list .vocab-list {
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}
.vocab-item {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 76px;
  padding: 9px 14px 9px 8px;
  overflow: hidden;
  border-left: 2px solid rgba(109,220,255,.18);
  color: rgba(231,246,246,.38);
  background: linear-gradient(90deg, rgba(3,18,24,.78), rgba(3,18,24,.18));
  opacity: .16;
  transform: translateX(-20px);
  transition: opacity .42s ease, transform .42s cubic-bezier(.2,.8,.2,1), color .3s ease, border-color .3s ease, background .3s ease;
}
.vocab-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 18%, rgba(255,255,255,.11), transparent 58%);
  opacity: 0;
  transform: translateX(-100%);
}
.vocab-item.is-visible {
  color: var(--ink);
  opacity: .78;
  transform: translateX(0);
}
.vocab-item.is-active {
  border-left-color: var(--sun);
  color: var(--ink);
  background: linear-gradient(90deg, rgba(255,211,90,.14), rgba(3,18,24,.22));
  opacity: 1;
}
.vocab-item.is-active::after { animation: vocab-scan .72s ease-out; }
.vocab-item > b {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--muted);
  font: 1000 10px/1 "Be Vietnam Pro", system-ui, sans-serif;
  letter-spacing: .08em;
  transition: color .3s ease, border-color .3s ease, background .3s ease;
}
.vocab-item.is-active > b {
  color: #071b18;
  border-color: var(--sun);
  background: var(--sun);
  box-shadow: 0 0 18px rgba(255,211,90,.28);
}
.vocab-item.is-translated:not(.is-active) > b {
  color: #071b18;
  border-color: var(--mint);
  background: var(--mint);
}
.vocab-item > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.vocab-item strong {
  display: block;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.08;
  letter-spacing: -.035em;
  opacity: 0;
  transform: translateX(-9px);
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  transition: opacity .34s ease, transform .42s cubic-bezier(.2,.8,.2,1);
  white-space: nowrap;
}
.vocab-item.is-visible strong { opacity: 1; transform: translateX(0); }
.vocab-item small {
  display: block;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  color: var(--mint);
  font: 1000 clamp(12px, 1.24vw, 15px)/1.15 "Be Vietnam Pro", system-ui, sans-serif;
  letter-spacing: .025em;
  opacity: 0;
  transform: translateY(-7px);
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  transition: opacity .35s ease, transform .35s ease;
  white-space: nowrap;
}
.vocab-item.is-translated small {
  opacity: 1;
  transform: translateY(0);
}
.vocab-preview__footer {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}
.vocab-preview__progress {
  position: relative;
  height: 22px;
  overflow: visible;
}
.vocab-preview__progress::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 3px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, rgba(109,220,255,.22) 0 9px, transparent 9px 14px),
    rgba(109,220,255,.08);
  transform: translateY(-50%);
}
.vocab-preview__progress i {
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sun), var(--mint));
  box-shadow: 0 0 15px var(--mint);
  transform: translateY(-50%);
  transition: width .45s ease;
}
.vocab-preview__progress i::after {
  content: "✈︎";
  position: absolute;
  z-index: 2;
  right: 0;
  top: 50%;
  color: var(--sun);
  font: 900 25px/1 "Arial Unicode MS", "Segoe UI Symbol", sans-serif;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,.72)) drop-shadow(0 0 8px var(--sun));
  transform: translate(45%, -56%);
  transform-origin: center;
}
.vocab-preview__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}
.vocab-ready {
  color: var(--mint);
  font: 1000 11px/1 "Be Vietnam Pro", system-ui, sans-serif;
  letter-spacing: .16em;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity .3s ease, transform .3s ease;
}
.vocab-ready b { padding-left: 7px; color: var(--sun); }
.vocab-ready.is-visible { opacity: 1; transform: translateX(0); }
.vocab-preview__actions .secondary-button {
  min-width: 88px;
  min-height: 44px;
  border: 1px solid rgba(109,220,255,.2);
  color: var(--ink);
  background: rgba(3,18,24,.42);
}
.vocab-preview__actions .secondary-button b { padding-left: 5px; color: var(--sun); }
.vocab-preview__actions .secondary-button:hover,
.vocab-preview__actions .secondary-button:focus-visible {
  border-color: var(--sun);
  background: rgba(255,211,90,.1);
}
.vocab-preview.is-ready {
  --preview-progress: 100%;
}
.vocab-preview.is-ready .vocab-item {
  opacity: .9;
}
#passport-intro.is-leaving {
  pointer-events: none;
  animation: vocab-overlay-out .62s ease forwards;
}
#passport-intro.is-leaving .vocab-preview__header,
#passport-intro.is-leaving .vocab-preview__footer {
  animation: vocab-chrome-out .34s ease forwards;
}
#passport-intro.is-leaving .vocab-item {
  animation: vocab-row-out .34s cubic-bezier(.4,0,1,1) forwards;
  animation-delay: calc(var(--row-index, 0) * 32ms);
}
#passport-intro.is-leaving .vocab-preview {
  animation: vocab-preview-out .62s cubic-bezier(.4,0,.7,1) forwards;
}
@keyframes vocab-scan {
  0% { opacity: 0; transform: translateX(-100%); }
  26% { opacity: 1; }
  100% { opacity: 0; transform: translateX(100%); }
}
@keyframes vocab-row-out {
  0% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(-54px); }
}
@keyframes vocab-chrome-out {
  to { opacity: 0; transform: translateX(-24px); }
}
@keyframes vocab-preview-out {
  0%, 42% { border-left-color: var(--mint); }
  100% { border-left-color: transparent; background: transparent; box-shadow: none; }
}
@keyframes vocab-overlay-out {
  0%, 45% { opacity: 1; }
  100% { opacity: 0; }
}
@media (max-width: 720px) {
  #passport-intro.overlay--passport {
    align-items: stretch;
    justify-content: stretch;
    padding: var(--safe-top) 10px var(--safe-bottom);
    background:
      linear-gradient(180deg, rgba(2,11,17,.48), rgba(2,11,17,.72) 42%, rgba(2,11,17,.84));
  }
  .vocab-preview {
    align-self: stretch;
    width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 16px 14px calc(12px + var(--safe-bottom-inset));
    border-left-width: 2px;
    background: linear-gradient(90deg, rgba(3,18,24,.72), rgba(3,18,24,.5));
  }
  .vocab-preview__header,
  .vocab-preview__footer {
    flex-shrink: 0;
  }
  .vocab-preview__header h2 { font-size: 22px; }
  .vocab-list {
    gap: 5px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .vocab-item {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    min-height: 66px;
    padding: 7px 10px 7px 6px;
  }
  .vocab-item > b { width: 36px; height: 36px; }
  .vocab-item strong { font-size: clamp(20px, 6.24vw, 26px); }
  .vocab-item small { font-size: clamp(12px, 3.6vw, 14px); }
}
@media (max-height: 650px) {
  .vocab-preview {
    gap: 8px;
    max-height: calc(100dvh - 12px);
    padding: 10px 16px;
  }
  .vocab-preview__header { padding-bottom: 7px; }
  .vocab-preview__header h2 { font-size: 19px; }
  .vocab-list { gap: 3px; }
  .vocab-item {
    grid-template-columns: 34px minmax(0,1fr);
    gap: 9px;
    min-height: 49px;
    padding: 4px 9px 4px 5px;
  }
  .vocab-item > b { width: 31px; height: 31px; font-size: 8px; }
  .vocab-item strong { font-size: clamp(18px, 4.64vh, 24px); }
  .vocab-item small { font-size: clamp(10px, 2.8vh, 12px); }
  .vocab-preview__footer { gap: 5px; }
  .vocab-preview__actions { min-height: 44px; }
  .vocab-preview__actions .secondary-button { min-height: 44px; }
}
/* Language World Tour */
.overlay--journey {
  --tour-blue: #6ddcff;
  --tour-navy: #06141d;
  z-index: 11;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at 75% 12%, rgba(84, 216, 255, .14), transparent 25%),
    #051219;
  background-size: 42px 42px, 42px 42px, auto, auto;
  backdrop-filter: none;
  touch-action: pan-y;
}
.tour-header {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 74px;
  padding: 10px clamp(16px, 3vw, 46px);
  border-bottom: 1px solid rgba(109, 220, 255, .18);
  background: rgba(3, 15, 22, .9);
  box-shadow: 0 16px 46px rgba(0, 0, 0, .22);
}
.tour-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.tour-brand > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px 4px 12px 4px; color: #041914; background: linear-gradient(145deg, var(--mint), var(--sun)); font-size: 13px; font-weight: 1000; box-shadow: 0 0 24px rgba(99,255,208,.16); }
.tour-brand strong { font-size: 16px; letter-spacing: -.04em; }
.tour-brand em { color: var(--sun); font-style: normal; }
.tour-season { display: grid; gap: 3px; text-align: center; }
.tour-season span { color: var(--mint); font-size: 8px; font-weight: 900; letter-spacing: .26em; }
.tour-season strong { font-size: 12px; letter-spacing: .12em; }
.tour-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.tour-progress { display: grid; gap: 5px; width: 150px; }
.tour-progress span { color: var(--muted); font: 8px "Be Vietnam Pro", system-ui, sans-serif; letter-spacing: .08em; text-align: right; text-transform: uppercase; }
.tour-progress i { display: block; height: 4px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.09); }
.tour-progress b { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), var(--sun)); transition: width .35s ease; }
.backup-button, .memory-loop-button, .setup-back-button {
  border: 1px solid rgba(109,220,255,.3);
  color: #dff8ff;
  background: rgba(9,34,44,.72);
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
  transition: color .16s ease, border-color .16s ease, transform .16s ease;
}
.backup-button { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 13px; border-radius: 9px 3px 9px 3px; }
.backup-button span { color: var(--sun); font-size: 17px; }
.memory-loop-button { display: grid; grid-template-columns: auto auto; align-items: center; gap: 0 7px; min-height: 38px; padding: 4px 11px; border-color: rgba(255,211,90,.34); border-radius: 8px; }
.memory-loop-button span { grid-row: 1 / 3; color: var(--sun); font-size: 19px; }
.memory-loop-button b { font-size: 8px; letter-spacing: .12em; }
.memory-loop-button small { color: var(--mint); font-size: 7px; letter-spacing: .08em; }
.backup-button:hover, .backup-button:focus-visible, .memory-loop-button:hover, .memory-loop-button:focus-visible, .setup-back-button:hover, .setup-back-button:focus-visible { border-color: var(--mint); color: var(--mint); transform: translateY(-1px); }
.tour-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); min-height: 0; }
.act-rail { position: relative; z-index: 2; padding: 28px 16px; overflow-y: auto; border-right: 1px solid rgba(109,220,255,.13); background: rgba(3,16,23,.72); scrollbar-width: thin; }
.act-rail__label { display: block; margin: 0 8px 13px; color: rgba(165,186,192,.56); font-size: 7px; font-weight: 900; letter-spacing: .21em; }
.act-rail nav { display: grid; gap: 5px; }
.act-link { display: grid; grid-template-columns: 24px minmax(0,1fr); align-items: center; gap: 8px; min-height: 44px; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px 3px 8px 3px; color: rgba(165,186,192,.72); background: transparent; text-align: left; cursor: pointer; }
.act-link i { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid rgba(109,220,255,.22); border-radius: 50%; color: var(--tour-blue); font-size: 8px; font-style: normal; }
.act-link span { display: grid; gap: 2px; min-width: 0; }
.act-link strong { overflow: hidden; font-size: 8px; letter-spacing: .08em; text-overflow: ellipsis; white-space: nowrap; }
.act-link small { overflow: hidden; font: 7px "Be Vietnam Pro", system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.act-link:hover, .act-link:focus-visible, .act-link.is-active { border-color: rgba(99,255,208,.28); color: var(--ink); background: rgba(15,48,56,.68); }
.act-link.is-active i { color: #041914; border-color: transparent; background: var(--mint); box-shadow: 0 0 16px rgba(99,255,208,.25); }
.journey-scroll { min-width: 0; overflow-x: hidden; overflow-y: auto; scroll-behavior: smooth; scrollbar-color: rgba(99,255,208,.45) rgba(4,17,23,.45); }
.tour-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); align-items: center; gap: clamp(30px, 7vw, 100px); min-height: 420px; padding: clamp(54px, 8vw, 110px) clamp(30px, 8vw, 130px); overflow: hidden; border-bottom: 1px solid rgba(109,220,255,.12); }
.tour-hero::before { content: ""; position: absolute; right: 3%; top: 7%; width: min(42vw, 560px); aspect-ratio: 1; border: 1px solid rgba(109,220,255,.12); border-radius: 50%; box-shadow: inset 0 0 0 38px rgba(109,220,255,.02), inset 0 0 0 39px rgba(109,220,255,.08), 0 0 100px rgba(109,220,255,.06); }
.tour-hero > * { position: relative; z-index: 1; }
.tour-hero h1 { margin: 12px 0 17px; font-size: clamp(48px, 7vw, 102px); line-height: .82; letter-spacing: -.075em; font-style: italic; }
.tour-hero h1 em { color: var(--sun); font-style: inherit; text-shadow: 0 0 40px rgba(255,211,90,.14); }
.tour-hero p { max-width: 620px; margin: 0; color: var(--muted); font: clamp(13px, 1.4vw, 17px)/1.65 "Be Vietnam Pro", system-ui, sans-serif; }
.tour-pass { justify-self: center; display: grid; align-content: center; gap: 8px; width: min(330px, 100%); min-height: 190px; padding: 25px; transform: rotate(2deg); border: 1px solid rgba(255,211,90,.4); border-radius: 18px 5px 18px 5px; background: linear-gradient(145deg, rgba(18,57,65,.94), rgba(5,24,32,.95)); box-shadow: 0 28px 70px rgba(0,0,0,.34), inset 0 0 0 5px rgba(255,255,255,.018); }
.tour-pass::after { content: "♪"; position: absolute; align-self: end; justify-self: end; color: rgba(99,255,208,.13); font-size: 80px; line-height: .8; }
.tour-pass__flag { justify-self: start; padding: 5px 8px; border-radius: 3px; color: #07131b; background: var(--sun); font-size: 8px; letter-spacing: .14em; }
.tour-pass strong { font-size: 20px; letter-spacing: -.03em; }
.tour-pass b { color: var(--mint); font-size: 9px; letter-spacing: .14em; }
.tour-pass small { color: var(--muted); font: 8px "Be Vietnam Pro", system-ui, sans-serif; letter-spacing: .09em; }
.journey-map { width: min(1120px, calc(100% - 44px)); margin: 0 auto; padding: 54px 0 100px; }
.journey-act { position: relative; padding-bottom: 70px; scroll-margin-top: 18px; }
.journey-act:last-child { padding-bottom: 0; }
.journey-act__header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; padding-bottom: 14px; border-bottom: 1px solid rgba(109,220,255,.17); }
.journey-act__header div { display: grid; gap: 5px; }
.journey-act__header span { color: var(--mint); font-size: 8px; letter-spacing: .24em; }
.journey-act__header h2 { margin: 0; font-size: clamp(28px, 4vw, 48px); letter-spacing: -.045em; }
.journey-act__header p { margin: 0 0 5px; color: var(--muted); font: 11px "Be Vietnam Pro", system-ui, sans-serif; }
.journey-route { position: relative; display: grid; gap: 22px; }
.journey-route::before { content: ""; position: absolute; left: 45px; top: 22px; bottom: 22px; width: 2px; background: repeating-linear-gradient(180deg, rgba(99,255,208,.6) 0 7px, transparent 7px 15px); }
.location-card { position: relative; display: grid; grid-template-columns: 92px minmax(185px,.65fr) minmax(0,1.6fr); align-items: center; min-height: 132px; padding: 18px 20px 18px 0; border: 1px solid rgba(109,220,255,.14); border-radius: 18px 5px 18px 5px; background: linear-gradient(105deg, rgba(7,31,40,.92), rgba(5,20,28,.74)); box-shadow: 0 18px 44px rgba(0,0,0,.16); }
.location-card.is-playable { border-color: rgba(99,255,208,.3); background: linear-gradient(105deg, rgba(10,48,52,.96), rgba(5,23,30,.8)); box-shadow: 0 18px 50px rgba(0,0,0,.22), inset 0 0 50px rgba(99,255,208,.025); }
.location-pin { position: relative; z-index: 1; display: grid; place-items: center; justify-self: center; width: 52px; height: 52px; border: 2px solid rgba(109,220,255,.32); border-radius: 50% 50% 50% 12px; transform: rotate(-45deg); color: var(--tour-blue); background: #071c26; box-shadow: 0 0 0 8px #061821; }
.location-pin span { transform: rotate(45deg); font-size: 13px; }
.location-card.is-playable .location-pin { color: #041914; border-color: var(--mint); background: var(--mint); box-shadow: 0 0 0 8px #072128, 0 0 28px rgba(99,255,208,.25); }
.location-copy { display: grid; gap: 5px; padding-right: 20px; }
.location-copy span { color: var(--sun); font-size: 7px; letter-spacing: .18em; }
.location-copy strong { font-size: 19px; letter-spacing: -.025em; }
.location-copy small { color: var(--muted); font: 10px "Be Vietnam Pro", system-ui, sans-serif; }
.location-songs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.song-node { position: relative; display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: center; gap: 8px; min-height: 66px; padding: 9px; overflow: hidden; border: 1px solid rgba(109,220,255,.14); border-radius: 10px 3px 10px 3px; color: rgba(165,186,192,.64); background: rgba(2,14,20,.52); text-align: left; }
button.song-node { cursor: pointer; }
.song-node > i { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid rgba(109,220,255,.2); border-radius: 50%; font-size: 10px; font-style: normal; }
.song-node > span { display: grid; gap: 4px; min-width: 0; }
.song-node strong { overflow: hidden; color: inherit; font-size: 9px; letter-spacing: .035em; text-overflow: ellipsis; white-space: nowrap; }
.song-node small { overflow: hidden; color: rgba(165,186,192,.48); font: 7px "Be Vietnam Pro", system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.song-node.is-ready { border-color: rgba(99,255,208,.38); color: var(--ink); background: linear-gradient(135deg, rgba(21,70,68,.88), rgba(7,34,40,.86)); box-shadow: inset 0 -2px rgba(99,255,208,.11); transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.song-node.is-ready > i { color: #041914; border-color: transparent; background: linear-gradient(145deg,var(--mint),var(--sun)); }
.song-node.is-ready:hover, .song-node.is-ready:focus-visible { border-color: var(--sun); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.2), 0 0 18px rgba(99,255,208,.09); }
.song-node.is-complete::after { content: "✓"; position: absolute; right: 5px; top: 4px; display: grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; color: #041914; background: var(--sun); font-size: 8px; }
.song-node.is-coming > i { color: rgba(165,186,192,.55); }
.song-node.is-coming { cursor: default; }
.tour-footer { padding: 40px; border-top: 1px solid rgba(109,220,255,.1); color: rgba(165,186,192,.35); font-size: 8px; letter-spacing: .22em; text-align: center; }
.journey-toast { position: fixed; z-index: 15; left: 50%; bottom: max(24px, var(--safe-bottom-inset)); max-width: min(430px,calc(100vw - 32px)); padding: 11px 16px; transform: translateX(-50%); border: 1px solid rgba(255,211,90,.48); border-radius: 8px 3px 8px 3px; color: var(--ink); background: rgba(7,27,34,.96); box-shadow: 0 12px 40px rgba(0,0,0,.4); font: 11px/1.4 "Be Vietnam Pro", system-ui, sans-serif; text-align: center; }
.setup-back-button { position: fixed; z-index: 2; left: var(--safe-left); top: var(--safe-top); min-height: 36px; padding: 0 13px; border-radius: 8px 3px 8px 3px; }
.journey-song-brief { display: grid; gap: 5px; width: min(560px,calc(100vw - 32px)); padding: 13px 16px; border: 1px solid rgba(255,211,90,.3); border-radius: 12px 4px 12px 4px; background: linear-gradient(100deg,rgba(17,53,57,.86),rgba(6,24,31,.8)); text-align: center; }
.journey-song-brief > span { color: var(--mint); font-size: 8px; letter-spacing: .18em; }
.journey-song-brief > span i { display: inline-grid; place-items: center; width: 23px; height: 23px; margin-right: 7px; border-radius: 50%; color: #041914; background: var(--sun); font-size: 8px; font-style: normal; }
.journey-song-brief strong { font-size: 22px; letter-spacing: -.02em; }
.journey-song-brief small { overflow: hidden; color: var(--muted); font: 10px "Be Vietnam Pro", system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.overlay--menu.is-journey-song .track-picker { display: none; }
.overlay--menu.is-backup .journey-song-brief { display: none; }
.overlay--menu.is-memory .track-picker { display: none; }
.overlay--menu.is-backup #setup-eyebrow::after { content: " · BACKUP LIBRARY"; color: var(--sun); }

/* Memory Loop */
.overlay--memory {
  z-index: 12;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
  background: #061219;
  backdrop-filter: none;
}
.memory-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 82px;
  padding: 11px clamp(16px, 3vw, 46px);
  border-bottom: 1px solid rgba(109,220,255,.18);
  background: rgba(3,15,22,.96);
}
.memory-header .setup-back-button { position: static; justify-self: start; }
.memory-header__title { display: grid; gap: 4px; text-align: center; }
.memory-header__title span { color: var(--mint); font-size: 8px; letter-spacing: .24em; }
.memory-header__title h1 { margin: 0; color: var(--ink); font-size: clamp(25px, 3vw, 38px); letter-spacing: 0; }
.memory-header__stats { display: flex; justify-self: end; border: 1px solid rgba(109,220,255,.18); }
.memory-header__stats div { display: grid; gap: 2px; min-width: 72px; padding: 9px 12px; text-align: center; }
.memory-header__stats div + div { border-left: 1px solid rgba(109,220,255,.18); }
.memory-header__stats strong { color: var(--sun); font-size: 18px; font-variant-numeric: tabular-nums; }
.memory-header__stats span { color: var(--muted); font-size: 7px; letter-spacing: .1em; }
.memory-body {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}
.memory-round-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  padding: clamp(28px, 5vw, 68px);
  border-right: 1px solid rgba(109,220,255,.14);
  background: rgba(5,22,30,.84);
}
.memory-round-panel h2 { margin: 0; max-width: 16ch; font-size: clamp(28px, 3.8vw, 46px); line-height: 1; letter-spacing: 0; }
.memory-round-panel p { margin: 0; color: var(--muted); font: 13px/1.55 "Be Vietnam Pro", system-ui, sans-serif; }
.memory-round-meta { display: grid; width: 100%; border-block: 1px solid rgba(109,220,255,.16); }
.memory-round-meta span { display: flex; align-items: baseline; justify-content: space-between; padding: 9px 0; color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.memory-round-meta span + span { border-top: 1px solid rgba(109,220,255,.1); }
.memory-round-meta strong { color: var(--ink); font-size: 18px; }
.memory-round-panel .primary-button { width: 100%; }
.memory-round-panel .primary-button:disabled { cursor: default; filter: grayscale(.7); opacity: .4; transform: none; }
.memory-mode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
}
.memory-mode-card {
  appearance: none;
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 0;
  padding: 12px 14px 13px;
  border: 1px solid rgba(109, 220, 255, 0.22);
  border-radius: 16px 6px 16px 6px;
  background:
    linear-gradient(180deg, rgba(109, 220, 255, 0.08), rgba(5, 22, 30, 0.2)),
    rgba(4, 16, 24, 0.72);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.memory-mode-card span {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
}
.memory-mode-card strong {
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: 0;
}
.memory-mode-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.memory-mode-card--run {
  box-shadow: inset 0 0 0 1px rgba(99, 255, 208, 0.08);
}
.memory-mode-card--run span { color: var(--mint); }
.memory-mode-card--quiz span { color: var(--sun); }
.memory-mode-card:hover,
.memory-mode-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(99, 255, 208, 0.55);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}
.memory-mode-card--quiz:hover,
.memory-mode-card--quiz:focus-visible { border-color: rgba(255, 211, 90, 0.62); }
.memory-mode-card:disabled {
  cursor: default;
  filter: grayscale(0.65);
  opacity: 0.42;
  transform: none;
  box-shadow: none;
}
.memory-mode-note {
  min-height: 0;
  margin: 0;
  color: var(--muted);
  font: 12px/1.45 "Be Vietnam Pro", system-ui, sans-serif;
}
.memory-mode-note:empty { display: none; }
.overlay--memory-quiz {
  z-index: 28;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-items: stretch;
  justify-content: stretch;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 0%, rgba(99, 255, 208, 0.16), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(255, 211, 90, 0.12), transparent 28%),
    linear-gradient(165deg, #06131c 0%, #081820 48%, #061017 100%);
  backdrop-filter: none;
}
.memory-quiz__header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}
.memory-quiz__close {
  appearance: none;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(109, 220, 255, 0.28);
  border-radius: 999px;
  background: rgba(109, 220, 255, 0.08);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.memory-quiz__close:hover,
.memory-quiz__close:focus-visible { border-color: var(--mint); color: var(--mint); }
.memory-quiz__meta {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
}
.memory-quiz__meta span {
  max-width: 100%;
  overflow: hidden;
  color: var(--mint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memory-quiz__meta strong {
  color: var(--ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}
.memory-quiz__retry {
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 104, 79, 0.55);
  border-radius: 999px;
  color: #ffd0c6;
  background: rgba(255, 71, 111, 0.16);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}
.memory-quiz__progress-track {
  height: 4px;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(109, 220, 255, 0.12);
}
.memory-quiz__progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--sun));
  transition: width 0.25s ease;
}
.memory-quiz__stage {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(16px, 2.4vh, 28px);
  width: min(820px, 100%);
  height: 100%;
  margin: 0 auto;
  min-height: 0;
}
.memory-quiz__stage p {
  margin: 0;
  color: var(--muted);
  font: 13px/1.45 "Be Vietnam Pro", system-ui, sans-serif;
  text-align: center;
}
.memory-quiz__stage h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(32px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-align: center;
  text-wrap: balance;
  outline: none;
}
.memory-quiz__example {
  padding: 12px 14px;
  border: 1px solid rgba(99, 255, 208, 0.28);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(99, 255, 208, 0.08);
  text-align: center;
}
.memory-quiz__example mark {
  color: var(--sun);
  background: transparent;
  font-weight: 800;
}
.memory-quiz__choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 0;
}
.memory-quiz__choice {
  appearance: none;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 108px;
  padding: 14px 16px;
  border: 1px solid rgba(109, 220, 255, 0.24);
  border-radius: 16px 8px 16px 8px;
  background: rgba(7, 24, 32, 0.82);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.16s ease, background 0.16s ease;
}
.memory-quiz__choice b {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #04140f;
  background: var(--mint);
  font-size: 14px;
}
.memory-quiz__choice span {
  min-width: 0;
  font-size: clamp(15px, 2.2vw, 20px);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.memory-quiz__choice:hover,
.memory-quiz__choice:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(99, 255, 208, 0.7);
}
.memory-quiz__choice:disabled { cursor: default; transform: none; }
.memory-quiz__choice.is-wrong,
.memory-quiz__choice.is-wrong:disabled {
  border-color: rgba(255, 71, 111, 0.7);
  background: rgba(255, 71, 111, 0.14);
}
.memory-quiz__choice.is-wrong b { background: var(--danger); color: white; }
.memory-quiz__choice.is-correct,
.overlay--memory-quiz.is-correct .memory-quiz__choice.is-correct {
  border-color: rgba(99, 255, 208, 0.8);
  background: rgba(99, 255, 208, 0.14);
  box-shadow: 0 0 24px rgba(99, 255, 208, 0.16);
}
.memory-quiz__choice.is-correct b { background: var(--sun); }
@media (max-width: 720px) {
  .memory-quiz__header { grid-template-columns: auto minmax(0, 1fr); }
  .memory-quiz__retry { grid-column: 1 / -1; justify-self: start; }
  .memory-quiz__choices { grid-template-columns: 1fr; }
  .memory-quiz__choice { min-height: 64px; }
  .memory-quiz__stage h2 { font-size: clamp(28px, 8vw, 42px); }
}
.memory-feedback-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 10px 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(109, 220, 255, 0.28);
  background: rgba(109, 220, 255, 0.08);
  color: var(--ink);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.memory-feedback-button .hub-svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  opacity: 0.85;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.memory-feedback-button:hover,
.memory-feedback-button:focus-visible {
  background: rgba(109, 220, 255, 0.16);
  border-color: rgba(109, 220, 255, 0.5);
}
.memory-feedback-button:hover .hub-svg,
.memory-feedback-button:focus-visible .hub-svg {
  opacity: 1;
  transform: translateX(2px);
}
.memory-library { min-width: 0; min-height: 0; padding: clamp(24px, 4vw, 54px); overflow-y: auto; }
.memory-library > header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid rgba(109,220,255,.16); }
.memory-library > header div { display: grid; gap: 5px; }
.memory-library > header span { color: var(--mint); font-size: 8px; letter-spacing: .18em; }
.memory-library > header h2 { margin: 0; font-size: 28px; letter-spacing: 0; }
.memory-library > header small { max-width: 360px; color: var(--muted); font: 11px/1.4 "Be Vietnam Pro", system-ui, sans-serif; text-align: right; }
.memory-phrase-list { display: grid; gap: 1px; background: rgba(109,220,255,.13); border: 1px solid rgba(109,220,255,.13); }
.memory-phrase-row { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(140px, 1fr) 96px 96px; align-items: center; gap: 16px; min-height: 62px; padding: 10px 14px; background: #071a22; }
.memory-phrase-row strong { overflow-wrap: anywhere; color: var(--ink); font-size: 15px; letter-spacing: 0; }
.memory-phrase-row > span { overflow-wrap: anywhere; color: var(--muted); font: 13px/1.3 "Be Vietnam Pro", system-ui, sans-serif; }
.memory-mastery { display: grid; gap: 5px; }
.memory-mastery span { color: var(--muted); font-size: 8px; text-align: right; }
.memory-mastery i { display: block; height: 4px; overflow: hidden; background: rgba(255,255,255,.08); }
.memory-mastery b { display: block; height: 100%; background: var(--mint); }
.memory-due-label { justify-self: end; padding: 6px 8px; border: 1px solid rgba(109,220,255,.2); border-radius: 4px; color: var(--muted); font-size: 8px; letter-spacing: .08em; text-align: center; }
.memory-due-label.is-due { border-color: rgba(255,211,90,.45); color: var(--sun); background: rgba(255,211,90,.08); }
.memory-empty { display: grid; place-items: center; min-height: 220px; padding: 32px; color: var(--muted); background: #071a22; font: 13px/1.5 "Be Vietnam Pro", system-ui, sans-serif; text-align: center; }

body.is-memory-run .hud__brand strong { color: var(--mint); }
body.is-memory-run .song-progress { border-color: rgba(255,211,90,.38); }
body.is-memory-run .song-progress__track i { background: linear-gradient(90deg, var(--sun), var(--mint)); }

body.mode-tunnel {
  --ink: #fff8ff;
  --muted: #c9aed8;
  --night: #080011;
  --panel: rgba(22, 5, 37, 0.88);
  --line: rgba(233, 168, 255, 0.3);
  --mint: #ff54d6;
  --cyan: #9b6cff;
  --sun: #ffb32d;
  --coral: #ff5d79;
}
body.mode-tunnel .vignette {
  background:
    linear-gradient(180deg, rgba(8, 0, 20, .5), transparent 24%, transparent 65%, rgba(13, 0, 23, .72) 100%),
    radial-gradient(circle at 50% 44%, transparent 28%, rgba(19, 0, 31, .56) 100%);
}
body.mode-tunnel .overlay {
  background:
    radial-gradient(circle at 50% 34%, rgba(155, 108, 255, .22), transparent 36%),
    linear-gradient(110deg, rgba(10, 0, 22, .96), rgba(29, 4, 42, .72), rgba(10, 0, 22, .96));
}
body.mode-tunnel .menu-emblem { border-radius: 9px; transform: rotate(45deg); color: var(--sun); border-color: rgba(255,84,214,.62); }
body.mode-tunnel .menu-emblem span { transform: rotate(-45deg); }
body.mode-tunnel .menu-emblem::before { border-radius: 9px; border-color: rgba(255,179,45,.4); }
body.mode-tunnel .track-ticket { border-radius: 999px; border-color: rgba(255,84,214,.36); background: linear-gradient(90deg, rgba(43,8,63,.92), rgba(17,3,31,.88)); }
body.mode-tunnel .track-ticket__art { border-radius: 50%; background: #33104a; }
body.mode-tunnel .track-ticket__art i { background: #ff54d6; box-shadow: 0 22px 0 #9b6cff, 0 -22px 0 #ffb32d; }
body.mode-tunnel .track-choice { border-radius: 999px; background: rgba(31, 6, 47, .82); }
body.mode-tunnel .track-choice.is-selected { background: rgba(67, 12, 78, .92); box-shadow: inset 3px 0 var(--sun), 0 0 26px rgba(255,84,214,.16); }
body.mode-tunnel .track-choice > i { border-radius: 50%; }
body.mode-tunnel .character-choice { border-radius: 999px; background: rgba(31, 6, 47, .82); }
body.mode-tunnel .character-choice.is-selected { background: rgba(67, 12, 78, .92); box-shadow: inset 3px 0 var(--sun), 0 0 26px rgba(255,84,214,.16); }
body.mode-tunnel .character-choice__avatar { border-radius: 50%; background: rgba(31, 6, 47, .9); }
body.mode-tunnel .experience-choice { border-radius: 999px; background: rgba(31, 6, 47, .82); }
body.mode-tunnel .experience-choice.is-selected { background: rgba(67, 12, 78, .92); box-shadow: inset 3px 0 var(--sun), 0 0 26px rgba(255,84,214,.16); }
body.mode-tunnel .brand-mark { border-radius: 50%; color: #210019; background: linear-gradient(145deg, #ffb32d, #ff54d6); box-shadow: 0 0 24px rgba(255,84,214,.36); }
body.mode-tunnel .song-progress { border-radius: 999px; border-color: rgba(255,84,214,.34); background: linear-gradient(180deg, rgba(32,5,51,.9), rgba(19,3,34,.76)); }
body.mode-tunnel .song-progress__track i { background: linear-gradient(90deg, #9b6cff, #ff54d6, #ffb32d); box-shadow: 0 0 16px #ff54d6; }
body.mode-tunnel .lives-badge,
body.mode-tunnel .stat-readout,
body.mode-tunnel .icon-button { border-radius: 999px; background: rgba(28, 5, 44, .84); }
body.mode-tunnel .primary-button { color: #210019; background: linear-gradient(90deg, #ff54d6, #ffb32d); box-shadow: 0 14px 35px rgba(255,84,214,.2); }
body.mode-tunnel .touch-controls button { border-radius: 50%; border-color: rgba(255,84,214,.5); background: rgba(32,5,51,.8); }
body.mode-tunnel .touch-controls button:active { background: #ff54d6; }

body.mode-desert {
  --ink: #fff7e8;
  --muted: #e0b98f;
  --night: #24120a;
  --panel: rgba(54, 23, 10, 0.9);
  --line: rgba(255, 209, 129, 0.32);
  --mint: #ffd181;
  --cyan: #7ce5c7;
  --sun: #ffe2a3;
  --coral: #e66a3d;
}
body.mode-desert .vignette {
  background:
    linear-gradient(180deg, rgba(69, 25, 11, .25), transparent 27%, transparent 62%, rgba(34, 13, 7, .7) 100%),
    radial-gradient(circle at 64% 28%, transparent 17%, rgba(54, 18, 8, .5) 100%);
}
body.mode-desert .overlay {
  background:
    radial-gradient(circle at 70% 22%, rgba(255, 209, 129, .2), transparent 30%),
    linear-gradient(118deg, rgba(37, 15, 7, .97), rgba(104, 44, 20, .78), rgba(37, 15, 7, .96));
}
body.mode-desert .menu-emblem { border-radius: 4px 4px 42% 42%; color: var(--cyan); border-color: rgba(255,209,129,.72); transform: rotate(-4deg); }
body.mode-desert .menu-emblem span { transform: rotate(4deg); }
body.mode-desert .menu-emblem::before { border-radius: 50% 50% 8px 8px; border-color: rgba(124,229,199,.42); }
body.mode-desert .track-ticket { border-color: rgba(255,209,129,.4); background: linear-gradient(100deg, rgba(102,43,18,.92), rgba(49,20,9,.9)); box-shadow: inset 0 -3px rgba(124,229,199,.12); }
body.mode-desert .track-ticket__art { background: #6b321b; clip-path: polygon(0 18%, 18% 0, 100% 0, 100% 82%, 82% 100%, 0 100%); }
body.mode-desert .track-ticket__art i { background: #ffd181; box-shadow: 0 22px 0 #7ce5c7, 0 -22px 0 #e66a3d; }
body.mode-desert .track-choice,
body.mode-desert .character-choice,
body.mode-desert .experience-choice { border-color: rgba(255,209,129,.24); background: rgba(63, 26, 11, .82); }
body.mode-desert .track-choice.is-selected,
body.mode-desert .character-choice.is-selected,
body.mode-desert .experience-choice.is-selected { background: rgba(116, 51, 23, .94); box-shadow: inset 3px 0 var(--cyan), 0 0 24px rgba(255,209,129,.13); }
body.mode-desert .brand-mark { color: #3a180a; background: linear-gradient(145deg, #ffe2a3, #e66a3d); box-shadow: 0 0 22px rgba(255,209,129,.3); clip-path: polygon(0 12%, 14% 0, 100% 0, 100% 88%, 86% 100%, 0 100%); }
body.mode-desert .song-progress { border-color: rgba(255,209,129,.38); background: linear-gradient(180deg, rgba(72,29,12,.92), rgba(46,18,8,.8)); }
body.mode-desert .song-progress__track i { background: linear-gradient(90deg, #e66a3d, #ffd181, #7ce5c7); box-shadow: 0 0 16px #ffd181; }
body.mode-desert .lives-badge,
body.mode-desert .stat-readout,
body.mode-desert .icon-button { background: rgba(61,24,10,.88); border-color: rgba(255,209,129,.32); }
body.mode-desert .primary-button { color: #351506; background: linear-gradient(90deg, #ffd181, #7ce5c7); box-shadow: 0 14px 35px rgba(255,209,129,.18); }
body.mode-desert .touch-controls button { border-color: rgba(255,209,129,.55); background: rgba(61,24,10,.84); }
body.mode-desert .touch-controls button:active { color: #351506; background: #ffd181; }

body.mode-forest {
  --ink: #f5ffe9; --muted: #c2d7b1; --night: #102a24; --panel: rgba(18,52,40,.9);
  --line: rgba(184,255,159,.3); --mint: #b8ff9f; --cyan: #73d693; --sun: #ffdc72; --coral: #dc7656;
}
body.mode-arctic {
  --ink: #f4ffff; --muted: #bed8e7; --night: #102b46; --panel: rgba(16,43,70,.91);
  --line: rgba(202,248,255,.32); --mint: #79f4db; --cyan: #9dc7ff; --sun: #ffdf78; --coral: #e87989;
}
body.mode-coast {
  --ink: #fff9e8; --muted: #c8dce0; --night: #17465b; --panel: rgba(18,63,75,.9);
  --line: rgba(255,239,208,.3); --mint: #58c9bd; --cyan: #7cddd2; --sun: #ffdf75; --coral: #eb7655;
}
body.mode-forest .vignette,
body.mode-arctic .vignette,
body.mode-coast .vignette { background: linear-gradient(180deg, rgba(6,24,28,.18), transparent 30%, transparent 68%, rgba(5,18,23,.58)); }
body.mode-forest .overlay,
body.mode-arctic .overlay,
body.mode-coast .overlay { background: radial-gradient(circle at 70% 22%, color-mix(in srgb, var(--sun) 16%, transparent), transparent 31%), linear-gradient(118deg, color-mix(in srgb, var(--night) 96%, transparent), color-mix(in srgb, var(--cyan) 36%, var(--night)), color-mix(in srgb, var(--night) 96%, transparent)); }
body.mode-forest .track-choice,
body.mode-forest .character-choice,
body.mode-forest .experience-choice,
body.mode-arctic .track-choice,
body.mode-arctic .character-choice,
body.mode-arctic .experience-choice,
body.mode-coast .track-choice,
body.mode-coast .character-choice,
body.mode-coast .experience-choice { border-color: var(--line); background: color-mix(in srgb, var(--panel) 88%, transparent); }
body.mode-forest .track-choice.is-selected,
body.mode-forest .character-choice.is-selected,
body.mode-forest .experience-choice.is-selected,
body.mode-arctic .track-choice.is-selected,
body.mode-arctic .character-choice.is-selected,
body.mode-arctic .experience-choice.is-selected,
body.mode-coast .track-choice.is-selected,
body.mode-coast .character-choice.is-selected,
body.mode-coast .experience-choice.is-selected { background: color-mix(in srgb, var(--panel) 72%, var(--cyan)); box-shadow: inset 3px 0 var(--sun), 0 0 24px color-mix(in srgb, var(--mint) 14%, transparent); }
body.mode-forest .brand-mark,
body.mode-arctic .brand-mark,
body.mode-coast .brand-mark { color: var(--night); background: linear-gradient(145deg, var(--sun), var(--mint)); box-shadow: 0 0 22px color-mix(in srgb, var(--mint) 28%, transparent); }
body.mode-forest .song-progress,
body.mode-arctic .song-progress,
body.mode-coast .song-progress { border-color: var(--line); background: color-mix(in srgb, var(--panel) 90%, transparent); }
body.mode-forest .song-progress__track i,
body.mode-arctic .song-progress__track i,
body.mode-coast .song-progress__track i { background: linear-gradient(90deg, var(--coral), var(--sun), var(--mint)); box-shadow: 0 0 16px var(--mint); }
body.mode-forest .primary-button,
body.mode-arctic .primary-button,
body.mode-coast .primary-button { color: var(--night); background: linear-gradient(90deg, var(--sun), var(--mint)); }
body.mode-forest .lives-badge,
body.mode-forest .stat-readout,
body.mode-forest .icon-button,
body.mode-arctic .lives-badge,
body.mode-arctic .stat-readout,
body.mode-arctic .icon-button,
body.mode-coast .lives-badge,
body.mode-coast .stat-readout,
body.mode-coast .icon-button { background: color-mix(in srgb, var(--panel) 92%, transparent); border-color: var(--line); }
body.mode-forest .touch-controls button,
body.mode-arctic .touch-controls button,
body.mode-coast .touch-controls button { border-color: var(--line); background: color-mix(in srgb, var(--panel) 88%, transparent); }
body.mode-forest .touch-controls button:active,
body.mode-arctic .touch-controls button:active,
body.mode-coast .touch-controls button:active { color: var(--night); background: var(--mint); }

body.mode-savanna {
  --ink: #fff8df; --muted: #dac49a; --night: #5b351d; --panel: rgba(70,43,27,.91);
  --line: rgba(255,228,155,.32); --mint: #c5a857; --cyan: #7f9e4d; --sun: #ffd56b; --coral: #c75d37;
}
body.mode-sakura {
  --ink: #fff7f5; --muted: #e4c2d2; --night: #633b55; --panel: rgba(73,43,64,.91);
  --line: rgba(255,215,232,.34); --mint: #ffa8c7; --cyan: #d991b3; --sun: #ffd285; --coral: #ce5d69;
}
body.mode-moon {
  --ink: #f5f8ff; --muted: #bdc5df; --night: #171b35; --panel: rgba(20,25,53,.93);
  --line: rgba(219,230,255,.34); --mint: #8eddf2; --cyan: #9aaeff; --sun: #ffdf78; --coral: #e46c54;
}
body.mode-cloud {
  --ink: #fffdf6; --muted: #d4e4e8; --night: #315a78; --panel: rgba(44,79,99,.91);
  --line: rgba(255,255,255,.36); --mint: #aeddf2; --cyan: #91d5db; --sun: #ffe8a6; --coral: #d9785d;
}
:is(body.mode-savanna, body.mode-sakura, body.mode-moon, body.mode-cloud) .vignette {
  background: linear-gradient(180deg, rgba(9,20,31,.16), transparent 30%, transparent 68%, rgba(8,18,26,.58));
}
:is(body.mode-savanna, body.mode-sakura, body.mode-moon, body.mode-cloud) .overlay {
  background: radial-gradient(circle at 70% 22%, color-mix(in srgb, var(--sun) 16%, transparent), transparent 31%), linear-gradient(118deg, color-mix(in srgb, var(--night) 96%, transparent), color-mix(in srgb, var(--cyan) 34%, var(--night)), color-mix(in srgb, var(--night) 96%, transparent));
}
:is(body.mode-savanna, body.mode-sakura, body.mode-moon, body.mode-cloud) :is(.track-choice, .character-choice, .experience-choice) {
  border-color: var(--line); background: color-mix(in srgb, var(--panel) 88%, transparent);
}
:is(body.mode-savanna, body.mode-sakura, body.mode-moon, body.mode-cloud) :is(.track-choice, .character-choice, .experience-choice).is-selected {
  background: color-mix(in srgb, var(--panel) 72%, var(--cyan)); box-shadow: inset 3px 0 var(--sun), 0 0 24px color-mix(in srgb, var(--mint) 14%, transparent);
}
:is(body.mode-savanna, body.mode-sakura, body.mode-moon, body.mode-cloud) .brand-mark {
  color: var(--night); background: linear-gradient(145deg, var(--sun), var(--mint)); box-shadow: 0 0 22px color-mix(in srgb, var(--mint) 28%, transparent);
}
:is(body.mode-savanna, body.mode-sakura, body.mode-moon, body.mode-cloud) .song-progress {
  border-color: var(--line); background: color-mix(in srgb, var(--panel) 90%, transparent);
}
:is(body.mode-savanna, body.mode-sakura, body.mode-moon, body.mode-cloud) .song-progress__track i {
  background: linear-gradient(90deg, var(--coral), var(--sun), var(--mint)); box-shadow: 0 0 16px var(--mint);
}
:is(body.mode-savanna, body.mode-sakura, body.mode-moon, body.mode-cloud) .primary-button {
  color: var(--night); background: linear-gradient(90deg, var(--sun), var(--mint));
}
:is(body.mode-savanna, body.mode-sakura, body.mode-moon, body.mode-cloud) :is(.lives-badge, .stat-readout, .icon-button) {
  background: color-mix(in srgb, var(--panel) 92%, transparent); border-color: var(--line);
}
:is(body.mode-savanna, body.mode-sakura, body.mode-moon, body.mode-cloud) .touch-controls button {
  border-color: var(--line); background: color-mix(in srgb, var(--panel) 88%, transparent);
}
:is(body.mode-savanna, body.mode-sakura, body.mode-moon, body.mode-cloud) .touch-controls button:active {
  color: var(--night); background: var(--mint);
}

.overlay--compact { gap: 14px; text-align: center; }
.overlay--compact h2,
.overlay--win h2 { margin: 0; font-size: clamp(38px, 6vw, 66px); line-height: 0.95; letter-spacing: -0.045em; }
.overlay--compact p { margin: -5px 0 10px; color: var(--muted); font-family: "Be Vietnam Pro", system-ui, sans-serif; }
.overlay--fail { background: radial-gradient(circle at 50% 35%, rgba(255, 71, 111, 0.16), transparent 38%), rgba(4, 11, 16, 0.9); }
.overlay--fail .eyebrow { color: var(--danger); }
.answer-reveal { display: grid; gap: 2px; min-width: min(360px, calc(100vw - 36px)); padding: 14px 24px; border-block: 1px solid rgba(255, 71, 111, 0.38); background: linear-gradient(90deg, transparent, rgba(255, 71, 111, 0.1), transparent); }
.answer-reveal span { color: var(--muted); font: 10px "Be Vietnam Pro", system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; }
.answer-reveal strong { color: var(--sun); font-size: clamp(25px, 4vw, 38px); letter-spacing: 0.07em; }
.fail-actions { display: grid; gap: 8px; width: min(330px, calc(100vw - 42px)); }
.fail-actions .primary-button { width: 100%; }
.fail-actions .primary-button > span { display: grid; gap: 2px; text-align: left; }
.fail-actions .primary-button small { font-size: 7px; font-weight: 900; letter-spacing: 0.16em; opacity: 0.64; }
.fail-actions.has-continue {
  grid-template-columns: 1fr 1fr;
}
.fail-actions.has-continue #continue-button { grid-column: 1 / -1; }
.fail-actions:not(.has-continue) #continue-button { display: none !important; }
.fail-actions:not(.has-continue) #retry-button {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  padding: 0 8px 0 24px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  color: #031511;
  background: linear-gradient(90deg, var(--mint), #8fffdc);
  box-shadow: 0 14px 35px rgba(99, 255, 208, 0.18);
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: 0.1em;
  border: 0;
}
.fail-actions:not(.has-continue) #retry-button > span { display: grid; gap: 2px; text-align: left; }
.fail-actions:not(.has-continue) #retry-button small { display: block; font-size: 7px; font-weight: 900; letter-spacing: 0.16em; opacity: 0.64; }
.fail-actions:not(.has-continue) #retry-button i {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: rgba(2, 21, 16, 0.12);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 11px 100%, 0 calc(100% - 11px));
  font-style: normal;
  font-size: 18px;
}
.fail-actions:not(.has-continue) #fail-menu-button { grid-column: 1 / -1; }
.fail-actions.has-continue #retry-button,
.fail-actions.has-continue #fail-menu-button {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid rgba(167, 255, 226, 0.2);
  border-radius: 8px 3px 8px 3px;
  background: rgba(5, 20, 27, 0.62);
  font-size: 10px;
  line-height: 1.25;
  white-space: normal;
}
.fail-actions.has-continue #retry-button small,
.fail-actions.has-continue #retry-button i { display: none; }
.fail-actions.has-continue #retry-button:hover,
.fail-actions.has-continue #retry-button:focus-visible,
.fail-actions.has-continue #fail-menu-button:hover,
.fail-actions.has-continue #fail-menu-button:focus-visible { border-color: var(--mint); background: rgba(9, 35, 42, 0.84); }
.overlay--win { z-index: 32; gap: 16px; text-align: center; background: radial-gradient(circle at 50% 34%, rgba(255, 211, 90, 0.18), transparent 38%), rgba(3, 13, 17, 0.88); }
#win-menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(330px, calc(100vw - 42px));
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid color-mix(in srgb, var(--ink) 32%, transparent);
  border-radius: 8px 3px 8px 3px;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
#win-menu-button.is-home::before {
  content: "";
  width: 16px;
  height: 14px;
  flex: 0 0 16px;
  background: currentColor;
  clip-path: polygon(50% 0, 100% 42%, 82% 42%, 82% 100%, 18% 100%, 18% 42%, 0 42%);
}
#win-menu-button:hover,
#win-menu-button:focus-visible {
  color: var(--ink);
  border-color: var(--sun);
  background: color-mix(in srgb, var(--panel) 96%, var(--sun));
  transform: translateY(-2px);
}
#win-menu-button:active { transform: translateY(1px); }
.rank-medal { position: relative; display: grid; place-items: center; width: 98px; height: 98px; border: 2px solid var(--sun); border-radius: 50%; color: var(--sun); box-shadow: inset 0 0 24px rgba(255, 211, 90, 0.13), 0 0 32px rgba(255, 211, 90, 0.14); }
.rank-medal::before { content: ""; position: absolute; inset: 7px; border: 1px dashed rgba(255, 211, 90, 0.45); border-radius: inherit; }
.rank-medal span { margin-top: 10px; font-size: 8px; letter-spacing: .18em; }
.rank-medal strong { margin-top: -12px; font-size: 50px; line-height: 1; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; width: min(420px, calc(100vw - 32px)); background: var(--line); border: 1px solid var(--line); }
.result-grid--memory { width: min(700px, calc(100vw - 32px)); }
.result-grid div { display: grid; gap: 4px; padding: 13px 12px; background: rgba(5, 24, 30, 0.9); }
.result-grid span { color: var(--muted); font-size: 8px; letter-spacing: .13em; }
.result-grid strong { color: var(--ink); font-size: 20px; font-variant-numeric: tabular-nums; }
.result-best {
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.result-grid .is-record strong { color: var(--sun); }
.result-grid .is-record .result-best { color: var(--sun); }

.run-tutorial {
  position: fixed;
  z-index: 6;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 0 20px calc(28px + var(--safe-bottom));
  pointer-events: none;
  touch-action: none;
}
.run-tutorial.is-hold {
  pointer-events: auto;
}
.run-tutorial__scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(4, 14, 20, 0.08), rgba(3, 10, 16, 0.46) 62%);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.run-tutorial.is-hold .run-tutorial__scrim { opacity: 1; }
.run-tutorial__card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(340px, calc(100vw - 40px));
  margin-bottom: 12px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(167, 255, 226, 0.28);
  border-radius: 18px 8px 18px 8px;
  background: rgba(5, 18, 26, 0.88);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
  text-align: center;
}
.run-tutorial__gesture {
  position: relative;
  width: 88px;
  height: 88px;
  margin-bottom: 2px;
}
.run-tutorial__pad {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(167, 255, 226, 0.28);
  border-radius: 50%;
  background: rgba(7, 28, 36, 0.9);
  overflow: hidden;
}
.run-tutorial__finger {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 16px rgba(99, 255, 208, 0.55);
  transform: translate(-50%, -50%);
}
.run-tutorial__trail {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(99, 255, 208, 0), var(--mint));
  transform: translate(-50%, -50%);
  opacity: 0.85;
}
.run-tutorial__keys {
  display: none;
  position: absolute;
  inset: 8px;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  place-items: center;
  gap: 4px;
}
.run-tutorial__keys kbd {
  min-width: 28px;
  padding: 6px 8px;
  font-size: 12px;
}
.run-tutorial__keys kbd[data-key="up"] { grid-column: 2; grid-row: 1; }
.run-tutorial__keys kbd[data-key="left"] { grid-column: 1; grid-row: 2; }
.run-tutorial__keys kbd[data-key="down"] { grid-column: 2; grid-row: 2; }
.run-tutorial__keys kbd[data-key="right"] { grid-column: 3; grid-row: 2; }
.run-tutorial[data-mode="keys"] .run-tutorial__pad { display: none; }
.run-tutorial[data-mode="keys"] .run-tutorial__keys { display: grid; }
.run-tutorial[data-mode="swipe"] .run-tutorial__keys { display: none; }
.run-tutorial__title,
#run-tutorial-title {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
}
#run-tutorial-hint {
  color: var(--muted);
  font: 12px/1.4 "Be Vietnam Pro", system-ui, sans-serif;
}
.run-tutorial[data-dir="up"] .run-tutorial__finger { animation: tutorial-swipe-up 1.05s ease-in-out infinite; }
.run-tutorial[data-dir="up"] .run-tutorial__trail { animation: tutorial-trail-up 1.05s ease-in-out infinite; }
.run-tutorial[data-dir="down"] .run-tutorial__finger { animation: tutorial-swipe-down 1.05s ease-in-out infinite; }
.run-tutorial[data-dir="down"] .run-tutorial__trail {
  background: linear-gradient(0deg, rgba(99, 255, 208, 0), var(--mint));
  animation: tutorial-trail-down 1.05s ease-in-out infinite;
}
.run-tutorial[data-dir="left"] .run-tutorial__finger { animation: tutorial-swipe-left 1.05s ease-in-out infinite; }
.run-tutorial[data-dir="left"] .run-tutorial__trail {
  width: 28px;
  height: 8px;
  background: linear-gradient(90deg, var(--mint), rgba(99, 255, 208, 0));
  animation: tutorial-trail-left 1.05s ease-in-out infinite;
}
.run-tutorial[data-dir="right"] .run-tutorial__finger { animation: tutorial-swipe-right 1.05s ease-in-out infinite; }
.run-tutorial[data-dir="right"] .run-tutorial__trail {
  width: 28px;
  height: 8px;
  background: linear-gradient(270deg, var(--mint), rgba(99, 255, 208, 0));
  animation: tutorial-trail-right 1.05s ease-in-out infinite;
}
.run-tutorial[data-dir="all"] .run-tutorial__finger { animation: tutorial-swipe-all 2.4s ease-in-out infinite; }
.run-tutorial[data-dir="all"] .run-tutorial__trail { opacity: 0; }
.run-tutorial[data-dir="keys"] .run-tutorial__keys kbd { opacity: 0.45; }
.run-tutorial[data-dir="keys"] .run-tutorial__keys kbd[data-key="left"],
.run-tutorial[data-dir="keys"] .run-tutorial__keys kbd[data-key="right"],
.run-tutorial[data-dir="keys"] .run-tutorial__keys kbd[data-key="up"],
.run-tutorial[data-dir="keys"] .run-tutorial__keys kbd[data-key="down"] {
  animation: tutorial-key-pulse 1.6s ease-in-out infinite;
}
.run-tutorial[data-dir="up"][data-mode="keys"] .run-tutorial__keys kbd { opacity: 0.35; }
.run-tutorial[data-dir="up"][data-mode="keys"] .run-tutorial__keys kbd[data-key="up"] {
  opacity: 1;
  border-color: var(--mint);
  color: var(--mint);
  animation: tutorial-key-pulse 0.9s ease-in-out infinite;
}
.run-tutorial[data-dir="down"][data-mode="keys"] .run-tutorial__keys kbd { opacity: 0.35; }
.run-tutorial[data-dir="down"][data-mode="keys"] .run-tutorial__keys kbd[data-key="down"] {
  opacity: 1;
  border-color: var(--mint);
  color: var(--mint);
  animation: tutorial-key-pulse 0.9s ease-in-out infinite;
}
.run-tutorial[data-dir="left"][data-mode="keys"] .run-tutorial__keys kbd,
.run-tutorial[data-dir="right"][data-mode="keys"] .run-tutorial__keys kbd { opacity: 0.35; }
.run-tutorial[data-dir="left"][data-mode="keys"] .run-tutorial__keys kbd[data-key="left"],
.run-tutorial[data-dir="left"][data-mode="keys"] .run-tutorial__keys kbd[data-key="right"],
.run-tutorial[data-dir="right"][data-mode="keys"] .run-tutorial__keys kbd[data-key="left"],
.run-tutorial[data-dir="right"][data-mode="keys"] .run-tutorial__keys kbd[data-key="right"] {
  opacity: 1;
  border-color: var(--sun);
  color: var(--sun);
  animation: tutorial-key-pulse 0.9s ease-in-out infinite;
}
.touch-controls,
.touch-controls:not(.is-hidden) {
  display: none !important;
}
@keyframes tutorial-swipe-up {
  0%, 12% { transform: translate(-50%, 14px); }
  55% { transform: translate(-50%, -18px); }
  100% { transform: translate(-50%, 14px); }
}
@keyframes tutorial-trail-up {
  0%, 18% { opacity: 0; height: 8px; transform: translate(-50%, 6px); }
  50% { opacity: 0.9; height: 30px; transform: translate(-50%, -8px); }
  100% { opacity: 0; height: 8px; transform: translate(-50%, -16px); }
}
@keyframes tutorial-swipe-down {
  0%, 12% { transform: translate(-50%, -18px); }
  55% { transform: translate(-50%, 14px); }
  100% { transform: translate(-50%, -18px); }
}
@keyframes tutorial-trail-down {
  0%, 18% { opacity: 0; height: 8px; transform: translate(-50%, -6px); }
  50% { opacity: 0.9; height: 30px; transform: translate(-50%, 8px); }
  100% { opacity: 0; height: 8px; transform: translate(-50%, 16px); }
}
@keyframes tutorial-swipe-left {
  0%, 12% { transform: translate(14px, -50%); }
  55% { transform: translate(-18px, -50%); }
  100% { transform: translate(14px, -50%); }
}
@keyframes tutorial-trail-left {
  0%, 18% { opacity: 0; width: 8px; transform: translate(6px, -50%); }
  50% { opacity: 0.9; width: 30px; transform: translate(-8px, -50%); }
  100% { opacity: 0; width: 8px; transform: translate(-16px, -50%); }
}
@keyframes tutorial-swipe-right {
  0%, 12% { transform: translate(-18px, -50%); }
  55% { transform: translate(14px, -50%); }
  100% { transform: translate(-18px, -50%); }
}
@keyframes tutorial-trail-right {
  0%, 18% { opacity: 0; width: 8px; transform: translate(-6px, -50%); }
  50% { opacity: 0.9; width: 30px; transform: translate(8px, -50%); }
  100% { opacity: 0; width: 8px; transform: translate(16px, -50%); }
}
@keyframes tutorial-swipe-all {
  0%, 8% { transform: translate(-50%, -50%); }
  22% { transform: translate(-50%, -18px); }
  36% { transform: translate(-50%, -50%); }
  50% { transform: translate(16px, -50%); }
  64% { transform: translate(-50%, -50%); }
  78% { transform: translate(-50%, 16px); }
  90% { transform: translate(-16px, -50%); }
  100% { transform: translate(-50%, -50%); }
}
@keyframes tutorial-key-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .run-tutorial__finger,
  .run-tutorial__trail,
  .run-tutorial__keys kbd { animation: none !important; }
}

.touch-controls {
  position: fixed;
  z-index: 7;
  left: var(--safe-left);
  right: var(--safe-right);
  bottom: var(--safe-bottom);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.touch-cluster { display: flex; gap: 9px; pointer-events: auto; }
.touch-controls button { width: 58px; height: 58px; border: 1px solid rgba(167,255,226,.35); border-radius: 16px 7px 16px 7px; color: var(--ink); background: rgba(5, 23, 30, 0.76); backdrop-filter: blur(8px); font-size: 23px; touch-action: none; }
.touch-controls button:active { color: #031511; background: var(--mint); transform: scale(.95); }
.touch-controls .touch-jump { border-color: rgba(255,211,90,.45); color: var(--sun); }

.loading {
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: var(--night);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .12em;
}
.loading i { width: 38px; height: 38px; border: 3px solid rgba(99,255,208,.15); border-top-color: var(--mint); border-radius: 50%; animation: spin 0.8s linear infinite; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes feedback-pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -72%) scale(.96); } }
@keyframes pickup-rise { 0% { opacity: 0; transform: translate(-50%, 16px) scale(.78); } 25% { opacity: 1; transform: translate(-50%, 0) scale(1.06); } 100% { opacity: 0; transform: translate(-50%, -28px) scale(.96); } }
@keyframes combo-pulse { 0% { transform: scale(.92); } 55% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes stamp-pop { 0% { opacity: 0; transform: rotate(-13deg) scale(.72); } 62% { opacity: 1; transform: rotate(-13deg) scale(1.08); } 100% { opacity: 1; transform: rotate(-13deg) scale(1); } }

@media (pointer: coarse), (max-width: 900px) {
  .control-strip { display: none; }
  .hud { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
  .hud__brand { display: none; }
  .song-progress { grid-column: 1; grid-row: 1; padding: 5px 10px 7px; }
  .song-progress__meta { grid-template-columns: auto auto; justify-content: space-between; margin-bottom: 5px; }
  #lyric-line { display: none; }
  .hud__score { grid-column: 2; grid-row: 1; }
  .lives-badge { min-width: 48px; padding: 4px 8px; }
  .stat-readout { min-width: 52px; padding: 4px 8px; }
  .touch-controls button { width: 48px; height: 48px; font-size: 20px; }
}

@media (max-width: 560px) {
  .overlay--menu { gap: 11px; justify-content: center; overflow-y: auto; }
  .menu-emblem { width: 48px; height: 48px; }
  .menu-emblem::before { width: 62px; height: 62px; }
  .menu-copy h1 { font-size: clamp(44px, 14vw, 66px); }
  .menu-copy p { max-width: 340px; font-size: 12px; }
  .track-ticket { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; }
  .track-ticket__art { width: 46px; height: 46px; }
  .track-ticket__copy strong { font-size: 15px; }
  .track-ticket__copy small { max-width: 205px; }
  .track-picker { gap: 5px; }
  .selector-label { margin-bottom: -6px; }
  .track-search { min-height: 36px; }
  .track-selector { gap: 6px; grid-template-columns: 1fr; max-height: 34vh; }
  .track-choice { grid-template-columns: 28px minmax(0, 1fr); gap: 6px; min-height: 46px; padding: 5px 7px; }
  .track-choice > i { width: 28px; height: 28px; }
  .track-choice > b { display: none; }
  .track-choice strong { font-size: 9px; }
  .track-choice small { font-size: 7px; }
  .character-selector { gap: 6px; }
  .character-choice { grid-template-columns: 34px minmax(0, 1fr); gap: 5px; min-height: 48px; padding: 6px; }
  .character-choice__avatar { width: 34px; height: 34px; }
  .character-choice strong { font-size: 8px; }
  .character-choice small { display: none; }
  .experience-selector { gap: 6px; }
  .experience-choice { grid-template-columns: 30px minmax(0, 1fr); gap: 7px; min-height: 48px; padding: 6px 8px; }
  .experience-choice__icon { width: 28px; height: 28px; }
  .experience-choice__icon--runner::before { left: 8px; top: 4px; }
  .experience-choice__icon--runner::after { left: 11px; top: 9px; }
  .experience-choice__icon--random::before { font-size: 17px; line-height: 28px; }
  .experience-choice__icon--tunnel::before { left: 6px; top: 5px; }
  .experience-choice strong { font-size: 9px; }
  .experience-choice small { font-size: 8px; }
  .hud__score { gap: 4px; }
  .icon-button { width: 40px; height: 40px; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .touch-controls button { width: 46px; height: 46px; font-size: 19px; }
}

@media (max-width: 900px) and (max-height: 560px) {
  .song-progress { padding: 5px 10px 7px; }
  .song-progress__meta { grid-template-columns: auto auto; justify-content: space-between; margin-bottom: 5px; }
  #lyric-line { display: none; }
}

@media (max-height: 820px) {
  .overlay--menu { gap: 8px; overflow-y: auto; }
  .menu-emblem { display: none; }
  .menu-copy h1 { font-size: clamp(42px, 8vh, 62px); }
  .track-ticket { padding-block: 6px; }
  .track-selector { max-height: min(25vh, 180px); }
  .track-choice { min-height: 44px; }
  .character-choice { min-height: 44px; }
  .experience-choice { min-height: 44px; }
  .experience-choice__icon { width: 28px; height: 28px; }
  .menu-note { display: none; }
}

@media (max-width: 820px) {
  .tour-header { grid-template-columns: 1fr auto; min-height: 66px; padding: 9px 13px; }
  .tour-season { display: none; }
  .tour-progress { display: none; }
  .tour-actions { gap: 6px; }
  .memory-loop-button { padding-inline: 9px; }
  .memory-loop-button b { display: none; }
  .backup-button { padding-inline: 10px; font-size: 7px; }
  .tour-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0,1fr); }
  .act-rail { padding: 8px 12px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid rgba(109,220,255,.13); scrollbar-width: none; }
  .act-rail::-webkit-scrollbar { display: none; }
  .act-rail__label { display: none; }
  .act-rail nav { display: flex; gap: 6px; width: max-content; }
  .act-link { grid-template-columns: 21px auto; min-height: 36px; padding: 4px 8px; }
  .act-link i { width: 21px; height: 21px; }
  .act-link small { display: none; }
  .tour-hero { grid-template-columns: 1fr; min-height: 0; padding: 56px 24px; }
  .tour-hero h1 { font-size: clamp(48px,14vw,78px); }
  .tour-pass { display: none; }
  .journey-map { width: min(100% - 24px,680px); padding-top: 34px; }
  .journey-act { padding-bottom: 54px; }
  .journey-act__header { align-items: start; flex-direction: column; gap: 7px; }
  .journey-act__header p { margin: 0; }
  .journey-route::before { left: 31px; }
  .location-card { grid-template-columns: 64px minmax(0,1fr); gap: 0; padding: 15px 14px 15px 0; }
  .location-pin { width: 44px; height: 44px; box-shadow: 0 0 0 7px #061821; }
  .location-copy { padding-right: 0; }
  .location-songs { grid-column: 2; grid-template-columns: 1fr; margin-top: 13px; }
  .song-node { min-height: 56px; }
  .song-node strong { font-size: 10px; }
  .song-node small { font-size: 8px; }
  .setup-back-button { font-size: 0; width: 38px; padding: 0; }
  .setup-back-button::before { content: "←"; font-size: 15px; }
  .memory-header { grid-template-columns: auto minmax(0, 1fr); min-height: 70px; padding: 9px 13px; }
  .memory-header__title { text-align: right; }
  .memory-header__title span { display: none; }
  .memory-header__title h1 { font-size: 23px; }
  .memory-header__stats { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; justify-content: stretch; margin: 8px -13px -9px; border-inline: 0; }
  .memory-header__stats div { flex: 1; padding: 6px 9px; }
  .memory-header__stats strong { font-size: 14px; }
  .memory-body { grid-template-columns: 1fr; overflow-y: auto; }
  .memory-round-panel { gap: 12px; padding: 28px 20px; border-right: 0; border-bottom: 1px solid rgba(109,220,255,.14); }
  .memory-round-panel h2 { max-width: none; font-size: 30px; }
  .memory-round-meta { grid-template-columns: repeat(3, 1fr); }
  .memory-round-meta span { display: grid; justify-items: center; gap: 3px; padding: 8px 4px; text-align: center; }
  .memory-round-meta span + span { border-top: 0; border-left: 1px solid rgba(109,220,255,.1); }
  .memory-library { overflow: visible; padding: 26px 14px; }
  .memory-library > header { align-items: start; flex-direction: column; gap: 7px; }
  .memory-library > header small { text-align: left; }
  .memory-phrase-row { grid-template-columns: minmax(100px, .8fr) minmax(120px, 1fr) 74px; gap: 9px; padding: 9px 10px; }
  .memory-mastery { display: none; }
  .hub-memory-strip {
    flex-direction: column;
    align-items: stretch;
  }
  .hub-memory-strip .memory-header__stats {
    width: 100%;
  }
  .hub-panel--memory .hub-memory-body,
  .hub-panel--memory .memory-body,
  .hub-panel--memory .memory-library {
    overflow: visible;
  }
}

@media (max-width: 430px) {
  .tour-brand strong { display: none; }
  .tour-brand > span { width: 38px; height: 38px; }
  .backup-button span { display: none; }
  .memory-loop-button span { font-size: 16px; }
  .memory-loop-button small { font-size: 6px; }
  .tour-hero { padding: 42px 18px; }
  .tour-hero h1 { font-size: 52px; }
  .journey-map { width: calc(100% - 16px); }
  .journey-act__header { padding-inline: 5px; }
  .journey-act__header h2 { font-size: 28px; }
  .journey-route { gap: 14px; }
  .location-card { grid-template-columns: 55px minmax(0,1fr); border-radius: 13px 4px 13px 4px; }
  .journey-route::before { left: 27px; }
  .location-pin { width: 38px; height: 38px; }
  .location-copy strong { font-size: 16px; }
  .location-songs { grid-column: 1 / -1; margin: 14px 0 0 13px; }
  .journey-song-brief { padding: 10px 12px; }
  .journey-song-brief strong { font-size: 18px; }
  .memory-phrase-row { grid-template-columns: minmax(84px, .8fr) minmax(104px, 1fr) 58px; }
  .memory-phrase-row strong { font-size: 12px; }
  .memory-phrase-row > span { font-size: 11px; }
  .memory-due-label { padding-inline: 4px; font-size: 6px; }
}

/* Mission briefing + hub shell */
.overlay--briefing {
  z-index: 24;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 12px);
  touch-action: pan-y;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(84, 216, 255, 0.18), transparent 42%),
    radial-gradient(ellipse at 90% 80%, rgba(99, 255, 208, 0.12), transparent 40%),
    linear-gradient(160deg, #06131c 0%, #0a1c28 48%, #071018 100%);
}

.overlay--hub {
  z-index: 24;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  touch-action: pan-y;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(84, 216, 255, 0.14), transparent 38%),
    radial-gradient(ellipse at 88% 100%, rgba(99, 255, 208, 0.1), transparent 42%),
    linear-gradient(160deg, #06131c 0%, #0a1c28 48%, #071018 100%);
}

.briefing-shell {
  width: min(920px, calc(100vw - 32px));
  height: min(860px, calc(100dvh - 24px));
  max-height: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
}

.hub-shell {
  width: 100%;
  height: 100%;
  max-height: none;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "nav main";
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.hub-shell > .hub-nav { grid-area: nav; }
.hub-shell > .hub-main { grid-area: main; }

.hub-account-card {
  margin-top: 16px;
  display: grid;
  gap: 20px;
  justify-items: start;
  padding: 20px 18px;
  border-radius: 16px;
  border: 1px solid rgba(167, 255, 226, 0.16);
  background: rgba(8, 24, 32, 0.72);
}

.hub-account-card__avatar {
  width: 72px;
  height: 72px;
}

.hub-account-card__fields {
  display: grid;
  gap: 14px;
  width: 100%;
}

.hub-account-card__fields .eyebrow {
  display: block;
  margin-bottom: 4px;
}

.hub-account-card__fields strong {
  font-size: 16px;
  font-weight: 700;
}

.hub-account-contact {
  margin-top: 18px;
  display: grid;
  gap: 10px;
  padding: 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid rgba(167, 255, 226, 0.16);
  background: rgba(8, 24, 32, 0.72);
}

.hub-account-contact h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.hub-account-contact p {
  margin: 0;
  color: var(--muted);
  font: 14px/1.5 "Avenir Next", sans-serif;
}

.hub-account-contact__action {
  appearance: none;
  justify-self: start;
  margin-top: 4px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(99, 255, 208, 0.4);
  background: rgba(99, 255, 208, 0.12);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.hub-account-contact__action:hover,
.hub-account-contact__action:focus-visible {
  background: rgba(99, 255, 208, 0.2);
  border-color: var(--mint);
}

.hub-dialog {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
}

.hub-dialog.is-hidden,
.hub-dialog[hidden] {
  display: none !important;
}

.hub-dialog__backdrop {
  appearance: none;
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.hub-dialog__card {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  max-height: min(92vh, 720px);
  overflow-y: auto;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 28px 22px 20px;
  border-radius: 22px;
  border: 1px solid rgba(167, 255, 226, 0.28);
  background:
    linear-gradient(180deg, rgba(8, 31, 38, 0.96), rgba(5, 18, 26, 0.96));
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 40px rgba(99, 255, 208, 0.08);
}

.hub-dialog__close {
  appearance: none;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.hub-dialog__close:hover,
.hub-dialog__close:focus-visible {
  color: var(--ink);
  background: rgba(99, 255, 208, 0.12);
}

.hub-dialog__card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
}

.hub-dialog__card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
}

.hub-dialog__qr-wrap {
  margin: 4px 0 0;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.hub-dialog__qr {
  width: min(220px, 70vw);
  height: auto;
  border-radius: 16px;
  background: #fff;
  padding: 10px;
}

.hub-dialog__qr-wrap figcaption {
  color: var(--mint);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.hub-dialog__channels {
  width: 100%;
  display: grid;
  gap: 10px;
}

.hub-dialog__channel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 10px 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(167, 255, 226, 0.2);
  background: rgba(2, 12, 18, 0.65);
  color: inherit;
  text-decoration: none;
  text-align: left;
  box-sizing: border-box;
}

.hub-dialog__channel-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.hub-dialog__channel-main > span,
.hub-dialog__channel > .hub-dialog__channel-main > span:first-child {
  color: var(--mint);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
}

.hub-dialog__channel strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.hub-dialog__channel-action {
  appearance: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(99, 255, 208, 0.1);
  color: var(--mint);
  cursor: pointer;
  font-style: normal;
}

.hub-dialog__channel-action .hub-svg {
  width: 18px;
  height: 18px;
}

button.hub-dialog__channel-action:hover,
button.hub-dialog__channel-action:focus-visible {
  background: rgba(99, 255, 208, 0.22);
  color: var(--ink);
}

button.hub-dialog__channel-action.is-copied {
  color: var(--sun);
  background: rgba(255, 211, 90, 0.16);
}

a.hub-dialog__channel:hover,
a.hub-dialog__channel:focus-visible,
.hub-dialog__channel--email:hover,
.hub-dialog__channel--email:focus-within {
  border-color: rgba(99, 255, 208, 0.45);
  background: rgba(99, 255, 208, 0.08);
}

a.hub-dialog__channel--external .hub-dialog__channel-action {
  pointer-events: none;
}

.hub-dialog__dismiss {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
}

.hub-dialog__dismiss:hover,
.hub-dialog__dismiss:focus-visible {
  color: var(--ink);
}

.hub-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: rgba(5, 18, 26, 0.72);
  border-left: 1px solid rgba(167, 255, 226, 0.14);
}

.hub-main > .hub-panel {
  min-height: 0;
}

.briefing-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(167, 255, 226, 0.28);
  border-radius: 22px;
  background: rgba(5, 18, 26, 0.92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.briefing-header,
.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(167, 255, 226, 0.14);
  background: rgba(7, 24, 31, 0.95);
  flex-shrink: 0;
}

.briefing-header strong,
.hub-identity strong {
  font-size: 18px;
  letter-spacing: 0.06em;
}

.briefing-header .lingosong-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lingosong-brand > img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(99, 255, 208, .18));
}

.briefing-header em {
  font-style: normal;
  color: var(--mint);
}

.briefing-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.briefing-header-btn {
  appearance: none;
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(167, 255, 226, 0.28);
  border-radius: 10px;
  background: rgba(4, 16, 22, 0.88);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.briefing-header-btn--text {
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink);
  white-space: nowrap;
}

.briefing-header-btn:hover,
.briefing-header-btn:focus-visible {
  border-color: rgba(99, 255, 208, 0.55);
  color: var(--mint);
}

.briefing-header-btn[aria-pressed="true"] {
  color: var(--sun);
  border-color: rgba(255, 211, 90, 0.45);
}

.briefing-log {
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px 18px calc(22px + var(--safe-bottom-inset));
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.briefing-log--name-entry {
  /* Leave room above the mobile keyboard without scrolling after focus (avoids caret offset). */
  padding-bottom: max(220px, 42dvh);
}

.briefing-bubble {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  max-width: min(88%, 520px);
  opacity: 0;
  transform: translateY(10px);
}

.briefing-bubble.is-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.briefing-bubble--guide.is-in {
  animation: briefing-in-left 0.32s ease both;
}

.briefing-bubble--player.is-in {
  animation: briefing-in-right 0.32s ease both;
}

.briefing-bubble--typing.is-in {
  animation: briefing-in-left 0.2s ease both;
}

@keyframes briefing-in-left {
  from { opacity: 0; transform: translateX(-14px) translateY(6px); }
  to { opacity: 1; transform: translateX(0) translateY(0); }
}

@keyframes briefing-in-right {
  from { opacity: 0; transform: translateX(14px) translateY(6px); }
  to { opacity: 1; transform: translateX(0) translateY(0); }
}

.briefing-meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.briefing-meta--player {
  justify-content: flex-end;
}

.briefing-meta__name {
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--muted);
}

.briefing-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid rgba(99, 255, 208, 0.4);
  background:
    linear-gradient(145deg, rgba(99, 255, 208, 0.28), rgba(84, 216, 255, 0.08)),
    rgba(7, 24, 31, 0.95);
  box-shadow: inset 0 0 12px rgba(99, 255, 208, 0.12);
  flex-shrink: 0;
}

.briefing-avatar b {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--mint);
  font-weight: 900;
}

.briefing-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
}

.briefing-bubble p {
  grid-column: 1 / -1;
  margin: 0;
  margin-left: 36px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(7, 24, 31, 0.88);
  border-radius: 4px 16px 16px 16px;
  line-height: 1.45;
  min-height: 1.45em;
  width: fit-content;
  max-width: 100%;
}

.briefing-bubble--player {
  justify-self: end;
  text-align: right;
  grid-template-columns: 1fr;
}

.briefing-bubble--player p {
  margin-left: 0;
  border-radius: 16px 4px 16px 16px;
  background: rgba(99, 255, 208, 0.14);
  border-color: rgba(99, 255, 208, 0.38);
  justify-self: end;
}

.briefing-bubble__with-media {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
}

.briefing-bubble__with-media .character-choice__avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.briefing-bubble__with-media span {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.briefing-bubble p.is-typing::after {
  content: "·";
  animation: briefing-caret 0.8s steps(1) infinite;
}

@keyframes briefing-caret {
  50% { opacity: 0; }
}

.briefing-typing-dots {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  min-width: 52px;
  padding: 14px 16px !important;
  width: fit-content;
}

.briefing-typing-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.45;
  animation: briefing-dot 1.1s ease-in-out infinite;
}

.briefing-typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.briefing-typing-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes briefing-dot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.briefing-prompt {
  width: 100%;
  max-width: min(100%, 420px);
  justify-self: end;
  display: grid;
  gap: 10px;
  opacity: 0;
  transform: translateY(8px);
  padding: 12px;
  border: 1px solid rgba(99, 255, 208, 0.28);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(99, 255, 208, 0.08), transparent 40%),
    rgba(4, 16, 22, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.briefing-prompt.is-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.briefing-prompt__head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.briefing-prompt__head span {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--mint);
}

.briefing-prompt__head::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px rgba(99, 255, 208, 0.55);
}

.briefing-prompt--name {
  max-width: min(100%, 400px);
}

.briefing-prompt--age {
  max-width: min(100%, 400px);
}

.briefing-name-box,
.briefing-age-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.briefing-prompt--name .primary-button,
.briefing-prompt--age .primary-button {
  width: auto;
  min-width: 128px;
}

.briefing-prompt--name .primary-button:disabled,
.briefing-prompt--age .primary-button:disabled {
  cursor: default;
  filter: grayscale(0.7);
  opacity: 0.42;
  transform: none;
}

.briefing-prompt--age .secondary-button {
  justify-self: end;
  border: 1px solid rgba(167, 255, 226, 0.22);
  border-radius: 10px;
  padding: 10px 14px;
}

.briefing-prompt--start {
  max-width: min(100%, 400px);
}

.briefing-prompt--thinking {
  max-width: min(100%, 400px);
  justify-self: start;
}

.briefing-prompt--thinking .briefing-prompt__head {
  justify-content: flex-start;
}

.briefing-think-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(99, 255, 208, 0.28);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(99, 255, 208, 0.08), transparent 55%),
    rgba(8, 28, 36, 0.96);
}

.briefing-think-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.briefing-think-pulse i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  opacity: 0.35;
  animation: briefing-think-dot 1s ease-in-out infinite;
}

.briefing-think-pulse i:nth-child(2) { animation-delay: 0.15s; }
.briefing-think-pulse i:nth-child(3) { animation-delay: 0.3s; }

@keyframes briefing-think-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.briefing-think-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.briefing-think-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  opacity: 0.42;
  transition: opacity 0.2s ease;
}

.briefing-think-step.is-active,
.briefing-think-step.is-done {
  opacity: 1;
}

.briefing-think-mark {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid rgba(99, 255, 208, 0.4);
  background: transparent;
  box-sizing: border-box;
}

.briefing-think-step.is-active .briefing-think-mark {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(99, 255, 208, 0.18);
  animation: briefing-think-spin 0.9s linear infinite;
  border-top-color: transparent;
}

.briefing-think-step.is-done .briefing-think-mark {
  border-color: var(--mint);
  background: var(--mint);
  box-shadow: none;
  animation: none;
  position: relative;
}

.briefing-think-step.is-done .briefing-think-mark::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  width: 5px;
  height: 8px;
  border: solid #042018;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

@keyframes briefing-think-spin {
  to { transform: rotate(360deg); }
}

.briefing-think-step span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.briefing-think-step strong {
  font-size: 13px;
  letter-spacing: 0.02em;
}

.briefing-think-step small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.briefing-prompt--confirm {
  max-width: min(100%, 280px);
}

.briefing-prompt--confirm .primary-button {
  width: 100%;
}

.briefing-prompt--login {
  max-width: min(100%, 320px);
}

.briefing-prompt--login .primary-button,
.briefing-prompt--login .secondary-button {
  width: 100%;
}

.briefing-prompt--login .secondary-button {
  border: 1px solid rgba(167, 255, 226, 0.22);
  border-radius: 10px;
  padding: 10px 14px;
}

.briefing-start-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(99, 255, 208, 0.28);
  border-radius: 14px;
  background: rgba(8, 28, 36, 0.96);
}

.briefing-start-card strong {
  font-size: 16px;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.briefing-start-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.briefing-start-card .primary-button {
  width: 100%;
  margin-top: 4px;
}

.briefing-prompt__grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .briefing-prompt__grid {
    grid-template-columns: 1fr 1fr;
  }

  .briefing-prompt__grid .briefing-card.is-featured,
  .briefing-prompt__grid .briefing-card:only-child,
  .briefing-prompt__grid .briefing-chip:only-child {
    grid-column: 1 / -1;
  }
}

.briefing-name-field {
  display: block;
  min-width: 0;
}

.briefing-name-field input {
  width: 100%;
  height: 100%;
  min-height: 52px;
  border: 1px solid rgba(99, 255, 208, 0.35);
  background: rgba(2, 12, 18, 0.85);
  color: var(--ink);
  border-radius: 12px;
  padding: 14px 16px;
  font: inherit;
  font-size: 17px;
  letter-spacing: 0.02em;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}

.briefing-name-field input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(99, 255, 208, 0.18);
}

.briefing-chip,
.briefing-card {
  appearance: none;
  border: 1px solid rgba(167, 255, 226, 0.28);
  background: rgba(8, 28, 36, 0.96);
  color: var(--ink);
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  align-items: start;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.briefing-choice-mark {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid rgba(99, 255, 208, 0.55);
  background: rgba(2, 12, 18, 0.65);
  box-shadow: inset 0 0 0 3px transparent;
  flex-shrink: 0;
}

.briefing-chip:hover .briefing-choice-mark,
.briefing-card:hover .briefing-choice-mark,
.briefing-chip:focus-visible .briefing-choice-mark,
.briefing-card:focus-visible .briefing-choice-mark {
  border-color: var(--mint);
  box-shadow: inset 0 0 0 4px rgba(99, 255, 208, 0.35);
}

.briefing-choice-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.briefing-chip:hover,
.briefing-card:hover,
.briefing-chip:focus-visible,
.briefing-card:focus-visible {
  border-color: rgba(99, 255, 208, 0.7);
  background: rgba(12, 40, 48, 0.98);
  transform: translateY(-1px);
}

.briefing-chip strong,
.briefing-card strong {
  font-size: 14px;
  letter-spacing: 0.02em;
}

.briefing-chip small,
.briefing-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.briefing-chip.is-disabled,
.briefing-card.is-disabled,
.briefing-chip:disabled,
.briefing-card:disabled {
  opacity: 0.42;
  cursor: default;
  transform: none;
}

.briefing-card.is-featured {
  border-color: rgba(255, 211, 90, 0.55);
  background: linear-gradient(135deg, rgba(255, 211, 90, 0.12), rgba(8, 28, 36, 0.92));
}

.briefing-card.is-featured .briefing-choice-mark {
  border-color: rgba(255, 211, 90, 0.7);
}

.briefing-card em {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--sun);
}

.briefing-card .character-choice__avatar {
  width: 40px;
  height: 40px;
  margin-bottom: 2px;
}


.overlay--save {
  z-index: 26;
}

.hub-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: calc(var(--safe-top) + 20px) 16px 20px;
  background: rgba(4, 14, 20, 0.96);
  border-right: 1px solid rgba(167, 255, 226, 0.14);
  min-height: 0;
}

.hub-nav__brand {
  display: grid;
  gap: 4px;
  padding: 0 8px 4px;
}

.hub-nav__brand strong {
  font-size: 18px;
  letter-spacing: 0.08em;
}

.hub-nav__brand em {
  font-style: normal;
  color: var(--mint);
}

.hub-nav__brand small {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.hub-header {
  padding: 14px 22px;
  border-bottom: 1px solid rgba(167, 255, 226, 0.12);
  background: rgba(7, 24, 31, 0.88);
}

.hub-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hub-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.hub-identity .character-choice__avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.hub-identity strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-identity small {
  color: var(--muted);
  letter-spacing: 0.1em;
}

.hub-eyebrow {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.hub-tabs {
  display: grid;
  gap: 8px;
  align-content: start;
}

.hub-tabs button {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
  justify-items: start;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  position: relative;
}

.hub-tabs button.is-hidden,
.hub-tabs button[hidden] {
  display: none !important;
}

.hub-tab-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 211, 90, 0.95);
  color: #1a1408;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  letter-spacing: 0;
  text-transform: none;
}

.hub-tabs button .hub-svg {
  width: 18px;
  height: 18px;
  opacity: 0.9;
  justify-self: center;
}

.hub-svg {
  display: block;
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  overflow: visible;
  fill: currentColor;
  pointer-events: none;
}

.hub-tabs button:hover,
.hub-tabs button:focus-visible {
  color: var(--ink);
  background: rgba(99, 255, 208, 0.08);
  border-color: rgba(167, 255, 226, 0.16);
}

.hub-tabs button.is-active {
  color: #042018;
  background: linear-gradient(90deg, var(--mint), var(--cyan));
  border-color: transparent;
}

.hub-tabs button.is-active .hub-svg {
  opacity: 1;
}

.hub-panel {
  overflow-y: auto;
  min-height: 0;
  padding: 22px 22px calc(22px + var(--safe-bottom-inset));
  touch-action: pan-y;
}

.hub-panel h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.hub-panel--create {
  display: grid;
  align-content: start;
  gap: 14px;
}

.hub-create-card {
  display: grid;
  gap: 16px;
  max-width: 560px;
  padding: 22px 20px 20px;
  border: 1px solid rgba(167, 255, 226, 0.2);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(8, 31, 38, 0.88), rgba(5, 20, 27, 0.82));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.hub-create-card h2 {
  margin: 0;
}

.hub-create-card p {
  margin: 0;
  color: var(--muted);
  font: 14px/1.55 "Be Vietnam Pro", system-ui, sans-serif;
}

.hub-create-form {
  display: grid;
  gap: 14px;
}

.hub-create-field {
  display: grid;
  gap: 8px;
}

.hub-create-field textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid rgba(99, 255, 208, 0.35);
  background: rgba(2, 12, 18, 0.85);
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  border-radius: 12px;
  padding: 14px 16px;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}

.hub-create-field textarea::placeholder,
.hub-create-field textarea::-webkit-input-placeholder {
  color: rgba(165, 186, 192, 0.28);
  -webkit-text-fill-color: rgba(165, 186, 192, 0.28);
  opacity: 1;
}

.hub-create-field textarea:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(99, 255, 208, 0.18);
}

.hub-create-form .primary-button {
  width: 100%;
  max-width: none;
}

.hub-create-form .primary-button:disabled {
  cursor: default;
  filter: grayscale(0.7);
  opacity: 0.4;
  transform: none;
}

.hub-panel--path {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.hub-tour-strip {
  flex-shrink: 0;
  display: grid;
  gap: 8px;
  padding: 16px 22px 12px;
  border-bottom: 1px solid rgba(167, 255, 226, 0.12);
  background: rgba(7, 24, 31, 0.92);
  z-index: 2;
}

.hub-tour-strip .eyebrow {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.hub-tour-switcher {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  touch-action: pan-x;
  scrollbar-width: none;
}

.hub-tour-switcher::-webkit-scrollbar {
  display: none;
}

.hub-tour-chip {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid rgba(167, 255, 226, 0.2);
  background: rgba(8, 28, 36, 0.85);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
}

.hub-tour-chip.is-active {
  color: #041219;
  background: linear-gradient(90deg, var(--mint), var(--cyan));
  border-color: transparent;
}

.hub-tour-strip__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.hub-tour-strip h1 {
  margin: 0;
  font-size: clamp(20px, 3.6vw, 28px);
  line-height: 1.05;
  letter-spacing: 0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-tour-strip #hub-tour-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.hub-progress {
  margin: 0;
  flex-shrink: 0;
  font-size: 12px !important;
  color: var(--mint) !important;
  letter-spacing: 0.06em;
  opacity: 0.95;
}

.hub-path {
  --path-cols: 3;
  --node-size: 84px;
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px 28px 96px;
  touch-action: pan-y;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(99, 255, 208, 0.06), transparent 42%),
    linear-gradient(180deg, rgba(6, 20, 28, 0.2), rgba(4, 14, 20, 0.55));
}

.hub-path__ribbon {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.hub-path__ribbon-edge {
  fill: none;
  stroke: rgba(90, 116, 128, 0.45);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hub-path__ribbon-fill {
  fill: none;
  stroke: rgba(120, 148, 158, 0.42);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hub-path__ribbon-progress-edge {
  fill: none;
  stroke: rgba(99, 255, 208, 0.42);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hub-path__ribbon-progress {
  fill: none;
  stroke: rgba(99, 255, 208, 0.92);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hub-path__brief {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(680px, 100%);
  margin: 0 auto 18px;
  padding: 16px 16px 4px;
}

.hub-path__brief-block {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(167, 255, 226, 0.14);
  background: rgba(8, 28, 36, 0.78);
}

.hub-path__brief-block .eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mint);
}

.hub-path__brief-block p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  opacity: 0.92;
}

.hub-path__empty {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  margin: 8px auto 24px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.hub-path__band {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--path-cols), minmax(0, 1fr));
  align-items: start;
  justify-items: center;
  gap: 36px 8px;
  width: min(680px, 100%);
  margin: 0 auto 4px;
  padding: 10px 4px 22px;
}

.hub-path__cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 120px;
  width: 100%;
  max-width: 120px;
}

.hub-path__node {
  appearance: none;
  position: relative;
  z-index: 1;
  width: var(--node-size);
  height: var(--node-size);
  margin: 0;
  border-radius: 50%;
  border: 4px solid rgba(167, 255, 226, 0.28);
  background: #16303a;
  color: #0a1a20;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font: inherit;
  padding: 0;
  overflow: visible;
}

.hub-path__node:active {
  transform: translateY(3px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
}

.hub-path__art {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.hub-path__art--fallback {
  background: radial-gradient(circle at 35% 30%, #8affe0, #26728c 65%, #12343e);
}

.hub-path__status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 22px;
  font-style: normal;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, .7);
}

.hub-path__status svg {
  width: 29px;
  height: 29px;
  fill: rgba(4, 15, 21, .28);
  stroke: #fff;
  stroke-width: 1.8;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .72));
}

.hub-path__status--locked {
  inset: -4px -4px auto auto;
  width: 27px;
  height: 27px;
  background: rgba(9, 28, 37, .96);
  border: 2px solid #91aab5;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .42);
}

.hub-path__status--locked svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke-width: 2.2;
  filter: none;
}

.hub-path__status--complete {
  inset: -4px -4px auto auto;
  width: 25px;
  height: 25px;
  background: linear-gradient(145deg, #8affe0, #35d995);
  border: 2px solid #d7fff1;
  color: #fff;
  font-size: 13px;
  font-weight: 1000;
  text-shadow: 0 1px 2px rgba(5, 65, 47, .45);
  box-shadow: 0 3px 9px rgba(25, 226, 151, .42);
}

.hub-path__status--current {
  display: none;
}

.hub-path__label {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 132px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  opacity: 0.88;
  pointer-events: none;
}

.hub-path__node.is-complete {
  border-color: #fff0b0;
}

.hub-path__node.is-current {
  border-color: #b8ffe8;
  animation: hub-path-pulse 1.8s ease-in-out infinite;
}

.hub-path__node.is-ready {
  border-color: #b4ecff;
}

.hub-path__node.is-locked {
  border-color: #5a7480;
  cursor: default;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.22);
}

.hub-path__node.is-locked:active {
  transform: none;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.22);
}

.hub-path__start {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(4, 18, 25, 0.92);
  border: 2px solid var(--mint);
  color: var(--mint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

@keyframes hub-path-pulse {
  0%, 100% { box-shadow: 0 8px 0 rgba(0, 0, 0, 0.28), 0 0 0 0 rgba(99, 255, 208, 0.35); }
  50% { box-shadow: 0 8px 0 rgba(0, 0, 0, 0.28), 0 0 0 12px rgba(99, 255, 208, 0); }
}

.hub-panel--path > .hub-due-chip {
  position: absolute;
  right: 14px;
  bottom: calc(12px + var(--hub-tabbar-offset, var(--safe-bottom-inset)));
  z-index: 3;
  margin: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.hub-path-toast {
  position: absolute;
  left: 50%;
  bottom: calc(64px + var(--hub-tabbar-offset, var(--safe-bottom-inset)));
  transform: translateX(-50%);
  z-index: 4;
  max-width: min(320px, calc(100% - 32px));
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(167, 255, 226, 0.22);
  background: rgba(4, 18, 25, 0.94);
  color: var(--ink);
  font-size: 13px;
  text-align: center;
  pointer-events: none;
}

.hub-due-chip {
  appearance: none;
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 211, 90, 0.35);
  background: rgba(255, 211, 90, 0.08);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.hub-due-chip span {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sun);
}

.hub-due-chip strong {
  font-size: 13px;
}

.hub-home--focus > .hub-tour-strip {
  display: none;
}

.hub-songs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  flex-shrink: 0;
}

.hub-songs-header h2 {
  margin: 0;
}

.hub-nav-create {
  appearance: none;
  flex-shrink: 0;
  width: 100%;
  margin-top: 4px;
  border: 1px solid rgba(255, 211, 90, 0.45);
  border-radius: 14px;
  min-height: 46px;
  padding: 11px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  color: #1a1408;
  background: linear-gradient(135deg, #ffe27a, #ffd35a 55%, #f0b429);
  box-shadow: 0 10px 24px rgba(255, 211, 90, 0.22);
}

.hub-nav-create .hub-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.hub-nav-create:hover,
.hub-nav-create:focus-visible {
  filter: brightness(1.04);
}

.hub-nav-create.is-active {
  box-shadow: 0 0 0 2px rgba(99, 255, 208, 0.55), 0 10px 24px rgba(255, 211, 90, 0.22);
}

.hub-nav-account {
  appearance: none;
  margin-top: auto;
  border: 1px solid rgba(167, 255, 226, 0.14);
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
  justify-items: start;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  color: var(--muted);
  background: rgba(8, 24, 32, 0.72);
}

.hub-nav-account .hub-svg {
  width: 16px;
  height: 16px;
  justify-self: center;
  opacity: 0.9;
}

.hub-nav-account:hover,
.hub-nav-account:focus-visible {
  color: var(--ink);
  background: rgba(99, 255, 208, 0.08);
  border-color: rgba(167, 255, 226, 0.22);
}

.hub-nav-account.is-active {
  color: #042018;
  background: linear-gradient(90deg, var(--mint), var(--cyan));
  border-color: transparent;
}

.hub-nav-account.is-active .hub-svg {
  opacity: 1;
}

.hub-songs-listen-all {
  appearance: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 211, 90, 0.42);
  background: rgba(255, 211, 90, 0.14);
  color: var(--sun, #ffd35a);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.hub-songs-listen-all .hub-svg {
  display: block;
  width: 14px;
  height: 14px;
  padding: 7px;
  box-sizing: content-box;
  border-radius: 50%;
  background: rgba(255, 211, 90, 0.92);
  color: #1a1408;
}

.hub-songs-listen-all:hover,
.hub-songs-listen-all:focus-visible {
  border-color: rgba(255, 211, 90, 0.7);
  background: rgba(255, 211, 90, 0.2);
}

.hub-songs-listen-all:disabled {
  opacity: 0.4;
  cursor: default;
}

.hub-songs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 10px;
  margin-top: 12px;
  margin-inline: auto;
  padding-bottom: 8px;
  width: min(100%, 1120px);
  align-content: start;
}

.hub-songs-empty {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hub-songs-card {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  height: auto;
  padding: 8px 12px 8px 8px;
  border-radius: 16px;
  border: 1px solid rgba(167, 255, 226, 0.16);
  background: rgba(8, 24, 32, 0.72);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.hub-songs-card__art {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: #050b10;
  box-shadow: inset 0 0 0 1px rgba(167, 255, 226, 0.12);
}

.hub-songs-card__art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hub-songs-card__art--fallback {
  background: radial-gradient(circle at 35% 30%, #8affe0, #26728c 65%, #12343e);
}

.hub-songs-card:hover,
.hub-songs-card:focus-visible,
.hub-songs-card.is-active {
  border-color: rgba(167, 255, 226, 0.42);
  background: rgba(12, 36, 46, 0.9);
}

.hub-songs-card__meta {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.hub-songs-card__karaoke {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(167, 255, 226, 0.28);
  background: rgba(167, 255, 226, 0.08);
  color: var(--mint, #a7ffe2);
}

.hub-songs-card__karaoke .hub-svg {
  width: 14px;
  height: 14px;
  display: block;
}

.hub-songs-card__karaoke b {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hub-songs-card:hover .hub-songs-card__karaoke,
.hub-songs-card:focus-visible .hub-songs-card__karaoke,
.hub-songs-card.is-active .hub-songs-card__karaoke {
  border-color: rgba(255, 211, 90, 0.45);
  background: rgba(255, 211, 90, 0.14);
  color: var(--sun, #ffd35a);
}

.hub-songs-card:hover .hub-songs-card__art,
.hub-songs-card:focus-visible .hub-songs-card__art,
.hub-songs-card.is-active .hub-songs-card__art {
  box-shadow: inset 0 0 0 1px rgba(255, 211, 90, 0.38);
}

.hub-songs-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}

.hub-songs-card small {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

#hub-songs {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-inline: clamp(16px, 4vw, 48px);
}

#hub-songs > .eyebrow,
#hub-songs .hub-songs-header,
#hub-songs .hub-songs-player-slot {
  width: min(100%, 1120px);
  margin-inline: auto;
}

#hub-songs > .eyebrow,
#hub-songs .hub-songs-header {
  flex-shrink: 0;
}

#hub-songs .hub-songs-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
}

.hub-songs-player-slot {
  flex-shrink: 0;
  margin-top: auto;
}

.hub-songs-player-slot--stage {
  margin-top: 0;
}

.hub-audio-player {
  display: grid;
  gap: 4px;
  padding: 8px 12px calc(8px + var(--safe-bottom-inset));
  border-top: 1px solid rgba(109, 220, 255, 0.16);
  background: rgba(3, 15, 22, 0.96);
}

.hub-audio-player__title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  color: var(--muted);
}

.hub-audio-player__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.hub-audio-player__transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.hub-audio-btn {
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(167, 255, 226, 0.22);
  background: rgba(8, 24, 32, 0.9);
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.hub-audio-btn--play {
  width: 38px;
  height: 38px;
  border-color: rgba(99, 255, 208, 0.45);
  background: linear-gradient(160deg, rgba(99, 255, 208, 0.28), rgba(84, 216, 255, 0.16));
}

.hub-audio-btn .hub-svg {
  width: 15px;
  height: 15px;
}

.hub-audio-btn--play .hub-svg {
  width: 16px;
  height: 16px;
}

.hub-audio-btn:hover,
.hub-audio-btn:focus-visible {
  border-color: rgba(167, 255, 226, 0.5);
}

.hub-audio-player__seek {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.hub-panel--memory {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  padding: 0;
}

.hub-memory-strip {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(109, 220, 255, 0.16);
  background: rgba(3, 15, 22, 0.92);
}

.hub-memory-strip__title h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.hub-memory-strip__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hub-memory-strip__heading h2 {
  margin: 2px 0 0;
}

.hub-memory-strip .memory-header__stats {
  justify-self: end;
  border: 1px solid rgba(109, 220, 255, 0.18);
  display: flex;
}

.hub-memory-body {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}

.hub-panel--memory .memory-round-panel {
  min-height: 0;
  padding: clamp(18px, 3vw, 36px);
}

.hub-panel--memory .memory-library {
  overflow: visible;
  padding: clamp(16px, 3vw, 36px);
}

@media (min-width: 821px) {
  .hub-panel--memory {
    overflow: hidden;
  }

  .hub-memory-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .hub-panel--memory .memory-library {
    overflow-y: auto;
  }
}

.overlay--songs {
  z-index: 12;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
  background: #061219;
  backdrop-filter: none;
}

.overlay--songs.is-hidden {
  display: none;
}

.songs-stage-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  padding: 11px clamp(16px, 3vw, 46px);
  border-bottom: 1px solid rgba(109, 220, 255, 0.18);
  background: rgba(3, 15, 22, 0.96);
}

.songs-stage-header .setup-back-button {
  position: static;
  justify-self: start;
}

.songs-stage-header__title {
  display: grid;
  gap: 4px;
  text-align: center;
}

.songs-stage-header__title span {
  color: var(--mint);
  font-size: 8px;
  letter-spacing: 0.24em;
}

.songs-stage-header__title h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(18px, 3vw, 28px);
  letter-spacing: 0;
}

.songs-stage-header__spacer {
  justify-self: end;
}

.songs-stage-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.hub-songs-lyrics {
  min-height: 0;
  overflow: auto;
  padding: 28px clamp(16px, 4vw, 48px) 20px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.hub-karaoke-block {
  display: grid;
  gap: 6px;
  transition: opacity 120ms ease;
}

.hub-karaoke-block.is-active-line .hub-karaoke-line {
  transform: none;
}

.hub-karaoke-line {
  margin: 0;
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-size: clamp(1.15rem, 4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.45;
  text-wrap: balance;
}

.hub-karaoke-line--vi {
  font-size: clamp(0.95rem, 3.2vw, 1.25rem);
  font-weight: 600;
  color: rgba(167, 255, 226, 0.55);
}

.hub-karaoke-block.is-active-line .hub-karaoke-line--vi {
  color: rgba(167, 255, 226, 0.88);
}

.hub-karaoke-line .karaoke-word {
  display: inline-block;
  margin: 0 0.1em;
  color: rgba(242, 245, 255, 0.28);
  transition:
    color 90ms ease,
    transform 90ms ease,
    text-shadow 90ms ease;
}

.hub-karaoke-line .karaoke-word.is-sung {
  color: rgba(242, 245, 255, 0.72);
}

.hub-karaoke-line .karaoke-word.is-active {
  color: var(--sun, #ffd35a);
  transform: scale(1.06);
  text-shadow: 0 0 18px rgba(255, 180, 84, 0.45);
}

.hub-karaoke-line--vi .karaoke-word {
  color: rgba(167, 255, 226, 0.28);
}

.hub-karaoke-line--vi .karaoke-word.is-sung {
  color: rgba(167, 255, 226, 0.82);
}

.hub-karaoke-line--vi .karaoke-word.is-active {
  color: var(--mint, #a7ffe2);
  text-shadow: 0 0 14px rgba(99, 255, 208, 0.35);
}

.hub-karaoke-line .karaoke-sep {
  display: inline-block;
  margin: 0 0.18em;
  color: rgba(242, 245, 255, 0.45);
  font-weight: 600;
}

.hub-songs-player__controls {
  display: grid;
  gap: 10px;
  padding: 14px clamp(16px, 4vw, 48px) calc(16px + var(--safe-bottom-inset));
  border-top: 1px solid rgba(109, 220, 255, 0.14);
  background: rgba(3, 15, 22, 0.96);
}

.hub-songs-seek {
  width: 100%;
  accent-color: var(--sun, #ffd35a);
}

.hub-songs-player__times {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.hub-hint {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.hub-discover-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.hub-discover-journey {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  gap: 0;
  overflow: hidden;
}

.hub-discover-journey.is-hidden {
  display: none;
}

.hub-discover-journey .hub-path {
  flex: 1;
  min-height: 0;
}

.hub-tour-strip--discover {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px 14px;
}

.hub-discover-journey__heading {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.hub-discover-back {
  position: static;
  justify-self: start;
  margin: 0;
}

.hub-discover-card {
  appearance: none;
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(167, 255, 226, 0.2);
  background: rgba(8, 28, 36, 0.88);
  color: var(--ink);
  cursor: pointer;
}

.hub-discover-card span {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--sun);
}

.hub-discover-card:disabled {
  opacity: 0.45;
  cursor: default;
}

.hub-discover-card.is-primary {
  border-color: rgba(99, 255, 208, 0.45);
  box-shadow: inset 0 0 0 1px rgba(99, 255, 208, 0.18);
}

.hub-memory-card {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(99, 255, 208, 0.22);
  background: rgba(7, 24, 31, 0.78);
}

.hub-memory-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.hub-memory-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.hub-memory-stat strong {
  font-size: 36px;
  letter-spacing: 0.02em;
  color: var(--mint);
}

.hub-memory-stat span {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hub-memory-card .primary-button {
  width: 100%;
}

@media (max-width: 767px) {
  .hub-shell {
    --hub-tabbar-offset: var(--safe-bottom-inset);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "main"
      "nav";
  }

  .hub-main {
    grid-area: main;
    border-left: 0;
    background: rgba(5, 18, 26, 0.88);
    padding-bottom: 12px;
  }

  .hub-nav {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-areas: "home songs create memory account";
    align-items: end;
    gap: 4px;
    padding: 8px 10px calc(8px + var(--safe-bottom-inset));
    border-right: 0;
    border-top: 1px solid rgba(167, 255, 226, 0.14);
    background: rgba(4, 14, 20, 0.98);
  }

  .hub-nav__brand {
    display: none;
  }

  .hub-tabs {
    display: contents;
  }

  .hub-tabs button {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 2px;
    border-radius: 12px;
    padding: 8px 4px;
    font-size: 9px;
    min-height: 52px;
  }

  .hub-tabs button[data-hub-tab="home"] { grid-area: home; }
  .hub-tabs button[data-hub-tab="songs"] { grid-area: songs; }
  .hub-tabs button[data-hub-tab="memory"] { grid-area: memory; }
  .hub-tabs button[data-hub-tab="discover"] { display: none !important; }

  .hub-nav-create {
    grid-area: create;
    position: relative;
    top: -10px;
    width: 52px;
    height: 52px;
    min-height: 52px;
    margin: 0 auto;
    padding: 0;
    border-radius: 50%;
    border: 0;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 20px rgba(255, 211, 90, 0.35);
  }

  .hub-nav-create.is-active {
    box-shadow: 0 0 0 2px rgba(99, 255, 208, 0.7), 0 8px 20px rgba(255, 211, 90, 0.35);
  }

  .hub-nav-create .hub-svg {
    width: 22px;
    height: 22px;
  }

  .hub-nav-create span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .hub-nav-account {
    grid-area: account;
    margin-top: 0;
    border: 1px solid transparent;
    background: transparent;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 2px;
    border-radius: 12px;
    padding: 8px 4px;
    font-size: 9px;
    min-height: 52px;
  }

  .hub-audio-player__row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
  }

  .hub-audio-player {
    padding: 6px 10px calc(6px + var(--safe-bottom-inset));
  }

  .hub-header {
    padding: calc(var(--safe-top) + 12px) 16px 12px;
  }

  .hub-panel {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 12px;
  }

  .hub-panel--memory {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    height: 100%;
    max-height: 100%;
    padding: 0;
  }
}

@media (max-width: 600px) {
  .overlay--briefing {
    padding: 0;
    place-items: stretch;
  }

  .briefing-shell {
    width: 100%;
    height: 100%;
    max-height: none;
  }

  .briefing-frame {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    box-shadow: none;
  }

  .briefing-header {
    padding-top: calc(var(--safe-top) + 12px);
  }

  .briefing-prompt--name,
  .briefing-prompt--age,
  .briefing-prompt--start,
  .briefing-prompt--thinking,
  .briefing-prompt--confirm,
  .briefing-prompt--login {
    max-width: 100%;
  }

  .briefing-name-box,
  .briefing-age-box {
    grid-template-columns: 1fr;
  }

  .briefing-prompt--name .primary-button,
  .briefing-prompt--age .primary-button {
    width: 100%;
  }

  .briefing-prompt--age .secondary-button {
    width: 100%;
    justify-self: stretch;
  }

  .hub-tour-strip {
    padding: 12px 16px 10px;
  }

  .hub-path {
    --node-size: 62px;
    padding: 16px 8px 88px;
  }

  .hub-path__cell {
    min-height: 98px;
  }

  .hub-path__status--complete {
    inset: -5px -5px auto auto;
    width: 23px;
    height: 23px;
    font-size: 12px;
  }

  .hub-path__status--locked {
    inset: -5px -5px auto auto;
    width: 23px;
    height: 23px;
  }

  .hub-path__status--locked svg {
    width: 14px;
    height: 14px;
  }

  .hub-path__band {
    gap: 24px 4px;
    width: 100%;
  }

  .hub-path__start {
    padding: 7px 10px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .briefing-bubble,
  .briefing-bubble.is-in,
  .briefing-bubble--guide.is-in,
  .briefing-bubble--player.is-in,
  .briefing-prompt,
  .briefing-prompt.is-in {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .briefing-typing-dots i,
  .briefing-think-pulse i,
  .briefing-think-step.is-active .briefing-think-mark,
  .hub-path__node.is-current {
    animation: none !important;
    opacity: 0.7;
  }

  .hub-path__node.is-current {
    opacity: 1;
  }

  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
