:root {
  --navy: #1e3a8a;
  --red: #b91c1c;
  --gold: #fbbf24;
  --ink: #0f172a;
  --muted: #64748b;
  --card: #ffffff;
  --bg: #0b1220;
  --panel: #111827;
  --line: #1f2937;
  --ok: #22c55e;
  --pup: #22c55e;
  --teen: #f59e0b;
  --adult: #3b82f6;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; min-height: 100%; min-height: 100dvh;
  background: var(--bg); color: #e2e8f0;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
a { color: #93c5fd; }
button, input, select { font: inherit; touch-action: manipulation; }
.hidden { display: none !important; }

.app-shell {
  max-width: 980px; margin: 0 auto;
  padding: 0.75rem 0.75rem calc(4.5rem + env(safe-area-inset-bottom, 0px));
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
  padding-top: max(0.75rem, env(safe-area-inset-top));
}

/* Top bar */
.topbar {
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--navy), #4c1d95 55%, var(--red));
  border-radius: var(--radius); padding: 0.9rem 1.1rem; box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.brand { display: flex; flex-direction: column; gap: 0.15rem; }
.brand strong { font-size: 1.15rem; letter-spacing: 0.02em; }
.brand span { font-size: 0.82rem; opacity: 0.9; }
.hud { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.pill {
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px; padding: 0.35rem 0.75rem; font-size: 0.85rem; font-weight: 700;
}
.pill.gold { background: rgba(251,191,36,0.2); border-color: rgba(251,191,36,0.5); color: #fde68a; }
.xp-bar {
  width: 140px; height: 10px; background: rgba(0,0,0,0.35); border-radius: 999px; overflow: hidden;
}
.xp-bar > i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), #fde68a); }

/* Screens */
.screen {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow); min-height: 420px;
}
.screen h1, .screen h2 { margin: 0 0 0.5rem; color: #fff; }
.lead { color: #94a3b8; margin: 0 0 1.25rem; line-height: 1.5; }

/* Age select cards */
.age-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.85rem;
}
.age-card {
  text-align: left; cursor: pointer; border: 1px solid var(--line); border-radius: 14px;
  padding: 1rem; background: #0b1220; color: inherit; transition: 0.15s transform, border-color;
}
.age-card:hover { transform: translateY(-2px); border-color: #475569; }
.age-card .tag {
  display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 0.2rem 0.5rem; border-radius: 999px; margin-bottom: 0.5rem;
}
.age-card.puppy .tag { background: rgba(34,197,94,0.2); color: #86efac; }
.age-card.adolescent .tag { background: rgba(245,158,11,0.2); color: #fcd34d; }
.age-card.adult .tag { background: rgba(59,130,246,0.2); color: #93c5fd; }
.age-card h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.age-card p { margin: 0; color: #94a3b8; font-size: 0.9rem; line-height: 1.45; }

/* Map */
.map-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.map-path {
  display: grid; gap: 0.75rem;
}
.map-node {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.85rem; align-items: center;
  background: #0b1220; border: 1px solid var(--line); border-radius: 14px; padding: 0.85rem 1rem;
}
.map-node.locked { opacity: 0.55; }
.map-node.done { border-color: rgba(34,197,94,0.45); }
.map-node .pin {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.4rem; background: #1e293b;
}
.map-node h4 { margin: 0 0 0.2rem; font-size: 1rem; }
.map-node .meta { color: #94a3b8; font-size: 0.82rem; }
.btn {
  appearance: none; border: none; border-radius: 999px; padding: 0.65rem 1.1rem;
  min-height: 44px; font-weight: 800; cursor: pointer; background: var(--gold); color: #1c1917;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: #e2e8f0; border: 1px solid #475569; }
.btn.navy { background: var(--navy); color: #fff; }
.btn.red { background: var(--red); color: #fff; }
.btn.gold { background: var(--gold); color: #1c1917; }
.btn.block { width: 100%; }

/* Lesson / cartoon stage */
.stage {
  background: radial-gradient(ellipse at 50% 20%, #1e3a8a 0%, #0b1220 55%);
  border: 1px solid var(--line); border-radius: 14px; padding: 1rem; min-height: 220px;
  display: grid; place-items: center; text-align: center; margin-bottom: 1rem; position: relative;
  overflow: hidden;
}
.stage.stage-cine {
  padding: 0.75rem; min-height: 0; display: block; text-align: left;
  background: #050a14;
}

/* Premium cinematic action demos — GPU dual-buffer (smoothest performance path) */
.cinematic { width: 100%; }
.cine-chrome {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center;
  justify-content: space-between; margin-bottom: 0.55rem; padding: 0 0.15rem;
}
.cine-badge {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: #fde68a; background: rgba(251,191,36,0.15); border: 1px solid rgba(251,191,36,0.4);
  border-radius: 999px; padding: 0.25rem 0.6rem;
}
.cine-title { font-weight: 800; color: #e2e8f0; font-size: 0.95rem; }
.cine-stage {
  position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden;
  background: #0b1220; border: 1px solid #334155; box-shadow: var(--shadow);
  /* promote to GPU layer for smooth fades */
  transform: translateZ(0);
  contain: layout paint;
}
.cine-canvas {
  display: block; width: 100%; height: 100%;
  background: #0b1220;
  /* hard-cut flipbook — no CSS crossfade (that looked like a slideshow) */
}
.cine-vignette {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.22) 100%);
}
.cine-video {
  width: 100%; height: 100%; object-fit: cover; background: #000; display: block;
}
.cine-stage-video { border: 1px solid #334155; }
.cine-beat {
  display: flex; align-items: center; gap: 0.65rem; margin: 0.65rem 0 0.35rem; padding: 0 0.1rem;
}
.cine-beat span {
  flex-shrink: 0; font-weight: 800; color: #fde68a; font-size: 0.88rem;
}
.cine-beat #cine-label { min-width: 5.5rem; }
.cine-step { color: #94a3b8 !important; font-size: 0.8rem !important; font-weight: 700 !important; }
.cine-progress {
  flex: 1; height: 6px; background: #1f2937; border-radius: 999px; overflow: hidden;
}
.cine-progress > i {
  display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), #fde68a);
  will-change: width;
}
.cinematic .caption {
  margin: 0.35rem 0 0; padding: 0 0.15rem; text-align: left; max-width: none;
  color: #cbd5e1; font-size: 0.98rem;
}
.cine-controls {
  display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.65rem; padding: 0 0.1rem;
}
@media (prefers-reduced-motion: reduce) {
  .cine-layer, .cine-layer.on {
    animation: none !important;
    transition: opacity 0.2s linear;
    transform: none !important;
  }
}
.lesson-caption {
  text-align: center; color: #94a3b8; font-size: 0.9rem; margin: 0.35rem 0 0;
}

/* Camera practice coach (Phase 1) */
.practice-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem; margin-top: 0.75rem;
}
.practice-card {
  text-align: left; background: #0b1220; border: 1px solid #334155; border-radius: 14px;
  padding: 0.95rem; color: #e2e8f0; cursor: pointer;
}
.practice-card:hover { border-color: rgba(251,191,36,0.5); transform: translateY(-1px); }
.practice-card.done { border-color: rgba(34,197,94,0.45); }
.practice-card h3 { margin: 0 0 0.35rem; font-size: 1.02rem; }
.practice-card p { margin: 0; color: #94a3b8; font-size: 0.88rem; line-height: 1.4; }
.practice-stage {
  position: relative; width: 100%; aspect-ratio: 4/3; max-height: 70vh;
  background: #000; border-radius: 14px; overflow: hidden; border: 1px solid #334155;
  margin: 0.75rem 0;
}
.prac-video, .prac-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.prac-video { opacity: 0; }
.prac-video.live { opacity: 0; } /* canvas shows annotated feed */
.prac-canvas { opacity: 1; background: #0b1220; }
.prac-hud {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 0.65rem 0.75rem 0.75rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}
.prac-status {
  font-weight: 800; font-size: 0.95rem; color: #fde68a; margin-bottom: 0.4rem;
  text-shadow: 0 1px 2px #000;
}
.prac-status.ok { color: #86efac; }
.prac-hold {
  height: 8px; background: rgba(255,255,255,0.15); border-radius: 999px; overflow: hidden;
  margin-bottom: 0.45rem;
}
.prac-hold > i {
  display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #22c55e, #fbbf24);
  transition: width 0.12s linear;
}
.prac-checks { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.prac-chip {
  font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 999px;
  background: rgba(51,65,85,0.9); color: #94a3b8; border: 1px solid #475569;
}
.prac-chip.ok { background: rgba(34,197,94,0.2); color: #86efac; border-color: rgba(34,197,94,0.5); }
.cartoon-frame {
  width: min(280px, 80%); aspect-ratio: 1; border-radius: 24px;
  background: linear-gradient(160deg, #fef3c7, #fdba74 40%, #f97316);
  border: 4px solid #fff; box-shadow: var(--shadow);
  display: grid; place-items: center; font-size: 4.5rem;
  animation: pop 0.45s ease;
}
.cartoon-frame.pup { background: linear-gradient(160deg, #dcfce7, #86efac 50%, #22c55e); }
.cartoon-frame.teen { background: linear-gradient(160deg, #fef3c7, #fbbf24 50%, #f59e0b); }
.cartoon-frame.adult { background: linear-gradient(160deg, #dbeafe, #60a5fa 50%, #2563eb); }
@keyframes pop {
  from { transform: scale(0.85); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}
.caption {
  margin-top: 0.85rem; max-width: 36rem; color: #e2e8f0; font-size: 1.05rem; line-height: 1.45;
}
.dots { display: flex; gap: 0.35rem; justify-content: center; margin: 0.75rem 0 0; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #334155; }
.dots i.on { background: var(--gold); }

/* Quiz */
.quiz-card {
  background: #0b1220; border: 1px solid var(--line); border-radius: 14px; padding: 1rem; margin-bottom: 0.75rem;
}
.quiz-card h3 { margin: 0 0 0.75rem; font-size: 1.05rem; color: #fff; }
.choices { display: grid; gap: 0.5rem; }
.choice {
  text-align: left; padding: 0.7rem 0.85rem; border-radius: 12px; border: 1px solid #334155;
  background: #111827; color: #e2e8f0; cursor: pointer;
}
.choice:hover { border-color: #64748b; }
.choice.correct { border-color: var(--ok); background: rgba(34,197,94,0.12); }
.choice.wrong { border-color: #ef4444; background: rgba(239,68,68,0.12); }
.why { margin-top: 0.65rem; color: #86efac; font-size: 0.92rem; }

/* Paywall */
.paywall {
  text-align: center; padding: 1.5rem 1rem; border: 1px dashed #7f1d1d; border-radius: 14px;
  background: linear-gradient(180deg, rgba(185,28,28,0.15), rgba(30,58,138,0.2));
}
.paywall .lock { font-size: 2.5rem; }
.plans {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem;
  margin: 1rem 0; text-align: left;
}
.plan {
  background: #0b1220; border: 1px solid #334155; border-radius: 12px; padding: 0.9rem;
}
.plan.featured { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(251,191,36,0.3); }
.plan h4 { margin: 0 0 0.25rem; }
.plan .price { font-size: 1.4rem; font-weight: 800; color: var(--gold); }
.plan ul { margin: 0.5rem 0 0; padding-left: 1.1rem; color: #94a3b8; font-size: 0.88rem; }

/* Result toast */
.result {
  text-align: center; padding: 1.25rem;
}
.result .big { font-size: 2.5rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 1rem; }

.footer-note {
  margin-top: 1rem; text-align: center; color: #64748b; font-size: 0.82rem;
}
.footer-note a { color: #93c5fd; }

/* Mobile bottom dock */
.mobile-dock {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(11, 18, 32, 0.94);
  border-top: 1px solid #1f2937;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  justify-content: space-around; align-items: stretch; gap: 0.2rem;
}
.dock-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.1rem; min-height: 52px; border: none; background: transparent; color: #94a3b8;
  font-size: 0.68rem; font-weight: 800; border-radius: 12px; cursor: pointer; padding: 0.25rem;
}
.dock-btn .dock-ico { font-size: 1.2rem; line-height: 1; }
.dock-btn.active, .dock-btn:active { color: #fde68a; background: rgba(251,191,36,0.1); }
.dock-btn.dock-primary { color: #fbbf24; }
.dock-btn.dock-primary.active { background: rgba(251,191,36,0.18); }

/* Ridge Points + merch rewards */
.rp-strip {
  display: flex; flex-wrap: wrap; gap: 0.65rem 1.25rem; align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(251,191,36,0.12), rgba(30,58,138,0.25));
  border: 1px solid rgba(251,191,36,0.35); border-radius: 12px;
  padding: 0.65rem 0.9rem; margin: 0.75rem 0 1rem; font-size: 0.88rem; color: #e2e8f0;
}
.rp-strip strong { color: #fde68a; }
.rp-toast {
  background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.4);
  color: #86efac; border-radius: 12px; padding: 0.6rem 0.85rem; margin: 0 0 0.75rem;
  font-weight: 700; font-size: 0.92rem;
}
.merch-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem; margin-top: 0.5rem;
}
.merch-card {
  display: flex; gap: 0.75rem; background: #0b1220; border: 1px solid #334155;
  border-radius: 14px; padding: 0.9rem; align-items: flex-start;
}
.merch-card:hover { border-color: rgba(251,191,36,0.45); }
.merch-emoji {
  font-size: 2rem; width: 3rem; height: 3rem; display: grid; place-items: center;
  background: rgba(251,191,36,0.12); border-radius: 12px; flex-shrink: 0;
}
.merch-body { flex: 1; min-width: 0; }
.merch-body h4 { margin: 0 0 0.25rem; font-size: 1rem; }
.merch-body p { margin: 0; color: #94a3b8; font-size: 0.88rem; line-height: 1.4; }
.merch-meta { margin-top: 0.4rem !important; color: #cbd5e1 !important; font-size: 0.82rem !important; }
.merch-body .btn { margin-top: 0.65rem; }
.redeem-log { display: grid; gap: 0.4rem; }
.redeem-row {
  background: #0b1220; border: 1px solid #1f2937; border-radius: 10px;
  padding: 0.55rem 0.75rem; font-size: 0.85rem; color: #94a3b8;
}

/* Virtual trail buddy (Tamagotchi-style) */
.vpet-screen .vpet-h3 { margin: 1rem 0 0.35rem; color: #fde68a; font-size: 1rem; }
/* .vpet-stage rules live with digidog styles below */
/* Photo panel (Trail Pass) */
.vpet-photo-panel {
  margin: 0.65rem 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.28), rgba(15, 23, 42, 0.85));
}
.vpet-photo-panel.locked {
  border-color: rgba(100, 116, 139, 0.45);
  background: rgba(15, 23, 42, 0.65);
}
.vpet-photo-label {
  margin: 0 0 0.25rem; color: #fde68a; font-size: 0.92rem;
}
.vpet-photo-panel.locked .vpet-photo-label { color: #cbd5e1; }
.vpet-photo-actions {
  display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center;
}
.vpet-photo-upload {
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  margin: 0;
}

/* ═══════════════════════════════════════════
   Digital dog · Tamagotchi device (not emoji)
   ═══════════════════════════════════════════ */
.tama-device {
  display: flex;
  justify-content: center;
  margin: 0.35rem auto 0.65rem;
  max-width: 100%;
}
.tama-bezel {
  background: linear-gradient(160deg, #2a3344 0%, #151b27 45%, #0c1018 100%);
  border-radius: 28px;
  padding: 0.65rem 0.75rem 0.8rem;
  border: 2px solid #3d4a5c;
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 8px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 280px;
}
.tama-device.size-camp .tama-bezel {
  max-width: 132px;
  border-radius: 18px;
  padding: 0.4rem 0.45rem 0.5rem;
}
.tama-device.size-compact .tama-bezel {
  max-width: 160px;
  border-radius: 20px;
  padding: 0.45rem 0.5rem 0.55rem;
}
.tama-brand {
  text-align: center;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #64748b;
  margin-bottom: 0.35rem;
}
.tama-device.size-camp .tama-brand {
  font-size: 0.48rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.2rem;
}
.tama-lcd {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 20%, #1a3a2a 0%, #0a1f14 55%, #06120c 100%);
  border: 2px solid #1e3d2a;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(134, 239, 172, 0.08);
  aspect-ratio: 1;
  min-height: 0;
}
.tama-device.size-vpet .tama-lcd { min-height: 200px; }
.tama-device.size-camp .tama-lcd {
  border-radius: 10px;
  aspect-ratio: 1;
}
.tama-lcd-scan {
  pointer-events: none;
  position: absolute; inset: 0; z-index: 2;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.55;
}
.tama-btns {
  display: flex;
  justify-content: center;
  gap: 1.1rem;
  margin-top: 0.55rem;
}
.tama-device.size-camp .tama-btns { gap: 0.55rem; margin-top: 0.35rem; }
.tama-btn {
  width: 1.35rem; height: 1.35rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #475569, #1e293b);
  border: 2px solid #0f172a;
  box-shadow: 0 2px 0 #020617, inset 0 1px 0 rgba(255,255,255,0.12);
}
.tama-btn.mid {
  background: radial-gradient(circle at 35% 30%, #fbbf24, #b45309);
  border-color: #78350f;
}
.tama-device.size-camp .tama-btn { width: 0.7rem; height: 0.7rem; border-width: 1px; }

.digidog-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  padding: 4% 2% 2%;
}
.digidog-root {
  width: 88%;
  max-width: 220px;
  aspect-ratio: 1;
  position: relative;
}
.tama-device.size-camp .digidog-root { width: 92%; max-width: none; }
.dd-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.digidog-status-row {
  display: none; /* reserved LCD chrome */
}

/* —— Animations by pose —— */
.digidog-root.pose-idle .dd-body-g,
.digidog-root.pose-idle .dd-head-g {
  animation: dd-bob 2.4s ease-in-out infinite;
  transform-origin: 60px 100px;
  transform-box: fill-box;
}
.digidog-root.pose-idle .dd-tail-g {
  animation: dd-wag 0.7s ease-in-out infinite;
  transform-origin: 88px 72px;
}
@keyframes dd-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes dd-wag {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(14deg); }
}

/* Eat */
.digidog-root.pose-eat .dd-fx-food { opacity: 1 !important; animation: dd-food 0.7s ease infinite; }
.digidog-root.pose-eat .dd-head-g { animation: dd-nibble 0.45s ease infinite; transform-origin: 60px 42px; }
.digidog-root.pose-eat .dd-tongue {
  transform: scale(3.2);
  transform-origin: 60px 57px;
  animation: dd-tongue 0.45s ease infinite;
}
@keyframes dd-food {
  0%, 100% { transform: translate(0, 0); opacity: 1; }
  50% { transform: translate(-10px, 4px); opacity: 0.85; }
}
@keyframes dd-nibble {
  0%, 100% { transform: rotate(0); }
  50% { transform: rotate(-6deg) translateY(2px); }
}
@keyframes dd-tongue {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Play */
.digidog-root.pose-play .dd-body-g { animation: dd-bounce 0.5s ease infinite; transform-origin: 60px 100px; }
.digidog-root.pose-play .dd-fx-ball { opacity: 1 !important; animation: dd-ball 0.55s ease infinite; }
.digidog-root.pose-play .dd-fx-hearts { opacity: 1 !important; }
.digidog-root.pose-play .dd-tail-g { animation: dd-wag 0.28s ease-in-out infinite; transform-origin: 88px 72px; }
@keyframes dd-bounce {
  0%, 100% { transform: translateY(0) scaleY(1); }
  40% { transform: translateY(-10px) scaleY(1.04); }
  70% { transform: translateY(2px) scaleY(0.96); }
}
@keyframes dd-ball {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-6px, -14px); }
}

/* Sleep */
.digidog-root.pose-sleep .dd-body-g { animation: dd-sleep-sway 3s ease-in-out infinite; }
.digidog-root.pose-sleep .dd-fx-zzz { opacity: 1 !important; animation: dd-zzz 2s ease-in-out infinite; }
.digidog-root.pose-sleep .dd-eye.left,
.digidog-root.pose-sleep .dd-eye.right {
  transform: scaleY(0.18);
  transform-origin: center;
}
.digidog-root.pose-sleep .dd-pupil { opacity: 0; }
@keyframes dd-sleep-sway {
  0%, 100% { transform: translateY(2px); }
  50% { transform: translateY(0); }
}
@keyframes dd-zzz {
  0%, 100% { opacity: 0.5; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* Sit */
.digidog-root.pose-sit .dd-body-g {
  transform: translateY(8px) scaleY(0.88);
  transform-origin: 60px 105px;
}
.digidog-root.pose-sit .dd-legs-front {
  transform: translateY(-4px) scaleY(0.55);
  transform-origin: 60px 100px;
}
.digidog-root.pose-sit .dd-fx-hearts { opacity: 0.9 !important; }
.digidog-root.pose-sit .dd-tail-g { animation: dd-wag 0.9s ease-in-out infinite; transform-origin: 88px 72px; }

/* Look / focus */
.digidog-root.pose-look .dd-pupil { animation: dd-look 1.2s ease-in-out infinite; }
.digidog-root.pose-look .dd-sparkle { opacity: 1 !important; animation: dd-spark 1s ease infinite; }
.digidog-root.pose-look .dd-head-g { animation: dd-tilt 2s ease-in-out infinite; transform-origin: 60px 42px; }
@keyframes dd-look {
  0%, 100% { transform: translate(0, 0); }
  40% { transform: translate(1.5px, -1px); }
  70% { transform: translate(-1px, 0); }
}
@keyframes dd-spark {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes dd-tilt {
  0%, 100% { transform: rotate(0); }
  50% { transform: rotate(-4deg); }
}

/* Mat settle */
.digidog-root.pose-mat .dd-fx-mat { opacity: 1 !important; }
.digidog-root.pose-mat .dd-body-g { transform: translateY(6px) scaleY(0.92); transform-origin: 60px 100px; }
.digidog-root.pose-mat .dd-head-g { transform: translateY(8px); }
.digidog-root.pose-mat .dd-eye.left ellipse,
.digidog-root.pose-mat .dd-eye.right ellipse { ry: 2.5; }

/* Sad */
.digidog-root.pose-sad .dd-mouth.smile { opacity: 0; }
.digidog-root.pose-sad .dd-mouth.sad { opacity: 1 !important; }
.digidog-root.pose-sad .dd-ear.left { transform: rotate(12deg); transform-origin: 38px 36px; }
.digidog-root.pose-sad .dd-ear.right { transform: rotate(-12deg); transform-origin: 82px 36px; }
.digidog-root.pose-sad .dd-tail-g { transform: rotate(25deg); transform-origin: 88px 72px; }
.digidog-root.pose-sad .dd-body-g { animation: dd-sad-bob 2.8s ease-in-out infinite; }
@keyframes dd-sad-bob {
  0%, 100% { transform: translateY(1px); }
  50% { transform: translateY(0); }
}

/* Success */
.digidog-root.pose-success .dd-fx-hearts { opacity: 1 !important; animation: dd-spark 0.8s ease infinite; }
.digidog-root.pose-success .dd-body-g { animation: dd-bounce 0.55s ease 3; transform-origin: 60px 100px; }
.digidog-root.pose-success .dd-tail-g { animation: dd-wag 0.25s ease-in-out infinite; transform-origin: 88px 72px; }
.digidog-root.pose-success .dd-tongue {
  transform: scale(3.2);
  transform-origin: 60px 57px;
}

/* Mood tints on LCD */
.digidog-root.mood-sad .dd-body,
.digidog-root.mood-sad .dd-head { filter: saturate(0.75) brightness(0.92); }
.digidog-root.mood-happy .dd-tail-g { animation-duration: 0.45s; }

/* Hide cartoon eyes when real photo is on face */
.digidog-root.has-photo .dd-eyes.with-photo { opacity: 0; }
.digidog-root.has-photo .dd-snout { opacity: 0.35; }

/* Camp card layout with device */
.camp-buddy-card .tama-device {
  grid-row: 1 / 3;
  margin: 0;
  align-self: center;
  justify-self: start;
}
.camp-buddy-card .tama-device.size-camp {
  width: 5.75rem;
  min-width: 5.75rem;
}
.camp-buddy-card {
  align-items: center;
}

/* Vpet stage hosts the device cleanly */
.vpet-stage {
  text-align: center;
  background: radial-gradient(ellipse at 50% 30%, #132038 0%, #0b1220 70%);
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 1rem 0.75rem 1.1rem;
  margin: 0.75rem 0;
}
.vpet-stage.train { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.vpet-stage.compact { min-height: 0; padding: 0.65rem; margin: 0.65rem 0; }
.vpet-stage.compact .tama-device { margin-bottom: 0; }

/* Soften long text: collapsible learning banner */
.vpet-learn-banner details summary {
  cursor: pointer;
  color: #86efac;
  font-weight: 800;
  list-style: none;
}
.vpet-learn-banner details summary::-webkit-details-marker { display: none; }
.vpet-name-row {
  display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; align-items: center; margin-bottom: 0.35rem;
}
.vpet-name-row input {
  max-width: 10rem; border-radius: 999px; border: 1px solid #334155; background: #0b1220;
  color: #fff; padding: 0.45rem 0.75rem; text-align: center; font-weight: 800;
}
.vpet-stage-tag { margin: 0; font-weight: 800; color: #93c5fd; font-size: 0.9rem; }
.vpet-mood { margin: 0.35rem 0 0; color: #cbd5e1; font-size: 0.92rem; }
.vpet-cue-call {
  margin: 0.75rem 0 0.25rem; font-size: 1.6rem; font-weight: 900; color: #fbbf24;
  letter-spacing: 0.02em;
}
.vpet-stats { display: grid; gap: 0.45rem; margin: 0.5rem 0 0.75rem; }
.vpet-stat {
  display: grid; grid-template-columns: 4.2rem 1fr 2.2rem; gap: 0.4rem; align-items: center;
  font-size: 0.82rem; color: #94a3b8;
}
.vpet-stat em { font-style: normal; font-weight: 800; color: #e2e8f0; text-align: right; }
.vpet-bar {
  height: 10px; background: #1f2937; border-radius: 999px; overflow: hidden;
}
.vpet-bar > i { display: block; height: 100%; border-radius: 999px; }
.vpet-bar > i.h { background: linear-gradient(90deg, #f97316, #fbbf24); }
.vpet-bar > i.e { background: linear-gradient(90deg, #3b82f6, #22d3ee); }
.vpet-bar > i.y { background: linear-gradient(90deg, #ec4899, #f472b6); }
.vpet-bar > i.f { background: linear-gradient(90deg, #22c55e, #a3e635); }
.vpet-cues {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.55rem;
}
.vpet-cue-card {
  text-align: left; border: 1px solid #334155; background: #0b1220; color: #e2e8f0;
  border-radius: 14px; padding: 0.75rem; cursor: pointer; min-height: 64px;
}
.vpet-cue-card strong { display: block; margin-bottom: 0.2rem; }
.vpet-cue-card span { font-size: 0.8rem; color: #94a3b8; }
.vpet-cue-card:active, .vpet-cue-card:hover { border-color: rgba(251,191,36,0.5); }
.vpet-window {
  height: 10px; background: #1f2937; border-radius: 999px; overflow: hidden;
  margin: 0.85rem auto 0; max-width: 240px;
}
.vpet-window > i {
  display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #22c55e, #fbbf24);
}
#btn-mark.pulse {
  animation: mark-pulse 0.55s ease-in-out infinite alternate;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.35);
}
@keyframes mark-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

.vpet-learn-banner {
  background: linear-gradient(135deg, rgba(30,58,138,0.35), rgba(34,197,94,0.12));
  border: 1px solid rgba(34,197,94,0.35); border-radius: 14px;
  padding: 0.85rem 1rem; margin: 0 0 0.85rem; color: #cbd5e1; font-size: 0.9rem; line-height: 1.45;
}
.vpet-learn-banner strong { color: #86efac; }
.vpet-learn-banner ol { margin: 0.5rem 0 0; padding-left: 1.15rem; }
.vpet-learn-banner li { margin: 0.25rem 0; }
.vpet-goal {
  display: block; color: #94a3b8; font-size: 0.8rem; line-height: 1.35; margin: 0.25rem 0 0.4rem;
}
.vpet-mastery {
  height: 6px; background: #1f2937; border-radius: 999px; overflow: hidden; margin: 0.35rem 0;
}
.vpet-mastery > i {
  display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #fbbf24); border-radius: 999px;
}
.vpet-lesson-card {
  background: #0b1220; border: 1px solid #334155; border-radius: 14px; padding: 1rem; margin-top: 0.5rem;
}
.vpet-lesson-card h3 { margin: 0.35rem 0 0.65rem; color: #fff; font-size: 1.05rem; line-height: 1.35; }
.vpet-lesson-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; color: #fde68a; background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.35); border-radius: 999px; padding: 0.2rem 0.55rem;
}
.vpet-choices { display: grid; gap: 0.45rem; margin: 0.5rem 0; }
.vpet-choice {
  text-align: left; padding: 0.75rem 0.85rem; border-radius: 12px; border: 1px solid #334155;
  background: #111827; color: #e2e8f0; cursor: pointer; font-weight: 600; font-size: 0.9rem;
  min-height: 48px; line-height: 1.35;
}
.vpet-choice:hover { border-color: #64748b; }
.vpet-choice.correct { border-color: #22c55e; background: rgba(34,197,94,0.12); }
.vpet-choice.wrong { border-color: #ef4444; background: rgba(239,68,68,0.12); }
.vpet-choice:disabled { cursor: default; opacity: 0.95; }
.vpet-feedback {
  margin: 0.5rem 0; padding: 0.65rem 0.75rem; border-radius: 10px; font-size: 0.9rem; line-height: 1.4;
}
.vpet-feedback.ok { background: rgba(34,197,94,0.12); color: #86efac; border: 1px solid rgba(34,197,94,0.35); }
.vpet-feedback.bad { background: rgba(251,191,36,0.1); color: #fde68a; border: 1px solid rgba(251,191,36,0.3); }
.vpet-takeaways { margin: 0.5rem 0 0.75rem; padding-left: 1.2rem; color: #cbd5e1; line-height: 1.45; }
.vpet-takeaways li { margin: 0.3rem 0; }
.vpet-journal { margin-top: 1rem; }
.vpet-journal-card {
  background: #0b1220; border: 1px solid #1f2937; border-radius: 12px; padding: 0.75rem; margin: 0.45rem 0;
  font-size: 0.88rem; color: #94a3b8;
}
.vpet-journal-card strong { color: #fde68a; display: block; margin-bottom: 0.3rem; }
.vpet-journal-card ul { margin: 0; padding-left: 1.1rem; }
.vpet-stage.compact { min-height: 0; padding: 0.65rem; margin: 0.65rem 0; }
.vpet-stage.compact .vpet-sprite { font-size: 2.8rem; margin: 0; animation: none; }

/* Install / beta banner */
.install-banner {
  display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center; justify-content: space-between;
  max-width: 980px; margin: 0 auto 0.65rem; padding: 0.65rem 0.85rem;
  background: linear-gradient(90deg, rgba(30,58,138,0.95), rgba(76,29,149,0.9));
  border: 1px solid rgba(251,191,36,0.4); border-radius: 12px;
  position: sticky; top: 0; z-index: 60;
}
.install-banner.hidden { display: none !important; }
.install-banner strong { display: block; color: #fff; font-size: 0.95rem; }
.install-banner span { display: block; color: #fde68a; font-size: 0.78rem; margin-top: 0.1rem; }
.install-banner-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.install-banner .btn { min-height: 40px; padding: 0.45rem 0.85rem; font-size: 0.85rem; }
.install-banner a.btn { display: inline-flex; align-items: center; text-decoration: none; }

/* —— Hypervig Hank helper —— */
#hank-trainer-root { position: relative; z-index: 80; }
.hank-fab {
  position: fixed; right: max(0.75rem, env(safe-area-inset-right));
  bottom: max(4.6rem, calc(3.8rem + env(safe-area-inset-bottom)));
  z-index: 90; display: flex; align-items: center; gap: 0.4rem;
  border: 2px solid rgba(251,191,36,0.55); border-radius: 999px;
  background: linear-gradient(135deg, #1e3a8a, #4c1d95); color: #fde68a;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem; cursor: pointer;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45); font-weight: 800; font-size: 0.85rem;
  min-height: 52px;
}
.hank-fab img { width: 40px; height: 40px; border-radius: 50%; background: #0b1220; object-fit: cover; }
.hank-fab.open { border-color: #22c55e; }
.hank-fab-label { padding-right: 0.25rem; }
.hank-panel {
  position: fixed; right: max(0.5rem, env(safe-area-inset-right));
  bottom: max(8.2rem, calc(7.4rem + env(safe-area-inset-bottom)));
  width: min(380px, calc(100vw - 1rem));
  max-height: min(70vh, 560px);
  display: none; flex-direction: column;
  background: #0f172a; border: 1px solid #334155; border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.55); overflow: hidden; z-index: 95;
}
.hank-panel.open { display: flex; }
.hank-head {
  display: flex; align-items: center; gap: 0.55rem; padding: 0.65rem 0.75rem;
  background: linear-gradient(135deg, #1e3a8a, #4c1d95 60%, #7f1d1d);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.hank-head-av { width: 36px; height: 36px; border-radius: 50%; background: #0b1220; }
.hank-head strong { display: block; font-size: 0.95rem; color: #fff; }
.hank-head span { display: block; font-size: 0.72rem; color: #fde68a; opacity: 0.95; }
.hank-x {
  margin-left: auto; border: none; background: rgba(0,0,0,0.25); color: #fff;
  width: 36px; height: 36px; border-radius: 10px; font-size: 1.3rem; cursor: pointer; line-height: 1;
}
.hank-quick {
  display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.5rem 0.65rem;
  border-bottom: 1px solid #1f2937; background: #0b1220;
}
.hank-quick button {
  border: 1px solid #334155; background: #111827; color: #e2e8f0;
  border-radius: 999px; padding: 0.3rem 0.65rem; font-size: 0.75rem; font-weight: 700; cursor: pointer;
  min-height: 34px;
}
.hank-quick button:active { border-color: #fbbf24; color: #fde68a; }
.hank-msgs {
  flex: 1; overflow-y: auto; padding: 0.65rem; display: flex; flex-direction: column; gap: 0.55rem;
  min-height: 180px; max-height: 42vh; -webkit-overflow-scrolling: touch;
}
.hank-msg { display: flex; gap: 0.4rem; align-items: flex-end; max-width: 100%; }
.hank-msg.user { flex-direction: row-reverse; }
.hank-mini { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; background: #0b1220; }
.hank-bubble {
  padding: 0.55rem 0.7rem; border-radius: 14px; font-size: 0.88rem; line-height: 1.4;
  max-width: 88%; word-wrap: break-word;
}
.hank-msg.hank .hank-bubble {
  background: #1e293b; color: #e2e8f0; border: 1px solid #334155; border-bottom-left-radius: 4px;
}
.hank-msg.user .hank-bubble {
  background: rgba(251,191,36,0.18); color: #fef3c7; border: 1px solid rgba(251,191,36,0.35);
  border-bottom-right-radius: 4px;
}
.hank-form {
  display: flex; gap: 0.4rem; padding: 0.55rem 0.65rem;
  border-top: 1px solid #1f2937; background: #0b1220;
}
.hank-form input {
  flex: 1; min-width: 0; border-radius: 999px; border: 1px solid #334155;
  background: #111827; color: #fff; padding: 0.55rem 0.85rem; font-size: 16px;
}
.hank-send { flex-shrink: 0; padding: 0.55rem 0.9rem !important; min-height: 44px; }

@media (min-width: 721px) {
  .hank-fab {
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    right: max(1.25rem, env(safe-area-inset-right));
  }
  .hank-panel {
    bottom: max(5.5rem, calc(4.5rem + env(safe-area-inset-bottom)));
    right: max(1.25rem, env(safe-area-inset-right));
  }
}

/* —— Mobile / on-the-go —— */
@media (max-width: 720px) {
  .mobile-dock { display: flex; }
  .app-shell { padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); }
  .topbar {
    border-radius: 12px; padding: 0.65rem 0.75rem; gap: 0.5rem;
    position: sticky; top: env(safe-area-inset-top, 0); z-index: 40;
  }
  .brand strong { font-size: 1rem; }
  .brand-sub, .brand span { font-size: 0.72rem; }
  .hud { gap: 0.3rem; width: 100%; justify-content: flex-start; }
  .pill { padding: 0.28rem 0.55rem; font-size: 0.75rem; }
  .xp-bar { width: 72px; height: 8px; flex: 1; max-width: 120px; min-width: 56px; }
  .screen {
    padding: 0.9rem 0.85rem 1rem; min-height: 0;
    border-radius: 14px;
  }
  .screen h1 { font-size: 1.35rem; }
  .screen h2 { font-size: 1.15rem; }
  .lead { font-size: 0.92rem; margin-bottom: 0.85rem; }
  .age-grid { grid-template-columns: 1fr; gap: 0.65rem; }
  .age-card { padding: 0.85rem; min-height: 44px; }
  .map-node {
    grid-template-columns: auto 1fr;
    gap: 0.55rem;
  }
  .map-node > button {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 0.15rem;
  }
  .map-node .pin { width: 42px; height: 42px; font-size: 1.2rem; }
  .row-actions {
    gap: 0.45rem;
  }
  .row-actions .btn {
    flex: 1 1 calc(50% - 0.45rem);
    min-width: 0;
    text-align: center;
    justify-content: center;
  }
  .practice-actions .btn {
    flex: 1 1 100%;
  }
  .sticky-actions {
    position: sticky;
    bottom: calc(3.6rem + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    background: linear-gradient(transparent, rgba(17,24,39,0.97) 18%);
    padding: 0.65rem 0 0.25rem;
    margin-left: -0.15rem;
    margin-right: -0.15rem;
  }
  body.view-practice .mobile-dock { opacity: 0.92; }
  body.view-practice .practice-stage {
    aspect-ratio: 3/4;
    max-height: min(62vh, 560px);
    border-radius: 12px;
  }
  .practice-grid { grid-template-columns: 1fr; }
  .practice-card { padding: 1rem; min-height: 48px; }
  .vpet-sprite { font-size: 3.8rem; }
  .vpet-cues { grid-template-columns: 1fr; }
  .mobile-dock .dock-btn { font-size: 0.62rem; }
  .mobile-dock .dock-ico { font-size: 1.1rem; }
  .merch-grid { grid-template-columns: 1fr; }
  .merch-card { flex-direction: row; }
  .plans { grid-template-columns: 1fr; }
  .cine-stage { border-radius: 10px; }
  .cine-beat { flex-wrap: wrap; }
  .cine-beat #cine-label { min-width: 0; }
  .choice { padding: 0.85rem 0.9rem; min-height: 48px; font-size: 0.95rem; }
  .cartoon-frame { font-size: 3.2rem; width: min(240px, 78%); }
  .rp-strip {
    flex-direction: column; align-items: flex-start; gap: 0.35rem;
    font-size: 0.82rem;
  }
  .footer-note { font-size: 0.78rem; line-height: 1.4; }
  input, select, textarea { font-size: 16px !important; } /* prevent iOS zoom on focus */
}

@media (max-width: 380px) {
  .hud .xp-bar { display: none; }
  .pill#hud-sub { display: none; }
  .brand-sub { display: none; }
}

@media (min-width: 721px) {
  .mobile-dock { display: none !important; }
  .app-shell { padding-bottom: 3rem; }
}

/* Landscape phone — practice uses wider frame */
@media (max-width: 900px) and (orientation: landscape) {
  body.view-practice .practice-stage {
    aspect-ratio: 16/9;
    max-height: 55vh;
  }
  body.view-practice .screen { padding-bottom: 0.5rem; }
  .mobile-dock { padding-top: 0.2rem; padding-bottom: 0.2rem; }
  .dock-btn { min-height: 44px; }
}

/* ═══════════════════════════════════════════
   Training Camp — modern hub (care · watch · train)
   ═══════════════════════════════════════════ */
.camp-home {
  background:
    radial-gradient(ellipse 90% 50% at 10% -10%, rgba(30, 58, 138, 0.45), transparent 55%),
    radial-gradient(ellipse 70% 40% at 100% 0%, rgba(185, 28, 28, 0.18), transparent 50%),
    var(--panel);
}
.camp-hero h1 {
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 30%, #fde68a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.camp-hero .lead { max-width: 40rem; }
.camp-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 1rem;
}
.camp-links { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.camp-h2 {
  margin: 1.15rem 0 0.35rem; font-size: 1.05rem; color: #fde68a;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.camp-note { margin: 0 0 0.85rem; }

/* Buddy care strip — Tamagotchi feel */
.camp-buddy-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem 0.85rem;
  align-items: center;
  padding: 0.9rem 1rem;
  margin: 0 0 1rem;
  border-radius: 18px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background:
    linear-gradient(145deg, rgba(30, 58, 138, 0.35), rgba(15, 23, 42, 0.9)),
    #0b1220;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}
.camp-buddy-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(251, 191, 36, 0.08), transparent 45%);
  pointer-events: none;
}
.camp-buddy-face {
  grid-row: 1 / 3;
  width: 4.25rem; height: 4.25rem;
  display: grid; place-items: center;
  font-size: 2.45rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1e293b, #0f172a);
  border: 2px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.35), 0 6px 16px rgba(0, 0, 0, 0.35);
  animation: camp-bob 2.8s ease-in-out infinite;
  position: relative; z-index: 1;
}
.camp-buddy-face.pose-eat { animation: camp-nibble 0.6s ease 2; }
.camp-buddy-face.pose-play { animation: camp-bounce 0.45s ease 3; }
.camp-buddy-face.pose-sleep { animation: camp-sleepy 2s ease-in-out infinite; filter: brightness(0.85); }
@keyframes camp-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes camp-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-10px) scale(1.08); }
  70% { transform: translateY(-2px) scale(0.98); }
}
@keyframes camp-nibble {
  0%, 100% { transform: scale(1) rotate(0); }
  50% { transform: scale(1.05) rotate(-6deg); }
}
@keyframes camp-sleepy {
  0%, 100% { transform: translateY(2px); opacity: 0.9; }
  50% { transform: translateY(0); opacity: 1; }
}
.camp-buddy-meta {
  display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; z-index: 1;
}
.camp-buddy-meta strong { color: #fff; font-size: 1.05rem; }
.camp-buddy-meta > span { color: #94a3b8; font-size: 0.82rem; line-height: 1.35; }
.camp-mini-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 0.65rem;
  margin-top: 0.45rem;
}
.camp-stat {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.3rem; align-items: center;
  font-size: 0.72rem; color: #cbd5e1; font-weight: 700;
}
.camp-stat-bar {
  height: 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.4); overflow: hidden;
}
.camp-stat-bar > i {
  display: block; height: 100%; border-radius: 999px; width: 0%;
  transition: width 0.45s ease;
}
.camp-stat-bar > i.h { background: linear-gradient(90deg, #f97316, #fbbf24); }
.camp-stat-bar > i.e { background: linear-gradient(90deg, #3b82f6, #22d3ee); }
.camp-stat-bar > i.y { background: linear-gradient(90deg, #ec4899, #f472b6); }
.camp-stat-bar > i.f { background: linear-gradient(90deg, #22c55e, #a3e635); }
.camp-care-row {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  z-index: 1;
}
.btn.care-mini {
  padding: 0.45rem 0.75rem; min-height: 40px; font-size: 0.82rem; font-weight: 800;
  border-radius: 999px; flex: 1 1 auto;
}
.btn.care-mini.ghost { opacity: 0.9; }
.camp-toast {
  grid-column: 1 / -1;
  margin: 0; padding: 0.55rem 0.75rem;
  border-radius: 10px; font-size: 0.82rem; line-height: 1.4;
  background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac; z-index: 1;
  animation: camp-toast-in 0.25s ease;
}
.camp-toast.err {
  background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.35); color: #fde68a;
}
@keyframes camp-toast-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* Lesson plan cards */
.camp-plan { display: grid; gap: 1.1rem; }
.camp-track h3 {
  margin: 0 0 0.2rem; font-size: 1.05rem; color: #fff;
}
.camp-track-blurb {
  margin: 0 0 0.55rem; color: #94a3b8; font-size: 0.88rem;
}
.camp-lessons { display: grid; gap: 0.5rem; }
.camp-lesson-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem; align-items: center;
  width: 100%; text-align: left;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #0b1220;
  color: inherit; cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
  min-height: 56px;
}
.camp-lesson-card:hover, .camp-lesson-card:focus-visible {
  border-color: rgba(147, 197, 253, 0.45);
  transform: translateY(-1px);
  outline: none;
}
.camp-lesson-card:active { transform: scale(0.99); }
.camp-lesson-card.done {
  border-color: rgba(34, 197, 94, 0.4);
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.08), #0b1220 40%);
}
.camp-step {
  width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.85rem;
  background: rgba(30, 58, 138, 0.55); color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.25);
  flex-shrink: 0;
}
.camp-lesson-card.done .camp-step {
  background: rgba(34, 197, 94, 0.2); color: #86efac; border-color: rgba(34, 197, 94, 0.4);
}
.camp-lesson-card > div { min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.camp-lesson-card strong { color: #fff; font-size: 0.95rem; }
.camp-lesson-card span { color: #94a3b8; font-size: 0.8rem; line-height: 1.35; }
.camp-vid-tag {
  display: inline-block; margin-top: 0.2rem;
  font-style: normal; font-size: 0.72rem; font-weight: 700;
  color: #fbbf24; opacity: 0.95;
}
.camp-go {
  font-size: 0.78rem; font-weight: 800;
  color: #93c5fd; letter-spacing: 0.02em;
  padding: 0.3rem 0.55rem; border-radius: 999px;
  background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3);
  white-space: nowrap;
}
.camp-lesson-card.done .camp-go {
  color: #86efac; background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.35);
}

/* Collapsed classic trails */
.camp-more {
  margin-top: 1.25rem; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.2);
  padding: 0.35rem 0.85rem 0.85rem;
}
.camp-more summary {
  cursor: pointer; padding: 0.65rem 0; font-weight: 700; color: #cbd5e1;
  list-style: none;
}
.camp-more summary::-webkit-details-marker { display: none; }
.camp-more summary::before {
  content: "▸ "; color: #64748b;
}
.camp-more[open] summary::before { content: "▾ "; }

/* Lesson detail: video + flow */
.camp-lesson .map-head { margin-bottom: 0.85rem; }
.camp-video-wrap { margin: 0.75rem 0 0.5rem; }
.camp-video {
  position: relative; width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(251, 191, 36, 0.25);
  background: #000;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
}
.camp-video iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.camp-video-credit {
  margin: 0.4rem 0 0; font-size: 0.78rem; color: #94a3b8;
}
.camp-flow {
  margin: 0.85rem 0;
  padding: 0.75rem 0.75rem 0.75rem 1.75rem;
  border-radius: 12px;
  background: rgba(30, 58, 138, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #cbd5e1; line-height: 1.45;
}
.camp-flow li { margin: 0.35rem 0; }
.camp-flow strong { color: #fde68a; }
.camp-actions { margin-top: 0.75rem; }
.camp-ready-ok { color: #86efac !important; }
.camp-ready-need { color: #fde68a !important; }
.linkish {
  background: none; border: 0; color: #93c5fd; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
  padding: 0; font: inherit;
}
.linkish:hover { color: #bfdbfe; }

@media (max-width: 720px) {
  .camp-buddy-card {
    padding: 0.75rem;
    gap: 0.5rem 0.65rem;
  }
  .camp-buddy-face { width: 3.6rem; height: 3.6rem; font-size: 2.1rem; }
  .camp-mini-stats { grid-template-columns: 1fr 1fr; }
  .camp-lesson-card { padding: 0.7rem; gap: 0.55rem; }
  .camp-care-row .btn.care-mini { flex: 1 1 calc(50% - 0.4rem); }
  .camp-hero h1 { font-size: 1.4rem; }
}

@media (min-width: 560px) {
  .camp-buddy-card {
    grid-template-columns: auto 1fr auto;
  }
  .camp-care-row {
    grid-column: auto;
    grid-row: 1 / 3;
    flex-direction: column;
    align-items: stretch;
    min-width: 6.5rem;
  }
  .camp-toast { grid-column: 1 / -1; }
}
