:root {
  --bg: #f5f2eb;
  --bg-warm: #fff8ee;
  --primary: #2d2a26;
  --muted: #6b6560;
  --purple: #7c3aed;
  --purple-soft: #ede9fe;
  --green: #3faf4a;
  --green-soft: #dcfce7;
  --gold: #d4af37;
  --gold-soft: #fef3c7;
  --nest-shadow: rgba(45, 42, 38, 0.1);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --touch-min: 64px;
  --font-kid: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  --font-family: Georgia, "Times New Roman", serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-kid);
  color: var(--primary);
  background: var(--bg);
}

body.jj-reduced-motion *,
body.jj-reduced-motion *::before,
body.jj-reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
}

a {
  color: var(--purple);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.jj-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px calc(10px + var(--safe-bottom));
  background: linear-gradient(180deg, #fff 0%, var(--bg-warm) 100%);
  border-bottom: 1px solid #ece4d6;
  position: sticky;
  top: 0;
  z-index: 20;
}

.jj-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.jj-header__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  flex-shrink: 0;
}

.jj-header__titles {
  min-width: 0;
}

.jj-header__title {
  margin: 0;
  font-family: var(--font-family);
  font-size: 1.25rem;
  line-height: 1.15;
  color: var(--purple);
}

.jj-header__subtitle {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jj-header__back {
  flex-shrink: 0;
  min-width: var(--touch-min);
  min-height: 44px;
  padding: 8px 14px;
  border: 2px solid #e8dfd0;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--primary);
  font-weight: 700;
}

/* Screens */
.jj-screen {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 18px 18px calc(24px + var(--safe-bottom));
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

.jj-screen.is-active {
  display: flex;
}

.jj-screen__lead {
  margin: 0 0 6px;
  font-family: var(--font-family);
  font-size: 1.55rem;
  line-height: 1.2;
  color: var(--purple);
}

.jj-screen__text {
  margin: 0 0 18px;
  line-height: 1.5;
  color: var(--muted);
  font-size: 1rem;
}

/* Home welcome */
.jj-welcome {
  text-align: center;
  align-items: center;
  padding-top: 8px;
}

.jj-welcome__tag {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 0.82rem;
  font-weight: 700;
}

.jj-welcome__hero-wrap {
  position: relative;
  width: clamp(260px, 78vw, 320px);
  aspect-ratio: 1;
  margin: 0 auto 18px;
  animation: jj-welcome-float 4.5s ease-in-out infinite;
}

.jj-welcome__hero-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72%;
  height: 72%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(124, 58, 237, 0.38) 0%, rgba(167, 139, 250, 0.18) 45%, transparent 72%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
  animation: jj-brand-glow-pulse 2.8s ease-in-out infinite;
}

.jj-welcome__hero {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(45, 42, 38, 0.18));
}

.jj-welcome__lead {
  margin-top: 0;
  margin-bottom: 10px;
  max-width: 22ch;
  margin-left: auto;
  margin-right: auto;
}

.jj-welcome__text {
  max-width: 34ch;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 20px;
}

.jj-welcome__actions {
  width: 100%;
  max-width: 320px;
}

.jj-welcome__play:hover,
.jj-welcome__play:focus-visible,
.jj-welcome__hub:hover,
.jj-welcome__hub:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.32);
}

.jj-welcome__hub:hover,
.jj-welcome__hub:focus-visible {
  box-shadow: 0 10px 22px rgba(45, 42, 38, 0.1);
}

.jj-btn__icon-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

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

@keyframes jj-brand-glow-pulse {
  0%,
  100% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

body.jj-reduced-motion .jj-welcome__hero-wrap,
body.jj-reduced-motion .jj-welcome__hero-glow {
  animation: none !important;
}

body.jj-reduced-motion .jj-welcome__play:hover,
body.jj-reduced-motion .jj-welcome__hub:hover {
  transform: none;
}

/* Legacy mascot (games / nest) */
.jj-welcome__mascot {
  width: min(280px, 78vw);
  margin: 8px auto 16px;
  filter: drop-shadow(0 10px 18px var(--nest-shadow));
}

/* Big buttons */
.jj-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--touch-min);
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.jj-btn:active {
  transform: scale(0.98);
}

.jj-btn--primary {
  background: linear-gradient(180deg, #8b5cf6 0%, var(--purple) 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.28);
}

.jj-btn--secondary {
  background: #fff;
  color: var(--primary);
  border: 2px solid #e8dfd0;
}

.jj-btn--warm {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.25);
}

.jj-btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 2px dashed #ddd2c0;
}

.jj-btn--block {
  width: 100%;
}

.jj-btn__icon {
  font-size: 1.35rem;
  line-height: 1;
}

/* Profile grid */
.jj-profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 4px;
}

@media (min-width: 420px) {
  .jj-profile-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.jj-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 16px;
  border: 3px solid #ece4d6;
  border-radius: var(--radius-lg);
  background: #fff;
  text-align: left;
  box-shadow: 0 6px 16px var(--nest-shadow);
}

.jj-profile-card:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 2px;
}

.jj-profile-card__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(45, 42, 38, 0.08);
}

.jj-profile-card__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
}

.jj-profile-card__meta {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Nest hub */
.jj-nest {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(251, 191, 36, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 0%, rgba(124, 58, 237, 0.08) 0%, transparent 45%),
    var(--bg-warm);
  border-radius: var(--radius-lg);
  padding: 18px 16px 20px;
  border: 1px solid #ece4d6;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.jj-nest--alive {
  isolation: isolate;
}

.jj-nest-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.jj-nest-fire {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  font-size: 2rem;
  filter: drop-shadow(0 0 12px rgba(251, 146, 60, 0.65));
  animation: jj-fire-glow 2.4s ease-in-out infinite;
}

.jj-nest-leaf {
  position: absolute;
  font-size: 1.2rem;
  opacity: 0.75;
  animation: jj-leaf-float 7s ease-in-out infinite;
}

.jj-nest-leaf--1 {
  left: 8%;
  top: 18%;
  animation-delay: 0s;
}

.jj-nest-leaf--2 {
  right: 10%;
  top: 28%;
  animation-delay: 2.5s;
}

.jj-nest-firefly {
  position: absolute;
  font-size: 0.9rem;
  opacity: 0;
  animation: jj-firefly-blink 4.5s ease-in-out infinite;
}

.jj-nest-firefly--1 {
  left: 18%;
  bottom: 32%;
  animation-delay: 0.8s;
}

.jj-nest-firefly--2 {
  right: 16%;
  bottom: 40%;
  animation-delay: 2.2s;
}

.jj-nest-hero {
  position: relative;
  z-index: 1;
}

.jj-nest__mascot--idle {
  animation: jj-mascot-bob 3.6s ease-in-out infinite;
  transform-origin: center bottom;
}

.jj-nest-hatched {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: -6px 0 8px;
}

.jj-nest-hatched__egg,
.jj-nest-hatched__baby {
  font-size: 1.8rem;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.12));
}

.jj-nest-hatched__baby {
  animation: jj-hatch-wiggle 2.8s ease-in-out infinite;
}

@keyframes jj-fire-glow {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
    filter: drop-shadow(0 0 8px rgba(251, 146, 60, 0.5));
  }
  50% {
    transform: translateX(-50%) scale(1.08);
    filter: drop-shadow(0 0 18px rgba(251, 146, 60, 0.85));
  }
}

@keyframes jj-leaf-float {
  0%,
  100% {
    transform: translate(0, 0) rotate(-6deg);
  }
  50% {
    transform: translate(6px, -10px) rotate(8deg);
  }
}

@keyframes jj-firefly-blink {
  0%,
  40%,
  100% {
    opacity: 0;
  }
  50%,
  60% {
    opacity: 0.9;
  }
}

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

@keyframes jj-hatch-wiggle {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-8deg);
  }
  75% {
    transform: rotate(8deg);
  }
}

.jj-nest-hero,
.jj-nest__greeting,
.jj-stats,
.jj-egg-meter,
.jj-nest-last-played,
.jj-nest-scene-btn,
.jj-nav-grid,
.jj-footer-link {
  position: relative;
  z-index: 1;
}

.jj-nest__mascot {
  width: min(220px, 60vw);
  margin: 0 auto 12px;
}

.jj-nest__greeting {
  margin: 0 0 14px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
}

.jj-stats {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.jj-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #ece4d6;
  font-weight: 800;
  font-size: 0.95rem;
}

.jj-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.jj-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 92px;
  padding: 14px 10px;
  border: none;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 6px 16px var(--nest-shadow);
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--primary);
}

.jj-nav-btn__icon {
  font-size: 1.8rem;
  line-height: 1;
}

.jj-nav-btn--play {
  background: linear-gradient(180deg, #bbf7d0 0%, #86efac 100%);
}

.jj-nav-btn--adventure {
  background: linear-gradient(180deg, #ddd6fe 0%, #c4b5fd 100%);
}

.jj-nav-btn--stickers {
  background: linear-gradient(180deg, #fde68a 0%, #fcd34d 100%);
}

.jj-nav-btn--hatchery {
  background: linear-gradient(180deg, #fecdd3 0%, #fda4af 100%);
}

.jj-nav-btn--parents {
  grid-column: 1 / -1;
  min-height: 56px;
  flex-direction: row;
  background: #fff;
  border: 2px solid #e8dfd0;
  box-shadow: none;
  font-size: 0.92rem;
  color: var(--muted);
}

/* Game cards */
.jj-game-grid {
  display: grid;
  gap: 14px;
}

.jj-game-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 2px solid #ece4d6;
  box-shadow: 0 6px 16px var(--nest-shadow);
  text-align: left;
}

.jj-game-card--soon {
  opacity: 0.88;
}

.jj-game-card__emoji {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  background: var(--purple-soft);
  flex-shrink: 0;
}

.jj-game-card__title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
}

.jj-game-card__blurb {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.35;
}

.jj-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.jj-badge--soon {
  background: #f3f4f6;
  color: #6b7280;
}

.jj-badge--play {
  background: var(--green-soft);
  color: #166534;
}

/* Placeholder panels */
.jj-panel {
  padding: 20px 18px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid #ece4d6;
  box-shadow: 0 6px 16px var(--nest-shadow);
}

.jj-panel__title {
  margin: 0 0 8px;
  font-family: var(--font-family);
  font-size: 1.25rem;
  color: var(--purple);
}

.jj-panel__text {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.jj-sticker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.jj-sticker-slot {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  border: 2px dashed #ddd2c0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: var(--bg-warm);
}

.jj-sticker-slot--filled {
  border-style: solid;
  border-color: var(--gold);
  background: var(--gold-soft);
}

.jj-egg-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.jj-egg-icon {
  font-size: 2.4rem;
  filter: drop-shadow(0 4px 6px var(--nest-shadow));
}

.jj-hatchery-panel {
  text-align: center;
}

.jj-hatchery-egg-row {
  min-height: 3rem;
}

.jj-hatchery-egg-more {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}

.jj-hatchery-badge {
  margin: 12px 0 0;
  font-weight: 800;
  color: var(--purple-deep);
}

.jj-hatchery-stickers {
  margin: 16px 0;
}

.jj-hatchery-stickers__label {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 800;
}

.jj-hatchery-stickers__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.jj-hatchery-sticker {
  font-size: 2rem;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--gold-soft);
  border: 2px solid #ece4d6;
}

.jj-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Parents */
.jj-parents-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.jj-parents-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0e8da;
  font-size: 0.95rem;
}

.jj-parents-list strong {
  font-weight: 800;
}

.jj-gate {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jj-gate input {
  min-height: var(--touch-min);
  padding: 12px 16px;
  border: 2px solid #e8dfd0;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  text-align: center;
}

.jj-gate__hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Hatch the Egg */
.jj-hatch-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 12px 0 24px;
  text-align: center;
}

.jj-hatch-prompt {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  max-width: 20ch;
}

.jj-egg-btn {
  position: relative;
  width: min(240px, 68vw);
  aspect-ratio: 0.78;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.jj-egg-shape {
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 48% 48% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 35% 28%, #fffef8 0%, #fde68a 38%, #f59e0b 100%);
  border: 4px solid #d97706;
  box-shadow:
    inset -12px -18px 24px rgba(180, 83, 9, 0.18),
    0 16px 28px var(--nest-shadow);
  transition: transform 0.12s ease;
}

.jj-egg-btn:active .jj-egg-shape {
  transform: scale(0.96);
}

.jj-egg-crack {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.jj-egg-crack line {
  stroke: #78350f;
  stroke-width: 4;
  stroke-linecap: round;
}

.jj-egg-btn[data-cracks="1"] .jj-egg-crack--1,
.jj-egg-btn[data-cracks="2"] .jj-egg-crack--1,
.jj-egg-btn[data-cracks="2"] .jj-egg-crack--2,
.jj-egg-btn[data-cracks="3"] .jj-egg-crack--1,
.jj-egg-btn[data-cracks="3"] .jj-egg-crack--2,
.jj-egg-btn[data-cracks="3"] .jj-egg-crack--3,
.jj-egg-btn[data-cracks="4"] .jj-egg-crack--1,
.jj-egg-btn[data-cracks="4"] .jj-egg-crack--2,
.jj-egg-btn[data-cracks="4"] .jj-egg-crack--3,
.jj-egg-btn[data-cracks="4"] .jj-egg-crack--4,
.jj-egg-btn[data-cracks="5"] .jj-egg-crack--1,
.jj-egg-btn[data-cracks="5"] .jj-egg-crack--2,
.jj-egg-btn[data-cracks="5"] .jj-egg-crack--3,
.jj-egg-btn[data-cracks="5"] .jj-egg-crack--4,
.jj-egg-btn[data-cracks="5"] .jj-egg-crack--5 {
  opacity: 1;
}

.jj-hatchling {
  width: min(260px, 72vw);
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
}

.jj-hatch-stage.is-hatched .jj-egg-btn {
  display: none;
}

.jj-hatch-stage.is-hatched .jj-hatchling {
  opacity: 1;
  transform: scale(1);
  animation: jj-pop-in 0.55s ease;
}

@keyframes jj-pop-in {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  70% {
    transform: scale(1.06);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.jj-reward-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom));
  transform: translateX(-50%) translateY(120%);
  z-index: 50;
  min-width: min(320px, calc(100vw - 36px));
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: #166534;
  color: #fff;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 12px 28px rgba(22, 101, 52, 0.35);
  transition: transform 0.35s ease;
}

.jj-reward-toast.is-visible {
  transform: translateX(-50%) translateY(0);
}

.jj-footer-link {
  margin-top: auto;
  padding-top: 18px;
  text-align: center;
}

.jj-footer-link a {
  font-size: 0.9rem;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Egg meter on The Nest */
.jj-egg-meter {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid #ece4d6;
}

.jj-egg-meter__label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.jj-egg-meter__track {
  height: 18px;
  border-radius: 999px;
  background: #f3ede3;
  overflow: hidden;
  border: 2px solid #e8dfd0;
}

.jj-egg-meter__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fde68a 0%, #f59e0b 55%, #fbbf24 100%);
  transition: width 0.35s ease;
}

.jj-egg-meter__hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Dino Dash */
.jj-dash-prompt,
.jj-nest-prompt {
  margin: 0 0 12px;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.jj-dash-hud {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}

.jj-dash-stat {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #ece4d6;
  font-weight: 800;
}

.jj-dash-track {
  position: relative;
  min-height: 280px;
  padding: 16px 12px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 45%, #86efac 100%);
  border: 2px solid #86efac;
  overflow: hidden;
}

.jj-dash-track::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 18%;
  height: 8px;
  border-radius: 999px;
  background: rgba(120, 53, 15, 0.2);
}

.jj-dash-rexi {
  position: absolute;
  left: calc(8% + (var(--dash-step, 0) / max(var(--dash-total, 1), 1)) * 68%);
  bottom: 22%;
  width: 88px;
  transition: left 0.35s ease;
  z-index: 2;
  filter: drop-shadow(0 6px 10px var(--nest-shadow));
}

.jj-dash-rexi img {
  width: 88px;
  height: auto;
}

.jj-dash-footprints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 150px;
  position: relative;
  z-index: 3;
}

.jj-footprint {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border: 3px solid #d6d3d1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  font-size: 1.6rem;
  opacity: 0.55;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.jj-footprint.is-active {
  opacity: 1;
  border-color: var(--purple);
  background: var(--purple-soft);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25);
  animation: jj-footprint-glow 1.2s ease-in-out infinite;
}

.jj-footprint.is-done {
  opacity: 0.85;
  border-color: var(--green);
  background: var(--green-soft);
}

.jj-footprint:disabled:not(.is-active) {
  cursor: default;
}

@keyframes jj-footprint-glow {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

/* Color Nest */
.jj-nest-progress {
  margin: 0 0 12px;
  text-align: center;
  font-weight: 800;
  color: var(--muted);
}

.jj-nest-playfield {
  position: relative;
  min-height: 420px;
  padding: 16px 12px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fff8ee 0%, #fef3c7 100%);
  border: 2px solid #ece4d6;
}

.jj-egg-pile {
  position: relative;
  min-height: 140px;
  margin-bottom: 20px;
}

.jj-drag-egg {
  position: absolute;
  width: 72px;
  height: 88px;
  border-radius: 50% 50% 48% 48% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 35% 28%, #fff 0%, var(--egg-color) 70%);
  border: 4px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 16px var(--nest-shadow);
  touch-action: none;
  cursor: grab;
  transition: transform 0.25s ease;
  z-index: 5;
}

.jj-drag-egg.is-dragging {
  cursor: grabbing;
  transform: scale(1.08);
  z-index: 10;
}

.jj-drag-egg.is-bouncing {
  transition: left 0.35s ease, top 0.35s ease, transform 0.35s ease;
}

.jj-drag-egg.is-placed {
  transform: scale(0.92);
  opacity: 0.95;
}

.jj-nest-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 420px) {
  .jj-nest-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

.jj-nest-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 110px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--nest-color);
  border: 3px dashed rgba(45, 42, 38, 0.18);
}

.jj-nest-zone.is-filled {
  border-style: solid;
  border-color: var(--egg-color);
}

.jj-nest-zone__label {
  font-size: 0.88rem;
  font-weight: 800;
}

.jj-nest-zone__bowl {
  width: 72px;
  height: 52px;
  border-radius: 0 0 40px 40px / 0 0 28px 28px;
  background: rgba(255, 255, 255, 0.55);
  border: 3px solid rgba(45, 42, 38, 0.12);
}

/* Grandma Lori's Adventure */
.jj-adv-episode {
  margin: -6px 0 14px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--purple);
}

.jj-adv-panel {
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 2px solid #ece4d6;
  box-shadow: 0 6px 16px var(--nest-shadow);
}

.jj-adv-lori {
  margin: 0 0 8px;
  font-weight: 800;
  color: var(--purple);
}

.jj-adv-speech {
  margin: 0 0 16px;
  line-height: 1.45;
  font-size: 1.02rem;
}

.jj-adv-speech--big {
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
}

.jj-adv-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jj-adv-egg-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
}

.jj-adv-nest-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.jj-adv-egg {
  width: 72px;
  height: 88px;
  border: 4px solid rgba(0, 0, 0, 0.12);
  border-radius: 50% 50% 48% 48% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 35% 28%, #fff 0%, var(--egg-color) 70%);
  cursor: pointer;
}

.jj-adv-egg.is-selected {
  outline: 4px solid var(--purple);
  outline-offset: 3px;
  transform: scale(1.05);
}

.jj-adv-nest {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 100px;
  padding: 10px;
  border: 3px dashed #ddd2c0;
  border-radius: var(--radius-md);
  background: var(--bg-warm);
  cursor: pointer;
}

.jj-adv-nest.is-filled {
  border-style: solid;
  border-color: var(--green);
  background: var(--green-soft);
}

.jj-adv-nest__label {
  font-size: 0.88rem;
  font-weight: 800;
}

.jj-adv-nest__bowl {
  width: 64px;
  height: 44px;
  border-radius: 0 0 36px 36px / 0 0 24px 24px;
  background: var(--nest-color, #eee);
  border: 3px solid rgba(45, 42, 38, 0.1);
}

.jj-adv-hatch {
  text-align: center;
}

.jj-adv-egg-btn {
  margin: 0 auto;
  display: block;
}

/* Sticker catalog */
.jj-sticker-catalog {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 420px) {
  .jj-sticker-catalog {
    grid-template-columns: repeat(3, 1fr);
  }
}

.jj-sticker-slot__emoji {
  font-size: 2rem;
  line-height: 1;
}

.jj-sticker-slot__label {
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
}

.jj-sticker-slot--locked {
  opacity: 0.72;
  background: #f3f4f6;
  border-style: dotted;
}

.jj-sticker-slot--locked .jj-sticker-slot__emoji {
  filter: grayscale(0.4);
}

/* Sticker Scene Safari */
.jj-scene-wrap {
  margin-bottom: 12px;
}

.jj-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 3px solid #86efac;
  background: linear-gradient(180deg, #bae6fd 0%, #86efac 42%, #4ade80 100%);
  touch-action: manipulation;
}

.jj-scene__sky {
  position: absolute;
  inset: 0 0 55%;
  background: linear-gradient(180deg, #7dd3fc 0%, #bae6fd 100%);
}

.jj-scene__trees {
  position: absolute;
  bottom: 18%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 1.6rem;
  opacity: 0.85;
  pointer-events: none;
}

.jj-scene__campfire {
  position: absolute;
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.2rem;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(234, 88, 12, 0.35));
}

.jj-scene__placements {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.jj-scene-placed {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 2.4rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
  z-index: 3;
}

.jj-scene-placed.is-dragging {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.1);
  z-index: 10;
}

.jj-scene-placed.is-selected {
  outline: 4px solid var(--purple);
  outline-offset: 4px;
  border-radius: 12px;
  z-index: 8;
}

/* Shared game completion */
.jj-complete {
  margin-top: 18px;
  padding: 18px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, #fff9e8 0%, #fef3c7 100%);
  border: 3px solid var(--gold);
  text-align: center;
}

.jj-complete__title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--purple-deep);
}

.jj-complete__message {
  margin: 0 0 12px;
  line-height: 1.45;
}

.jj-complete__rewards {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.jj-complete__rewards li {
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #ece4d6;
  font-weight: 800;
}

.jj-complete__actions {
  display: grid;
  gap: 10px;
}

.jj-nest-last-played {
  margin: 0 0 12px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
}

.jj-nest-scene-btn {
  margin-bottom: 14px;
}

/* Playtest notes */
.jj-playtest-form {
  display: grid;
  gap: 14px;
}

.jj-playtest-q {
  margin: 0;
  padding: 12px 14px;
  border: 2px solid #ece4d6;
  border-radius: var(--radius-md);
  background: #fff;
}

.jj-playtest-q legend {
  font-weight: 800;
  margin-bottom: 8px;
}

.jj-playtest-q label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-right: 16px;
  font-weight: 700;
}

.jj-playtest-bugs {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.jj-playtest-bugs textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #ece4d6;
  border-radius: var(--radius-md);
  font: inherit;
  resize: vertical;
}

.jj-playtest-saved {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Adventure shape puzzle (Episode 2) */
.jj-adv-shape-row,
.jj-adv-shape-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.jj-adv-shape-btn,
.jj-adv-shape-slot {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border: 3px solid #ece4d6;
  border-radius: 16px;
  background: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
}

.jj-adv-shape-btn.is-selected {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2);
}

.jj-adv-shape-slot.is-filled {
  background: var(--gold-soft);
  border-color: var(--gold);
}

.jj-adv-shape-slot__label {
  font-size: 0.75rem;
  font-weight: 800;
}

.jj-adv-river-end {
  text-align: center;
}

.jj-scene-tray {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 2px solid #ece4d6;
}

.jj-scene-tray__label {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 800;
}

.jj-scene-tray__items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.jj-scene-tray__sticker {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border: 3px solid #ece4d6;
  border-radius: 16px;
  background: var(--gold-soft);
  font-size: 1.8rem;
  cursor: pointer;
}

.jj-scene-tray__sticker.is-selected {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25);
  transform: scale(1.05);
}

.jj-scene-tray__empty {
  margin: 0;
  text-align: center;
  color: var(--muted);
  line-height: 1.4;
}

/* Parent settings toggles */
.jj-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 8px;
  font-weight: 700;
  cursor: pointer;
}

.jj-toggle input {
  width: 22px;
  height: 22px;
  accent-color: var(--purple);
}



