/* ============ Toon Tails — styles ============ */
:root {
  --bg: #fff8e7;
  --ink: #33272a;
  --pink: #ff7bac;
  --orange: #ff9f43;
  --yellow: #ffd93d;
  --green: #6bcb77;
  --blue: #4d96ff;
  --purple: #b983ff;
  --card: #ffffff;
  --shadow: 0 8px 0 rgba(51, 39, 42, 0.12);
  --radius: 24px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Nunito", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 18%, #ffe9f2 0%, transparent 42%),
    radial-gradient(circle at 88% 12%, #e8f2ff 0%, transparent 40%),
    radial-gradient(circle at 80% 90%, #fff3c4 0%, transparent 45%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.wrap {
  width: min(1080px, 92vw);
  margin: 0 auto;
}

/* ---------- Header ---------- */
.site-header {
  padding: 28px 0 8px;
  text-align: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.logo h1 {
  font-family: "Baloo 2", cursive;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  margin: 0;
  letter-spacing: 0.5px;
}

.logo h1 .accent,
h1 {
  color: var(--ink);
}

.logo-blob {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  font-size: 2rem;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 50% 45% 55% 50%;
  box-shadow: var(--shadow);
  transform: rotate(-6deg);
}

.tagline {
  margin: 10px 0 0;
  font-weight: 800;
  font-size: 1.05rem;
  color: #7a6a6e;
}

.back-arrow {
  display: inline-block;
  margin-left: 14px;
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: 0 4px 0 rgba(51, 39, 42, 0.15);
  transition: transform 0.15s ease;
}

.back:hover .back-arrow { transform: translateX(-4px); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 26px 0 8px;
}

.hero h2 {
  font-family: "Baloo 2", cursive;
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  margin: 0 0 8px;
}

.hero-sub {
  font-weight: 700;
  color: #7a6a6e;
  margin: 0;
}

/* ---------- Story grid / tiles ---------- */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  padding: 30px 0 10px;
}

.story-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

a.story-tile:hover {
  transform: translateY(-6px) rotate(-0.5deg);
  box-shadow: 0 16px 0 rgba(51, 39, 42, 0.14);
}

.tile-art {
  position: relative;
  height: 190px;
  display: grid;
  place-items: center;
  border-bottom: 4px solid var(--ink);
  background: linear-gradient(160deg, #fff2b8, #ffd1e8);
  overflow: hidden;
}

.tile-dino .tile-art { background: linear-gradient(160deg, #ffe0a3, #ffb3c6); }
.tile-penguin .tile-art { background: linear-gradient(160deg, #cde9ff, #eaf6ff); }
.tile-cat .tile-art { background: linear-gradient(160deg, #2e3564, #7b62b8); }
.tile-robot .tile-art { background: linear-gradient(160deg, #cfd8e8, #f0e0ff); }

.big-emoji {
  font-size: 5.5rem;
  filter: drop-shadow(0 6px 0 rgba(51, 39, 42, 0.12));
  animation: bob 3.2s ease-in-out infinite;
}

.float {
  position: absolute;
  font-size: 1.9rem;
  animation: floaty 4s ease-in-out infinite;
}
.f1 { top: 18%; left: 12%; }
.f2 { bottom: 16%; left: 22%; animation-delay: 1.1s; }
.f3 { top: 22%; right: 14%; animation-delay: 2s; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.15); }
}

.tile-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 22px;
  flex: 1;
}

.tile-info h3 {
  font-family: "Baloo 2", cursive;
  font-size: 1.35rem;
  margin: 6px 0 0;
  line-height: 1.2;
}

.tile-info p {
  margin: 0;
  font-weight: 700;
  color: #7a6a6e;
}

.tile-badge {
  align-self: flex-start;
  font-family: "Baloo 2", cursive;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--green);
  color: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 3px 12px;
}

.coming-soon .tile-badge { background: var(--purple); }
.coming-soon { cursor: default; }
.coming-soon .tile-art { background: linear-gradient(160deg, #ece5ff, #d9f0ff); }
.coming-soon { opacity: 0.85; }

.tile-cta {
  margin-top: auto;
  font-family: "Baloo 2", cursive;
  font-weight: 700;
  color: var(--pink);
}

a.story-tile:hover .tile-cta { color: var(--orange); }

/* ---------- How to ---------- */
.how-to {
  margin: 44px 0 20px;
  text-align: center;
}

.how-to h3 {
  font-family: "Baloo 2", cursive;
  font-size: 1.7rem;
  margin: 0 0 18px;
}

.how-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

.how-card {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.how-card span { font-size: 2rem; display: block; margin-bottom: 6px; }
.how-card p { margin: 0; font-weight: 700; color: #7a6a6e; }
.how-card strong { color: var(--ink); }

/* ---------- Story hero ---------- */
.story-hero {
  text-align: center;
  padding: 26px 0 10px;
}

.story-emoji { font-size: 4rem; display: inline-block; animation: bob 3s ease-in-out infinite; }

.story-hero h2 {
  font-family: "Baloo 2", cursive;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  margin: 10px 0 6px;
}

.story-sub {
  font-weight: 700;
  color: #7a6a6e;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Comic panels ---------- */
.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 26px;
  padding: 28px 0 10px;
  counter-reset: panel;
}

.panel {
  position: relative;
  background: var(--card);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-num {
  position: absolute;
  top: -2px; left: -2px;
  z-index: 3;
  font-family: "Baloo 2", cursive;
  font-size: 1.15rem;
  font-weight: 800;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-right: none;
  border-bottom: none;
  border-radius: 0 var(--radius) 0 var(--radius);
}

.panel-art {
  position: relative;
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 34px 16px 18px;
  border-bottom: 4px solid var(--ink);
}

/* per-panel backgrounds so the comic gets more colorful 1 → 8 */
.p1 .panel-art { background: linear-gradient(160deg, #d6ecff, #fff6c9); }
.p2 .panel-art { background: linear-gradient(160deg, #fff6c9, #ffe3c2); }
.p3 .panel-art { background: linear-gradient(160deg, #d9f6ff, #e6fff2); }
.p4 .panel-art { background: linear-gradient(160deg, #ffe3c2, #ffd0d8); }
.p5 .panel-art { background: linear-gradient(160deg, #ffd9a0, #ff9f7c); }
.p6 .panel-art { background: linear-gradient(160deg, #ffe1b8, #ffc9a3); }
.p7 .panel-art { background: linear-gradient(160deg, #fff0b3, #fff8e7); }
.p8 .panel-art { background: linear-gradient(160deg, #d9f0ff, #ffe1f0); }

.char {
  display: block;
  text-align: center;
  line-height: 1;
}
.char.small { font-size: 2.6rem; }
.char.big { font-size: 4.2rem; }

.char.puff { animation: puff 1.6s ease-in-out infinite; }
.char.puff-hard { animation: puff 0.9s ease-in-out infinite; }
.char.shocked { animation: shake 0.7s ease-in-out infinite; }
.char.sneeze { animation: shake 0.5s ease-in-out infinite; }
.char.happy { animation: bob 2.2s ease-in-out infinite; }
.char.golden { filter: sepia(1) saturate(3) hue-rotate(-15deg) drop-shadow(0 0 6px #ffb700); }

@keyframes puff {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18) rotate(-3deg); }
}

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

.bubble {
  position: relative;
  display: inline-block;
  font-family: "Baloo 2", cursive;
  font-weight: 700;
  font-size: 1.02rem;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 6px 14px;
  box-shadow: 0 4px 0 rgba(51, 39, 42, 0.15);
  max-width: 200px;
}

.bubble::after {
  content: "";
  position: absolute;
  bottom: -11px; left: 24px;
  width: 14px; height: 14px;
  background: #fff;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: rotate(45deg);
}

.fx {
  display: inline-block;
  font-size: 2.4rem;
  animation: flame 1s ease-in-out infinite;
}

.fx.bubble-fx { animation: floaty 2.4s ease-in-out infinite; }
.fx.big-flame { font-size: 3rem; }

@keyframes flame {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50% { transform: scale(1.25) rotate(3deg); }
}

.panel-caption {
  margin: 0;
  padding: 14px 16px 16px;
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.35;
}

/* shop sign in final panel */
.shop-sign {
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  text-align: center;
  background: var(--yellow);
  border: 3px dashed var(--ink);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 1rem;
  line-height: 1.25;
  transform: rotate(-2deg);
}
.shop-sign small { font-weight: 700; font-size: 0.78rem; }

/* ---------- Pip the Penguin (story 2) ---------- */
.pp1 .panel-art { background: linear-gradient(160deg, #bfe3ff, #e8f7ff); }
.pp2 .panel-art { background: linear-gradient(160deg, #e6f7e0, #fff3c4); }
.pp3 .panel-art { background: linear-gradient(160deg, #d6efff, #ffffff); }
.pp4 .panel-art { background: linear-gradient(160deg, #eaf6ff, #d9f2ff); }
.pp5 .panel-art { background: linear-gradient(160deg, #ffe0f0, #fff3c4); }
.pp6 .panel-art { background: linear-gradient(160deg, #9fd2ff, #dff0ff); }
.pp7 .panel-art { background: linear-gradient(160deg, #cfe9ff, #ffeef5); }
.pp8 .panel-art { background: linear-gradient(160deg, #7fc4ff, #3f7fd6); }
.underwater .panel-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.35) 0 6px, transparent 7px),
    radial-gradient(circle at 75% 65%, rgba(255,255,255,0.3) 0 4px, transparent 5px),
    radial-gradient(circle at 45% 85%, rgba(255,255,255,0.25) 0 8px, transparent 9px);
  pointer-events: none;
}
.underwater .panel-caption { background: #eaf6ff; }

.bird { position: absolute; font-size: 1.6rem; animation: floaty 3s ease-in-out infinite; }
.b1 { top: 14%; left: 14%; }
.b2 { top: 10%; right: 18%; animation-delay: 0.6s; }
.b3 { top: 28%; right: 6%; animation-delay: 1.2s; }

.char.looks-up { animation: lookup 2.4s ease-in-out infinite; }
@keyframes lookup {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-8px) rotate(-14deg); }
}

.char.rotover { animation: plop 1.8s ease-in-out infinite; }
@keyframes plop {
  0%, 100% { transform: rotate(180deg) translateY(0); }
  50% { transform: rotate(180deg) translateY(6px); }
}

.char.flying { animation: flying 2.6s ease-in-out infinite; }
@keyframes flying {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-16px) rotate(6deg); }
}

.char.zooming { animation: zoom 1.4s linear infinite; }
@keyframes zoom {
  0%, 100% { transform: translateX(0) scale(1); }
  50% { transform: translateX(8px) scale(1.08); }
}

.sfx {
  display: inline-block;
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: 1.5rem;
  color: #d64550;
  transform: rotate(-4deg);
  text-shadow: 2px 2px 0 #fff;
}
.sfx.sfx-plop { font-size: 2.4rem; color: #e07a00; animation: plopword 1.8s ease-in-out infinite; }
@keyframes plopword {
  0%, 100% { transform: rotate(-4deg) scale(1); }
  50% { transform: rotate(-4deg) scale(1.12); }
}

.balloon { position: absolute; font-size: 1.7rem; animation: floaty 2.8s ease-in-out infinite; }
.pp5 .balloon.b1 { top: 8%; left: 10%; }
.pp5 .balloon.b2 { top: 5%; right: 24%; animation-delay: 0.5s; }
.pp5 .balloon.b3 { top: 12%; right: 8%; animation-delay: 1s; }
.pp5 .balloon.b4 { top: 30%; left: 5%; animation-delay: 1.5s; }

.bub { position: absolute; font-size: 1.4rem; animation: floaty 3.2s ease-in-out infinite; }
.bub { top: 12%; left: 12%; }
.bub2 { top: 20%; right: 14%; animation-delay: 1.2s; }

/* ---------- Milo the Cat (story 3) ---------- */
.mc1 .panel-art { background: linear-gradient(160deg, #2b3161, #4a5194); }
.mc2 .panel-art { background: linear-gradient(160deg, #f6d6ff, #ffd9ec); }
.mc3 .panel-art { background: linear-gradient(160deg, #fff0c2, #ffd6a1); }
.mc4 .panel-art { background: linear-gradient(160deg, #d9f3ff, #ffeef5); }
.mc5 .panel-art { background: linear-gradient(160deg, #232a52, #3c4480); }
.mc6 .panel-art { background: linear-gradient(160deg, #33305e, #55477e); }
.mc7 .panel-art { background: linear-gradient(160deg, #8fc9ff, #eaf6ff); }
.mc8 .panel-art { background: linear-gradient(160deg, #fff3c4, #ffe0b3); }

/* dark panels: brighter captions + light starfield */
.dark .panel-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 24%, rgba(255,255,255,0.6) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 18%, rgba(255,255,255,0.5) 0 2px, transparent 3px),
    radial-gradient(circle at 60% 80%, rgba(255,255,255,0.35) 0 2px, transparent 3px),
    radial-gradient(circle at 28% 70%, rgba(255,255,255,0.35) 0 1.5px, transparent 2.5px);
  pointer-events: none;
}
.dark .panel-caption { background: #fdf6e3; }

.moon { display: block; filter: drop-shadow(0 0 12px rgba(255, 238, 160, 0.95)); }
.moon.big { font-size: 4.2rem; animation: floaty 3.4s ease-in-out infinite; }
.moon.small-moon { font-size: 2.7rem; animation: glowpulse 2.2s ease-in-out infinite; }

@keyframes glowpulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 238, 160, 0.8)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 18px rgba(255, 238, 160, 1)); transform: scale(1.08); }
}

.star { position: absolute; font-size: 1.3rem; animation: floaty 3s ease-in-out infinite; }
.s1 { top: 16%; left: 12%; }
.s2 { top: 30%; right: 16%; animation-delay: 1.1s; }

/* the RIDICULOUS wobbly tower (panel 3) */
.tower {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  animation: wobble 1.1s ease-in-out infinite;
  transform-origin: 50% 100%;
}
.tower-item { display: block; font-size: 1.75rem; line-height: 1.12; }
.tower .climbing { font-size: 2.2rem; animation: climb 2.4s ease-in-out infinite; }

@keyframes wobble {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

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

.mc3 .bubble { transform: rotate(-6deg); }

/* moon off / hidden (panels 5–6) */
.moon.off { font-size: 3.4rem; filter: grayscale(1) brightness(0.55) drop-shadow(0 4px 4px rgba(0, 0, 0, 0.4)); }
.mc5 .crowd { display: flex; gap: 14px; }
.townie { display: block; font-size: 2rem; line-height: 1; }
.t2 { transform: translateY(3px); }
.moon.hidden-moon { position: absolute; right: 12%; bottom: 18%; font-size: 2.1rem; opacity: 0.9; }

/* panel 7: flung moon zooming away */
.moon.fling {
  position: absolute;
  top: 10%;
  left: 14%;
  font-size: 2.5rem;
  animation: fling 1.6s ease-in infinite;
}

@keyframes fling {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(200px, -34px) scale(0.55); opacity: 0.15; }
}

.sfx.sfx-big { font-size: 2.6rem; color: #2f6fd6; animation: plopword 1.4s ease-in-out infinite; }

/* ---------- Beep the Robot (story 4) ---------- */
.rb1 .panel-art { background: linear-gradient(160deg, #d8e0d0, #c9cdb8); }
.rb2 .panel-art { background: linear-gradient(160deg, #ffe8c2, #ffd6a1); }
.rb3 .panel-art { background: linear-gradient(160deg, #fff3b0, #ffe39b); }
.rb4 .panel-art { background: linear-gradient(160deg, #d6ecff, #eaf6ff); }
.rb5 .panel-art { background: linear-gradient(160deg, #c4ecc8, #9fddaa); }
.rb6 .panel-art { background: linear-gradient(160deg, #232a52, #3c4480); }
.rb7 .panel-art { background: linear-gradient(160deg, #fff0a3, #ffe27a); }
.rb8 .panel-art { background: linear-gradient(160deg, #ffd6e8, #fff0f5); }

.bubble.tiny { font-size: 0.85rem; padding: 4px 10px; max-width: 160px; }

.char.litup { animation: glowpulse 2.2s ease-in-out infinite; }
.char.frenzy { animation: shake 0.3s ease-in-out infinite; }

.char.kick { animation: kicklunge 1.2s ease-in-out infinite; }
@keyframes kicklunge {
  0%, 100% { transform: translateX(0) rotate(0); }
  30% { transform: translateX(8px) rotate(10deg); }
  60% { transform: translateX(2px) rotate(-2deg); }
}

.fx.hifive { animation: floaty 2s ease-in-out infinite; }

.rb5 .ball {
  position: absolute;
  top: 10%;
  right: 14%;
  font-size: 2rem;
  animation: floaty 1.8s ease-in-out infinite;
}

.sfx.boom { font-size: 2.5rem; color: #d64550; animation: plopword 1.2s ease-in-out infinite; }

.batt {
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: 1rem;
  background: #ffe3e3;
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 4px 12px;
  transform: rotate(-3deg);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.char.robot-screen { position: relative; }
.screen-heart {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  animation: floaty 1.8s ease-in-out infinite;
}

.fx.heart-fx { animation: floaty 2.4s ease-in-out infinite; }

/* ---------- Story end ---------- */
.story-end {
  text-align: center;
  padding: 34px 0 10px;
}

.story-end p {
  font-family: "Baloo 2", cursive;
  font-size: 1.2rem;
  margin: 0 0 14px;
}

.end-links {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.end-cta {
  display: inline-block;
  font-family: "Baloo 2", cursive;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: var(--pink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 10px 26px;
  box-shadow: 0 5px 0 rgba(51, 39, 42, 0.2);
  transition: transform 0.15s ease, background 0.15s ease;
}

.end-cta.ghost { background: #fff; color: var(--ink); }
.end-cta.ghost:hover { background: var(--yellow); }

.end-cta:hover { transform: translateY(-3px); background: var(--orange); }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 36px 0 26px;
  color: #9a8b8f;
  font-weight: 700;
}

/* ---------- Small screens ---------- */
@media (max-width: 520px) {
  .logo-blob { width: 52px; height: 52px; font-size: 1.6rem; }
  .back-arrow { display: block; margin: 12px auto 0; }
  .panel-art { min-height: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
