/* ==========================================================================
   Bonnie & Leo · 家庭成长档案馆 The Little Archive — Style Sheets
   ========================================================================== */

/* --- CSS Variables & Design System (P0 brand tokens) --- */
:root {
  /* Typography: serif display + sans UI with local Chinese fallbacks (no Google Fonts required) */
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-title: var(--font-display);
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  /* Paper archive palette */
  --color-bg-primary: #FAF6EF;
  --color-bg-secondary: #F3EEE4;
  --color-paper: #FAF6EF;
  --color-ink: #20302F;
  --color-ink-muted: #68716D;
  --color-text-dark: var(--color-ink);
  --color-text-muted: var(--color-ink-muted);

  --archive-gold: #B8935F;
  --archive-gold-line: #D8C3A2;
  --sage: #A9B49C;
  --sky-ash: #A9B7C1;

  /* Hero only: restrained gradient */
  --hero-gradient: linear-gradient(145deg, #FAF6EF 0%, #F0E6D6 48%, #E8DCC8 100%);
  --magic-gradient: var(--hero-gradient);
  --bubble-gradient: linear-gradient(to top, rgba(168, 180, 156, 0.35) 0%, rgba(184, 147, 95, 0.2) 100%);

  /* AI companion (muted, solid accents) */
  --ai-primary: #3D6B7A;
  --ai-secondary: #5A8491;
  --ai-light: #EEF3F4;
  --ai-glow: rgba(61, 107, 122, 0.18);
  --ai-gradient: linear-gradient(135deg, #3D6B7A 0%, #5A8491 100%);

  /* Bonnie — berry red (solid, not candy gradient as primary chrome) */
  --bonnie-primary: #C74B6E;
  --bonnie-primary-hover: #8F304D;
  --bonnie-secondary: #D8C3A2;
  --bonnie-light: #FBF0F3;
  --bonnie-gradient: linear-gradient(135deg, #FBF0F3 0%, #F5E6EA 100%);
  --bonnie-shadow: rgba(143, 48, 77, 0.18);

  /* Leo — navy */
  --leo-primary: #22405C;
  --leo-primary-hover: #173047;
  --leo-secondary: #A9B7C1;
  --leo-light: #EFF3F6;
  --leo-gradient: linear-gradient(135deg, #EFF3F6 0%, #E4EBF0 100%);
  --leo-shadow: rgba(23, 48, 71, 0.16);

  /* Surfaces */
  --glass-bg: rgba(255, 252, 246, 0.92);
  --glass-border: rgba(216, 195, 162, 0.65);
  --glass-shadow: 0 8px 24px rgba(32, 48, 47, 0.06);
  --line: 1px solid var(--archive-gold-line);
  --transition-smooth: all 0.28s cubic-bezier(0.25, 0.8, 0.25, 1);
  --border-radius-lg: 12px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
  --content-max: 1200px;
}

/* --- Global Reset & Base Styles --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg-primary);
  color: var(--color-text-dark);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 650;
  color: var(--color-text-dark);
  letter-spacing: 0.01em;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
}

:focus-visible {
  outline: 2px solid var(--archive-gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Animated Background Decorations --- */
.bg-decorations {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -10;
  overflow: hidden;
  pointer-events: none;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: var(--bubble-gradient);
  opacity: 0.12;
  filter: blur(1px);
  animation: floatUp 15s infinite ease-in-out;
}

.bubble-1 { width: 120px; height: 120px; left: 10%; bottom: -150px; animation-duration: 20s; }
.bubble-2 { width: 80px; height: 80px; left: 75%; bottom: -100px; animation-duration: 16s; animation-delay: 2s; }
.bubble-3 { width: 150px; height: 150px; left: 40%; bottom: -200px; animation-duration: 25s; animation-delay: 5s; }
.bubble-4 { width: 60px; height: 60px; left: 90%; bottom: -50px; animation-duration: 12s; animation-delay: 1s; }

@keyframes floatUp {
  0% { transform: translateY(0) scale(1) rotate(0deg); opacity: 0; }
  10% { opacity: 0.12; }
  90% { opacity: 0.12; }
  100% { transform: translateY(-120vh) scale(1.2) rotate(360deg); opacity: 0; }
}

/* --- Navigation & Header --- */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  transition: var(--transition-smooth);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-emoji {
  font-size: 2rem;
  animation: wave 3s infinite ease-in-out;
}

.logo-text {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(45deg, var(--bonnie-primary), var(--ai-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.logo-sub {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(15deg); }
}

.nav-menu {
  display: flex;
  gap: 8px;
}

.nav-link {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--border-radius-lg);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.nav-link i {
  font-size: 0.95rem;
}

.nav-link:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--color-text-dark);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--bonnie-primary) 0%, var(--ai-primary) 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
}

.mobile-toggle {
  display: none;
  font-size: 1.5rem;
  background: transparent;
  border: none;
  color: var(--color-text-dark);
  cursor: pointer;
}

/* --- Section Switching & Layout --- */
.content-wrapper {
  min-height: calc(100vh - 160px);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-padding {
  padding: 48px 0;
}

/* --- Home / Welcome Dashboard --- */
.hero-banner {
  background: linear-gradient(135deg, rgba(255, 117, 143, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
  padding: 80px 0;
  text-align: center;
  border-bottom-left-radius: 40px;
  border-bottom-right-radius: 40px;
  box-shadow: inset 0 -4px 15px rgba(0,0,0,0.01);
}

.hero-title {
  font-size: 3.2rem;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--bonnie-primary-hover) 0%, var(--ai-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  max-width: 700px;
  margin: 0 auto;
}

/* Kids Grid & Entrance Cards */
.kids-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: -30px;
  margin-bottom: 40px;
}

.kid-entrance-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s;
}

.kid-entrance-card:hover {
  transform: translateY(-8px) scale(1.01);
}

.kid-entrance-card.bonnie-theme:hover {
  box-shadow: 0 15px 35px var(--bonnie-shadow);
}

.kid-entrance-card.leo-theme:hover {
  box-shadow: 0 15px 35px var(--leo-shadow);
}

.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.kid-entrance-card:hover .card-glow {
  opacity: 1;
}

.card-avatar-wrap {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 3.5rem;
  background: white;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
  transition: var(--transition-smooth);
}

.kid-entrance-card.bonnie-theme .card-avatar-wrap {
  background: var(--bonnie-light);
  border: 3px solid var(--bonnie-primary);
}

.kid-entrance-card.leo-theme .card-avatar-wrap {
  background: var(--leo-light);
  border: 3px solid var(--leo-primary);
}

.kid-entrance-card:hover .card-avatar-wrap {
  transform: scale(1.1) rotate(5deg);
}

.kid-entrance-card h2 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.kid-entrance-card.bonnie-theme h2 { color: var(--bonnie-primary-hover); }
.kid-entrance-card.leo-theme h2 { color: var(--leo-primary); }

.kid-entrance-card p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

.hero-kicker {
  width: fit-content;
  margin: 0 auto 0.8rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  backdrop-filter: blur(10px);
}

.age-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 auto 0.65rem;
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.bonnie-theme .age-pill {
  color: #9f285f;
  background: #fff0f7;
}

.leo-theme .age-pill {
  color: #075985;
  background: #e8f7ff;
}

.enter-btn {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: var(--border-radius-lg);
  border: none;
  cursor: pointer;
  color: white;
  transition: var(--transition-smooth);
}

.bonnie-theme .enter-btn {
  background: linear-gradient(135deg, var(--bonnie-primary), #ff9a9e);
  box-shadow: 0 4px 15px rgba(255, 117, 143, 0.2);
}

.bonnie-theme .enter-btn:hover {
  background: var(--bonnie-primary-hover);
  box-shadow: 0 6px 20px rgba(255, 117, 143, 0.35);
}

.leo-theme .enter-btn {
  background: linear-gradient(135deg, var(--leo-primary), #48cae4);
  box-shadow: 0 4px 15px rgba(58, 134, 200, 0.2);
}

.leo-theme .enter-btn:hover {
  background: var(--leo-primary-hover);
  box-shadow: 0 6px 20px rgba(58, 134, 200, 0.35);
}

/* Home AI Partner banner promotion */
.ai-partner-banner-card {
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  color: white;
  padding: 32px 40px;
  border-radius: var(--border-radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(14, 165, 233, 0.25);
  transition: var(--transition-smooth);
}

.ai-partner-banner-card:hover {
  transform: scale(1.005) translateY(-3px);
  box-shadow: 0 15px 35px rgba(14, 165, 233, 0.35);
}

.ai-card-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.ai-avatar-glow {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: white;
  animation: floatIcon 3s infinite ease-in-out;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.ai-text h2 {
  font-size: 1.8rem;
  color: white;
  margin-bottom: 6px;
}

.ai-text p {
  font-size: 1rem;
  opacity: 0.95;
  max-width: 750px;
  line-height: 1.5;
}

.ai-enter-btn {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--border-radius-lg);
  border: none;
  background: white;
  color: var(--ai-primary);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.ai-enter-btn:hover {
  background: var(--ai-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Family Intro and Timeline */
.family-intro-box {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 48px;
  box-shadow: var(--glass-shadow);
  border: 1px solid rgba(0,0,0,0.03);
}

.intro-header {
  text-align: center;
  margin-bottom: 40px;
}

.intro-header h2 {
  font-size: 2.2rem;
  margin-top: 8px;
}

.intro-header p {
  color: var(--color-text-muted);
}

.icon-glow {
  font-size: 2.5rem;
  color: var(--ai-primary);
  filter: drop-shadow(0 4px 10px var(--ai-glow));
}

/* Timeline Components */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 6px;
  background-color: var(--color-bg-secondary);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -3px;
  border-radius: 3px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  background-color: inherit;
  width: 50%;
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 25px;
  height: 25px;
  right: -17px;
  background-color: white;
  border: 4px solid var(--bonnie-secondary);
  top: 15px;
  border-radius: 50%;
  z-index: 1;
}

.timeline-item.left { left: 0; }
.timeline-item.right { left: 50%; }

.timeline-item.right::after {
  left: -8px;
  border-color: var(--ai-secondary);
}

.timeline-badge {
  position: absolute;
  top: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  font-size: 1.2rem;
}

.timeline-item.left .timeline-badge { right: -20px; color: var(--bonnie-primary); border: 2px solid var(--bonnie-light); }
.timeline-item.right .timeline-badge { left: -20px; color: var(--ai-primary); border: 2px solid var(--ai-light); }

.timeline-panel {
  padding: 20px 24px;
  background: var(--color-bg-secondary);
  position: relative;
  border-radius: var(--border-radius-md);
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
  transition: var(--transition-smooth);
}

.timeline-panel:hover {
  transform: translateY(-3px);
  background: white;
  box-shadow: 0 8px 25px rgba(0,0,0,0.05);
}

.timeline-date {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-muted);
}

.timeline-panel h3 {
  font-size: 1.3rem;
  margin: 6px 0;
  color: var(--color-text-dark);
}

.timeline-panel p {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

/* --- Kid Section Page Layouts --- */
.kid-banner {
  padding: 60px 0;
  color: white;
  border-bottom-left-radius: 30px;
  border-bottom-right-radius: 30px;
}

.ai-bg {
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
  box-shadow: 0 10px 30px var(--ai-glow);
}

.bonnie-bg {
  background: linear-gradient(135deg, var(--bonnie-primary), var(--bonnie-secondary));
  box-shadow: 0 10px 30px var(--bonnie-shadow);
}

.leo-bg {
  background: linear-gradient(135deg, var(--leo-primary), var(--leo-secondary));
  box-shadow: 0 10px 30px var(--leo-shadow);
}

.photo-bg {
  background: linear-gradient(135deg, #a18cd1, #fbc2eb);
  box-shadow: 0 10px 30px rgba(161, 140, 209, 0.3);
}

.banner-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.banner-emoji {
  font-size: 4rem;
}

.banner-text h1 {
  font-size: 2.8rem;
  color: white;
}

.banner-text p {
  font-size: 1.15rem;
  opacity: 0.9;
}

/* Sub tabs switcher for interior pages */
.sub-tabs-container {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
}

.sub-tab-btn {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--border-radius-lg);
  border: none;
  background: white;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  transition: var(--transition-smooth);
}

.sub-tab-btn:hover {
  transform: translateY(-2px);
  color: var(--color-text-dark);
}

#bonnie-section .sub-tab-btn.active {
  background: var(--bonnie-primary);
  color: white;
  box-shadow: 0 6px 20px var(--bonnie-shadow);
}

#leo-section .sub-tab-btn.active {
  background: var(--leo-primary);
  color: white;
  box-shadow: 0 6px 20px var(--leo-shadow);
}

.sub-tab-content {
  display: none;
}

.sub-tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

/* Feature Cards & Split Layout */
.split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.split-layout.vertical-large {
  grid-template-columns: 1fr;
}

.feature-card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 36px;
  box-shadow: var(--glass-shadow);
  border: 1px solid rgba(0,0,0,0.02);
  transition: transform 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
}

.card-title-icon {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.card-title-icon i {
  font-size: 1.8rem;
}

.card-title-icon h3 {
  font-size: 1.6rem;
}

.icon-coral { color: var(--bonnie-primary); }
.icon-yellow { color: #fcc206; }
.icon-lavender { color: var(--bonnie-secondary); }
.icon-blue { color: var(--leo-primary); }
.icon-teal { color: var(--leo-secondary); }

.card-desc {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

/* --- AI Chat Box Console --- */
.chat-container {
  display: grid;
  grid-template-columns: 3fr 1.5fr;
  gap: 32px;
  align-items: start;
}

.chat-window {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--glass-shadow);
  border: 1px solid rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  height: 520px;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background-color: #fcfdfe;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  align-items: flex-start;
}

.msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  flex-shrink: 0;
}

.msg-bubble {
  padding: 14px 20px;
  border-radius: var(--border-radius-md);
  font-size: 0.98rem;
  line-height: 1.6;
  white-space: pre-line;
}

/* AI message styles */
.ai-message {
  align-self: flex-start;
}

.ai-message .msg-avatar {
  background-color: var(--ai-light);
  border: 1px solid var(--ai-primary);
}

.ai-message .msg-bubble {
  background-color: #f3f4f6;
  color: var(--color-text-dark);
  border-top-left-radius: 4px;
}

/* User message styles */
.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.user-message .msg-avatar {
  background-color: #fef08a;
  border: 1px solid #f59e0b;
}

.user-message .msg-bubble {
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-secondary) 100%);
  color: white;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.15);
}

.chat-input-area {
  padding: 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  background-color: white;
}

.chat-input-area input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 12px 20px;
  border-radius: var(--border-radius-lg);
  border: 1px solid #d1d5db;
  outline: none;
  transition: var(--transition-smooth);
}

.chat-input-area input:focus {
  border-color: var(--ai-primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

#chat-send-btn {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 12px 28px;
  border-radius: var(--border-radius-lg);
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-secondary) 100%);
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2);
  transition: var(--transition-smooth);
}

#chat-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(14, 165, 233, 0.35);
}

/* Chat Shortcuts Sidebox */
.chat-shortcuts {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 28px;
  box-shadow: var(--glass-shadow);
  border: 1px solid rgba(0,0,0,0.02);
}

.chat-shortcuts h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--ai-primary);
}

.shortcut-desc {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shortcut-btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
  color: var(--color-text-dark);
  transition: var(--transition-smooth);
}

.shortcut-btn:hover {
  border-color: var(--ai-primary);
  background: var(--ai-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.08);
}


/* --- Bonnie's Interactive Features --- */
/* Word Box */
.word-card-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.word-card {
  width: 100%;
  max-width: 320px;
  height: 220px;
  background: linear-gradient(135deg, #fff 0%, var(--bonnie-light) 100%);
  border: 2px dashed var(--bonnie-primary);
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 15px rgba(0,0,0,0.02);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.word-card:hover {
  transform: scale(1.03) rotate(-1deg);
}

.word-emoji {
  font-size: 4.5rem;
  margin-bottom: 10px;
}

.word-text {
  font-size: 2.2rem;
  color: var(--bonnie-primary-hover);
  margin-bottom: 4px;
}

.word-translation {
  font-size: 1.15rem;
  color: var(--color-text-muted);
}

.word-card-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
}

.control-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: white;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.control-btn:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-dark);
}

.speak-btn {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: var(--border-radius-lg);
  border: none;
  cursor: pointer;
  background: var(--bonnie-primary);
  color: white;
  box-shadow: 0 4px 10px var(--bonnie-shadow);
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 8px;
}

.speak-btn:hover {
  background: var(--bonnie-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px var(--bonnie-shadow);
}

/* Math Game */
.math-adventure-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.star-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 1.1rem;
  background: #fef9c3;
  padding: 8px 16px;
  border-radius: var(--border-radius-lg);
  border: 1px solid #fef08a;
  color: #a16207;
}

.star-icon {
  color: #f59e0b;
  animation: spinStar 4s infinite linear;
}

@keyframes spinStar {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.math-question {
  font-family: var(--font-title);
  font-size: 3.2rem;
  color: var(--color-text-dark);
  font-weight: 700;
  letter-spacing: 2px;
  background: #f3f4f6;
  padding: 15px 40px;
  border-radius: var(--border-radius-md);
  margin: 10px 0;
}

.math-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  max-width: 320px;
}

.math-option-btn {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  padding: 14px;
  border: 2px solid #e5e7eb;
  border-radius: var(--border-radius-md);
  background: white;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.math-option-btn:hover {
  border-color: var(--bonnie-primary);
  background: var(--bonnie-light);
  transform: translateY(-2px);
}

.math-feedback {
  font-size: 1.1rem;
  font-weight: 600;
  min-height: 24px;
  transition: var(--transition-smooth);
}

.math-feedback.correct { color: #10b981; }
.math-feedback.incorrect { color: #ef4444; }

/* AI Inspiration drawing alert box */
.ai-box-message {
  background-color: var(--ai-light);
  border: 1px dashed var(--ai-primary);
  border-radius: var(--border-radius-md);
  padding: 16px 20px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--color-text-dark);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-badge {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--ai-primary);
}

/* Drawing Board */
.drawing-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawing-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #f3f4f6;
  padding: 20px;
  border-radius: var(--border-radius-md);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-group label {
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--color-text-dark);
}

.palette-colors {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid white;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: var(--transition-smooth);
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.active {
  transform: scale(1.15);
  box-shadow: 0 0 0 3px white, 0 0 0 5px var(--bonnie-primary);
}

#custom-color-picker {
  border: none;
  background: transparent;
  width: 34px;
  height: 34px;
  cursor: pointer;
  border-radius: 50%;
}

#brush-size {
  width: 120px;
  accent-color: var(--bonnie-primary);
}

.canvas-btn {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  border: 1px solid #cbd5e1;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.canvas-btn:hover {
  background: #f1f5f9;
}

.canvas-btn.danger {
  color: #ef4444;
  border-color: #fca5a5;
}
.canvas-btn.danger:hover {
  background: #fef2f2;
}

.canvas-btn.success {
  color: white;
  background: #10b981;
  border: none;
}
.canvas-btn.success:hover {
  background: #059669;
}

.canvas-wrapper {
  border: 3px solid #f3f4f6;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  background: white;
  display: flex;
  justify-content: center;
}

#paint-canvas {
  background-color: #fff;
  cursor: crosshair;
  display: block;
  width: 100%;
  max-width: 650px;
  height: auto;
}

/* Piano Styles */
.piano-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.piano {
  display: flex;
  position: relative;
  background: #1f2937;
  padding: 16px;
  padding-bottom: 2px;
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  margin-top: 10px;
  width: 480px;
  height: 220px;
}

.piano-key {
  position: relative;
  cursor: pointer;
  border: none;
  transition: background-color 0.1s, transform 0.1s;
}

.piano-key.white {
  width: 60px;
  height: 200px;
  background: white;
  border-right: 1px solid #e5e7eb;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
}

.piano-key.white:last-child {
  border-right: none;
}

.piano-key.white span {
  font-family: var(--font-title);
  font-weight: 700;
  color: #9ca3af;
}

.piano-key.white:hover {
  background: #f9fafb;
}

.piano-key.white.active {
  background: #cbd5e1;
  transform: translateY(2px);
}

.piano-key.black {
  width: 36px;
  height: 120px;
  background: #374151;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  position: absolute;
  z-index: 2;
}

.piano-key.black:hover {
  background: #4b5563;
}

.piano-key.black.active {
  background: #000;
  height: 122px;
}

.sound-mode-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cute-select {
  font-family: var(--font-title);
  font-size: 1rem;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  border: 1px solid #cbd5e1;
  background: white;
  cursor: pointer;
}


/* --- Leo's World: Coding Adventure --- */
.coding-game-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Leo jump-rope challenge */
.rope-challenge {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid rgba(14, 165, 233, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 0%, rgba(45, 212, 191, 0.16), transparent 34%),
    linear-gradient(145deg, #f8fdff, #effaff);
}

.rope-dashboard {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.9rem;
}

.rope-count-wrap,
.rope-timer-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
  min-height: 116px;
  padding: 1rem;
  border-radius: 20px;
  background: white;
  box-shadow: 0 12px 32px rgba(14, 165, 233, 0.1);
}

.rope-count-wrap {
  flex-wrap: wrap;
  background: linear-gradient(135deg, #ffffff, #e8fbff);
}

.rope-label {
  flex-basis: 100%;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}

.rope-count-wrap strong {
  color: #0284c7;
  font-family: 'Fredoka', sans-serif;
  font-size: 3.4rem;
  line-height: 1;
}

.rope-timer-wrap {
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  color: #64748b;
}

.rope-timer-wrap strong {
  color: #0f766e;
  font-family: 'Fredoka', sans-serif;
  font-size: 2.35rem;
  line-height: 1.1;
}

.rope-progress {
  height: 14px;
  overflow: hidden;
}

.rope-progress .progress-bar-inner {
  background: linear-gradient(90deg, #0ea5e9, #2dd4bf, #facc15);
}

.rope-target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: #334155;
  font-weight: 700;
}

.rope-target-row .cute-select {
  width: auto;
  min-width: 170px;
}

.rope-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.rope-controls > button {
  flex: 1 1 120px;
  min-height: 48px;
}

.count-btn {
  border: none;
  border-radius: 14px;
  color: white;
  background: #0ea5e9;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.22);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.count-btn.count-ten {
  background: #14b8a6;
}

.count-btn:not(:disabled):hover,
.count-btn:not(:disabled):focus-visible {
  transform: translateY(-2px);
}

.count-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.rope-best {
  color: #0f766e;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

.rope-best strong {
  color: #0284c7;
  font-size: 1.2rem;
}

@media (max-width: 640px) {
  .hero-kicker {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
  }

  .rope-dashboard {
    grid-template-columns: 1fr;
  }

  .rope-count-wrap,
  .rope-timer-wrap {
    min-height: 96px;
  }

  .rope-timer-wrap {
    flex-direction: row;
    justify-content: center;
    gap: 0.35rem;
  }

  .rope-target-row {
    align-items: stretch;
    flex-direction: column;
  }

  .rope-target-row .cute-select {
    width: 100%;
  }
}

/* Map Grid */
.coding-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 4px;
  width: 250px;
  height: 250px;
  margin: 0 auto;
  background-color: #1e293b;
  border: 4px solid #0f172a;
  border-radius: var(--border-radius-md);
  padding: 6px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.grid-cell {
  background-color: #334155;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  position: relative;
  transition: background-color 0.2s;
}

.grid-cell.active-path {
  background-color: #475569;
}

.cell-rocket {
  animation: rocketWobble 1.5s infinite ease-in-out;
  z-index: 5;
}

@keyframes rocketWobble {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(5deg); }
}

.cell-star {
  animation: starPulse 1s infinite alternate;
}

@keyframes starPulse {
  from { transform: scale(0.9); filter: drop-shadow(0 0 2px #facc15); }
  to { transform: scale(1.1); filter: drop-shadow(0 0 8px #facc15); }
}

/* Coding Controls layout */
.coding-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  background: #f3f4f6;
  padding: 20px;
  border-radius: var(--border-radius-md);
}

.commands-palette {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.commands-palette h4 {
  font-family: var(--font-title);
  color: var(--color-text-dark);
  font-size: 1.1rem;
}

.palette-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cmd-btn {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px;
  border-radius: var(--border-radius-sm);
  border: 1px solid #cbd5e1;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.cmd-btn:hover {
  background: var(--leo-light);
  border-color: var(--leo-primary);
  transform: translateY(-1px);
}

.commands-queue-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.commands-queue-box h4 {
  font-family: var(--font-title);
  font-size: 1.1rem;
}

.queue-list {
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: var(--border-radius-sm);
  padding: 12px;
  min-height: 80px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}

.queue-item {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 12px;
  background: var(--leo-light);
  border: 1px solid var(--leo-primary);
  color: var(--leo-primary-hover);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: popIn 0.2s ease;
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.queue-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* Habit Checklist */
.habit-box {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.progress-container {
  background: #f3f4f6;
  padding: 16px;
  border-radius: var(--border-radius-md);
}

.progress-label {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--leo-primary);
}

.progress-bar-outer {
  height: 14px;
  background: #cbd5e1;
  border-radius: 7px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--leo-primary) 0%, var(--leo-secondary) 100%);
  border-radius: 7px;
  transition: width 0.4s cubic-bezier(0.1, 0.8, 0.1, 1);
}

.habit-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.habit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  padding: 14px 20px;
  border-radius: var(--border-radius-md);
  border: 1px solid #e5e7eb;
  transition: var(--transition-smooth);
}

.habit-item:hover {
  background: white;
  border-color: var(--leo-secondary);
}

.cute-checkbox {
  width: 24px;
  height: 24px;
  accent-color: var(--leo-primary);
  cursor: pointer;
}

.habit-item label {
  font-size: 1.05rem;
  color: var(--color-text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  color: white;
}
.badge-math { background-color: var(--bonnie-primary); }
.badge-reading { background-color: var(--bonnie-secondary); }
.badge-sport { background-color: #10b981; }
.badge-clean { background-color: #f59e0b; }
.badge-family { background-color: #ec4899; }

.habit-complete-msg {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: #065f46;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  padding: 12px;
  border-radius: var(--border-radius-md);
  text-align: center;
  display: none;
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}


/* --- Bubble Pop Game & AI Toggle --- */
.game-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.game-dashboard {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f3f4f6;
  padding: 16px 24px;
  border-radius: var(--border-radius-md);
  flex-wrap: wrap;
  gap: 12px;
}

.dash-item {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text-dark);
}

.dash-item i {
  color: var(--leo-primary);
}

/* AI Assist switch */
.ai-coop-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch-container {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.switch-container input:checked + .switch-slider {
  background-color: var(--ai-primary);
}

.switch-container input:checked + .switch-slider:before {
  transform: translateX(24px);
}

.switch-label {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.play-btn {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: var(--border-radius-lg);
  border: none;
  cursor: pointer;
  background: var(--leo-primary);
  color: white;
  box-shadow: 0 4px 10px var(--leo-shadow);
  transition: var(--transition-smooth);
}

.play-btn:hover {
  background: var(--leo-primary-hover);
  transform: translateY(-1px);
}

.game-board-wrapper {
  background: #0f172a;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 4px 20px rgba(0,0,0,0.3);
}

.game-area {
  width: 100%;
  height: 380px;
  position: relative;
}

.start-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 10;
  text-align: center;
  padding: 24px;
}

.start-overlay h2 {
  font-size: 2.2rem;
  color: white;
  margin-bottom: 8px;
}

.start-overlay p {
  color: #94a3b8;
  max-width: 450px;
}

.game-bubble {
  position: absolute;
  border-radius: 50%;
  cursor: pointer;
  transform: translate(-50%, -50%);
  animation: bubbleWobble 2s infinite ease-in-out;
  box-shadow: inset -5px -5px 15px rgba(0,0,0,0.15), 0 4px 10px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes bubbleWobble {
  0%, 100% { border-radius: 50%; }
  50% { border-radius: 48% 52% 47% 53% / 51% 49% 52% 48%; }
}

/* AI Laser Beam animation */
.ai-laser-beam {
  position: absolute;
  width: 4px;
  background: linear-gradient(to top, var(--ai-primary), #fff);
  box-shadow: 0 0 10px #22d3ee;
  transform-origin: bottom center;
  animation: laserFade 0.2s forwards;
  z-index: 8;
}

@keyframes laserFade {
  from { opacity: 1; transform: scaleY(1); }
  to { opacity: 0; transform: scaleY(0); }
}

/* Soundboard pads */
.soundboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.sound-pad {
  background: #f3f4f6;
  border: 1px solid #cbd5e1;
  border-radius: var(--border-radius-md);
  padding: 24px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: var(--transition-smooth);
}

.sound-pad:hover {
  background: white;
  border-color: var(--leo-secondary);
  transform: translateY(-3px);
  box-shadow: 0 4px 15px var(--leo-shadow);
}

.sound-pad:active {
  transform: scale(0.95);
}

.pad-emoji {
  font-size: 2.5rem;
}

.pad-label {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-dark);
}


/* --- Growth Photo Wall / Gallery --- */
.gallery-wrapper {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 40px;
  box-shadow: var(--glass-shadow);
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 16px;
}

.gallery-header h2 {
  font-size: 2rem;
}

.gallery-header p {
  color: var(--color-text-muted);
}

.add-photo-btn {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: var(--border-radius-lg);
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--bonnie-primary), var(--ai-primary));
  color: white;
  box-shadow: 0 4px 12px rgba(255, 117, 143, 0.2);
  transition: var(--transition-smooth);
}

.add-photo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 117, 143, 0.35);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.photo-card {
  background: #f3f4f6;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.02);
  transition: var(--transition-smooth);
}

.photo-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
  background: white;
}

.img-container {
  position: relative;
  overflow: hidden;
  height: 200px;
  cursor: pointer;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.photo-card:hover .gallery-img {
  transform: scale(1.05);
}

.img-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.img-container:hover .img-overlay {
  opacity: 1;
}

.zoom-icon {
  color: white;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.photo-info {
  padding: 20px;
}

.photo-info h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.photo-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 12px;
}

.bonnie-tag { background-color: var(--bonnie-light); color: var(--bonnie-primary); }
.leo-tag { background-color: var(--leo-light); color: var(--leo-primary); }
.family-tag { background-color: #fef3c7; color: #d97706; }

.photo-info p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.photo-date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- Modals & Popups --- */
.modal, .lightbox-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.modal.active, .lightbox-modal.active {
  display: flex;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 480px;
  padding: 32px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
  from { transform: translateY(40px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 1.5rem;
  background: linear-gradient(45deg, var(--bonnie-primary), var(--ai-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-close, .lightbox-close {
  font-size: 2rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: var(--transition-smooth);
}

.modal-close:hover, .lightbox-close:hover {
  color: var(--color-text-dark);
}

/* Form Styles */
.upload-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
}

.form-group input[type="text"], .form-group textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  border: 1px solid #cbd5e1;
  outline: none;
  transition: var(--transition-smooth);
}

.form-group input[type="text"]:focus, .form-group textarea:focus {
  border-color: var(--ai-primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* File upload button styling */
.file-upload-wrapper {
  position: relative;
  width: 100%;
}

.file-upload-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
}

.file-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f3f4f6;
  border: 2px dashed #cbd5e1;
  border-radius: var(--border-radius-sm);
  padding: 14px;
  text-align: center;
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--color-text-muted);
  transition: var(--transition-smooth);
}

.file-upload-wrapper:hover .file-upload-btn {
  border-color: var(--ai-primary);
  color: var(--ai-primary);
  background: var(--ai-light);
}

.file-name {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  text-align: center;
}

/* --- Growth archive media layout --- */
/* Keep the family film inside the viewport on desktop and mobile.  The
   archive markup is manifest-driven, so these rules are intentionally
   independent of the number of cards or the selected media source. */
.archive-banner {
  background: var(--hero-gradient);
  border-bottom: var(--line);
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2rem, 5vw, 3.5rem);
}

.archive-banner h1 {
  margin: 0.35rem 0 0.55rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.archive-banner p:last-child {
  max-width: 52rem;
  color: var(--color-ink-muted);
}

.archive-layer {
  margin-top: clamp(1.5rem, 3vw, 2.75rem);
  overflow: hidden;
  border: var(--line);
  border-radius: var(--border-radius-lg);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
}

.archive-layer-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  padding: clamp(1rem, 2.5vw, 1.5rem) clamp(1rem, 3vw, 2rem);
  border-bottom: var(--line);
}

.archive-layer-header h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
}

.layer-meta {
  color: var(--color-ink-muted);
  font-size: 0.88rem;
}

.hero-film-card {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(15rem, 0.75fr);
  min-width: 0;
  background: #1f2b2c;
}

.hero-film-card video {
  display: block;
  width: 100%;
  height: auto;
  min-width: 0;
  aspect-ratio: 16 / 9;
  max-height: min(68vh, 42rem);
  background: #101718;
  object-fit: contain;
}

.hero-film-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 0.7rem;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  color: #f8f4ec;
}

.hero-film-meta h3 {
  color: inherit;
  font-size: clamp(1.25rem, 2.3vw, 1.8rem);
}

.hero-film-meta p {
  color: rgba(248, 244, 236, 0.82);
  overflow-wrap: anywhere;
}

.hero-film-meta .year-pill {
  align-self: flex-start;
}

.member-grid,
.timeline-grid,
.local-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: clamp(0.85rem, 2vw, 1.25rem);
  padding: clamp(1rem, 3vw, 2rem);
}

.member-card,
.timeline-card {
  min-width: 0;
  overflow: hidden;
  border: var(--line);
  border-radius: var(--border-radius-md);
  background: #fffdf9;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.member-card:hover,
.member-card:focus-visible,
.timeline-card:hover,
.timeline-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow);
}

.member-card img,
.timeline-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--color-bg-secondary);
}

.member-info,
.tl-info {
  min-width: 0;
  padding: 0.9rem 1rem 1.1rem;
}

.member-info h3,
.tl-info h3 {
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.member-info p,
.tl-info p {
  margin-top: 0.35rem;
  color: var(--color-ink-muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.pending-tag,
.tl-tag {
  display: inline-flex;
  margin-top: 0.6rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--ai-light);
  color: var(--ai-primary);
  font-size: 0.75rem;
}

.upload-source-note {
  margin: clamp(1rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem) 0;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--archive-gold);
  background: rgba(216, 195, 162, 0.14);
  color: var(--color-ink-muted);
  font-size: 0.88rem;
}

.lightbox-content video {
  display: block;
  width: min(92vw, 68rem);
  max-width: 100%;
  max-height: 78vh;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: var(--border-radius-md);
  background: #101718;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@media (max-width: 900px) {
  .hero-film-card {
    grid-template-columns: 1fr;
  }

  .hero-film-meta {
    padding-top: 1.1rem;
    padding-bottom: 1.35rem;
  }
}

@media (max-width: 520px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .archive-layer-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-film-card video {
    aspect-ratio: 16 / 10;
    max-height: none;
  }
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.btn {
  font-family: var(--font-title);
  font-weight: 700;
  padding: 10px 24px;
  border-radius: var(--border-radius-lg);
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary {
  background: #f3f4f6;
  color: var(--color-text-muted);
}
.btn-secondary:hover {
  background: #cbd5e1;
  color: var(--color-text-dark);
}

.btn-primary {
  background: linear-gradient(135deg, var(--bonnie-primary), var(--ai-primary));
  color: white;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

/* Lightbox Details */
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  color: white;
  font-size: 3rem;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 800px;
  width: 90%;
  animation: modalSlideUp 0.3s ease;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lightbox-caption {
  margin-top: 16px;
  color: white;
  font-size: 1.1rem;
  text-align: center;
}

/* --- Footer --- */
.main-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-p {
  font-size: 0.95rem;
}

.footer-p-sub {
  font-size: 0.8rem;
  color: #4b5563;
}

/* --- Scroll Animation trigger --- */
.animate-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
  .hero-title {
    font-size: 2.6rem;
  }
  .kids-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: -30px auto 40px;
  }
  .ai-partner-banner-card {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  .ai-card-left {
    flex-direction: column;
  }
  .chat-container {
    grid-template-columns: 1fr;
  }
  .split-layout {
    grid-template-columns: 1fr;
  }
  .coding-controls {
    grid-template-columns: 1fr;
  }
  .timeline::after {
    left: 31px;
  }
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 20px;
  }
  .timeline-item.left, .timeline-item.right {
    left: 0;
  }
  .timeline-item::after {
    left: 20px;
    right: auto;
  }
  .timeline-item.right::after {
    left: 20px;
  }
  .timeline-item.left .timeline-badge, .timeline-item.right .timeline-badge {
    left: 12px;
    right: auto;
  }
  .soundboard-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .header-container {
    height: 70px;
  }
  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: white;
    flex-direction: column;
    padding: 30px;
    gap: 16px;
    z-index: 99;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: left 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .nav-menu.active {
    left: 0;
  }
  .nav-link {
    width: 100%;
    justify-content: center;
    font-size: 1.15rem;
    padding: 12px;
  }
  .mobile-toggle {
    display: block;
  }
  .hero-title {
    font-size: 2.1rem;
  }
  .banner-inner {
    flex-direction: column;
    text-align: center;
  }
  .piano {
    width: 100%;
    max-width: 480px;
  }
  .sub-tabs-container {
    flex-direction: column;
    align-items: stretch;
  }
  .gallery-header {
    flex-direction: column;
    text-align: center;
  }
  .photo-grid {
    grid-template-columns: 1fr;
  }
}

/* Photo wall entry on home */
.photo-entry-card {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.35rem 1.5rem;
  border-radius: 24px;
  background: linear-gradient(135deg, #fff8f3 0%, #f3f8ff 100%);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.photo-entry-card:hover,
.photo-entry-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
  outline: none;
}
.photo-entry-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.photo-entry-emoji {
  font-size: 2.4rem;
}
.photo-entry-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  color: #0f172a;
}
.photo-entry-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Safety + warm-up */
.safety-banner {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 0.92rem;
  line-height: 1.55;
}
.warmup-list {
  margin: 0.75rem 0 1rem 1.1rem;
  padding: 0;
  color: #334155;
  line-height: 1.7;
}
.warmup-list li {
  margin-bottom: 0.35rem;
}
.warm-up-card {
  background: linear-gradient(180deg, #fff5f7 0%, #ffffff 70%);
}
.rhythm-mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.sport-helper {
  margin-top: 0.85rem;
}

@media (max-width: 768px) {
  .photo-entry-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .rope-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   P1 · difficulty, piano follow, BGM dock, daily task
   ========================================================================== */
.difficulty-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.65rem 0 0.85rem;
  font-size: 0.9rem;
  color: var(--color-ink-muted);
}
.difficulty-row label { font-weight: 600; color: var(--color-ink); }
.piano-mode-row { margin-bottom: 0.5rem; }
.piano-follow-hint {
  font-size: 0.88rem;
  color: var(--color-ink-muted);
  margin: 0.35rem 0 0.75rem;
  min-height: 1.3em;
}
.piano-key.follow-next {
  box-shadow: 0 0 0 3px var(--archive-gold);
  outline: 2px solid var(--archive-gold);
  z-index: 2;
}
.piano-key.follow-ok {
  background: #cfe8d8 !important;
}
.piano-key.follow-miss {
  background: #f3d5d5 !important;
}
.rope-target-help {
  font-size: 0.85rem;
  color: var(--color-ink-muted);
  margin: 0.35rem 0 0.75rem;
}
.daily-task-card {
  margin-top: 1.25rem;
  border: var(--line);
  border-radius: var(--border-radius-md);
  padding: 1.1rem 1.25rem;
  background: #FFFCF6;
  box-shadow: var(--glass-shadow);
}
.daily-task-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}
.daily-task-date {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--archive-gold);
}
.daily-task-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-ink);
  margin: 0.35rem 0 0.75rem;
}
.daily-task-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.daily-stamp {
  display: inline-block;
  border: 2px solid var(--bonnie-primary);
  color: var(--bonnie-primary-hover);
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  transform: rotate(-4deg);
  background: rgba(199, 75, 110, 0.08);
}
.daily-task-note {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--color-ink-muted);
}
.bgm-dock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
}
.bgm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: var(--line);
  background: #FFFCF6;
  color: var(--color-ink);
  box-shadow: var(--glass-shadow);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.bgm-toggle[aria-pressed="true"] {
  background: var(--leo-primary);
  color: #fff;
  border-color: var(--leo-primary);
}
.bgm-toggle:focus-visible {
  outline: 2px solid var(--archive-gold);
  outline-offset: 3px;
}

/* P2 year return + AI status */
.ai-status-line {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-ink-muted);
  border-left: 3px solid var(--archive-gold);
  padding-left: 0.75rem;
}
.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.year-card {
  border: var(--line);
  border-radius: var(--border-radius-md);
  background: #FFFCF6;
  padding: 1.15rem 1.2rem 1.35rem;
  box-shadow: var(--glass-shadow);
}
.year-card h2 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}
.year-card-wide { grid-column: 1 / -1; }
.year-card .form-group { margin: 0.65rem 0; }
.year-card label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-ink-muted);
  margin-bottom: 0.25rem;
}
.year-card input[type="text"],
.year-card input[type="number"],
.year-card input[type="date"],
.year-card textarea,
.year-card select {
  width: 100%;
  border: var(--line);
  border-radius: var(--border-radius-sm);
  padding: 0.45rem 0.55rem;
  font-family: var(--font-body);
  background: #fff;
  color: var(--color-ink);
}
.year-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.year-list {
  list-style: none;
  margin-top: 0.75rem;
  padding: 0;
  font-size: 0.88rem;
  color: var(--color-ink-muted);
}
.year-list li {
  border-top: 1px dashed var(--archive-gold-line);
  padding: 0.45rem 0;
}
.star-map { margin-top: 0.75rem; }
.star-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 2rem;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0;
  font-size: 0.88rem;
}
.star-bar {
  display: block;
  height: 10px;
  min-width: 4px;
  background: var(--archive-gold);
  border-radius: 99px;
  opacity: 0.85;
}

/* Account bar + password form */
.header-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.account-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}
.account-user {
  font-size: 0.8rem;
  color: var(--color-ink-muted);
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-btn {
  min-height: 36px;
  padding: 0.35rem 0.65rem;
  border: var(--line);
  border-radius: var(--border-radius-sm);
  background: #fffcf6;
  color: var(--color-ink);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font-body);
}
.account-btn:hover {
  border-color: var(--archive-gold);
}
.pw-heading {
  margin-top: 1.25rem;
  font-size: 1.05rem;
}
#pw-msg {
  color: #8f304d;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}
#pw-msg.is-ok {
  color: #2f5d3a;
}

.chat-parent-tools {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--archive-gold-line);
}
.chat-store-note {
  display: block;
  font-size: 0.82rem;
  color: var(--color-ink-muted);
  margin-bottom: 0.45rem;
}

/* ---- Multi-user role chrome ---- */
.role-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: #efe4d2;
  color: var(--color-ink);
  border: 1px solid var(--archive-gold-line, #d8c3a2);
}
body.role-bonnie .role-chip { background: #f8e3ec; }
body.role-leo .role-chip { background: #dceaf7; }
body.role-admin .role-chip { background: #e8e4d8; }
body.role-bonnie .main-header { box-shadow: inset 0 -3px 0 #e8a0bf; }
body.role-leo .main-header { box-shadow: inset 0 -3px 0 #6ea8d6; }
body.role-admin .main-header { box-shadow: inset 0 -3px 0 #b8935f; }

.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #c45c7a;
  color: #fff;
  font-size: 0.7rem;
}

.wallpaper-strip { margin: 1rem 0 1.25rem; }
.wallpaper-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.wallpaper-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(140px, 180px);
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
}
.wallpaper-card {
  margin: 0;
  background: #fffcf6;
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  border-radius: 10px;
  overflow: hidden;
}
.wallpaper-card img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: #eee5d6;
}
.wallpaper-card figcaption {
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem 0.5rem;
  color: var(--color-ink-muted, #68716d);
}

.personal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}
.personal-chip {
  min-height: 40px;
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  border-radius: 999px;
  background: #fffcf6;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  font-family: inherit;
}

.media-toolbar,
.media-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 1rem;
}
.media-field { font-size: 0.85rem; color: var(--color-ink-muted, #68716d); }
.cute-input {
  min-height: 40px;
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  font: inherit;
  background: #fff;
}
.wallpaper-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.65rem;
  margin: 0.75rem 0;
}
.wp-pick {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.wp-pick img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  background: #eee5d6;
}
.year-accordion { display: grid; gap: 0.65rem; }
.year-acc-item {
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  border-radius: 10px;
  background: #fffcf6;
  padding: 0.35rem 0.75rem 0.75rem;
}
.year-acc-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.45rem 0;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.media-card {
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.media-card img,
.media-card video {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: #1a2a3a;
}
.media-card h4 {
  margin: 0.4rem 0.5rem 0;
  font-size: 0.92rem;
}
.media-card p {
  margin: 0.15rem 0.5rem 0.5rem;
  font-size: 0.78rem;
  color: var(--color-ink-muted, #68716d);
}

.messages-layout,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.msg-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  max-height: 420px;
  overflow: auto;
}
.msg-item {
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  background: #fff;
}
.msg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}
.msg-item p { margin: 0; white-space: pre-wrap; }
.msg-unread {
  color: #c45c7a;
  font-weight: 600;
}

/* Dress-up */
.dressup-layout {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 1rem;
  align-items: start;
}
.dressup-stage {
  background: linear-gradient(180deg, #f7eef3, #fff8f2);
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}
.du-figure {
  position: relative;
  width: 120px;
  height: 180px;
  margin: 0 auto 0.5rem;
}
.du-hair {
  position: absolute;
  left: 30px; top: 8px;
  width: 60px; height: 40px;
  border-radius: 40px 40px 12px 12px;
}
.du-face {
  position: absolute;
  left: 38px; top: 36px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #ffe0bd;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  color: #8a5a3a;
}
.du-top {
  position: absolute;
  left: 34px; top: 82px;
  width: 52px; height: 40px;
  border-radius: 10px 10px 6px 6px;
}
.du-skirt {
  position: absolute;
  left: 28px; top: 118px;
  width: 64px; height: 48px;
  border-radius: 4px 4px 28px 28px;
}
.du-acc {
  position: absolute;
  right: 10px; top: 20px;
  font-size: 1.25rem;
}
.dressup-controls {
  display: grid;
  gap: 0.55rem;
}
.dressup-controls label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.88rem;
}

/* Subway */
.subway-wrap { display: grid; gap: 0.5rem; }
#subway-canvas {
  width: 100%;
  max-width: 720px;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  background: #1a2a3a;
}
.subway-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.subway-keys { display: flex; gap: 0.5rem; }

@media (max-width: 720px) {
  .dressup-layout { grid-template-columns: 1fr; }
  .nav-menu .nav-link { font-size: 0.85rem; }
}

/* ===== Multi-user shell (roles / messages / media / games) ===== */
body.role-bonnie .account-bar { box-shadow: inset 0 -3px 0 #e87a90; }
body.role-leo .account-bar { box-shadow: inset 0 -3px 0 #5b9bd5; }
body.role-admin .account-bar { box-shadow: inset 0 -3px 0 #b8935f; }

.role-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: #fff6e8;
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  font-size: 0.78rem;
  color: var(--color-ink-muted, #68716d);
}
.nav-badge {
  display: inline-block;
  min-width: 1.1rem;
  margin-left: 0.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #c45c6a;
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.2rem;
  text-align: center;
}
.wallpaper-strip {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--archive-gold-line, #d8c3a2);
  border-radius: 12px;
  background: rgba(255,252,246,0.72);
}
.wallpaper-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.wallpaper-track {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.wallpaper-item {
  margin: 0;
  flex: 0 0 auto;
  width: 120px;
}
.wallpaper-item img {
  width: 120px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  background: #eee;
}
.wallpaper-item figcaption {
  font-size: 0.72rem;
  color: var(--color-ink-muted, #68716d);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.personal-home-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.personal-chip {
  min-height: 40px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  background: #fffcf6;
  cursor: pointer;
  font-family: inherit;
}
.personal-chip:hover { border-color: var(--archive-gold, #b8935f); }

.messages-layout,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.msg-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  max-height: 420px;
  overflow: auto;
}
.msg-item {
  border-top: 1px dashed var(--archive-gold-line, #d8c3a2);
  padding: 0.55rem 0;
}
.msg-item.is-unread { background: rgba(255, 244, 220, 0.55); }
.msg-meta { font-size: 0.8rem; color: var(--color-ink-muted, #68716d); margin-bottom: 0.25rem; }
.msg-body { font-size: 0.95rem; line-height: 1.45; white-space: pre-wrap; }
.empty-hint { color: var(--color-ink-muted, #68716d); font-size: 0.9rem; }

.media-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}
.media-field { display: grid; gap: 0.25rem; font-size: 0.85rem; }
.media-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.cute-input {
  min-height: 40px;
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  font-family: inherit;
  background: #fff;
}
.wallpaper-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}
.wp-pick {
  position: relative;
  width: 96px;
  height: 72px;
  display: block;
  cursor: pointer;
}
.wp-pick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
}
.wp-pick input {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 1;
}
.wp-pick input:checked + img { border-color: var(--archive-gold, #b8935f); }
.year-accordion details {
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
  background: #fffcf6;
}
.year-accordion summary {
  cursor: pointer;
  font-weight: 600;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.media-card {
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.media-card img,
.media-card video {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: #eee;
}
.media-card-meta {
  padding: 0.45rem 0.55rem 0.6rem;
  display: grid;
  gap: 0.25rem;
  font-size: 0.82rem;
}

.dressup-layout {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 1rem;
  align-items: start;
}
.dressup-stage {
  background: linear-gradient(180deg, #fff7fb, #f3f7ff);
  border-radius: 12px;
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.du-figure {
  position: relative;
  width: 120px;
  height: 200px;
}
.du-hair {
  position: absolute;
  top: 8px;
  left: 25px;
  width: 70px;
  height: 48px;
  border-radius: 40px 40px 18px 18px;
}
.du-hair[data-shape="pony"]::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 18px;
  width: 16px;
  height: 46px;
  background: inherit;
  border-radius: 10px;
}
.du-hair[data-shape="bun"]::before {
  content: "";
  position: absolute;
  left: 22px;
  top: -14px;
  width: 26px;
  height: 26px;
  background: inherit;
  border-radius: 50%;
}
.du-face {
  position: absolute;
  top: 40px;
  left: 38px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffe0bd;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  color: #7a4b2e;
}
.du-top {
  position: absolute;
  top: 88px;
  left: 30px;
  width: 60px;
  height: 48px;
  border-radius: 12px 12px 8px 8px;
}
.du-skirt {
  position: absolute;
  top: 132px;
  left: 22px;
  width: 76px;
  height: 52px;
  border-radius: 8px 8px 28px 28px;
}
.du-acc {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.75rem;
  background: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--archive-gold-line, #d8c3a2);
}
.du-caption { margin: 0.5rem 0 0; font-size: 0.85rem; text-align: center; }
.dressup-controls {
  display: grid;
  gap: 0.55rem;
}
.dressup-controls label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.88rem;
}

.subway-wrap { display: grid; gap: 0.55rem; }
#subway-canvas {
  width: 100%;
  max-width: 720px;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--archive-gold-line, #d8c3a2);
  background: #1b2a3a;
}
.subway-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.subway-keys { display: flex; gap: 0.5rem; }

#error.msg, .error.is-ok, #msg-send-status.is-ok, #media-upload-msg.is-ok, #wallpaper-msg.is-ok {
  color: #2f5d3a;
}

@media (max-width: 720px) {
  .dressup-layout { grid-template-columns: 1fr; }
  .nav-menu .nav-link { font-size: 0.82rem; }
}


/* ===== Premium games + artistic wallpaper ===== */
.wallpaper-art {
  margin-top: 1.1rem;
  padding: 1rem 1rem 1.25rem;
  border: 1px solid rgba(184, 147, 95, 0.35);
  border-radius: 16px;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 214, 170, 0.35), transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(200, 220, 255, 0.3), transparent 35%),
    linear-gradient(180deg, #fffaf1 0%, #f6efe3 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
}
.wallpaper-collage {
  position: relative;
  min-height: 280px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 96px;
  gap: 0.35rem 0.45rem;
  padding: 0.5rem 0.25rem 0.75rem;
  align-items: center;
  justify-items: center;
}
.art-frame {
  position: relative;
  width: min(100%, 150px);
  margin: 0;
  transform: rotate(var(--rot, 0deg));
  z-index: var(--z, 1);
  transition: transform .25s ease, z-index 0s;
  filter: drop-shadow(0 10px 14px rgba(40, 30, 15, 0.16));
}
.art-frame.is-wide {
  width: min(100%, 220px);
  grid-column: span 2;
}
.art-frame:hover {
  transform: rotate(0deg) scale(1.05);
  z-index: 20;
}
.art-mat {
  background: #fffdf8;
  border: 1px solid rgba(120, 90, 50, 0.22);
  padding: 7px;
  border-radius: 3px;
}
.art-mat img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 2px;
  background: #e9e2d6;
}
.art-frame.is-wide .art-mat img { height: 140px; }
.art-frame figcaption {
  text-align: center;
  font-size: 0.72rem;
  color: #6d6254;
  margin-top: 0.25rem;
  font-family: "Noto Serif SC", serif;
}
.frame-tape {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 46px;
  height: 16px;
  margin-left: -23px;
  background: rgba(255, 230, 150, 0.75);
  border: 1px solid rgba(200, 160, 60, 0.35);
  transform: rotate(-2deg);
  z-index: 2;
}

.premium-game-card { overflow: hidden; }
.du-premium {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 1rem;
  align-items: stretch;
}
.du-stage-wrap {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(184,147,95,0.3);
  background: #1b1b2f;
  min-height: 420px;
  display: grid;
  grid-template-rows: 1fr auto auto auto;
  justify-items: center;
  padding-bottom: 0.75rem;
}
.du-stage-bg {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #fff7fb, #f0e9ff 55%, #dfe7ff);
  transition: background .35s ease;
}
.du-stage-bg[data-theme="stage"] { background: radial-gradient(circle at 50% 20%, #ffe08a55, transparent 35%), linear-gradient(180deg,#2b2d42,#4a4e69); }
.du-stage-bg[data-theme="gym"] { background: linear-gradient(180deg,#e8f7ff,#bde0fe); }
.du-stage-bg[data-theme="party"] { background:
  radial-gradient(circle at 20% 30%, #ffadad88, transparent 25%),
  radial-gradient(circle at 80% 20%, #ffd6a588, transparent 25%),
  radial-gradient(circle at 50% 80%, #caffbf88, transparent 30%),
  linear-gradient(180deg,#fff0f5,#fde2e4); }
.du-stage-bg[data-theme="rain"] { background: linear-gradient(180deg,#caf0f8,#90e0ef 60%, #ade8f4); }
.du-stage-bg[data-theme="night"] { background: radial-gradient(circle at 70% 20%, #fff3, transparent 20%), linear-gradient(180deg,#10002b,#240046 50%, #5a189a); }
.du-avatar {
  position: relative;
  z-index: 2;
  width: min(100%, 260px);
  height: 360px;
  margin-top: 0.5rem;
  filter: drop-shadow(0 12px 16px rgba(0,0,0,.18));
}
.du-caption {
  position: relative;
  z-index: 2;
  margin: 0.25rem 0.75rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  color: #3d3a35;
  font-size: 0.86rem;
  text-align: center;
}
.du-stage-actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin: 0.35rem;
}
.du-stage-wrap .daily-task-note {
  position: relative;
  z-index: 2;
  color: #4a433a;
  margin: 0.15rem 0.75rem 0;
}
.du-stage-bg[data-theme="stage"] ~ .du-caption + .du-stage-actions + .daily-task-note,
.du-stage-bg[data-theme="night"] ~ .daily-task-note { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }

.du-shop {
  border: 1px solid rgba(184,147,95,0.28);
  border-radius: 16px;
  background: #fffcf6;
  padding: 0.75rem;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.65rem;
  min-height: 420px;
}
.du-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.du-tab {
  min-height: 36px;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #e2d3bc;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.86rem;
}
.du-tab.active { background: #22405c; color: #fff; border-color: #22405c; }
.du-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.5rem;
  align-content: start;
  overflow: auto;
  max-height: 300px;
}
.du-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0.4rem;
  align-items: center;
  min-height: 48px;
  padding: 0.4rem 0.5rem;
  border-radius: 12px;
  border: 1px solid #eadfcd;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  font-size: 0.84rem;
}
.du-item.is-on {
  border-color: #b8935f;
  box-shadow: 0 0 0 2px rgba(184,147,95,0.25);
  background: #fff8ec;
}
.du-swatch {
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
}
.du-swatch-icon {
  display: grid; place-items: center; background: #f0e6d6;
  font-weight: 700; color: #5c4a32;
}
.du-look-summary {
  font-size: 0.82rem; color: #6d6254;
  border-top: 1px dashed #e2d3bc; padding-top: 0.45rem;
}
.du-sparkles { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.du-spark {
  position: absolute; width: 8px; height: 8px; background: #ffe08a;
  border-radius: 50%; animation: duPop .65s ease forwards;
  box-shadow: 0 0 10px #ffe08a;
}
@keyframes duPop {
  0% { transform: scale(0); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: scale(1.8) translateY(-18px); opacity: 0; }
}

.subway-premium { display: grid; gap: 0.65rem; }
.subway-canvas-shell {
  position: relative; border-radius: 16px; overflow: hidden;
  border: 1px solid #1b263b; background: #0d1b2a;
  box-shadow: 0 12px 28px rgba(13,27,42,0.28);
}
#subway-canvas { width: 100%; height: auto; display: block; touch-action: none; }
.subway-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(8, 15, 25, 0.48); backdrop-filter: blur(2px);
}
.subway-overlay[hidden] { display: none !important; }
.subway-overlay-card {
  width: min(92%, 360px); background: rgba(255,252,246,0.95);
  border-radius: 16px; padding: 1.1rem 1.2rem 1.2rem; text-align: center;
  border: 1px solid rgba(184,147,95,0.35);
}
.subway-overlay-card h3 { margin: 0 0 0.4rem; }
.subway-overlay-card p { margin: 0 0 0.85rem; color: #5c564c; line-height: 1.5; }
.subway-hud-bar {
  display: flex; flex-wrap: wrap; gap: 0.65rem;
  align-items: center; justify-content: space-between;
}
.subway-stat {
  display: grid; gap: 0.1rem; min-width: 72px;
  padding: 0.35rem 0.55rem; border-radius: 10px;
  background: #f4f7fb; border: 1px solid #d5deea;
  font-size: 0.78rem; color: #5b6b7c;
}
.subway-stat strong { font-size: 1.1rem; color: #1b2838; }
.subway-keys { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.subway-keys .canvas-btn { min-width: 52px; min-height: 44px; font-size: 1rem; }

@media (max-width: 900px) {
  .du-premium { grid-template-columns: 1fr; }
  .wallpaper-collage {
    grid-template-columns: repeat(3, 1fr);
    min-height: 340px;
  }
  .art-frame.is-wide { grid-column: span 1; width: min(100%, 160px); }
}


/* Full commercial game embeds */
.game-embed-shell {
  display: grid;
  gap: 0.65rem;
}
.game-embed-frame {
  width: 100%;
  min-height: 720px;
  height: min(82vh, 860px);
  border: 0;
  border-radius: 16px;
  background: #fff5ee;
  box-shadow: 0 12px 28px rgba(40,30,20,0.12);
}
.game-embed-frame-tall {
  min-height: 760px;
  height: min(86vh, 920px);
  background: #0b1020;
}
.game-embed-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
