:root {
  --bg: #f8fafd;
  --bg-subtle: #eef3fa;
  --surface: #ffffff;
  --surface-tint: #f1f7ff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #e6f0ff;
  --accent: #ff6b4a;
  --accent-dark: #ea5231;
  --accent-soft: #fff0ec;
  --gold: #f59e0b;
  --gold-soft: #fef6e4;
  --ink: #0f172a;
  --ink-muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
  position: relative;
}

#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 900;
}

/* Subtle Ambient Floating Clouds & Sparkles */
.ambient-scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.drift-item {
  position: absolute;
  font-size: 20px;
  opacity: 0.24;
  will-change: transform;
  animation: gentleDrift 18s ease-in-out infinite;
}

.drift-item.d1 { top: 10%; left: 5%; animation-duration: 18s; font-size: 26px; }
.drift-item.d2 { top: 26%; right: 5%; animation-duration: 15s; animation-delay: -4s; font-size: 18px; }
.drift-item.d3 { bottom: 24%; left: 4%; animation-duration: 22s; animation-delay: -9s; font-size: 24px; }
.drift-item.d4 { top: 56%; right: 6%; animation-duration: 17s; animation-delay: -3s; font-size: 18px; }
.drift-item.d5 { bottom: 10%; right: 14%; animation-duration: 20s; animation-delay: -11s; font-size: 16px; }

@keyframes gentleDrift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(16px, -20px, 0) rotate(8deg); }
}

/* Minimal Frosted Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 250, 253, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 12px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-btn:hover {
  transform: scale(1.03);
}

.brand-mark {
  font-size: 28px;
  line-height: 1;
}

.brand-name {
  font-size: 19px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px 0 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.rank-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.rank-lv {
  background: var(--gold-soft);
  color: #b45309;
  font-size: 12px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.rank-bar {
  width: 52px;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
  display: block;
}

.rank-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-pill {
  height: 38px;
  min-width: 38px;
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.icon-pill:hover {
  transform: translateY(-1px);
  background: var(--surface-tint);
  border-color: var(--line-strong);
}

.icon-pill.is-muted {
  opacity: 0.55;
}

.pill-count {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* Music Equalizer Animation */
.music-btn {
  padding: 0 12px;
  gap: 6px;
}

.music-btn.playing {
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.22);
}

.eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.eq-bars i {
  display: block;
  width: 2.5px;
  height: 12px;
  border-radius: 2px;
  background: var(--ink-muted);
  transform-origin: bottom center;
  transform: scaleY(0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}

.music-btn.playing .eq-bars i {
  background: var(--primary);
  animation: eqBounce 0.9s ease-in-out infinite;
}

.music-btn.playing .eq-bars i:nth-child(1) { animation-delay: 0s; }
.music-btn.playing .eq-bars i:nth-child(2) { animation-delay: 0.22s; }
.music-btn.playing .eq-bars i:nth-child(3) { animation-delay: 0.44s; }

@keyframes eqBounce {
  0%, 100% { transform: scaleY(0.35); }
  50% { transform: scaleY(1); }
}

.account-pill {
  height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  border: none;
  background: var(--ink);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.18s ease, background 0.18s ease;
}

.account-pill:hover {
  transform: translateY(-1px);
  background: #1e293b;
}

/* Main Container */
.container {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

.view-fade {
  animation: viewFadeIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden {
  display: none !important;
}

/* HERO SPOTLIGHT */
.hero-spotlight {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 310px;
  background: #fcf6ea;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.hero-bg-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  transform-origin: center center;
  animation: heroArtBreathe 14s ease-in-out infinite;
  pointer-events: none;
}

@keyframes heroArtBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.hero-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(253, 248, 238, 0.94) 0%,
    rgba(253, 248, 238, 0.72) 38%,
    rgba(253, 248, 238, 0.05) 62%,
    rgba(253, 248, 238, 0) 100%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 32px 36px;
  max-width: 470px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-mascot-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-mascot-btn {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mini-mascot-btn:hover {
  transform: scale(1.08) rotate(3deg);
}

.mini-mascot-btn:active {
  transform: scale(0.95);
}

.hero-rank-chip {
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  color: var(--primary-dark);
  font-size: 13.5px;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.hero-rank-chip:hover {
  transform: translateY(-1px);
  background: var(--primary-soft);
}

.hero-title {
  font-size: 40px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-primary-cta {
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  background: var(--accent);
  color: #ffffff;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(255, 107, 74, 0.34);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary-cta:hover {
  transform: translateY(-2px) scale(1.02);
  background: var(--accent-dark);
  box-shadow: 0 14px 28px rgba(255, 107, 74, 0.4);
}

.btn-primary-cta:active {
  transform: translateY(1px) scale(0.98);
}

.btn-primary-cta.btn-compact {
  padding: 12px 24px;
  font-size: 15.5px;
}

.btn-primary-cta.btn-full {
  width: 100%;
  padding: 13px 20px;
  font-size: 15.5px;
}

.cta-play {
  font-size: 13px;
}

.cta-stage-tag {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  font-variant-numeric: tabular-nums;
}

.hero-stats-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-xp-track {
  width: 170px;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.hero-xp-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  transition: width 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-stat-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.hero-star-chip {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* Mascot SVG Micro-Animations */
.mascot-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: mascotBreathe 3s ease-in-out infinite;
}

.mascot-svg .mascot-eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: mascotBlink 4.4s ease-in-out infinite;
}

.mascot-svg .cat-tail {
  transform-origin: 142px 172px;
  animation: tailWag 2.2s ease-in-out infinite;
}

.mascot-svg .cat-hat {
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: hatSway 3.4s ease-in-out infinite;
}

.mascot-svg .aura-spin {
  transform-box: fill-box;
  transform-origin: center;
  animation: slowSpin 16s linear infinite;
}

.mascot-svg.mood-cheer {
  animation: mascotJump 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mascot-svg.mood-oops {
  animation: mascotShake 0.36s ease-in-out;
}

@keyframes mascotBreathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes mascotBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}

@keyframes tailWag {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(9deg); }
}

@keyframes hatSway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

@keyframes slowSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes mascotJump {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-18px) scale(1.08); }
  75% { transform: translateY(2px) scale(0.96); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes mascotShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px) rotate(-3deg); }
  75% { transform: translateX(6px) rotate(3deg); }
}

/* TABBED ISLAND EXPLORER */
.island-explorer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.island-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.island-tab {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.island-tab:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.island-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28);
  transform: translateY(-2px);
}

.island-tab-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease;
}

.island-tab.active .island-tab-ico {
  background: rgba(255, 255, 255, 0.92);
  transform: scale(1.06);
}

.island-tab-name {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.island-tab-stars {
  font-size: 11px;
  font-weight: 800;
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}

.island-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.island-banner {
  position: relative;
  height: 116px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.island-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
  animation: bannerFloat 18s ease-in-out infinite;
}

@keyframes bannerFloat {
  0%, 100% { transform: scale(1.02) translateY(0); }
  50% { transform: scale(1.06) translateY(-4px); }
}

.island-banner-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 255, 255, 0.62) 55%,
    rgba(255, 255, 255, 0.25) 100%
  );
}

.island-banner-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 26px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.island-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.island-banner-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.island-banner-stars {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* 4 Clean Visual Stage Cards */
.stages-grid {
  padding: 20px 22px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stage-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 16px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: cardRiseIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

@keyframes cardRiseIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.stage-card:hover {
  transform: translateY(-5px);
  background: var(--surface);
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.1);
}

.stage-card.is-next {
  background: var(--surface);
  border-color: rgba(255, 107, 74, 0.36);
  box-shadow: 0 10px 24px rgba(255, 107, 74, 0.1);
}

.stage-visual-badge {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stage-card:hover .stage-visual-badge {
  transform: scale(1.12) rotate(4deg);
}

.stage-name {
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.3;
}

.stage-stars {
  font-size: 16px;
  letter-spacing: 3px;
  line-height: 1;
}

.stage-play-chip {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  transition: background 0.18s ease, color 0.18s ease;
}

.stage-card:hover .stage-play-chip {
  background: var(--primary);
  color: #ffffff;
}

/* PRACTICE ARENA */
.arena-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.btn-ghost {
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, background 0.18s ease;
}

.btn-ghost:hover {
  transform: translateY(-1px);
  background: var(--bg-subtle);
}

.btn-ghost.btn-full {
  width: 100%;
  height: 44px;
}

.arena-stage-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.arena-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 16px;
  align-items: stretch;
}

.coach-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px 16px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.coach-mascot-box {
  width: 128px;
  height: 128px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.coach-mascot-box:hover {
  transform: scale(1.06);
}

.coach-bubble {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-metrics {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.metric-tile {
  background: var(--bg);
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.metric-ico {
  font-size: 14px;
  line-height: 1;
}

.metric-val {
  font-size: 17px;
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: transform 0.18s ease, color 0.18s ease;
}

.metric-val.combo-hot {
  color: var(--accent);
  transform: scale(1.1);
}

/* Center Stage Card */
.stage-arena-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 22px 26px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 310px;
  gap: 14px;
}

.round-dots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.round-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.round-dot.done {
  background: var(--primary);
}

.round-dot.current {
  width: 26px;
  background: var(--accent);
}

.arena-prompt-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 10px;
}

.prompt-visual-wrap {
  width: 82px;
  height: 82px;
  border-radius: 26px;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, var(--primary-soft) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 20px rgba(37, 99, 235, 0.08);
}

.prompt-emoji {
  font-size: 46px;
  line-height: 1;
  animation: promptPop 0.36s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes promptPop {
  0% { transform: scale(0.65) rotate(-8deg); opacity: 0.2; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.meaning-pill {
  background: var(--primary-soft);
  border: 1px solid rgba(37, 99, 235, 0.16);
  color: var(--primary-dark);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.16s ease, background 0.16s ease;
}

.meaning-pill:hover {
  transform: scale(1.04);
  background: #dbeafe;
}

.en-words-flow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 4px;
  max-width: 720px;
  margin: 6px 0;
}

.en-word-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.en-letter {
  min-width: 40px;
  height: 54px;
  padding: 0 7px;
  border-radius: 14px;
  border: 1.5px solid var(--line-strong);
  background: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 29px;
  font-weight: 900;
  color: var(--ink);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s ease, border-color 0.15s ease;
}

.en-letter.space-box {
  min-width: 28px;
  font-size: 16px;
  color: #94a3b8;
  border-style: dashed;
}

.en-letter.typed {
  border-color: rgba(16, 185, 129, 0.35);
  background: #ecfdf5;
  color: #059669;
}

.en-letter.current {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 8px 18px rgba(255, 107, 74, 0.2);
}

.en-letter.wrong-flash {
  border-color: #ef4444;
  background: #fef2f2;
  color: #dc2626;
  animation: mascotShake 0.28s ease;
}

.finger-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-muted);
}

.finger-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.floating-pop {
  position: fixed;
  pointer-events: none;
  font-weight: 900;
  font-size: 20px;
  color: var(--accent);
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.95);
  z-index: 950;
  animation: floatUpFade 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes floatUpFade {
  0% { opacity: 1; transform: translate(-50%, 0) scale(0.8); }
  40% { opacity: 1; transform: translate(-50%, -32px) scale(1.12); }
  100% { opacity: 0; transform: translate(-50%, -62px) scale(0.95); }
}

/* Authentic Apple Mac Keyboard */
.keyboard-panel {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 14px;
  box-shadow: var(--shadow-md);
}

.kb-rows {
  max-width: 820px;
  margin: 0 auto;
  background: #eaf0f7;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kb-row {
  display: flex;
  gap: 6px;
  width: 100%;
}

.kb-key {
  flex: var(--u, 1) 1 0;
  min-width: 0;
  height: 46px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 2px 0 rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  position: relative;
  transition: transform 0.07s ease, background 0.14s ease, box-shadow 0.14s ease, color 0.14s ease;
  cursor: pointer;
  padding: 3px 5px;
  line-height: 1.05;
}

.kb-key.kb-dual {
  justify-content: space-between;
  padding: 4px 5px;
}

.kb-key .kb-top {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-muted);
}

.kb-key .kb-main {
  font-size: 15px;
  font-weight: 900;
}

.kb-key.kb-punct .kb-main {
  font-size: 18px;
  line-height: 0.9;
}

.kb-key.kb-mod {
  background: #f8fafd;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  justify-content: flex-end;
  padding: 5px 7px;
}

.kb-key.kb-mod-left {
  align-items: flex-start;
}

.kb-key.kb-mod-right {
  align-items: flex-end;
}

.kb-key.kb-mod-mac {
  justify-content: space-between;
  padding: 4px 6px;
}

.kb-key .kb-sym {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.85;
}

.kb-key .kb-lbl {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.kb-key.kb-caps::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.16);
}

.kb-key.space-key {
  background: #ffffff;
  font-size: 11.5px;
  color: var(--ink-muted);
  justify-content: center;
}

.kb-arrows {
  flex: 2.7 1 0;
  min-width: 0;
  display: flex;
  gap: 4px;
  align-items: flex-end;
}

.kb-arrow-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  height: 46px;
}

.kb-key.kb-arrow-half {
  flex: 1 1 0;
  height: 21px;
  font-size: 9px;
  padding: 0;
  border-radius: 6px;
  background: #f8fafd;
  color: var(--ink-muted);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.12);
}

.kb-key.kb-arrow-side {
  flex: 1 1 0;
  height: 22px;
  font-size: 9px;
  padding: 0;
  border-radius: 6px;
  background: #f8fafd;
  color: var(--ink-muted);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.12);
}

.kb-key.home-bump::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 11px;
  height: 2px;
  border-radius: 2px;
  background: rgba(15, 23, 42, 0.3);
}

.kb-key.target-key {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent-dark);
  box-shadow: 0 2px 0 var(--accent-dark), 0 0 0 3.5px rgba(255, 107, 74, 0.26);
  animation: keyGlow 1s ease-in-out infinite;
}

.kb-key.target-key .kb-top,
.kb-key.target-key .kb-sym,
.kb-key.target-key .kb-lbl {
  color: rgba(255, 255, 255, 0.92);
}

.kb-key.target-shift {
  background: #ec4899;
  color: #ffffff;
  border-color: #be185d;
  box-shadow: 0 2px 0 #be185d, 0 0 0 3.5px rgba(236, 72, 153, 0.24);
}

.kb-key.target-shift .kb-sym,
.kb-key.target-shift .kb-lbl {
  color: #ffffff;
}

.kb-key.target-key::after {
  background: #ffffff;
}

.kb-key:active,
.kb-key.pressed {
  transform: translateY(2px);
  box-shadow: none;
}

@keyframes keyGlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  max-width: 440px;
  width: 100%;
  padding: 28px 26px;
  text-align: center;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 88vh;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-card.modal-wide {
  max-width: 560px;
}

.modal-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.close-x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-subtle);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  color: var(--ink-muted);
  transition: background 0.15s ease, transform 0.15s ease;
}

.close-x:hover {
  background: var(--line-strong);
  transform: scale(1.06);
}

.celebrate-art-wrap {
  width: 156px;
  height: 156px;
  margin: 0 auto 10px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.18);
  animation: mascotJump 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.celebrate-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.big-stars-row {
  font-size: 40px;
  letter-spacing: 6px;
  margin-bottom: 6px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 22px;
}

.result-item {
  background: var(--bg);
  border-radius: 16px;
  padding: 12px 8px;
}

.result-item .lbl {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 800;
}

.result-item .val {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary-dark);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Promo Sunburst Modal & Dancing Avatar Celebration Stage */
.promo-card {
  background: radial-gradient(circle at 50% 25%, #eff6ff 0%, #ffffff 72%);
  overflow: hidden;
}

.promo-sunburst {
  position: absolute;
  top: -60px;
  left: 50%;
  width: 360px;
  height: 360px;
  margin-left: -180px;
  background: repeating-conic-gradient(
    from 0deg,
    var(--promo-ray, rgba(56, 189, 248, 0.14)) 0deg 15deg,
    transparent 15deg 30deg
  );
  border-radius: 50%;
  animation: slowSpin 16s linear infinite;
  pointer-events: none;
}

.promo-mascot-wrap {
  position: relative;
  z-index: 2;
  width: 220px;
  height: 200px;
  margin: 0 auto 8px;
  cursor: pointer;
}

.dance-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dance-floor-glow {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 148px;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--floor-glow, rgba(56, 189, 248, 0.35)) 0%, transparent 72%);
  animation: floorPulse 0.9s ease-in-out infinite;
}

.dance-shadow {
  position: absolute;
  bottom: 14px;
  left: 50%;
  width: 96px;
  height: 14px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.14);
  animation: danceShadow 0.9s ease-in-out infinite;
}

.dancer-rig {
  position: relative;
  z-index: 2;
  width: 174px;
  height: 174px;
  animation: danceGroove 0.9s cubic-bezier(0.37, 0, 0.63, 1) infinite;
  transform-origin: center 88%;
}

.dancer-rig.spin-boost {
  animation: danceSpinPop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dancer-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 8px 14px rgba(15, 23, 42, 0.1));
}

.dancer-svg .dance-arm-l {
  transform-box: fill-box;
  transform-origin: right center;
  animation: danceArmL 0.45s ease-in-out infinite alternate;
}

.dancer-svg .dance-arm-r {
  transform-box: fill-box;
  transform-origin: left center;
  animation: danceArmR 0.45s ease-in-out infinite alternate;
}

.dancer-svg .dance-foot-l {
  transform-box: fill-box;
  transform-origin: center top;
  animation: danceFootL 0.45s ease-in-out infinite alternate;
}

.dancer-svg .dance-foot-r {
  transform-box: fill-box;
  transform-origin: center top;
  animation: danceFootR 0.45s ease-in-out infinite alternate;
}

.dancer-svg .dance-head {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: danceHeadBob 0.9s ease-in-out infinite;
}

.dancer-svg .dance-ear-l {
  transform-box: fill-box;
  transform-origin: right bottom;
  animation: danceEarL 0.45s ease-in-out infinite alternate;
}

.dancer-svg .dance-ear-r {
  transform-box: fill-box;
  transform-origin: left bottom;
  animation: danceEarR 0.45s ease-in-out infinite alternate;
}

.dancer-svg .dance-tail {
  transform-box: fill-box;
  transform-origin: left center;
  animation: danceTailWag 0.42s ease-in-out infinite alternate;
}

.dancer-svg .dance-crown {
  animation: danceCrownFloat 0.9s ease-in-out infinite;
}

.dance-floater {
  position: absolute;
  font-size: 22px;
  z-index: 3;
  pointer-events: none;
  animation: danceFloatNote 2.1s ease-in-out infinite;
}

.dance-floater.f1 { top: 14px; left: 8px; animation-delay: 0s; }
.dance-floater.f2 { top: 6px; right: 12px; animation-delay: -0.55s; font-size: 20px; }
.dance-floater.f3 { bottom: 38px; left: 2px; animation-delay: -1.1s; font-size: 19px; }
.dance-floater.f4 { bottom: 34px; right: 4px; animation-delay: -1.55s; font-size: 21px; }

@keyframes danceGroove {
  0% { transform: translate3d(-10px, 0, 0) rotate(-7deg) scale(1.03, 0.95); }
  25% { transform: translate3d(0, -18px, 0) rotate(0deg) scale(0.96, 1.06); }
  50% { transform: translate3d(10px, 0, 0) rotate(7deg) scale(1.03, 0.95); }
  75% { transform: translate3d(0, -18px, 0) rotate(0deg) scale(0.96, 1.06); }
  100% { transform: translate3d(-10px, 0, 0) rotate(-7deg) scale(1.03, 0.95); }
}

@keyframes danceSpinPop {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  45% { transform: translateY(-28px) rotate(180deg) scale(1.12); }
  100% { transform: translateY(0) rotate(360deg) scale(1); }
}

@keyframes danceShadow {
  0%, 50%, 100% { transform: translateX(-50%) scaleX(1.06); opacity: 0.2; }
  25%, 75% { transform: translateX(-50%) scaleX(0.72); opacity: 0.09; }
}

@keyframes floorPulse {
  0%, 50%, 100% { transform: translateX(-50%) scale(1.08); opacity: 0.9; }
  25%, 75% { transform: translateX(-50%) scale(0.88); opacity: 0.55; }
}

@keyframes danceArmL {
  from { transform: rotate(-22deg) translateY(3px); }
  to { transform: rotate(28deg) translateY(-8px); }
}

@keyframes danceArmR {
  from { transform: rotate(-28deg) translateY(-8px); }
  to { transform: rotate(22deg) translateY(3px); }
}

@keyframes danceFootL {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(-9px) rotate(-14deg); }
}

@keyframes danceFootR {
  from { transform: translateY(-9px) rotate(14deg); }
  to { transform: translateY(0) rotate(0deg); }
}

@keyframes danceHeadBob {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

@keyframes danceEarL {
  from { transform: rotate(-8deg); }
  to { transform: rotate(9deg); }
}

@keyframes danceEarR {
  from { transform: rotate(8deg); }
  to { transform: rotate(-9deg); }
}

@keyframes danceTailWag {
  from { transform: rotate(-14deg); }
  to { transform: rotate(16deg); }
}

@keyframes danceCrownFloat {
  0%, 100% { transform: translate(100px, 18px) rotate(-5deg); }
  50% { transform: translate(100px, 13px) rotate(5deg); }
}

@keyframes danceFloatNote {
  0%, 100% { transform: translateY(4px) scale(0.92) rotate(-8deg); opacity: 0.78; }
  50% { transform: translateY(-10px) scale(1.15) rotate(10deg); opacity: 1; }
}

.promo-lv-pill {
  position: relative;
  z-index: 2;
  display: inline-block;
  background: var(--gold-soft);
  color: #b45309;
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 8px;
}

.promo-acc {
  position: relative;
  z-index: 2;
  font-size: 15px;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 6px 0 20px;
}

.avatar-grid.avatar-grid-compact {
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 0 0 16px;
}

.avatar-grid.avatar-grid-compact .avatar-option {
  padding: 6px 2px;
  font-size: 22px;
  border-radius: 12px;
}

.avatar-grid.avatar-grid-compact .avatar-option span {
  font-size: 10px;
}

/* Account Form */
.auth-tabs {
  display: flex;
  background: var(--bg-subtle);
  border-radius: 999px;
  padding: 4px;
  margin: 16px 0;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink-muted);
  transition: all 0.18s ease;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.avatar-option {
  border: 1.5px solid var(--line);
  background: var(--bg);
  border-radius: 13px;
  padding: 7px 2px;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.avatar-option span {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
}

.avatar-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.04);
}

.field-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line-strong);
  background: var(--bg);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.field-input:focus {
  border-color: var(--primary);
  background: var(--surface);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.pin-btn {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 10px;
  padding: 9px 0;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  color: var(--ink);
}

.pin-btn:active {
  background: var(--primary-soft);
}

.error-msg {
  color: #dc2626;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  min-height: 18px;
}

.prof-avatar {
  font-size: 52px;
  margin-bottom: 4px;
}

.prof-rank {
  font-size: 13.5px;
  color: var(--primary-dark);
  font-weight: 800;
  margin-top: 4px;
}

.ranks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
  text-align: left;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
  text-align: left;
}

.badge-item {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.45;
  filter: grayscale(1);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.badge-item.unlocked {
  opacity: 1;
  filter: none;
  background: var(--gold-soft);
  border-color: rgba(245, 158, 11, 0.35);
}

.badge-item.unlocked[data-preview-lv]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.leader-list {
  margin-top: 16px;
  text-align: left;
}

.leader-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.leader-row:last-child {
  border-bottom: none;
}

/* Responsive */
@media (max-width: 860px) {
  .island-tabs {
    grid-template-columns: repeat(3, 1fr);
  }
  .stages-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .arena-layout {
    grid-template-columns: 1fr;
  }
  .coach-panel {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 14px;
  }
  .coach-mascot-box {
    width: 82px;
    height: 82px;
  }
  .live-metrics {
    grid-template-columns: repeat(4, 1fr);
  }
  .hero-title {
    font-size: 32px;
  }
  .hero-veil {
    background: linear-gradient(
      180deg,
      rgba(253, 248, 238, 0.92) 0%,
      rgba(253, 248, 238, 0.72) 55%,
      rgba(253, 248, 238, 0.25) 100%
    );
  }
}

@media (max-width: 540px) {
  .topbar-inner {
    padding: 10px 14px;
  }
  .brand-name {
    font-size: 16px;
  }
  .rank-bar {
    display: none;
  }
  .hero-content {
    padding: 24px 20px;
  }
  .kb-rows {
    padding: 6px;
    gap: 4px;
  }
  .kb-row {
    gap: 3px;
  }
  .kb-key {
    height: 36px;
    font-size: 11px;
    padding: 2px;
    border-radius: 6px;
  }
  .kb-key .kb-top,
  .kb-key .kb-lbl {
    display: none;
  }
  .kb-arrow-col {
    height: 36px;
  }
  .kb-key.kb-arrow-half,
  .kb-key.kb-arrow-side {
    height: 16px;
    font-size: 7px;
  }
  .en-letter {
    min-width: 30px;
    height: 44px;
    font-size: 22px;
  }
  .ranks-grid,
  .badges-grid {
    grid-template-columns: 1fr;
  }
}

/* Performance Mode Pill */
.perf-pill {
  padding: 0 10px;
  gap: 4px;
  font-size: 13px;
}

.perf-pill .perf-lbl {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-muted);
}

html[data-perf="lite"] .perf-pill {
  background: #ecfdf5;
  border-color: rgba(16, 185, 129, 0.28);
}

html[data-perf="lite"] .perf-pill .perf-lbl {
  color: #047857;
}

html[data-perf="balanced"] .perf-pill {
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.22);
}

html[data-perf="balanced"] .perf-pill .perf-lbl {
  color: var(--primary-dark);
}

/* Balanced Tier: strip expensive sticky backdrop blur & ambient background loops */
html[data-perf="balanced"] .topbar {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(248, 250, 253, 0.96);
}

html[data-perf="balanced"] .ambient-scene,
html[data-perf="balanced"] .drift-item {
  display: none !important;
  animation: none !important;
}

html[data-perf="balanced"] .hero-bg-art,
html[data-perf="balanced"] .island-banner-art {
  animation: none !important;
}

html[data-perf="balanced"] .dancer-svg {
  filter: none;
}

/* Lite Tier (Mid-2015 MBP / Legacy Intel GPU / Older Safari & Chrome):
   Eliminates all GPU backdrop-filter blurs, idle 60fps loops, SVG sub-element repaints,
   and heavy shadows while preserving a cute single-layer level-up bounce animation. */
html[data-perf="lite"] {
  --shadow-sm: 0 1px 4px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 10px 24px rgba(15, 23, 42, 0.14);
}

html[data-perf="lite"] .topbar,
html[data-perf="lite"] .hero-rank-chip,
html[data-perf="lite"] .modal-backdrop {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-perf="lite"] .topbar {
  background: #f8fafd;
}

html[data-perf="lite"] .hero-rank-chip {
  background: #ffffff;
}

html[data-perf="lite"] .modal-backdrop {
  background: rgba(15, 23, 42, 0.52);
}

html[data-perf="lite"] .ambient-scene,
html[data-perf="lite"] .drift-item {
  display: none !important;
  animation: none !important;
  will-change: auto !important;
}

html[data-perf="lite"] .hero-bg-art,
html[data-perf="lite"] .island-banner-art,
html[data-perf="lite"] .mascot-svg,
html[data-perf="lite"] .mascot-eyes,
html[data-perf="lite"] .cat-hat-anim,
html[data-perf="lite"] .cat-tail-anim,
html[data-perf="lite"] .aura-spin,
html[data-perf="lite"] .music-btn.playing .eq-bars i,
html[data-perf="lite"] .letter-cell.current,
html[data-perf="lite"] .kb-key.target-key,
html[data-perf="lite"] .promo-sunburst,
html[data-perf="lite"] .dance-floor-glow,
html[data-perf="lite"] .dance-shadow,
html[data-perf="lite"] .dance-floater {
  animation: none !important;
}

html[data-perf="lite"] .music-btn.playing .eq-bars i:nth-child(1) { transform: scaleY(0.55); }
html[data-perf="lite"] .music-btn.playing .eq-bars i:nth-child(2) { transform: scaleY(1); }
html[data-perf="lite"] .music-btn.playing .eq-bars i:nth-child(3) { transform: scaleY(0.7); }

html[data-perf="lite"] .promo-sunburst {
  background: radial-gradient(circle at center, var(--promo-ray, rgba(56, 189, 248, 0.16)) 0%, transparent 68%);
}

html[data-perf="lite"] .dancer-svg {
  filter: none !important;
}

html[data-perf="lite"] .dancer-svg .dance-arm-l,
html[data-perf="lite"] .dancer-svg .dance-arm-r,
html[data-perf="lite"] .dancer-svg .dance-foot-l,
html[data-perf="lite"] .dancer-svg .dance-foot-r,
html[data-perf="lite"] .dancer-svg .dance-head,
html[data-perf="lite"] .dancer-svg .dance-ear-l,
html[data-perf="lite"] .dancer-svg .dance-ear-r,
html[data-perf="lite"] .dancer-svg .dance-tail,
html[data-perf="lite"] .dancer-svg .dance-crown {
  animation: none !important;
}

html[data-perf="lite"] .dancer-rig {
  animation: danceGrooveLite 1.15s ease-in-out infinite;
}

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

@media (max-width: 540px) {
  .perf-pill .perf-lbl {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   SEO Below-the-Fold Curriculum Hub & SSR Island / Stage Pages
   ============================================================ */
.seo-hub,
.ssr-page {
  user-select: text;
}

.ssr-link-reset {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.seo-hub {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.seo-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
}

.seo-card-head h2 {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 6px;
}

.seo-card-head p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-muted);
}

.seo-islands-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.seo-island-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.seo-island-card:hover {
  border-color: rgba(37, 99, 235, 0.28);
  transform: translateY(-2px);
}

.seo-island-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.seo-island-icon {
  font-size: 24px;
  line-height: 1.2;
  flex-shrink: 0;
}

.seo-island-meta h3 {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.seo-island-meta h3 a {
  color: var(--ink);
  text-decoration: none;
}

.seo-island-meta h3 a:hover {
  color: var(--primary);
}

.seo-age-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11.5px;
  font-weight: 800;
}

.seo-island-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-muted);
}

.seo-stage-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.seo-stage-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.seo-stage-pill:hover {
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--primary-dark);
}

.seo-highlights-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.seo-highlight-chip {
  background: var(--surface-tint);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.seo-highlight-chip strong {
  font-size: 16px;
  font-weight: 900;
  color: var(--primary-dark);
}

.seo-highlight-chip span {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 700;
}

.seo-faq-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.seo-faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 12px 16px;
}

.seo-faq-item summary {
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.seo-faq-item summary::-webkit-details-marker {
  display: none;
}

.seo-faq-item summary::after {
  content: '+';
  font-size: 18px;
  font-weight: 900;
  color: var(--primary);
  flex-shrink: 0;
}

.seo-faq-item[open] summary::after {
  content: '−';
}

.seo-faq-item p {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-muted);
}

.seo-footer {
  margin-top: 4px;
  padding: 20px 24px 28px;
  border-top: 1px solid var(--line);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.seo-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
}

.seo-footer-nav a {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-muted);
  text-decoration: none;
}

.seo-footer-nav a:hover {
  color: var(--primary);
}

.seo-footer-note {
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* Standalone SSR Island & Stage Pages */
.ssr-main {
  padding-top: 22px;
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.ssr-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
}

.ssr-breadcrumb a {
  color: var(--primary-dark);
  text-decoration: none;
}

.ssr-breadcrumb a:hover {
  text-decoration: underline;
}

.ssr-hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: var(--radius-xl);
  padding: 28px 30px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ssr-hero-badge {
  align-self: flex-start;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
}

.ssr-hero-card h1 {
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 900;
  color: var(--ink);
  line-height: 1.25;
}

.ssr-hero-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-muted);
  max-width: 780px;
}

.ssr-hero-actions {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ssr-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ssr-section-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--ink);
}

.ssr-stages-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ssr-stage-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ssr-stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.ssr-stage-top h2 {
  font-size: 18px;
  font-weight: 900;
}

.ssr-stage-top h2 a {
  color: var(--ink);
  text-decoration: none;
}

.ssr-stage-top h2 a:hover {
  color: var(--primary);
}

.ssr-stage-sub {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.ssr-stage-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ssr-item-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ssr-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink);
}

.ssr-item-chip em {
  font-style: normal;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
}

.ssr-practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.ssr-practice-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ssr-practice-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ssr-practice-num {
  font-size: 11.5px;
  font-weight: 900;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.ssr-practice-emoji {
  font-size: 24px;
}

.ssr-practice-text {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.35;
  word-break: break-word;
}

.ssr-en-text {
  letter-spacing: 0.01em;
}

.ssr-practice-pinyin {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
}

.ssr-practice-keys {
  font-size: 12.5px;
  color: var(--ink-muted);
}

.ssr-practice-keys code {
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  color: var(--ink);
}

.ssr-tip-box {
  background: var(--gold-soft);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
}

.ssr-tip-box h3 {
  font-size: 16px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 8px;
}

.ssr-tip-box ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink);
}

.ssr-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.ssr-world-pills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.ssr-world-pill {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ssr-world-pill span {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
}

.ssr-world-pill:hover,
.ssr-world-pill.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

@media (max-width: 900px) {
  .seo-islands-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .seo-highlights-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .seo-card,
  .ssr-hero-card,
  .ssr-stage-card {
    padding: 18px 16px;
    border-radius: var(--radius-lg);
  }
  .seo-islands-grid,
  .seo-highlights-row {
    grid-template-columns: 1fr;
  }
  .ssr-hero-actions,
  .ssr-stage-btns {
    width: 100%;
  }
  .ssr-hero-actions a,
  .ssr-stage-btns a {
    flex: 1 1 auto;
  }
}

