/* ==========================================================================
   天生我才 (CogniGift AI) - 全新淡雅童趣UI (Light & Pastel Theme)
   作者: 赵绿汀 (All rights reserved)
   ========================================================================== */

/* 1. 全局设计变量定义 */
:root {
  /* Fonts */
  --font-display: 'TsangerYuYangT', 'Outfit', 'Noto Sans SC', system-ui, -apple-system, sans-serif; /* Fallback round font */
  --font-body: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  
  /* Light Pastel Palette */
  --bg-primary: #f0f7ff;
  --bg-gradient: linear-gradient(135deg, #fceeff 0%, #e0f2fe 50%, #fff1f2 100%);
  
  --accent-blue: #60a5fa;
  --accent-cyan: #38bdf8;
  --accent-purple: #c084fc;
  --accent-pink: #f472b6;
  --accent-yellow: #fbbf24;
  --accent-green: #34d399;
  
  --text-primary: #334155;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  /* White Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 1);
  --glass-glow: 0 8px 30px rgba(0, 0, 0, 0.04), inset 0 0 15px rgba(255, 255, 255, 0.8);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
}

/* 3. 云朵点缀背景 */
.cloud-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background-image: url('data:image/svg+xml;utf8,<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"><g fill="rgba(255,255,255,0.4)"><circle cx="10%" cy="80%" r="150"/><circle cx="20%" cy="90%" r="200"/><circle cx="85%" cy="85%" r="180"/><circle cx="95%" cy="75%" r="120"/></g></svg>');
  background-size: cover;
  background-position: bottom;
}

/* 4. 统一布局 */
#app {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.view-panel {
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  flex: 1;
  padding: 2rem;
  padding-top: 5rem; /* Allow space for top nav */
}

.view-panel.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
}

/* 5. 核心美学组件: 白色玻璃拟态 (Light Glassmorphism) */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: var(--glass-glow);
  transition: var(--transition-smooth);
}

.game-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.8rem 2rem;
  border-radius: 99px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  color: #fff;
  background: linear-gradient(135deg, #fca5a5, #f472b6);
  box-shadow: 0 4px 15px rgba(244, 114, 182, 0.3);
}

.game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 114, 182, 0.4);
}

.btn-secondary {
  background: #fff;
  color: var(--text-primary);
  border: 2px solid #e2e8f0;
  box-shadow: none;
}

.btn-secondary:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: #f8fafc;
}

/* 6. 顶部导航栏 (Top Nav) */
.top-nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 95%;
  max-width: 1800px;
  height: 76px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-radius: 99px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 999;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: 3rem;
}

.nav-item {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1.15rem;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.nav-item:hover, .nav-item.active {
  color: #6366f1;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--accent-pink);
  border-radius: 2px;
}

.nav-login {
  border: 1px solid #cbd5e1;
  color: var(--accent-blue);
  padding: 0.4rem 1.5rem;
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  transition: all 0.2s;
}
.nav-login:hover {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

#portal-view.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 1;
  background-image: url('background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  padding-top: 80px;
  padding-bottom: 40px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

#portal-view {
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: 8rem;
}

.hero-section {
  text-align: center;
  margin-bottom: 4rem;
}

.hero-title-img {
  max-width: 800px;
  width: 100%;
  animation: float 4s ease-in-out infinite;
}

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

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

.pulse-anim {
  animation: pulseScale 2s infinite ease-in-out;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.hero-btn {
  font-size: 1.25rem;
  padding: 1rem 3rem;
  background: linear-gradient(90deg, #fcd34d, #f472b6);
  box-shadow: 0 8px 25px rgba(244, 114, 182, 0.4);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1100px;
  width: 100%;
  margin-top: 2rem;
}

.feature-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
}

.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.feature-text h4 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.feature-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* 8. Preparation View (测试准备) */
#prep-view {
  align-items: center;
}

.prep-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  width: 100%;
  max-width: 1100px;
  margin-top: 2rem;
}

.prep-left {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.user-profile-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
}

.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #e2e8f0;
  border: 4px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.device-check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.device-item {
  padding: 1rem;
  text-align: center;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #f1f5f9;
}
.device-item .icon { font-size: 2rem; margin-bottom: 0.5rem; }
.device-item .status { font-size: 0.8rem; color: var(--accent-green); font-weight: 700; }

.prep-map {
  width: 100%;
  height: 100%;
  min-height: 400px;
  background: linear-gradient(to bottom, #dbeafe, #f3e8ff);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 9. Child Testing View (测试进行中) */
#child-view {
  padding-top: 6rem; /* Under nav */
  align-items: center;
}

.test-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  background: rgba(255,255,255,0.7);
  padding: 1rem 2rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

.step-tracker {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid #e2e8f0;
}

.step-dot.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.step-dot.done {
  background: var(--accent-green);
  color: #fff;
  border-color: var(--accent-green);
}

.timer {
  color: var(--accent-pink);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.test-main-layout {
  display: flex;
  gap: 1.5rem;
  width: 100%;
  max-width: 1200px;
  flex: 1;
}

.game-viewport {
  flex: 3;
  position: relative;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

.ai-sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Stage Panels */
.stage-panel {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  padding: 1.5rem;
}
.stage-panel.active { display: flex; }

.stage-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stage-content {
  flex: 1;
  background: #fff;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.15);
}

.stage-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Interactive Elements for Stages */
.waveform-mic {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fca5a5, #f472b6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(244,114,182,0.4);
}

.piano-keys {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.piano-key {
  width: 50px;
  height: 60px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,0.1);
}
.piano-key:active { transform: translateY(4px); box-shadow: none; }
.key-C { background: #fca5a5; }
.key-D { background: #fdba74; }
.key-E { background: #fde047; }
.key-F { background: #86efac; }
.key-G { background: #93c5fd; }
.key-A { background: #a78bfa; }
.key-B { background: #c084fc; }

/* 10. Report View (报告示例) */
#report-view {
  align-items: center;
  padding-bottom: 2rem;
}

#report-view.active {
  background-image: url('background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  padding-top: 110px;
  padding-bottom: 40px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

.report-page-wrapper {
  width: 96%;
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 0 1rem;
}

/* --- Hero Section (image left, title right) --- */
.report-hero-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0;
}

.report-hero-text {
  flex: 1;
}

.report-hero-img {
  width: 200px;
  height: auto;
  flex-shrink: 0;
}

.report-hero-title {
  font-size: 2.8rem;
  font-weight: 900;
  color: #1e293b;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}
.report-hero-title span { color: #6366f1; }
.report-hero-title .highlight-text { color: #f472b6; }

.report-hero-subtitle {
  font-size: 1.05rem;
  color: #64748b;
}

/* --- Main 2-Column Grid --- */
.report-main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  width: 100%;
  align-items: stretch;
}

.report-left-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Make the matrix card fill remaining height */
.report-left-col .report-card {
  flex: 1;
}

.report-right-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Icon for section headers */
.rp-icon {
  width: 26px;
  height: 26px;
  vertical-align: middle;
  margin-right: 4px;
}

/* Icon inside items */
.rp-item-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* Smaller icons in compact right column */
.report-right-col .rp-item-icon {
  width: 30px;
  height: 30px;
}
.report-right-col .report-item-icon {
  width: 34px;
  height: 34px;
}

/* --- Generic Report Card --- */
.report-card {
  background: #fff !important;
  padding: 1rem 1.2rem !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.report-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Compact cards in right column */
.report-right-col .report-card {
  padding: 0.7rem 0.9rem !important;
  flex: 1;
}
.report-right-col .report-card-title {
  margin-bottom: 0.4rem;
  font-size: 1.15rem;
}

/* --- Talent / Weakness Items --- */
.report-talent-list,
.report-weakness-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.report-talent-item,
.report-weakness-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  transition: transform 0.15s ease;
}
.report-talent-item:hover,
.report-weakness-item:hover {
  transform: translateX(4px);
}

.report-talent-item {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-left: 3px solid #f59e0b;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.report-weakness-item {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-left: 3px solid #f87171;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.report-item-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.8);
}

.report-item-name {
  font-weight: 700;
  font-size: 1rem;
  color: #334155;
}
.report-item-desc {
  font-size: 0.88rem;
  color: #64748b;
  margin-top: 1px;
}

/* --- Matrix Header + Legend --- */
.report-matrix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.report-legend {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* --- Matrix Grid --- */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  margin-top: 0.5rem;
  background: #ffffff;
  border-radius: 14px;
  padding: 1rem 0.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.matrix-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0 0.6rem;
  border-right: 1px solid #e2e8f0;
}
.matrix-col:last-child {
  border-right: none;
}

.matrix-col h4 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #f1f5f9;
}

/* Larger icons inside matrix column headers */
.matrix-col h4 .rp-icon {
  width: 36px;
  height: 36px;
}

.matrix-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 4px 0;
}

.dots {
  display: flex;
  gap: 3px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e2e8f0;
}
.dot.filled.c1 { background: #60a5fa; }
.dot.filled.c2 { background: #34d399; }
.dot.filled.c3 { background: #fbbf24; }
.dot.filled.c4 { background: #f472b6; }
.dot.filled.c5 { background: #c084fc; }
.dot.filled.c6 { background: #f87171; }

/* --- Bottom Row: 3 Columns --- */
.report-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  width: 100%;
}

/* Recommendations Grid - 3 columns, flex wrap for centering last row */
.report-rec-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.report-rec-item {
  width: calc(33.333% - 0.6rem);
  min-width: 140px;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 1rem 0.8rem;
  border-radius: 14px;
  background: #ffffff;
  gap: 0.8rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid #f1f5f9;
}
.report-rec-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.report-rec-item .rec-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.report-rec-item .rec-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
}
.report-rec-item .rec-name {
  font-size: 1rem;
  font-weight: 700;
  color: #334155;
}
.report-rec-item .rec-desc {
  font-size: 0.82rem;
  color: #94a3b8;
}

/* Interventions List */
.report-int-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.report-int-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  background: #ffffff;
  border-left: 3px solid #f9a8d4;
  box-shadow: 0 2px 10px rgba(244,114,182,0.08);
}

.report-int-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.report-int-item h4 {
  font-size: 0.95rem;
  color: #be185d;
  font-weight: 700;
  margin-bottom: 2px;
}
.report-int-item p {
  font-size: 0.8rem;
  color: #f472b6;
  line-height: 1.3;
}

/* --- Footer --- */
.report-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  background: rgba(255,255,255,0.7);
  border-radius: 20px;
  font-size: 0.8rem;
  color: #94a3b8;
  width: 100%;
  border: 1px solid #f1f5f9;
}

.report-actions {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  width: 100%;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .report-main-grid { grid-template-columns: 1fr; }
  .report-hero-section { flex-direction: column; text-align: center; }
  .report-hero-img { width: 120px; }
  .report-bottom-row { grid-template-columns: 1fr; }
  .matrix-grid { grid-template-columns: repeat(3, 1fr); }
  .report-footer { flex-direction: column; gap: 0.5rem; text-align: center; }
  .report-hero-title { font-size: 1.6rem; }
}

/* Auth & Child Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.auth-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 3rem 2.5rem;
  border-radius: 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
  width: 90%;
  max-width: 420px;
  text-align: center;
  position: relative;
  animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auth-header h2 {
  color: #334155;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: #94a3b8;
  margin-bottom: 2rem;
}

.auth-toggle {
  display: flex;
  background: #f1f5f9;
  border-radius: 20px;
  padding: 0.3rem;
  margin-bottom: 2rem;
}

.auth-toggle button {
  flex: 1;
  padding: 0.8rem;
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: bold;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-toggle button.active {
  background: white;
  color: #f472b6;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.auth-input {
  width: 100%;
  padding: 1.2rem;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: #f472b6;
}

.auth-btn {
  width: 100%;
  padding: 1.2rem;
  background: linear-gradient(135deg, #f472b6, #fb923c);
  color: white;
  border: none;
  border-radius: 99px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(244,114,182,0.3);
}

.auth-error {
  background: #fef2f2;
  color: #ef4444;
  padding: 0.8rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #cbd5e1;
  cursor: pointer;
}

.modal-close:hover {
  color: #94a3b8;
}

.child-gender-select {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.gender-radio {
  flex: 1;
  cursor: pointer;
}

.gender-radio input {
  display: none;
}

.gender-btn {
  display: block;
  padding: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  text-align: center;
  font-weight: bold;
  color: #64748b;
  transition: all 0.2s;
}

.gender-radio input:checked + .gender-btn {
  border-color: #f472b6;
  background: #fdf2f8;
  color: #f472b6;
}

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

/* ==========================================================================
   Game Specific Styles
   ========================================================================== */

/* 1. Puzzle (Pipes) */
.pipe-container {
  display: grid;
  grid-template-columns: repeat(3, 80px);
  grid-template-rows: repeat(2, 80px);
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
}
.pipe-cell {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
}
.pipe-cell:hover {
  transform: scale(1.08);
}
.pipe-cell.success {
  animation: pulse-glow 0.8s infinite alternate;
}
.pipe-cell.success img {
  filter: drop-shadow(0 0 10px #4ade80) drop-shadow(0 0 20px #22c55e);
}
@keyframes pulse-glow {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

/* 3. Pressure (Resources) */
.resource-tank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.tank-bar {
  width: 40px;
  height: 120px;
  background: #fecaca;
  border-radius: 99px;
  position: relative;
  overflow: hidden;
}
.tank-fill {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(0deg, #ef4444, #f87171);
  transition: height 0.3s ease-out;
}
.btn-res {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: white;
  color: #ef4444;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.btn-res:hover {
  background: #fee2e2;
}

/* 5. Physics */
#physics-box {
  width: 100%;
  height: 300px;
  background: #f0f9ff;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  border: 2px solid #bae6fd;
  cursor: pointer;
}
#physics-ball {
  position: absolute;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle at 30% 30%, #7dd3fc, #0ea5e9);
  border-radius: 50%;
  left: 50%;
  transform: translateX(-50%);
  top: 20px;
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.4);
}
#physics-target {
  position: absolute;
  width: 100%;
  height: 60px;
  top: 120px;
  background: rgba(56, 189, 248, 0.1);
  border-top: 2px dashed #7dd3fc;
  border-bottom: 2px dashed #7dd3fc;
}

/* 6. Tracking */
.tracking-star {
  position: absolute;
  font-size: 3rem;
  color: #fbbf24;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.3s;
  opacity: 0.5;
  user-select: none;
}
.tracking-star.flash {
  opacity: 1;
  transform: scale(1.5) rotate(15deg);
  filter: drop-shadow(0 0 20px #fbbf24);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ==========================================================================
   Dynamic Pressure Stage UI (Pink Glassmorphism)
   ========================================================================== */
.pressure-stage-container {
  background: linear-gradient(180deg, #fff5f5 0%, #ffe4e6 100%);
  border-radius: 30px;
  padding: 1.5rem;
  box-shadow: inset 0 10px 40px rgba(244, 114, 182, 0.2), inset 0 2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.pressure-stage-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('data:image/svg+xml;utf8,<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"><g fill="rgba(244,114,182,0.03)"><rect width="10" height="10" x="10" y="10" rx="2"/></g></svg>');
  pointer-events: none;
}

.pressure-header-card {
  width: 100%;
  background: linear-gradient(90deg, #fff1f2, #ffe4e6);
  border-radius: 20px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 15px rgba(244, 114, 182, 0.1);
  border: 1px solid white;
  margin-bottom: 1.5rem;
  position: relative;
}

.pressure-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pressure-header-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 2px 5px rgba(239, 68, 68, 0.3));
}

.pressure-header-text h2 {
  color: #9f1239;
  margin: 0 0 0.2rem 0;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.pressure-header-text p {
  color: #be123c;
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.8;
}

.pressure-lv-badge {
  background: linear-gradient(135deg, #a855f7, #8b5cf6);
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: 99px;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
  border: 2px solid rgba(255,255,255,0.5);
}

.pressure-timer-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.main-timer-circle {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    inset 0 0 20px rgba(244, 114, 182, 0.2),
    0 10px 25px rgba(244, 114, 182, 0.15),
    0 0 0 10px rgba(255, 255, 255, 0.5);
  position: relative;
  border: 2px solid #fce7f3;
}

.main-timer-circle::before {
  content: '';
  position: absolute;
  top: -15px; left: -15px; right: -15px; bottom: -15px;
  border-radius: 50%;
  border: 2px dashed #fbcfe8;
  animation: spin 20s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.main-timer-circle h1 {
  font-size: 7.5rem;
  margin: 0;
  background: linear-gradient(180deg, #f43f5e, #fda4af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
  filter: drop-shadow(0 2px 4px rgba(244, 63, 94, 0.2));
}

.pressure-command-pill {
  background: white;
  border: 1px solid #fecdd3;
  border-radius: 99px;
  padding: 1.2rem 3rem;
  color: #9f1239;
  font-weight: bold;
  font-size: 1.3rem;
  text-align: center;
  box-shadow: 0 4px 15px rgba(244, 114, 182, 0.1);
  margin-bottom: 1.2rem;
  max-width: 95%;
}

.pressure-energy-pill {
  background: #fff1f2;
  border-radius: 99px;
  padding: 0.8rem 2.5rem;
  color: #e11d48;
  font-weight: bold;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  box-shadow: inset 0 2px 5px rgba(255,255,255,0.8), 0 2px 5px rgba(225, 29, 72, 0.1);
}
.pressure-energy-pill span {
  font-size: 2rem;
  margin-left: 0.5rem;
}

.pressure-tanks-container {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  width: 100%;
  flex: 1;
  align-items: flex-end;
}

.resource-tank-new {
  background: white;
  border-radius: 24px;
  padding: 1.5rem 1rem;
  width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 8px 20px rgba(244, 114, 182, 0.1);
  border: 1px solid #fce7f3;
  position: relative;
}

/* Side tech lines decoration */
.resource-tank-new::before, .resource-tank-new::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 40px;
  background: #fbcfe8;
  border-radius: 2px;
}
.resource-tank-new::before { left: 4px; }
.resource-tank-new::after { right: 4px; }

.tank-header {
  font-size: 1.2rem;
  color: #475569;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tank-btn-new {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid #fecdd3;
  background: white;
  color: #e11d48;
  font-size: 1.8rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(225, 29, 72, 0.1);
  transition: all 0.2s;
}

.tank-btn-new:hover {
  background: #fff1f2;
  transform: scale(1.1);
}

.tank-track-new {
  width: 50px;
  height: 160px;
  background: #fff1f2;
  border-radius: 25px;
  box-shadow: inset 0 4px 10px rgba(225, 29, 72, 0.1);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 4px;
}

.tank-fill-new {
  width: 100%;
  background: linear-gradient(180deg, #f43f5e, #fb7185);
  border-radius: 16px;
  transition: height 0.15s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s;
  box-shadow: inset 0 2px 5px rgba(255,255,255,0.4);
}

/* ==========================================================================
   Audio Hearing Test Stage (Sonar Radar)
   ========================================================================== */
.sonar-wrapper {
  position: relative;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(187, 247, 208, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(34, 197, 94, 0.3);
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.1);
  overflow: hidden;
}

.sonar-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(34, 197, 94, 0.2);
  box-sizing: border-box;
}

.sonar-circle::before, .sonar-circle::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 50%;
}
.sonar-circle::before { width: 66%; height: 66%; }
.sonar-circle::after { width: 33%; height: 33%; }

.sonar-sweep {
  position: absolute;
  top: 0; left: 50%;
  width: 50%; height: 50%;
  background: linear-gradient(to right, rgba(34, 197, 94, 0) 0%, rgba(34, 197, 94, 0.4) 100%);
  transform-origin: 0% 100%;
  animation: radar-spin 3s linear infinite;
  border-right: 2px solid rgba(34, 197, 94, 0.8);
}

.sonar-icon {
  font-size: 3rem;
  z-index: 10;
  filter: drop-shadow(0 0 10px rgba(34, 197, 94, 0.5));
}

@keyframes radar-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.audio-btn:active {
  transform: scale(0.9) !important;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.2), inset 0 2px 10px rgba(0,0,0,0.1) !important;
}
