:root {
  --bg-1: #fff6d6;
  --bg-2: #fffbeb;
  --bg-3: #ffedd5;
  --theme-primary: #f59e0b;
  --theme-primary-dark: #d97706;
  --theme-primary-soft: #fef3c7;
  --theme-accent: #fb7185;
  --theme-border: #fcd34d;
  --theme-glow: rgba(245, 158, 11, 0.28);
  --stage-border: #fde68a;
  --frame-bg: #fffbeb;
  --frame-border: #fbbf24;
  --cell-border: #fde68a;

  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;

  --color-a: #2563eb;
  --color-a-soft: #dbeafe;
  --color-b: #f97316;
  --color-b-soft: #ffedd5;
  --color-sub: #9333ea;
  --color-sub-soft: #f3e8ff;
  --color-green: #16a34a;
  --color-green-soft: #dcfce7;
  --color-gold: #f59e0b;
  --color-gold-soft: #fef3c7;

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --shadow-card: 0 16px 38px rgba(30, 41, 59, 0.10);
  --shadow-soft: 0 6px 16px rgba(15, 23, 42, 0.08);

  --font-round: 'YouYuan', 'PingFang SC', 'Hiragino Maru Gothic ProN', 'Yuanti SC', 'Microsoft YaHei', 'Nunito', system-ui, -apple-system, sans-serif;
}

/* ==================== 角色与三大英雄护眼绘本主题 ==================== */
body[data-theme="explorer"] {
  --bg-1: #d8f8e1;
  --bg-2: #f4fdf7;
  --bg-3: #fef9c3;
  --theme-primary: #10b981;
  --theme-primary-dark: #047857;
  --theme-primary-soft: #d1fae5;
  --theme-accent: #f59e0b;
  --theme-border: #34d399;
  --theme-glow: rgba(16, 185, 129, 0.28);
  --stage-border: #a7f3d0;
  --frame-bg: #f0fdf4;
  --frame-border: #10b981;
  --cell-border: #86efac;
}

body[data-theme="wukong"] {
  --bg-1: #fff3c4;
  --bg-2: #fffbeb;
  --bg-3: #ffedd5;
  --theme-primary: #f59e0b;
  --theme-primary-dark: #c2410c;
  --theme-primary-soft: #fef3c7;
  --theme-accent: #f97316;
  --theme-border: #fbbf24;
  --theme-glow: rgba(245, 158, 11, 0.30);
  --stage-border: #fde68a;
  --frame-bg: #fff9e6;
  --frame-border: #f59e0b;
  --cell-border: #fcd34d;
}

body[data-theme="ultraman"] {
  --bg-1: #d7f3ff;
  --bg-2: #eff6ff;
  --bg-3: #ede9fe;
  --theme-primary: #0ea5e9;
  --theme-primary-dark: #0369a1;
  --theme-primary-soft: #e0f2fe;
  --theme-accent: #8b5cf6;
  --theme-border: #38bdf8;
  --theme-glow: rgba(14, 165, 233, 0.30);
  --stage-border: #bae6fd;
  --frame-bg: #eff6ff;
  --frame-border: #38bdf8;
  --cell-border: #93c5fd;
}

body[data-theme="transformer"] {
  --bg-1: #dbeafe;
  --bg-2: #f8fafc;
  --bg-3: #ffe4e6;
  --theme-primary: #2563eb;
  --theme-primary-dark: #1d4ed8;
  --theme-primary-soft: #dbeafe;
  --theme-accent: #ef4444;
  --theme-border: #60a5fa;
  --theme-glow: rgba(37, 99, 235, 0.26);
  --stage-border: #bfdbfe;
  --frame-bg: #f0f7ff;
  --frame-border: #3b82f6;
  --cell-border: #93c5fd;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-round);
  color: var(--text-main);
  background: linear-gradient(165deg, var(--bg-1) 0%, var(--bg-2) 48%, var(--bg-3) 100%);
  transition: background 0.45s ease;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* ==================== 英雄场景 SVG 动态装饰 ==================== */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.theme-decor {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
}

body[data-theme="explorer"] .theme-decor-explorer,
body[data-theme="wukong"] .theme-decor-wukong,
body[data-theme="ultraman"] .theme-decor-ultraman,
body[data-theme="transformer"] .theme-decor-transformer {
  opacity: 1;
}

.decor-item {
  position: absolute;
  opacity: 0.72;
}

.exp-cloud-1 {
  width: 164px;
  top: 28px;
  left: 3%;
  animation: driftSlow 26s ease-in-out infinite;
}
.exp-leaf-1 {
  width: 58px;
  top: 100px;
  right: 4%;
  animation: driftSlow 18s ease-in-out infinite reverse;
}
.exp-leaf-2 {
  width: 54px;
  bottom: 92px;
  left: 4%;
  animation: driftSlow 22s ease-in-out infinite;
}
.exp-compass-star {
  width: 46px;
  bottom: 72px;
  right: 5%;
  animation: twinkle 3.2s ease-in-out infinite;
}

.wukong-cloud-1 {
  width: 170px;
  top: 26px;
  left: 3%;
  animation: driftSlow 26s ease-in-out infinite;
}
.wukong-cloud-2 {
  width: 150px;
  top: 90px;
  right: 4%;
  animation: driftSlow 32s ease-in-out infinite reverse;
}
.sparkle-float {
  width: 30px;
  animation: twinkle 3.2s ease-in-out infinite;
}
.sp-1 { top: 210px; left: 5%; }
.sp-2 { bottom: 90px; right: 5%; animation-delay: 1.4s; }

.ultra-ring-1 {
  width: 180px;
  top: 24px;
  right: 3%;
  animation: spinSlow 24s linear infinite;
}
.ultra-star-1 { width: 42px; top: 56px; left: 5%; animation: twinkle 2.8s ease-in-out infinite; }
.ultra-star-2 { width: 34px; bottom: 130px; left: 4%; animation: twinkle 3.6s ease-in-out infinite 0.9s; }
.ultra-star-3 { width: 32px; bottom: 70px; right: 6%; animation: twinkle 2.4s ease-in-out infinite 0.4s; }

.tf-gear-1 {
  width: 112px;
  top: 40px;
  right: 4%;
  animation: spinSlow 20s linear infinite;
}
.tf-hex-1 { width: 84px; top: 96px; left: 3%; animation: driftSlow 18s ease-in-out infinite; }
.tf-hex-2 { width: 72px; bottom: 72px; right: 5%; animation: driftSlow 22s ease-in-out infinite reverse; }

@keyframes driftSlow {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(22px, -10px); }
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes twinkle {
  0%, 100% { transform: scale(0.85) rotate(0deg); opacity: 0.55; }
  50% { transform: scale(1.18) rotate(22deg); opacity: 1; }
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
}

.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 88;
  overflow: hidden;
}

/* ==================== 主容器（适配 iPad 一屏） ==================== */
.app-shell {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
}

/* ==================== 顶部栏 ==================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  width: 54px;
  height: 54px;
  border: 3px solid #ffffff;
  border-radius: 18px;
  padding: 2px;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
  display: grid;
  place-items: center;
  box-shadow: 0 5px 0 var(--theme-primary-dark), 0 8px 18px var(--theme-glow);
  cursor: pointer;
  overflow: hidden;
  animation: heroBreathe 3.2s ease-in-out infinite;
  transition: transform 0.16s ease;
}

.brand-badge:active {
  transform: scale(0.92) translateY(3px);
}

.brand-badge .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

@keyframes heroBreathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.03); }
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-text h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #0f172a;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, #fb923c, #ef4444);
  color: #ffffff;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 3px 0 #b91c1c;
  animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.streak-pill[hidden] {
  display: none;
}

.brand-text .subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: #475569;
  font-weight: 700;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.mascot-picker {
  display: flex;
  background: rgba(255, 255, 255, 0.92);
  padding: 4px;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  border: 2px solid rgba(255, 255, 255, 0.95);
  gap: 4px;
}

.mascot-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding: 3px 10px 3px 4px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  color: #475569;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.mascot-thumb-wrap {
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.mascot-thumb {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.15);
  display: block;
  transition: filter 0.25s ease, opacity 0.25s ease;
}

.mascot-lock-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  display: grid;
  place-items: center;
  font-size: 10px;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.22);
}

.mascot-btn:not(.locked) .mascot-lock-badge {
  display: none;
}

.mascot-btn.locked {
  color: #94a3b8;
  background: rgba(241, 245, 249, 0.85);
  border-color: #e2e8f0;
}

.mascot-btn.locked .mascot-thumb {
  filter: grayscale(1) brightness(0.45) contrast(1.1);
  opacity: 0.9;
}

.mascot-btn.locked.next-unlock {
  border: 2px dashed #f59e0b;
  background: #fffbeb;
  color: #b45309;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.18);
}

.mascot-btn.locked.next-unlock .mascot-lock-badge {
  border-color: #f59e0b;
  background: #fef3c7;
}

.mascot-btn.lock-shake {
  animation: lockShake 0.42s ease;
}

.mascot-btn.just-unlocked {
  animation: heroUnlockPop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes lockShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px) rotate(-3deg); }
  45% { transform: translateX(5px) rotate(3deg); }
  70% { transform: translateX(-3px) rotate(-1.5deg); }
}

@keyframes heroUnlockPop {
  0% { transform: scale(0.85); }
  45% { transform: scale(1.18) translateY(-3px); }
  100% { transform: scale(1) translateY(-1px); }
}

.mascot-btn.active {
  background: var(--theme-primary-soft);
  border-color: var(--theme-border);
  color: #0f172a;
  box-shadow: 0 3px 0 var(--theme-primary);
  transform: translateY(-1px);
}

/* ==================== 英雄召唤连对能量条 ==================== */
.hero-quest-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 7px 14px 7px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.90);
  border: 2.5px solid var(--theme-border);
  box-shadow: 0 4px 12px var(--theme-glow);
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.hero-quest-bar[hidden] {
  display: none;
}

.quest-target {
  display: flex;
  align-items: center;
  gap: 9px;
}

.quest-hero-preview {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 2px dashed #f59e0b;
  background: #fffbeb;
  padding: 2px;
  flex-shrink: 0;
}

.quest-hero-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  filter: grayscale(1) brightness(0.42) contrast(1.15);
  display: block;
}

.quest-lock-dot {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fef3c7;
  border: 1.5px solid #f59e0b;
  display: grid;
  place-items: center;
  font-size: 9px;
  line-height: 1;
}

.quest-label {
  font-size: 14px;
  font-weight: 800;
  color: #334155;
}

.quest-label strong {
  color: #d97706;
  font-weight: 900;
}

.quest-charge-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quest-slots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quest-slot {
  width: 30px;
  height: 26px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  display: grid;
  place-items: center;
  font-size: 14px;
  filter: grayscale(1) opacity(0.45);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease, border-color 0.25s ease, filter 0.25s ease;
}

.quest-slot.filled {
  background: linear-gradient(135deg, #fef08a, #fb923c);
  border-color: #ea580c;
  filter: none;
  box-shadow: 0 3px 0 #c2410c, 0 0 10px rgba(251, 146, 60, 0.45);
  transform: scale(1.08);
  animation: popIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quest-remain {
  font-size: 13px;
  font-weight: 900;
  color: #c2410c;
  background: #ffedd5;
  padding: 4px 10px;
  border-radius: 999px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.star-pill {
  background: linear-gradient(135deg, #fef08a, #facc15);
  color: #854d0e;
  box-shadow: 0 4px 0 #ca8a04;
}

.star-pill:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #ca8a04;
}

.star-pill.star-bump {
  animation: starBump 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.install-pill {
  background: linear-gradient(135deg, #d1fae5, #34d399);
  color: #065f46;
  font-size: 13px;
  padding: 6px 11px;
  box-shadow: 0 4px 0 #059669;
}

.install-pill:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #059669;
}

.install-pill[hidden] {
  display: none;
}

@keyframes starBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.24) rotate(-5deg); }
  100% { transform: scale(1); }
}

.egg-dots {
  display: inline-flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.72);
  padding: 4px 7px;
  border-radius: 999px;
}

.egg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fde68a;
  border: 1.5px solid #ca8a04;
  transition: transform 0.25s ease, background 0.25s ease;
}

.egg-dot.filled {
  background: #f97316;
  border-color: #c2410c;
  transform: scale(1.18);
}

.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border: 2px solid #ffffff;
  border-radius: 15px;
  background: #ffffff;
  font-size: 19px;
  cursor: pointer;
  box-shadow: 0 4px 0 #cbd5e1;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.icon-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #cbd5e1;
}

.icon-btn[aria-pressed="false"] {
  opacity: 0.55;
  filter: grayscale(0.75);
}

/* 家长设置长按 2 秒防误触进度环 */
.settings-hold-btn {
  overflow: visible;
  touch-action: none;
}

.hold-ring {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  transform: rotate(-90deg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.settings-hold-btn.holding .hold-ring {
  opacity: 1;
}

.hold-ring-bg {
  fill: none;
  stroke: rgba(148, 163, 184, 0.35);
  stroke-width: 4;
}

.hold-ring-fg {
  fill: none;
  stroke: var(--theme-primary);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-dasharray: 119.4;
  stroke-dashoffset: 119.4;
}

.settings-hold-btn.holding .hold-ring-fg {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 2s linear;
}

.hold-hint-toast {
  position: fixed;
  top: 72px;
  right: 18px;
  background: #1e293b;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
  z-index: 80;
  animation: popIn 0.2s ease;
}

.hold-hint-toast[hidden] {
  display: none;
}

/* ==================== 模式切换标签（6大模式紧凑玩具按键） ==================== */
.mode-tabs {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.mode-tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 5px 0 #cbd5e1;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.mode-tab-adventure {
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
  border-color: #fdba74;
  box-shadow: 0 5px 0 #f97316;
}

.mode-tab-adventure.active {
  background: linear-gradient(135deg, #ffedd5 0%, #fef08a 100%);
  border-color: #f97316;
  box-shadow: 0 5px 0 #ea580c, 0 10px 22px rgba(249, 115, 22, 0.28);
}

.mode-tab-island {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #6ee7b7;
  box-shadow: 0 5px 0 #10b981;
}

.mode-tab-island.active {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: #10b981;
  box-shadow: 0 5px 0 #059669, 0 10px 22px rgba(16, 185, 129, 0.28);
}

.tab-notify-dot {
  position: absolute;
  top: -5px;
  right: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #facc15, #f97316);
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.35);
  animation: notifyPulse 1.2s ease-in-out infinite;
}

.tab-notify-dot[hidden] {
  display: none;
}

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

.mode-tab:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #cbd5e1;
}

.mode-tab.active {
  background: #ffffff;
  border-color: var(--theme-border);
  box-shadow: 0 5px 0 var(--theme-primary), 0 10px 20px var(--theme-glow);
  transform: translateY(-2px);
}

.tab-emoji {
  font-size: 24px;
  line-height: 1;
}

.tab-title {
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
}

/* ==================== 主舞台卡片 ==================== */
.stage-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-xl);
  padding: 13px 18px 13px;
  box-shadow: var(--shadow-card);
  border: 4px solid var(--stage-border);
  transition: border-color 0.35s ease;
}

.game-view {
  display: none;
}

.game-view.active {
  display: block;
  animation: fadeIn 0.24s ease;
}

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

/* ==================== 算式头部 + 英雄语音气泡 ==================== */
.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.equation-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  padding: 8px 16px;
  border-radius: 20px;
  border: 3px solid #e2e8f0;
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 2px 6px rgba(15, 23, 42, 0.04);
}

.eq-num {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  height: 48px;
  padding: 0 9px;
  border-radius: 14px;
}

.eq-a { background: var(--color-a-soft); color: var(--color-a); }
.eq-b { background: var(--color-b-soft); color: var(--color-b); }
.eq-sub-b { background: var(--color-sub-soft); color: var(--color-sub); }
.eq-whole { background: var(--color-green-soft); color: var(--color-green); }

.eq-op, .eq-eq {
  color: #475569;
  font-size: 32px;
}

.eq-blank {
  min-width: 54px;
  height: 50px;
  border: 3px dashed #94a3b8;
  border-radius: 14px;
  background: #ffffff;
  color: #94a3b8;
  display: inline-grid;
  place-items: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.eq-blank.solved {
  border-style: solid;
  border-color: #22c55e;
  background: var(--color-green-soft);
  color: var(--color-green);
  transform: scale(1.1);
}

/* 可点击的英雄语音气泡 */
.companion-bubble {
  flex: 1;
  min-width: 190px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 3px solid var(--theme-border);
  border-radius: 20px;
  padding: 6px 14px 6px 7px;
  background: var(--theme-primary-soft);
  color: #1e293b;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--theme-border);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.companion-bubble:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--theme-border);
}

.companion-bubble.cheer {
  animation: companionCheer 0.55s ease;
}

.companion-bubble.wobble {
  animation: gentleShake 0.45s ease;
}

@keyframes companionCheer {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.06) rotate(-2deg); }
  70% { transform: scale(1.04) rotate(2deg); }
}

.companion-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 2.5px solid #ffffff;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 3px 6px rgba(15, 23, 42, 0.16);
}

.companion-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.companion-text {
  flex: 1;
  line-height: 1.25;
}

.companion-speaker {
  font-size: 18px;
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.mini-btn {
  position: relative;
  border: 2px solid #ffffff;
  border-radius: 16px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  background: #f1f5f9;
  color: #334155;
  cursor: pointer;
  box-shadow: 0 4px 0 #cbd5e1;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.mini-btn.accent {
  background: linear-gradient(180deg, #fef08a, #fde047);
  color: #854d0e;
  box-shadow: 0 4px 0 #ca8a04;
}

.mini-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #cbd5e1;
}

/* 答错时高亮提示按钮 + 闪烁指引小手 */
.hand-pointer {
  display: none;
  position: absolute;
  right: -12px;
  bottom: -18px;
  font-size: 26px;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.25));
  pointer-events: none;
  z-index: 6;
}

.helper-btn.nudge {
  animation: helperPulse 0.9s ease-in-out infinite;
  box-shadow: 0 4px 0 #ea580c, 0 0 0 6px rgba(251, 146, 60, 0.35);
}

.helper-btn.nudge .hand-pointer {
  display: block;
  animation: handTap 0.7s ease-in-out infinite;
}

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

@keyframes handTap {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6px, -8px) scale(1.15); }
}

/* ==================== 模式1：十格阵 ==================== */
.tenframe-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.tenframe-wrapper {
  width: 100%;
  max-width: 460px;
}

.tenframe-row-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 14px;
  color: #475569;
  font-weight: 800;
}

.five-tag {
  background: var(--theme-primary-soft);
  color: #92400e;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
}

.progress-badge {
  background: #e0f2fe;
  color: #0369a1;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.ten-frame {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
  padding: 12px;
  background: var(--frame-bg);
  border: 4px solid var(--frame-border);
  border-radius: 24px;
  box-shadow: inset 0 4px 10px rgba(30, 41, 59, 0.06), 0 6px 0 rgba(15, 23, 42, 0.06);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.ten-frame.compact {
  gap: 6px;
  padding: 10px;
  border-width: 3px;
  border-radius: 16px;
}

.tf-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border: 3px solid var(--cell-border);
  border-radius: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.ten-frame.compact .tf-cell {
  border-radius: 11px;
  border-width: 2px;
  cursor: default;
}

.tf-cell[data-row="0"] { background: #ffffff; }
.tf-cell[data-row="1"] { background: rgba(255, 255, 255, 0.72); }

.tf-cell.clickable-hint {
  border-color: #f97316;
  border-style: dashed;
  animation: pulseBorder 1.2s ease-in-out infinite;
}

@keyframes pulseBorder {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.38); transform: scale(1); }
  50% { box-shadow: 0 0 0 7px rgba(249, 115, 22, 0.08); transform: scale(1.04); }
}

/* 英雄贴纸棋子（仅在新增时触发 enter-pop，已有棋子不闪烁） */
.tf-token {
  position: relative;
  display: grid;
  place-items: center;
  width: 88%;
  height: 88%;
  padding: 4px;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
}

.tf-token.enter-pop {
  animation: elasticPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tf-token.puff-out {
  animation: puffAway 0.36s ease forwards;
}

@keyframes elasticPop {
  0% { transform: scale(0.25) rotate(-14deg); opacity: 0; }
  65% { transform: scale(1.14) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes puffAway {
  0% { transform: scale(1) translateY(0); opacity: 1; }
  45% { transform: scale(1.12) translateY(-10px) rotate(10deg); opacity: 0.75; }
  100% { transform: scale(0.84) translateY(0) rotate(0deg); opacity: 0.44; }
}

.ten-frame.compact .tf-token {
  padding: 3px;
  border-radius: 10px;
}

.tf-token-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 11px;
  border: 2px solid #ffffff;
  display: block;
}

.ten-frame.compact .tf-token-img {
  border-radius: 7px;
  border-width: 1.5px;
}

.tf-token.group-a {
  background: var(--color-a-soft);
  border: 3px solid #3b82f6;
  box-shadow: 0 4px 0 rgba(37, 99, 235, 0.28);
}

.tf-token.group-b {
  background: var(--color-b-soft);
  border: 3px solid #f97316;
  box-shadow: 0 4px 0 rgba(249, 115, 22, 0.30);
}

.tf-token.removed {
  background: #faf5ff;
  border: 3px dashed #c084fc;
  opacity: 0.44;
  transform: scale(0.84);
  filter: grayscale(0.7);
}

.tf-token.removed::after {
  content: '✕';
  position: absolute;
  font-size: 32px;
  font-weight: 900;
  color: #9333ea;
  text-shadow: 0 0 6px #ffffff;
  opacity: 1;
}

.ten-frame.compact .tf-token.removed::after {
  font-size: 18px;
}

.tf-count-tag {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: #ffffff;
  border: 2px solid #ffffff;
  font-size: 15px;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.4);
  animation: elasticPop 0.28s ease;
  z-index: 4;
}

.tf-cell.counting {
  transform: scale(1.12);
  border-color: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.28);
  z-index: 3;
}

@keyframes popIn {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.tf-interactive-bar, .nl-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.action-btn {
  position: relative;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.15s ease;
}

.action-btn.primary {
  background: linear-gradient(180deg, var(--theme-primary), var(--theme-primary-dark));
  color: #ffffff;
  box-shadow: 0 6px 0 rgba(15, 23, 42, 0.25), 0 8px 18px var(--theme-glow);
}

.action-btn.primary:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(15, 23, 42, 0.25);
}

.action-btn.primary.sub-mode {
  background: linear-gradient(180deg, #c084fc, #9333ea);
  box-shadow: 0 6px 0 #6b21a8;
}

.action-btn.secondary {
  background: #f1f5f9;
  color: #334155;
  box-shadow: 0 6px 0 #cbd5e1;
}

.action-btn.secondary:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #cbd5e1;
}

.action-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

/* ==================== 模式2：跳跳数轴 ==================== */
.numberline-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.nl-status-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.nl-pill {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
}

.start-pill { background: var(--color-a-soft); color: var(--color-a); }
.dir-pill { background: var(--color-b-soft); color: var(--color-b); }
.dir-pill.sub { background: var(--color-sub-soft); color: var(--color-sub); }
.step-pill { background: var(--color-green-soft); color: var(--color-green); }

.numberline-canvas-wrap {
  width: 100%;
  background: var(--frame-bg);
  border: 4px solid var(--frame-border);
  border-radius: 24px;
  padding: 8px 8px 4px;
}

.nl-svg-wrap {
  position: relative;
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
}

.nl-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* 数轴弧线平滑绘制动画 */
.nl-arc-draw {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: drawArc 0.36s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes drawArc {
  to { stroke-dashoffset: 0; }
}

.nl-tick-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: tickLand 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tickLand {
  0% { transform: scale(0.75); }
  55% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.nl-hopper {
  position: absolute;
  top: 61%;
  left: 0;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  padding: 3px;
  background: #ffffff;
  border: 4px solid #facc15;
  transform: translate(-50%, -100%);
  pointer-events: none;
  transition: left 0.36s cubic-bezier(0.34, 1.35, 0.64, 1);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.hopper-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.nl-hopper.hopping {
  animation: hopperSquashArc 0.38s ease;
}

@keyframes hopperSquashArc {
  0% { transform: translate(-50%, -100%) scale(1.12, 0.86); }
  45% { transform: translate(-50%, -182%) scale(0.94, 1.16); }
  85% { transform: translate(-50%, -95%) scale(1.16, 0.85); }
  100% { transform: translate(-50%, -100%) scale(1, 1); }
}

.nl-hopper.facing-left {
  transform: translate(-50%, -100%) scaleX(-1);
}

.nl-hopper.facing-left.hopping {
  animation: hopperSquashArcLeft 0.38s ease;
}

@keyframes hopperSquashArcLeft {
  0% { transform: translate(-50%, -100%) scaleX(-1) scale(1.12, 0.86); }
  45% { transform: translate(-50%, -182%) scaleX(-1) scale(0.94, 1.16); }
  85% { transform: translate(-50%, -95%) scaleX(-1) scale(1.16, 0.85); }
  100% { transform: translate(-50%, -100%) scaleX(-1) scale(1, 1); }
}

.big-hop-btn {
  padding: 13px 32px;
  font-size: 19px;
}

/* ==================== 模式3：数字分与合 ==================== */
.bonds-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.bonds-visual-layout {
  width: 100%;
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: center;
  gap: 14px;
}

.bond-diagram {
  position: relative;
  width: 260px;
  height: 150px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.bond-diagram.compact {
  width: 240px;
  height: 126px;
}

.bond-lines {
  position: absolute;
  top: 40px;
  left: 0;
  width: 100%;
  height: 78px;
  pointer-events: none;
}

.bond-diagram.compact .bond-lines {
  top: 32px;
  height: 68px;
}

.bond-parts-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1;
}

.bond-node {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 900;
  z-index: 1;
  box-shadow: 0 6px 0 rgba(15, 23, 42, 0.14);
  transition: transform 0.2s ease;
}

.bond-diagram.compact .bond-node {
  width: 54px;
  height: 54px;
  font-size: 25px;
}

.bond-node.whole { background: var(--color-green-soft); border: 4px solid #22c55e; color: var(--color-green); }
.bond-node.part-a { background: var(--color-a-soft); border: 4px solid #3b82f6; color: var(--color-a); }
.bond-node.part-b { background: var(--color-b-soft); border: 4px solid #f97316; color: var(--color-b); }
.bond-node.unknown { background: #ffffff; border-style: dashed; color: #94a3b8; }

.baskets-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 10px;
}

.basket {
  background: #f8fafc;
  border: 3px solid #e2e8f0;
  border-radius: 22px;
  padding: 10px 12px;
  min-height: 146px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.basket-a { border-color: #93c5fd; background: #eff6ff; }
.basket-b { border-color: #fdba74; background: #fff7ed; }

.basket-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 900;
  color: #334155;
}

.basket-count {
  background: #ffffff;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
}

.basket-items {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-content: flex-start;
  justify-content: center;
  padding: 6px;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  min-height: 76px;
}

.basket-token {
  width: 44px;
  height: 44px;
  padding: 3px;
  border-radius: 13px;
  background: #ffffff;
  border: 3px solid #93c5fd;
  box-shadow: 0 3px 0 rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.basket-token.enter-pop {
  animation: elasticPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.basket-b .basket-token { border-color: #fb923c; }

.basket-token img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.basket-plus {
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 900;
  color: #94a3b8;
}

.basket-adjust {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.mini-round-btn {
  width: 48px;
  height: 48px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
  background: #e2e8f0;
  color: #334155;
  box-shadow: 0 4px 0 #94a3b8;
  display: grid;
  place-items: center;
  transition: transform 0.1s ease;
}

.mini-round-btn.plus {
  background: linear-gradient(180deg, #fb923c, #ea580c);
  color: #ffffff;
  box-shadow: 0 4px 0 #9a3412;
}

.mini-round-btn:active {
  transform: translateY(3px);
}

.fact-family {
  width: 100%;
  background: #f0fdf4;
  border: 3px solid #86efac;
  border-radius: 18px;
  padding: 10px 14px;
  text-align: center;
  animation: elasticPop 0.35s ease;
}

.fact-title {
  font-size: 15px;
  font-weight: 900;
  color: #166534;
  margin-bottom: 6px;
}

.fact-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.fact-chip {
  background: #ffffff;
  border: 2px solid #4ade80;
  border-radius: 12px;
  padding: 5px 14px;
  font-size: 18px;
  font-weight: 900;
  color: #15803d;
}

/* ==================== 模式4：自由探索台 ==================== */
.sandbox-top {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.sandbox-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sb-control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.sb-label { font-size: 12px; font-weight: 900; }
.color-a { color: var(--color-a); }
.color-b { color: var(--color-b); }

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 5px 8px;
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.step-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: #e2e8f0;
  font-size: 22px;
  font-weight: 900;
  color: #1e293b;
  cursor: pointer;
}
.step-btn:active { transform: scale(0.9); }

.step-val { min-width: 34px; text-align: center; font-size: 28px; font-weight: 900; }

.sb-op-toggle {
  display: flex;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 14px;
  gap: 4px;
}

.op-btn {
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  background: transparent;
  color: #475569;
  cursor: pointer;
}

.op-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.sb-result-box { display: inline-flex; align-items: center; gap: 8px; }
.sb-eq-sign { font-size: 30px; font-weight: 900; color: #64748b; }

.sb-result-val {
  min-width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--color-green-soft);
  border: 3px solid #22c55e;
  color: var(--color-green);
  font-size: 32px;
  font-weight: 900;
  display: inline-grid;
  place-items: center;
}

.sb-explain {
  margin: 10px 0 0;
  text-align: center;
  font-size: 15px;
  font-weight: 900;
  color: #0369a1;
}

.sandbox-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
}

.sb-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 12px;
}

.sb-card h3 { margin: 0 0 8px; font-size: 15px; font-weight: 900; color: #334155; }
.sb-card-wide { grid-column: 1 / -1; }
.sb-card-note { margin: 6px 0 0; font-size: 13px; color: #475569; font-weight: 800; text-align: center; }

.sb-family-mini {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sb-family-mini span {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  padding: 3px 10px;
  font-size: 14px;
  font-weight: 900;
  color: #334155;
}

/* ==================== 两排超大糖果数字键盘 ==================== */
.answer-section {
  border-top: 3px dashed #e2e8f0;
  padding-top: 12px;
}

.number-pad {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 680px;
  margin: 0 auto;
}

.num-btn {
  flex: 0 0 calc((100% - 50px) / 6);
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 3px solid #cbd5e1;
  box-shadow: 0 5px 0 #cbd5e1, 0 6px 12px rgba(15, 23, 42, 0.06);
  font-family: inherit;
  font-size: 28px;
  font-weight: 900;
  color: #0f172a;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

.num-btn:hover:not(:disabled) {
  background: var(--theme-primary-soft);
  border-color: var(--theme-border);
  transform: translateY(-2px);
}

.num-btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #cbd5e1;
}

.num-btn.correct {
  background: linear-gradient(180deg, #4ade80, #22c55e);
  border-color: #16a34a;
  color: #ffffff;
  box-shadow: 0 6px 0 #15803d, 0 0 20px rgba(34, 197, 94, 0.45);
  animation: elasticPop 0.35s ease;
}

.num-btn.wrong {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
  animation: gentleShake 0.4s ease;
}

@keyframes gentleShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px) rotate(-3deg); }
  50% { transform: translateX(7px) rotate(3deg); }
  75% { transform: translateX(-4px); }
}

/* ==================== 底部反馈与大号发光「下一题」栏 ==================== */
.feedback-bar {
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 20px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
}

.feedback-bar.success {
  background: #dcfce7;
  border-color: #4ade80;
}

.feedback-bar.encourage {
  background: #fef3c7;
  border-color: #fbbf24;
}

.feedback-msg {
  font-size: 16px;
  font-weight: 900;
  color: #1e293b;
}

.next-btn {
  border: 3px solid #ffffff;
  border-radius: 18px;
  padding: 12px 28px;
  background: linear-gradient(180deg, #4ade80, #16a34a);
  color: #ffffff;
  font-family: inherit;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 0 #15803d, 0 0 22px rgba(34, 197, 94, 0.5);
  white-space: nowrap;
  animation: nextBtnGlow 1.3s ease-in-out infinite;
}

.next-btn[hidden] {
  display: none;
}

.next-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #15803d;
}

@keyframes nextBtnGlow {
  0%, 100% { transform: scale(1); box-shadow: 0 6px 0 #15803d, 0 0 14px rgba(34, 197, 94, 0.4); }
  50% { transform: scale(1.06); box-shadow: 0 6px 0 #15803d, 0 0 28px rgba(34, 197, 94, 0.78); }
}

/* ==================== 飞入星星动效 ==================== */
.flying-star {
  position: fixed;
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.9));
  transform: translate(-50%, -50%) scale(0.5);
  pointer-events: none;
  transition: left 0.65s cubic-bezier(0.22, 0.8, 0.36, 1),
              top 0.65s cubic-bezier(0.45, -0.35, 0.36, 1),
              transform 0.65s ease,
              opacity 0.65s ease;
}

/* ==================== 连对 3 题 · 英雄大招全屏高燃特效 ==================== */
.ultimate-overlay {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, rgba(254, 240, 138, 0.92), rgba(234, 88, 12, 0.85));
  overflow: hidden;
  animation: ultFadeIn 0.25s ease;
}

.ultimate-overlay[hidden] {
  display: none;
}

.ultimate-overlay[data-hero="explorer"] {
  background: radial-gradient(circle at center, rgba(167, 243, 208, 0.94), rgba(5, 150, 105, 0.88));
}

.ultimate-overlay[data-hero="ultraman"] {
  background: radial-gradient(circle at center, rgba(186, 230, 253, 0.94), rgba(37, 99, 235, 0.88));
}

.ultimate-overlay[data-hero="transformer"] {
  background: radial-gradient(circle at center, rgba(219, 234, 254, 0.94), rgba(220, 38, 38, 0.86));
}

.ultimate-overlay.is-unlock .ult-combo-tag {
  background: linear-gradient(135deg, #fef08a, #facc15);
  color: #854d0e;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.ultimate-overlay.is-unlock .ult-hero-wrap {
  width: 172px;
  height: 172px;
  border-color: #fef08a;
  box-shadow: 0 0 0 12px rgba(254, 240, 138, 0.42), 0 22px 46px rgba(0, 0, 0, 0.36);
}

.ult-next-hint {
  margin-top: 18px;
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  border: 2px solid rgba(255, 255, 255, 0.72);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  backdrop-filter: blur(4px);
}

.ult-next-hint[hidden] {
  display: none;
}

.ult-rays {
  position: absolute;
  width: 170vmax;
  height: 170vmax;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.26) 0deg 12deg,
    transparent 12deg 24deg
  );
  animation: spinSlow 8s linear infinite;
}

.ult-beam {
  position: absolute;
  left: -20%;
  width: 140%;
  height: 90px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), #fde047, rgba(255, 255, 255, 0.95), transparent);
  filter: blur(4px);
  transform: rotate(-10deg) scaleX(0);
  animation: beamSweep 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.ultimate-overlay[data-hero="ultraman"] .ult-beam {
  background: linear-gradient(90deg, transparent, #ffffff, #38bdf8, #ffffff, transparent);
}

.ultimate-overlay[data-hero="transformer"] .ult-beam {
  background: linear-gradient(90deg, transparent, #ffffff, #60a5fa, #f87171, transparent);
}

@keyframes beamSweep {
  0% { transform: rotate(-10deg) scaleX(0); opacity: 0; }
  35% { transform: rotate(-10deg) scaleX(1.1); opacity: 1; }
  100% { transform: rotate(-10deg) scaleX(1.2); opacity: 0.35; }
}

@keyframes ultFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ult-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  animation: elasticPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ult-combo-tag {
  background: #ffffff;
  color: #dc2626;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  margin-bottom: 14px;
}

.ult-hero-wrap {
  width: 154px;
  height: 154px;
  border-radius: 36px;
  border: 6px solid #ffffff;
  overflow: hidden;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.32), 0 18px 40px rgba(0, 0, 0, 0.32);
  animation: heroBreathe 1.1s ease-in-out infinite;
}

.ult-hero-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ult-title {
  margin-top: 16px;
  font-size: 40px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 4px 0 rgba(15, 23, 42, 0.35), 0 0 24px rgba(255, 255, 255, 0.6);
}

.ult-sub {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 900;
  color: #fef9c3;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* ==================== 神秘彩蛋破壳全屏仪式 ==================== */
.egg-backdrop {
  background: rgba(15, 23, 42, 0.68);
  z-index: 95;
}

.egg-ceremony-card {
  position: relative;
  width: min(92vw, 430px);
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
  border: 5px solid #facc15;
  border-radius: 32px;
  padding: 28px 22px;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.38);
  animation: elasticPop 0.36s ease;
}

.egg-sunburst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(253, 224, 71, 0.28) 0deg 15deg,
    transparent 15deg 30deg
  );
  animation: spinSlow 14s linear infinite;
  pointer-events: none;
}

.egg-shell-stage,
.egg-reveal-stage {
  position: relative;
  z-index: 2;
}

.egg-shell-stage[hidden],
.egg-reveal-stage[hidden] {
  display: none;
}

.mystery-egg-svg {
  width: 150px;
  height: 180px;
  cursor: pointer;
  filter: drop-shadow(0 12px 20px rgba(234, 88, 12, 0.32));
  animation: eggWobble 0.65s ease-in-out infinite;
}

@keyframes eggWobble {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-10deg) scale(1.04); }
  50% { transform: rotate(10deg) scale(1.06); }
  75% { transform: rotate(-6deg) scale(1.03); }
}

.egg-stage-tip {
  margin-top: 12px;
  font-size: 18px;
  font-weight: 900;
  color: #b45309;
}

.egg-reveal-kicker {
  font-size: 16px;
  font-weight: 900;
  color: #ea580c;
  margin-bottom: 12px;
}

.egg-reveal-badge {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto 14px;
  border-radius: 28px;
  border: 5px solid #facc15;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(234, 179, 8, 0.38);
  animation: elasticPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.egg-reveal-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
  display: block;
}

.egg-reveal-badge .egg-sub-emoji {
  position: absolute;
  right: -12px;
  bottom: -12px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #facc15;
  display: grid;
  place-items: center;
  font-size: 28px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.egg-reveal-name {
  margin: 0 0 18px;
  font-size: 26px;
  font-weight: 900;
  color: #0f172a;
}

.big-claim-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 20px;
}

/* ==================== 弹窗样式 ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.50);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 60;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.25);
  animation: popIn 0.22s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-header h2 { margin: 0; font-size: 21px; font-weight: 900; }

.close-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: #f1f5f9;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.modal-sub { margin: 0 0 14px; font-size: 14px; color: #475569; font-weight: 700; }

.stickers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.sticker-card {
  border-radius: 18px;
  padding: 12px 6px;
  text-align: center;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
}

.sticker-card.unlocked {
  background: linear-gradient(180deg, #fef9c3, #ffffff);
  border-color: #facc15;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.18);
}

.sticker-card.locked {
  opacity: 0.58;
  filter: grayscale(0.8);
}

.sticker-emoji {
  width: 58px;
  height: 58px;
  margin: 0 auto;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 34px;
  position: relative;
}

.sticker-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  border: 3px solid #facc15;
  display: block;
}

.sticker-badge-sub {
  position: absolute;
  right: -4px;
  bottom: -4px;
  font-size: 16px;
  background: #ffffff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}

.sticker-name { font-size: 12px; font-weight: 900; margin-top: 5px; color: #334155; }
.sticker-need { font-size: 11px; color: #64748b; margin-top: 2px; font-weight: 700; }

/* 设置项 */
.setting-group { margin-bottom: 16px; }
.setting-label { display: block; font-size: 14px; font-weight: 900; color: #334155; margin-bottom: 8px; }
.segmented { display: flex; gap: 8px; }

.seg-btn {
  flex: 1;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  color: #475569;
  cursor: pointer;
}

.seg-btn.active {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

.setting-hint { margin: 6px 0 0; font-size: 12px; color: #64748b; }

.stats-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 14px;
  font-size: 14px;
  color: #475569;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.secondary-link {
  border: none;
  background: none;
  color: #0284c7;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.danger-link {
  border: none;
  background: none;
  color: #dc2626;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* ==================== 响应式适配（iPad / 手机） ==================== */
@media (max-width: 780px) {
  .bonds-visual-layout {
    grid-template-columns: 1fr;
  }

  .mode-tabs {
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
  }

  .mode-tab {
    flex-direction: column;
    gap: 2px;
    padding: 7px 2px;
  }

  .tab-emoji { font-size: 20px; }
  .tab-title { font-size: 12px; }

  .stage-card { padding: 14px 12px; }

  .equation-display {
    font-size: 30px;
    padding: 6px 12px;
    gap: 6px;
  }
  .eq-num, .eq-blank { min-width: 38px; height: 42px; }
  .eq-op, .eq-eq { font-size: 26px; }

  .companion-bubble {
    order: 3;
    flex-basis: 100%;
    font-size: 14px;
  }

  .num-btn {
    flex: 0 0 calc((100% - 40px) / 6);
    height: 54px;
    font-size: 24px;
    border-radius: 16px;
  }

  .number-pad { gap: 8px; }

  .baskets-row { gap: 8px; }
  .basket { padding: 8px; min-height: 128px; }
  .basket-token { width: 38px; height: 38px; }

  .nl-hopper { width: 44px; height: 44px; }

  .sandbox-grid { grid-template-columns: 1fr; }
  .stickers-grid { grid-template-columns: repeat(2, 1fr); }
  .ult-title { font-size: 30px; }
}

@media (max-width: 480px) {
  .brand-text .subtitle { display: none; }
  .mascot-btn > span:last-child { display: none; }
  .mascot-btn { padding: 3px; height: 38px; }
  .hero-quest-bar { padding: 6px 10px; gap: 6px; }
  .quest-label { font-size: 12px; }
  .quest-slot { width: 25px; height: 22px; font-size: 12px; }
  .quest-remain { font-size: 11px; padding: 3px 8px; }
  .num-btn {
    flex: 0 0 calc((100% - 28px) / 6);
    height: 50px;
    font-size: 22px;
  }
  .number-pad { gap: 5px; }
  .feedback-bar {
    flex-direction: column;
    text-align: center;
  }
  .next-btn { width: 100%; }
}

/* ==================== 一期新增：打怪冒险、三大新玩法、英雄技能与互动大招 ==================== */

/* 顶栏光之护盾徽章 */
.shield-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #ffffff;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 3px 0 #1d4ed8;
  animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.shield-pill[hidden] { display: none; }
.shield-pill.shield-flash {
  animation: shieldBurst 0.65s ease;
}
@keyframes shieldBurst {
  0% { transform: scale(1); }
  35% { transform: scale(1.38); box-shadow: 0 0 18px #38bdf8; }
  100% { transform: scale(1); }
}

/* 5关进度地图条 */
.adv-map-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fafc 0%, var(--theme-primary-soft) 100%);
  border: 2.5px solid var(--stage-border);
}

.adv-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.adv-step-node {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: #ffffff;
  color: #64748b;
  border: 2px solid #e2e8f0;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.adv-step-node.done {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
}

.adv-step-node.current {
  background: linear-gradient(135deg, #fef08a, #facc15);
  border-color: #ea580c;
  color: #7c2d12;
  transform: scale(1.06);
  box-shadow: 0 3px 0 #ea580c;
}

.adv-step-node.is-boss {
  border-style: dashed;
  border-color: #f43f5e;
  color: #be123c;
}
.adv-step-node.is-boss.current {
  border-style: solid;
  background: linear-gradient(135deg, #fda4af, #f43f5e);
  color: #ffffff;
  box-shadow: 0 3px 0 #9f1239;
}

.adv-meta-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.adv-gear-pill,
.adv-boss-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  color: #334155;
}
.adv-gear-pill {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}
.adv-boss-pill {
  border-color: #fde047;
  background: #fefce8;
  color: #a16207;
}

/* 英雄 vs 怪兽 对战舞台 */
.battle-arena {
  position: relative;
  display: grid;
  grid-template-columns: minmax(190px, 1.05fr) minmax(190px, 1.2fr) minmax(190px, 1.05fr);
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  margin-bottom: 8px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, var(--frame-bg) 52%, #fff1f2 100%);
  border: 3px solid var(--frame-border);
  box-shadow: inset 0 2px 10px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.battle-arena.boss-arena {
  background: linear-gradient(135deg, #fff7ed 0%, #fef2f2 52%, #fae8ff 100%);
  border-color: #f43f5e;
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.16);
}

.battle-beam-fx {
  position: absolute;
  left: 16%;
  right: 16%;
  top: 50%;
  height: 22px;
  margin-top: -11px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fde047, #ffffff, var(--theme-primary), #ffffff);
  box-shadow: 0 0 22px var(--theme-primary), 0 0 40px #fde047;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
  z-index: 6;
}

.battle-beam-fx.fire {
  animation: arenaBeamShoot 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes arenaBeamShoot {
  0% { opacity: 0.95; transform: scaleX(0.05) scaleY(0.6); }
  45% { opacity: 1; transform: scaleX(1) scaleY(1.35); }
  100% { opacity: 0; transform: scaleX(1.06) scaleY(0.3); }
}

.fighter-card {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-fighter.attack-lunge {
  animation: heroLunge 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes heroLunge {
  0%, 100% { transform: translateX(0); }
  45% { transform: translateX(26px) scale(1.08); }
}

.fighter-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.fighter-avatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  border: 3.5px solid #ffffff;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
  padding: 2px;
  box-shadow: 0 5px 0 var(--theme-primary-dark), 0 8px 16px var(--theme-glow);
  overflow: hidden;
  animation: heroBreathe 2.8s ease-in-out infinite;
}

.fighter-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
  display: block;
}

.fighter-shield-tag {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  border: 2px solid #ffffff;
  display: grid;
  place-items: center;
  font-size: 14px;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
}
.fighter-shield-tag[hidden] { display: none; }

.fighter-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.fighter-name {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
}

.hero-skill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 2.5px solid var(--theme-border);
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, var(--theme-primary-soft) 100%);
  color: #0f172a;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--theme-primary);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.2s ease;
  white-space: nowrap;
}

.hero-skill-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--theme-primary);
}

.hero-skill-btn:disabled {
  opacity: 0.52;
  filter: grayscale(0.45);
  cursor: default;
  box-shadow: 0 2px 0 #cbd5e1;
}

.hero-skill-btn.skill-glow {
  animation: helperPulse 1.1s ease-in-out infinite;
}

.adv-mission-bubble {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 14px;
  border-radius: 18px;
  border: 2.5px solid var(--theme-border);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  box-shadow: 0 4px 0 var(--theme-border);
  transition: transform 0.14s ease;
}

.adv-mission-bubble:active {
  transform: translateY(2px);
}

.adv-stage-tag {
  font-size: 11px;
  font-weight: 900;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--theme-primary-soft);
  color: var(--theme-primary-dark);
}

.adv-mission-text {
  font-size: 14px;
  font-weight: 900;
  color: #1e293b;
  line-height: 1.3;
}

.adv-mission-speaker {
  position: absolute;
  right: 8px;
  top: 6px;
  font-size: 13px;
  opacity: 0.7;
}

.monster-fighter {
  justify-content: flex-end;
  flex-direction: row-reverse;
}

.monster-art-wrap {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  animation: monsterFloat 2.4s ease-in-out infinite;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.monster-art-wrap svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 8px rgba(15, 23, 42, 0.16));
}

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

.monster-fighter.monster-hit .monster-art-wrap {
  animation: monsterHitShake 0.48s ease;
}

@keyframes monsterHitShake {
  0% { transform: translateX(0) scale(1); filter: brightness(1); }
  25% { transform: translateX(12px) rotate(12deg) scale(0.9); filter: brightness(2); }
  50% { transform: translateX(-8px) rotate(-10deg) scale(1.06); filter: brightness(1.6); }
  75% { transform: translateX(6px) rotate(6deg); }
  100% { transform: translateX(0) scale(1); filter: brightness(1); }
}

.monster-fighter.monster-defeated .monster-art-wrap {
  animation: monsterDefeatSpin 0.65s ease forwards;
}

@keyframes monsterDefeatSpin {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  45% { transform: scale(1.18) rotate(20deg); opacity: 0.9; }
  100% { transform: scale(0.15) rotate(260deg) translateY(-30px); opacity: 0; }
}

.monster-dmg-pop {
  position: absolute;
  right: 12px;
  top: -4px;
  font-size: 20px;
  font-weight: 900;
  color: #ef4444;
  text-shadow: 0 2px 0 #ffffff, 0 4px 10px rgba(239, 68, 68, 0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 8;
}

.monster-dmg-pop.show {
  animation: dmgFloatUp 0.85s ease forwards;
}

@keyframes dmgFloatUp {
  0% { opacity: 0; transform: translateY(10px) scale(0.7); }
  25% { opacity: 1; transform: translateY(-8px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-34px) scale(0.95); }
}

.monster-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.monster-name {
  font-size: 14px;
  font-weight: 900;
  color: #9f1239;
}

.monster-hp-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hp-heart {
  font-size: 18px;
  line-height: 1;
  transition: transform 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
}
.hp-heart.lost {
  opacity: 0.25;
  filter: grayscale(1);
  transform: scale(0.78);
}

/* 冒险子舞台通用 */
.adv-subpanel[hidden] { display: none; }

.adv-charge-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

#view-adventure .tenframe-stage {
  gap: 6px;
}

#view-adventure .tenframe-wrapper {
  padding: 8px 10px;
}

#view-adventure .answer-section {
  margin-top: 8px;
}

/* 孙悟空火眼金睛：点亮上排 5 格金光 */
.ten-frame.gold-five-highlight .tf-cell[data-row="0"] {
  border-color: #f59e0b !important;
  background: linear-gradient(180deg, #fef9c3 0%, #fde68a 100%) !important;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.42), inset 0 0 10px rgba(245, 158, 11, 0.22);
}

/* 通用 5+5 视觉补能条（帮还在掰手指的 6 岁娃一眼看出“还差几格”） */
.visual-meter-card {
  background: #f8fafc;
  border: 2.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 10px 14px;
  margin-bottom: 12px;
  text-align: center;
}

.visual-meter-caption {
  font-size: 14px;
  font-weight: 900;
  color: #334155;
  margin-bottom: 8px;
}

.visual-meter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.meter-slot {
  width: 34px;
  height: 30px;
  border-radius: 10px;
  border: 2.5px dashed #cbd5e1;
  background: #ffffff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  color: #94a3b8;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.meter-slot.five-divider {
  margin-left: 8px;
  position: relative;
}

.meter-slot.filled-a {
  border-style: solid;
  border-color: #2563eb;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #ffffff;
  transform: scale(1.06);
}

.meter-slot.filled-b {
  border-style: solid;
  border-color: #ea580c;
  background: linear-gradient(135deg, #fb923c, #f97316);
  color: #ffffff;
  transform: scale(1.06);
}

.meter-slot.need-hint {
  border-style: dashed;
  border-color: #f97316;
  background: #fff7ed;
  color: #ea580c;
  animation: slotNeedPulse 1s ease-in-out infinite;
}

.meter-slot.over-err {
  border-style: solid;
  border-color: #ef4444;
  background: #fee2e2;
  color: #dc2626;
}

@keyframes slotNeedPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); background: #ffedd5; }
}

/* ==================== 新玩法 1：☄️ 凑十/凑五消陨石 ==================== */
.meteor-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.meteor-target-badge {
  padding: 6px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fef08a, #fde047);
  border: 2.5px solid #f59e0b;
  color: #78350f;
  font-size: 16px;
  font-weight: 900;
}

.meteor-pair-progress {
  padding: 6px 12px;
  border-radius: 14px;
  background: #eff6ff;
  border: 2px solid #93c5fd;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 900;
}

.meteor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 620px;
  margin: 0 auto 6px;
}

.meteor-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 440px;
}

.meteor-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 106px;
  padding: 10px 8px;
  border-radius: 26px;
  border: 3.5px solid #818cf8;
  background: radial-gradient(circle at 30% 25%, #ffffff 0%, #e0e7ff 55%, #c7d2fe 100%);
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 7px 0 #6366f1, 0 12px 22px rgba(99, 102, 241, 0.22);
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease, border-color 0.16s ease, opacity 0.25s ease;
  animation: meteorBob 3s ease-in-out infinite;
}

.meteor-btn:nth-child(2n) { animation-delay: 0.45s; }
.meteor-btn:nth-child(3n) { animation-delay: 0.9s; }

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

.meteor-btn:active:not(:disabled) {
  transform: translateY(4px) scale(0.96);
}

.meteor-btn.selected {
  animation: none;
  transform: translateY(-4px) scale(1.06);
  border-color: #f97316;
  background: radial-gradient(circle at 30% 25%, #fffbeb 0%, #fed7aa 65%, #fb923c 100%);
  box-shadow: 0 7px 0 #ea580c, 0 0 0 5px rgba(249, 115, 22, 0.28);
}

.meteor-btn.hint-pair {
  border-color: #eab308;
  box-shadow: 0 7px 0 #ca8a04, 0 0 0 6px rgba(250, 204, 21, 0.45);
}

.meteor-btn.matched {
  animation: meteorExplode 0.42s ease forwards;
  pointer-events: none;
}

.meteor-btn.mismatch {
  animation: lockShake 0.4s ease;
  border-color: #ef4444;
}

@keyframes meteorExplode {
  0% { transform: scale(1.1); opacity: 1; }
  40% { transform: scale(1.26) rotate(12deg); opacity: 0.85; background: #fef08a; }
  100% { transform: scale(0.2) rotate(-18deg); opacity: 0; }
}

.meteor-num {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  color: #1e1b4b;
}

/* 5-结构紧凑小点阵（帮孩子不掰手指，一眼认出 7 = 5 + 2） */
.mini-dot-matrix {
  display: grid;
  grid-template-columns: repeat(5, 8px);
  gap: 3px;
  padding: 4px 6px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.78);
}

.mini-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2e8f0;
}

.mini-dot.on {
  background: #4f46e5;
}

.mini-dot.on.row-second {
  background: #f97316;
}

/* ==================== 新玩法 2：👁️ 火眼金睛（闪电看数） ==================== */
.flash-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.flash-timer-track {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 10px;
}

.flash-timer-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  transform-origin: left center;
}

.flash-frame-box {
  position: relative;
  max-width: 560px;
  margin: 0 auto 12px;
}

.flash-mist-cover {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.96) 0%, rgba(241, 245, 249, 0.98) 50%, rgba(224, 242, 254, 0.97) 100%);
  border: 3.5px dashed #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 12px;
  z-index: 4;
  animation: fadeIn 0.25s ease;
}

.flash-mist-cover[hidden] { display: none; }
.mist-cloud-icon { font-size: 32px; }
.mist-cloud-text { font-size: 18px; font-weight: 900; color: #0f172a; }
.mist-cloud-sub { font-size: 13px; font-weight: 800; color: #475569; }

/* ==================== 新玩法 3：🔓 能量密码门（开放双块拼数） ==================== */
.gate-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.gate-target-pill {
  padding: 6px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border: 2.5px solid #3b82f6;
  color: #1e3a8a;
  font-size: 16px;
  font-weight: 900;
}

.gate-eq-preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 16px;
  background: #f8fafc;
  border: 2.5px solid #cbd5e1;
  font-size: 24px;
  font-weight: 900;
}

.gate-slot {
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2.5px dashed #94a3b8;
  background: #ffffff;
  color: #64748b;
  display: inline-grid;
  place-items: center;
}

.gate-slot.filled-a {
  border-style: solid;
  border-color: #2563eb;
  background: #dbeafe;
  color: #1d4ed8;
}

.gate-slot.filled-b {
  border-style: solid;
  border-color: #ea580c;
  background: #ffedd5;
  color: #c2410c;
}

.gate-slot.target {
  border-style: solid;
  border-color: #16a34a;
  background: #dcfce7;
  color: #15803d;
}

.gate-tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 620px;
  margin: 0 auto 6px;
}

.gate-tile-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 98px;
  padding: 10px 8px;
  border-radius: 22px;
  border: 3.5px solid #38bdf8;
  background: linear-gradient(180deg, #ffffff 0%, #e0f2fe 100%);
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 0 #0284c7;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.gate-tile-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #0284c7;
}

.gate-tile-btn.pick-a {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff 0%, #bfdbfe 100%);
  box-shadow: 0 6px 0 #1d4ed8, 0 0 0 4px rgba(37, 99, 235, 0.24);
  transform: translateY(-3px) scale(1.04);
}

.gate-tile-btn.pick-b {
  border-color: #f97316;
  background: linear-gradient(180deg, #fff7ed 0%, #fed7aa 100%);
  box-shadow: 0 6px 0 #ea580c, 0 0 0 4px rgba(249, 115, 22, 0.24);
  transform: translateY(-3px) scale(1.04);
}

.gate-tile-btn.hint-tile {
  border-color: #eab308;
  box-shadow: 0 6px 0 #ca8a04, 0 0 0 6px rgba(250, 204, 21, 0.45);
}

.gate-tile-btn.solved-tile {
  border-color: #22c55e;
  background: linear-gradient(180deg, #f0fdf4 0%, #bbf7d0 100%);
  box-shadow: 0 6px 0 #16a34a;
}

.gate-tile-btn.wrong {
  animation: lockShake 0.4s ease;
  border-color: #ef4444;
}

.gate-tile-num {
  font-size: 34px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}

/* ==================== 亲手连点 3 下发射大招 UI ==================== */
.ult-charge-zone {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.ult-charge-zone[hidden] { display: none; }

.ult-charge-dots {
  display: flex;
  gap: 10px;
}

.ult-charge-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.72);
  background: rgba(15, 23, 42, 0.25);
  display: grid;
  place-items: center;
  font-size: 22px;
  opacity: 0.55;
  transform: scale(0.92);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ult-charge-dot.lit {
  opacity: 1;
  transform: scale(1.16);
  background: #fef08a;
  border-color: #ffffff;
  box-shadow: 0 0 22px #fde047;
}

.ult-fire-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border: 4px solid #ffffff;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde047 0%, #f97316 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 22px;
  font-weight: 900;
  text-shadow: 0 2px 4px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  box-shadow: 0 8px 0 #c2410c, 0 14px 34px rgba(0, 0, 0, 0.35);
  animation: fireBtnPulse 0.9s ease-in-out infinite;
  transition: transform 0.1s ease;
}

.ult-fire-btn:active {
  transform: scale(0.92) translateY(5px);
}

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

.ultimate-overlay.is-charging .ult-beam {
  animation: none;
  opacity: 0;
  transform: rotate(-10deg) scaleX(0);
}

.ultimate-overlay.ult-fired .ult-hero-wrap {
  transform: scale(1.18);
  box-shadow: 0 0 0 16px rgba(254, 240, 138, 0.5), 0 0 60px #ffffff;
}

/* ==================== 冒险通关 · 击败 Boss 结算弹窗 ==================== */
.adv-win-backdrop {
  background: rgba(15, 23, 42, 0.68);
  z-index: 94;
}

.adv-win-card {
  position: relative;
  width: min(92vw, 460px);
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
  border: 5px solid #f59e0b;
  border-radius: 32px;
  padding: 26px 22px;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.38);
  animation: elasticPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.adv-win-inner {
  position: relative;
  z-index: 2;
}

.adv-win-kicker {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #78350f;
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 12px;
}

.adv-win-hero-stage {
  width: 112px;
  height: 112px;
  margin: 0 auto 12px;
  border-radius: 28px;
  border: 5px solid #facc15;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.35);
}

.adv-win-hero-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.adv-win-title {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 900;
  color: #0f172a;
}

.adv-win-sub {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 800;
  color: #475569;
}

.adv-win-loot-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.loot-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  text-align: left;
  border: 2.5px solid #e2e8f0;
  background: #f8fafc;
}

.loot-chip.star-loot {
  background: #fefce8;
  border-color: #facc15;
}

.loot-chip.gear-loot {
  background: #eff6ff;
  border-color: #60a5fa;
}

.loot-icon {
  font-size: 28px;
  line-height: 1;
}

.loot-val {
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
}

.loot-desc {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
}

.adv-win-total-note {
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #ecfdf5;
  border: 2px solid #6ee7b7;
  font-size: 13px;
  font-weight: 800;
  color: #065f46;
}

.adv-win-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.adv-win-btn-row .big-claim-btn {
  font-size: 16px;
  padding: 13px 12px;
}

/* 可点击齿轮徽章（跳转小岛） */
button.adv-gear-pill {
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

button.adv-gear-pill:active {
  transform: scale(0.95);
}

button.adv-gear-pill.has-buildable {
  background: linear-gradient(135deg, #fef08a, #fde047);
  border-color: #eab308;
  color: #854d0e;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.35);
  animation: notifyPulse 1.6s ease-in-out infinite;
}

/* ==================== 二期：🏝️ 我的数感小岛可互动基地 ==================== */
.island-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.island-hud-left,
.island-hud-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.island-badge-pill,
.island-gear-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
}

.island-badge-pill {
  background: #ecfdf5;
  border: 2px solid #6ee7b7;
  color: #065f46;
}

.island-gear-badge {
  background: #eff6ff;
  border: 2px solid #93c5fd;
  color: #1e40af;
}

.island-party-btn {
  background: linear-gradient(135deg, #fef08a, #fb923c);
  border-color: #f97316;
  color: #7c2d12;
  box-shadow: 0 4px 0 #c2410c;
}

.island-party-btn[hidden] {
  display: none;
}

/* 岛屿全景 SVG 舞台 */
.island-scene-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9.4;
  border-radius: 24px;
  overflow: hidden;
  border: 4px solid #7dd3fc;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55), 0 10px 26px rgba(2, 132, 199, 0.16);
  background: #38bdf8;
  margin-bottom: 12px;
}

.island-backdrop-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.isl-cloud-1 {
  animation: driftSlow 28s ease-in-out infinite;
}

.isl-cloud-2 {
  animation: driftSlow 34s ease-in-out infinite reverse;
}

.isl-wave {
  animation: islWaveFloat 4.5s ease-in-out infinite;
}

@keyframes islWaveFloat {
  0%, 100% { transform: translateX(0); opacity: 0.45; }
  50% { transform: translateX(10px); opacity: 0.78; }
}

.island-plots-layer,
.island-fx-layer {
  position: absolute;
  inset: 0;
}

.island-fx-layer {
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
}

/* 岛屿 8 个地标槽位 */
.island-plot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 112px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: inherit;
  z-index: 3;
  transition: transform 0.16s ease;
}

.island-plot:active {
  transform: translate(-50%, -50%) scale(0.93);
}

.island-plot-art {
  position: relative;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.island-plot-art svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 6px 8px rgba(15, 23, 42, 0.2));
}

.island-plot.unbuilt .island-plot-art {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  border: 3px dashed #94a3b8;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}

.island-plot.unbuilt .island-plot-art svg {
  width: 52px;
  height: 52px;
  filter: grayscale(1) opacity(0.38);
}

.island-plot.unbuilt.can-build .island-plot-art {
  background: linear-gradient(135deg, #fefce8, #fef08a);
  border: 3px dashed #f59e0b;
  box-shadow: 0 0 0 5px rgba(250, 204, 21, 0.36), 0 8px 16px rgba(245, 158, 11, 0.28);
  animation: plotCanBuild 1.4s ease-in-out infinite;
}

.island-plot.unbuilt.can-build .island-plot-art svg {
  filter: grayscale(0.25) opacity(0.78);
}

@keyframes plotCanBuild {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.08) translateY(-4px); }
}

.island-plot.built .island-plot-art {
  animation: islandIdleBob 3.4s ease-in-out infinite;
}

.island-plot.built:hover .island-plot-art {
  transform: scale(1.08) translateY(-4px);
}

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

.island-plot.just-built .island-plot-art {
  animation: elasticPop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 8 种地标专属点击互动动画 */
.island-plot.act-peach .island-plot-art { animation: actWiggleJump 0.75s ease; }
.island-plot.act-cloud .island-plot-art { animation: actCloudFly 1.05s cubic-bezier(0.22, 1, 0.36, 1); }
.island-plot.act-plasma .island-plot-art { animation: actPlasmaPulse 0.9s ease; }
.island-plot.act-volcano .island-plot-art { animation: actVolcanoBoom 0.85s ease; }
.island-plot.act-garage .island-plot-art { animation: actGarageMorph 0.85s ease; }
.island-plot.act-lighthouse .island-plot-art { animation: actLighthouseGlow 1s ease; }
.island-plot.act-rocket .island-plot-art { animation: actRocketLaunch 1.2s cubic-bezier(0.22, 1, 0.36, 1); }
.island-plot.act-statue .island-plot-art { animation: actStatueShine 1s ease; }

@keyframes actWiggleJump {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-10px) rotate(-10deg) scale(1.12); }
  55% { transform: translateY(-12px) rotate(10deg) scale(1.14); }
  80% { transform: translateY(-4px) rotate(-5deg); }
}

@keyframes actCloudFly {
  0% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(18px, -36px) scale(1.18) rotate(-8deg); }
  75% { transform: translate(-14px, -24px) scale(1.12) rotate(6deg); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes actPlasmaPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 #38bdf8); }
  35% { transform: scale(1.22); filter: drop-shadow(0 0 22px #38bdf8) brightness(1.2); }
  65% { transform: scale(1.12); filter: drop-shadow(0 0 18px #818cf8); }
}

@keyframes actVolcanoBoom {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(1.16, 0.88); }
  45% { transform: scale(0.92, 1.22) translateY(-10px); }
  70% { transform: scale(1.08, 0.96); }
}

@keyframes actGarageMorph {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.15) rotate(-5deg); filter: drop-shadow(0 0 16px #3b82f6); }
  60% { transform: scale(1.15) rotate(5deg); filter: drop-shadow(0 0 16px #ef4444); }
}

@keyframes actLighthouseGlow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 24px #fde047) brightness(1.18); }
}

@keyframes actRocketLaunch {
  0% { transform: translateY(0) scale(1); }
  20% { transform: translateY(4px) scale(1.08, 0.92); }
  55% { transform: translateY(-58px) scale(1.16); filter: drop-shadow(0 18px 14px rgba(249, 115, 22, 0.6)); }
  85% { transform: translateY(-10px) scale(1.04); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes actStatueShine {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.24) translateY(-10px); filter: drop-shadow(0 0 26px #facc15) brightness(1.2); }
}

.island-plot-tag {
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 2px solid #e2e8f0;
  font-size: 11px;
  font-weight: 900;
  color: #334155;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.14);
}

.island-plot.unbuilt.can-build .island-plot-tag {
  background: linear-gradient(135deg, #fef08a, #fb923c);
  border-color: #ea580c;
  color: #7c2d12;
}

.island-plot.built .island-plot-tag {
  border-color: #34d399;
  color: #065f46;
}

/* 中央广场巡逻英雄 */
.island-hero-walker {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: inherit;
}

.island-hero-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 3.5px solid #ffffff;
  overflow: hidden;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
  box-shadow: 0 5px 0 var(--theme-primary-dark), 0 8px 18px rgba(15, 23, 42, 0.26);
  animation: heroBreathe 2.6s ease-in-out infinite;
  display: block;
}

.island-hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.island-hero-walker.hop .island-hero-avatar {
  animation: actWiggleJump 0.65s ease;
}

.island-hero-bubble {
  margin-bottom: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid var(--theme-border);
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
  animation: popIn 0.25s ease;
}

.island-hero-bubble[hidden] {
  display: none;
}

/* 小岛互动飘起彩蛋元素 */
.island-fx-float {
  position: absolute;
  font-size: 26px;
  transform: translate(-50%, -50%);
  animation: islandFxRise 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.18));
}

@keyframes islandFxRise {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.5); }
  20% { opacity: 1; transform: translate(calc(-50% + var(--dx, 0px)), -65%) scale(1.2); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -195%) scale(0.95); }
}

/* 底部建造蓝图卡片 & 魔王战利品展示架 */
.island-bottom-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.island-section-head {
  font-size: 13px;
  font-weight: 900;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.boss-shelf-head {
  margin-top: 4px;
}

.island-blueprint-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.blueprint-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 2.5px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.blueprint-card:active {
  transform: scale(0.96);
}

.blueprint-card.can-build {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: #f59e0b;
  box-shadow: 0 3px 0 #d97706;
}

.blueprint-card.built {
  background: linear-gradient(135deg, #ecfdf5, #ffffff);
  border-color: #34d399;
}

.blueprint-emoji {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.blueprint-info {
  min-width: 0;
}

.blueprint-name {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blueprint-status {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  margin-top: 2px;
}

.blueprint-card.can-build .blueprint-status {
  color: #c2410c;
}

.blueprint-card.built .blueprint-status {
  color: #059669;
}

/* 击败魔王战利品展示架 */
.boss-trophy-shelf {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.boss-trophy-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px;
  border-radius: 16px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  text-align: center;
}

.boss-trophy-card.defeated {
  background: linear-gradient(180deg, #fefce8 0%, #ffffff 100%);
  border-color: #facc15;
  box-shadow: 0 4px 10px rgba(234, 179, 8, 0.16);
}

.boss-trophy-art {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
}

.boss-trophy-art svg {
  width: 100%;
  height: 100%;
}

.boss-trophy-card.locked .boss-trophy-art svg {
  filter: grayscale(1) brightness(0.28);
  opacity: 0.55;
}

.boss-trophy-name {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 900;
  color: #334155;
}

.boss-trophy-card.locked .boss-trophy-name {
  color: #94a3b8;
}

/* 冒险模式与小岛响应式适配 */
@media (max-width: 780px) {
  .battle-arena {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }
  .adv-mission-bubble {
    grid-column: 1 / -1;
    order: 3;
    padding: 6px 12px;
  }
  .fighter-avatar { width: 52px; height: 52px; border-radius: 16px; }
  .monster-art-wrap { width: 58px; height: 58px; }
  .meteor-btn { min-height: 92px; }
  .meteor-num { font-size: 30px; }
  .gate-tile-btn { min-height: 86px; }
  .gate-tile-num { font-size: 28px; }
  .meter-slot { width: 26px; height: 24px; border-radius: 8px; font-size: 11px; }
  .ult-fire-btn { font-size: 18px; padding: 13px 22px; }

  .island-plot { width: 88px; }
  .island-plot-art { width: 62px; height: 62px; }
  .island-plot.unbuilt .island-plot-art { width: 52px; height: 52px; }
  .island-plot.unbuilt .island-plot-art svg { width: 38px; height: 38px; }
  .island-plot-tag { font-size: 10px; padding: 2px 6px; }
  .island-hero-avatar { width: 46px; height: 46px; }
  .island-blueprint-row { grid-template-columns: repeat(2, 1fr); }
  .boss-trophy-shelf { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .mode-tabs {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .adv-step-node { font-size: 11px; padding: 3px 7px; }
  .hero-skill-btn { font-size: 11px; padding: 4px 8px; }
  .meteor-grid,
  .gate-tiles-grid { gap: 8px; }
  .adv-win-btn-row { grid-template-columns: 1fr; }
  .island-scene-wrap { aspect-ratio: 4 / 3.2; }
  .island-plot { width: 72px; }
  .island-plot-art { width: 48px; height: 48px; }
  .island-plot.unbuilt .island-plot-art { width: 42px; height: 42px; }
  .island-plot-tag { font-size: 9px; padding: 1px 5px; }
}
