:root {
    --giggle-void: #0d0221;
    --snicker-plum: #1a0a3e;
    --electric-magenta: #ff2ecc;
    --fizz-yellow: #ffe13a;
    --burst-cyan: #00f5d4;
    --tickle-coral: #ff6b6b;
    --bright-cream: #f0e6ff;
    --muted-lilac: #a78bfa;
    --glow-origin: #6c2bd9;
    --glow-peak: #ff2ecc;
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --bubble-radius: 48% 52% 45% 55% / 52% 48% 55% 45%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--giggle-void);
    color: var(--bright-cream);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    overflow-x: hidden;
    cursor: default;
}

/* ---------- noise overlay ---------- */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 900;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(240, 230, 255, 0.4) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255, 46, 204, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, rgba(0, 245, 212, 0.25) 1px, transparent 1px);
    background-size: 3px 3px, 5px 5px, 7px 7px;
    animation: noise-shift 0.6s steps(4) infinite;
}

@keyframes noise-shift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-1px, 1px); }
    50% { transform: translate(1px, -1px); }
    75% { transform: translate(-1px, -1px); }
    100% { transform: translate(0, 0); }
}

/* ---------- canvases ---------- */
#confetti-canvas, #cursor-trail-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#confetti-canvas { z-index: 1000; }
#cursor-trail-canvas { z-index: 950; }

/* ---------- radial nav ---------- */
.radial-nav {
    position: fixed;
    top: 28px;
    right: 28px;
    z-index: 1100;
    width: 64px;
    height: 64px;
}

.nav-toggle {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: var(--bubble-radius);
    background: linear-gradient(135deg, var(--glow-origin), var(--electric-magenta));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 0 30px rgba(255, 46, 204, 0.45);
    animation: bubble-morph 8s ease-in-out infinite;
    transition: transform 0.4s var(--spring);
    z-index: 2;
}

.nav-toggle:hover {
    transform: scale(1.08) rotate(8deg);
}

.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bright-cream);
    transition: transform 0.4s var(--spring);
}

.radial-nav.open .nav-toggle .nav-dot:nth-child(1) { transform: translate(2px, 2px) scale(1.6); }
.radial-nav.open .nav-toggle .nav-dot:nth-child(2) { transform: scale(0.5); }
.radial-nav.open .nav-toggle .nav-dot:nth-child(3) { transform: translate(-2px, -2px) scale(1.6); }

.nav-petals {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}

.nav-petal {
    position: absolute;
    top: -22px;
    left: -44px;
    width: 88px;
    height: 44px;
    transform: translate(0, 0) scale(0);
    border-radius: 60% 40% 50% 50% / 55% 45% 55% 45%;
    background: var(--snicker-plum);
    border: 2px solid var(--burst-cyan);
    color: var(--bright-cream);
    font-family: 'Baloo 2', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.55s var(--spring), background 0.3s ease, color 0.3s ease;
    pointer-events: none;
}

.nav-petal.sound-toggle {
    border-color: var(--fizz-yellow);
}

.radial-nav.open .nav-petals { pointer-events: auto; }

.radial-nav.open .nav-petal {
    pointer-events: auto;
    transform: rotate(calc(var(--angle, 0) * 1deg)) translate(110px) rotate(calc(var(--angle, 0) * -1deg)) scale(1);
}

.nav-petal:hover {
    background: var(--electric-magenta);
    color: var(--giggle-void);
    border-color: var(--fizz-yellow);
}

.sound-toggle.active {
    background: var(--fizz-yellow);
    color: var(--giggle-void);
}

/* ---------- chapter base ---------- */
.chapter {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 110px 40px 110px;
    overflow: hidden;
}

.spark-chapter {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(108, 43, 217, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(255, 46, 204, 0.18) 0%, transparent 55%),
        var(--giggle-void);
}

.build-chapter {
    background: linear-gradient(180deg, var(--giggle-void) 0%, var(--snicker-plum) 50%, var(--giggle-void) 100%);
}

.break-chapter {
    background:
        radial-gradient(circle at center, rgba(255, 46, 204, 0.18) 0%, var(--giggle-void) 65%);
}

.echo-chapter {
    background:
        radial-gradient(ellipse at 70% 30%, rgba(167, 139, 250, 0.18) 0%, transparent 60%),
        linear-gradient(180deg, var(--giggle-void) 0%, var(--snicker-plum) 60%, var(--giggle-void) 100%);
}

.next-chapter {
    background:
        radial-gradient(ellipse at center, var(--snicker-plum) 0%, var(--giggle-void) 70%);
}

.chapter-content {
    max-width: 920px;
    text-align: center;
    z-index: 10;
    position: relative;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s var(--spring), transform 1s var(--spring);
}

.chapter.visible .chapter-content {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- chapter marker ---------- */
.chapter-marker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 22px;
    margin-bottom: 28px;
    border: 2px solid var(--burst-cyan);
    border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
    background: rgba(0, 245, 212, 0.08);
    transform: rotate(-1.5deg);
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    color: var(--bright-cream);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.chapter-marker.break-marker {
    border-color: var(--electric-magenta);
    background: rgba(255, 46, 204, 0.1);
    transform: rotate(2deg);
}

.marker-no {
    color: var(--fizz-yellow);
    font-weight: 600;
}

.marker-label {
    color: var(--bright-cream);
}

/* ---------- hero ---------- */
.hero-title {
    font-family: 'Bungee', cursive;
    font-size: clamp(4rem, 14vw, 11rem);
    line-height: 1;
    margin-bottom: 28px;
    display: flex;
    justify-content: center;
    gap: 0.04em;
    flex-wrap: wrap;
}

.bounce-letter {
    display: inline-block;
    color: var(--fizz-yellow);
    text-shadow: 0 0 25px rgba(255, 46, 204, 0.45);
    animation: letter-bounce 1s var(--spring) both;
    animation-delay: var(--delay);
    transform-origin: 50% 100%;
    cursor: pointer;
    transition: filter 0.3s ease;
}

.bounce-letter:nth-child(1) { color: var(--tickle-coral); }
.bounce-letter:nth-child(2) { color: var(--fizz-yellow); }
.bounce-letter:nth-child(3) { color: var(--burst-cyan); }
.bounce-letter:nth-child(4) { color: var(--muted-lilac); }
.bounce-letter:nth-child(5) { color: var(--electric-magenta); }
.bounce-letter:nth-child(6) { color: var(--tickle-coral); }

.bounce-letter:hover {
    filter: drop-shadow(0 0 18px currentColor);
}

@keyframes letter-bounce {
    0%   { transform: translateY(-160px) scale(0.4) rotate(-12deg); opacity: 0; }
    55%  { transform: translateY(20px)  scale(1.12) rotate(4deg);  opacity: 1; }
    72%  { transform: translateY(-10px) scale(0.95) rotate(-2deg); }
    88%  { transform: translateY(4px)   scale(1.02) rotate(1deg);  }
    100% { transform: translateY(0)     scale(1)    rotate(0);     opacity: 1; }
}

.hero-tagline {
    font-family: 'Baloo 2', sans-serif;
    font-size: clamp(1.05rem, 2vw, 1.4rem);
    font-weight: 600;
    color: var(--muted-lilac);
    letter-spacing: 0.06em;
    margin-bottom: 50px;
}

.hero-prompt {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--bright-cream);
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.7;
}

.prompt-arrow {
    font-size: 1.5rem;
    color: var(--burst-cyan);
    animation: arrow-bob 2s var(--spring) infinite;
}

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

/* ---------- titles ---------- */
.chapter-title {
    font-family: 'Bungee', cursive;
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    color: var(--fizz-yellow);
    margin-bottom: 28px;
    line-height: 1.05;
    letter-spacing: 0.01em;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}

.break-title {
    color: var(--electric-magenta);
    transform: rotate(-2deg);
    text-shadow:
        2px 2px 0 var(--fizz-yellow),
        4px 4px 0 var(--burst-cyan),
        0 0 40px rgba(255, 46, 204, 0.6);
    animation: title-shake 0.6s ease-in-out infinite;
}

.echo-title {
    color: var(--muted-lilac);
    transform: rotate(1deg);
}

@keyframes title-shake {
    0%, 100% { transform: rotate(-2deg) translate(0); }
    25%      { transform: rotate(-1deg) translate(-2px, 1px); }
    50%      { transform: rotate(-3deg) translate(2px, -1px); }
    75%      { transform: rotate(-2deg) translate(-1px, 2px); }
}

.chapter-text {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(1.05rem, 1.5vw, 1.2rem);
    line-height: 1.85;
    color: rgba(240, 230, 255, 0.82);
    margin: 0 auto 38px;
    max-width: 640px;
}

/* ---------- blobs ---------- */
.blob {
    position: absolute;
    border-radius: var(--bubble-radius);
    opacity: 0.18;
    pointer-events: none;
    filter: blur(80px);
    animation: blob-morph 10s ease-in-out infinite, blob-drift 22s ease-in-out infinite;
}

@keyframes bubble-morph {
    0%, 100% { border-radius: 48% 52% 45% 55% / 52% 48% 55% 45%; }
    25%      { border-radius: 55% 45% 52% 48% / 45% 55% 48% 52%; }
    50%      { border-radius: 42% 58% 55% 45% / 55% 42% 52% 48%; }
    75%      { border-radius: 52% 48% 42% 58% / 48% 55% 45% 52%; }
}

@keyframes blob-morph {
    0%, 100% { border-radius: 48% 52% 45% 55% / 52% 48% 55% 45%; }
    33%      { border-radius: 55% 45% 60% 40% / 45% 55% 48% 52%; }
    66%      { border-radius: 38% 62% 55% 45% / 60% 42% 58% 40%; }
}

@keyframes blob-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(40px, -30px) scale(1.08); }
    66%      { transform: translate(-30px, 40px) scale(0.94); }
}

.blob-1 { width: 360px; height: 360px; background: var(--tickle-coral);   top: 8%;   left: -8%; }
.blob-2 { width: 300px; height: 300px; background: var(--burst-cyan);     top: 20%;  right: -6%; animation-delay: -3s; }
.blob-3 { width: 240px; height: 240px; background: var(--muted-lilac);    bottom: 8%; left: 12%; animation-delay: -5s; }
.blob-4 { width: 420px; height: 420px; background: var(--electric-magenta); top: 15%; right: -12%; opacity: 0.22; }
.blob-5 { width: 320px; height: 320px; background: var(--fizz-yellow);    top: 12%;  left: -6%; opacity: 0.14; }
.blob-6 { width: 240px; height: 240px; background: var(--glow-origin);    bottom: 12%; right: -4%; opacity: 0.22; animation-delay: -4s; }
.blob-7 { width: 280px; height: 280px; background: var(--fizz-yellow);    bottom: 10%; left: -6%; opacity: 0.18; }
.blob-build-1 { width: 380px; height: 380px; background: var(--glow-origin); top: 30%; left: 50%; opacity: 0.16; animation-delay: -2s; }
.blob-echo-1 { width: 340px; height: 340px; background: var(--muted-lilac); top: 5%; left: -5%; opacity: 0.16; }
.blob-echo-2 { width: 280px; height: 280px; background: var(--burst-cyan); bottom: 8%; right: -3%; opacity: 0.14; animation-delay: -6s; }

/* ---------- floating bubbles in hero ---------- */
.floating-bubbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.float-bubble {
    position: absolute;
    border-radius: var(--bubble-radius);
    border: 2px solid currentColor;
    opacity: 0.5;
    animation: float-up 14s linear infinite, bubble-morph 6s ease-in-out infinite;
}

.fb-1 { width: 24px; height: 24px; left: 12%;  bottom: -40px; color: var(--burst-cyan);     animation-delay: 0s; }
.fb-2 { width: 36px; height: 36px; left: 28%;  bottom: -60px; color: var(--electric-magenta); animation-delay: 2s; }
.fb-3 { width: 18px; height: 18px; left: 55%;  bottom: -30px; color: var(--fizz-yellow);    animation-delay: 4s; }
.fb-4 { width: 48px; height: 48px; left: 72%;  bottom: -70px; color: var(--muted-lilac);    animation-delay: 6s; }
.fb-5 { width: 28px; height: 28px; left: 86%;  bottom: -50px; color: var(--tickle-coral);   animation-delay: 8s; }

@keyframes float-up {
    0%   { transform: translateY(0) translateX(0); opacity: 0; }
    10%  { opacity: 0.6; }
    50%  { transform: translateY(-50vh) translateX(20px); }
    90%  { opacity: 0.4; }
    100% { transform: translateY(-110vh) translateX(-30px); opacity: 0; }
}

/* ---------- wobble strips ---------- */
.wobble-strip {
    position: absolute;
    height: 80px;
    width: 130%;
    left: -15%;
    pointer-events: none;
}

.strip-1 {
    top: 18%;
    background: linear-gradient(90deg, transparent, rgba(255, 225, 58, 0.1), transparent);
    transform: rotate(2deg);
}

.strip-2 {
    top: 50%;
    background: linear-gradient(90deg, transparent, rgba(255, 46, 204, 0.1), transparent);
    transform: rotate(-2.5deg);
}

.strip-3 {
    bottom: 18%;
    background: linear-gradient(90deg, transparent, rgba(0, 245, 212, 0.08), transparent);
    transform: rotate(1.5deg);
}

/* ---------- bubble cluster ---------- */
.bubble-cluster {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 22px;
    margin: 30px auto 36px;
    flex-wrap: wrap;
}

.wobble-bubble {
    border-radius: var(--bubble-radius);
    animation: bubble-float 4s ease-in-out infinite, bubble-morph 6s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.3s var(--spring), filter 0.3s ease;
    color: var(--giggle-void);
    font-family: 'Bungee', cursive;
    font-size: 1.3rem;
}

.wobble-bubble:hover {
    transform: scale(1.15) rotate(8deg);
    filter: drop-shadow(0 0 20px currentColor);
}

.wobble-bubble.popped {
    animation: bubble-pop 0.6s var(--spring) forwards;
}

.bubble-small  { width: 60px;  height: 60px;  background: var(--muted-lilac);    border-color: var(--burst-cyan); }
.bubble-medium { width: 90px;  height: 90px;  background: var(--burst-cyan);     border-color: var(--fizz-yellow); }
.bubble-large  { width: 120px; height: 120px; background: var(--fizz-yellow);    border-color: var(--electric-magenta); }
.bubble-medium.alt { background: var(--electric-magenta); border-color: var(--fizz-yellow); color: var(--bright-cream); }
.bubble-small.alt  { background: var(--tickle-coral);     border-color: var(--burst-cyan); }

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

@keyframes bubble-pop {
    0%   { transform: scale(1); opacity: 1; }
    40%  { transform: scale(1.5); opacity: 0.7; }
    100% { transform: scale(0.1); opacity: 0; }
}

.bubble-icon {
    pointer-events: none;
}

/* ---------- callout ---------- */
.callout {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 18px 28px;
    border-radius: 60% 40% 50% 50% / 55% 45% 55% 45%;
    background: rgba(167, 139, 250, 0.12);
    border: 2px dashed var(--muted-lilac);
    transform: rotate(-1.5deg);
    margin-top: 20px;
    max-width: 480px;
}

.emoji-svg {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.callout-text {
    font-family: 'Baloo 2', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bright-cream);
    text-align: left;
}

/* ---------- break section: ha ---------- */
.ha-display {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 18px;
    margin: 30px 0 32px;
    flex-wrap: wrap;
}

.ha-text {
    font-family: 'Bungee', cursive;
    font-size: clamp(2.6rem, 8vw, 5.5rem);
    animation: ha-pop 0.8s var(--spring) both;
    display: inline-block;
}

.ha-text:nth-child(1) { color: var(--tickle-coral);   animation-delay: 0s;    transform: rotate(-4deg); }
.ha-text:nth-child(2) { color: var(--fizz-yellow);    animation-delay: 0.15s; transform: rotate(3deg); }
.ha-text:nth-child(3) { color: var(--burst-cyan);     animation-delay: 0.3s;  transform: rotate(-2deg); }
.ha-text:nth-child(4) { color: var(--electric-magenta); animation-delay: 0.45s; transform: rotate(6deg); font-size: 0.7em; }

@keyframes ha-pop {
    0%   { transform: scale(0) rotate(0deg); opacity: 0; }
    70%  { transform: scale(1.3) rotate(8deg); opacity: 1; }
    100% { transform: scale(1) rotate(var(--ha-rot, 0deg)); opacity: 1; }
}

/* ---------- burst rays ---------- */
.burst-rays {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 1;
}

.ray {
    position: absolute;
    top: -2px;
    left: 0;
    width: 50vw;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 46, 204, 0.3), transparent);
    transform-origin: left center;
    animation: ray-pulse 4s ease-in-out infinite;
}

.ray-1 { transform: rotate(0deg);   animation-delay: 0s; }
.ray-2 { transform: rotate(45deg);  animation-delay: 0.4s; background: linear-gradient(90deg, transparent, rgba(255, 225, 58, 0.3), transparent); }
.ray-3 { transform: rotate(90deg);  animation-delay: 0.8s; background: linear-gradient(90deg, transparent, rgba(0, 245, 212, 0.3), transparent); }
.ray-4 { transform: rotate(135deg); animation-delay: 1.2s; background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.3), transparent); }
.ray-5 { transform: rotate(180deg); animation-delay: 1.6s; }
.ray-6 { transform: rotate(225deg); animation-delay: 2s;   background: linear-gradient(90deg, transparent, rgba(255, 107, 107, 0.3), transparent); }
.ray-7 { transform: rotate(270deg); animation-delay: 2.4s; background: linear-gradient(90deg, transparent, rgba(0, 245, 212, 0.3), transparent); }
.ray-8 { transform: rotate(315deg); animation-delay: 2.8s; background: linear-gradient(90deg, transparent, rgba(255, 225, 58, 0.3), transparent); }

@keyframes ray-pulse {
    0%, 100% { opacity: 0.2; transform: rotate(var(--rot, 0deg)) scaleX(0.6); }
    50%      { opacity: 0.6; transform: rotate(var(--rot, 0deg)) scaleX(1.1); }
}

.ray-1 { --rot: 0deg; }
.ray-2 { --rot: 45deg; }
.ray-3 { --rot: 90deg; }
.ray-4 { --rot: 135deg; }
.ray-5 { --rot: 180deg; }
.ray-6 { --rot: 225deg; }
.ray-7 { --rot: 270deg; }
.ray-8 { --rot: 315deg; }

/* ---------- trigger button ---------- */
.trigger-button {
    font-family: 'Bungee', cursive;
    font-size: 0.95rem;
    padding: 16px 36px;
    background: transparent;
    color: var(--fizz-yellow);
    border: 3px solid var(--fizz-yellow);
    border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
    cursor: pointer;
    transition: all 0.4s var(--spring);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 8px;
}

.trigger-button:hover {
    background: var(--fizz-yellow);
    color: var(--giggle-void);
    transform: scale(1.07) rotate(-2deg);
    box-shadow: 0 0 35px rgba(255, 225, 58, 0.5);
}

.trigger-button:active {
    transform: scale(0.94);
}

/* ---------- echo grid ---------- */
.echo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 26px;
    margin: 36px 0 40px;
    text-align: left;
}

.echo-card {
    padding: 28px 24px;
    background: rgba(167, 139, 250, 0.08);
    border: 2px solid rgba(167, 139, 250, 0.3);
    border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
    transform: rotate(calc(var(--card-tilt, 0) * 1deg));
    transition: transform 0.5s var(--spring), background 0.4s ease, border-color 0.4s ease;
    animation: bubble-morph 12s ease-in-out infinite;
}

.echo-card:hover {
    background: rgba(0, 245, 212, 0.1);
    border-color: var(--burst-cyan);
    transform: rotate(0) scale(1.04);
}

.echo-card .emoji-svg {
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
    color: var(--burst-cyan);
}

.echo-card-title {
    font-family: 'Baloo 2', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--fizz-yellow);
    margin-bottom: 10px;
}

.echo-card-text {
    font-family: 'Nunito', sans-serif;
    font-size: 0.96rem;
    line-height: 1.6;
    color: rgba(240, 230, 255, 0.78);
}

/* ---------- echo stats ---------- */
.echo-stats {
    display: inline-block;
    text-align: left;
    padding: 22px 28px;
    background: rgba(13, 2, 33, 0.7);
    border: 2px dashed var(--burst-cyan);
    border-radius: 28px;
    margin-top: 14px;
    font-family: 'Fira Code', monospace;
    font-size: 0.92rem;
    color: var(--bright-cream);
    transform: rotate(-1deg);
    overflow: auto;
}

.echo-stats code {
    white-space: pre;
}

.stat-val {
    color: var(--fizz-yellow);
    font-weight: 600;
}

/* ---------- finale ---------- */
.finale-title {
    font-family: 'Bungee', cursive;
    font-size: clamp(3rem, 10vw, 7rem);
    background: linear-gradient(135deg, var(--tickle-coral), var(--fizz-yellow), var(--burst-cyan), var(--muted-lilac), var(--electric-magenta));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: holo-shift 6s ease-in-out infinite;
    margin-bottom: 14px;
    transform: rotate(-1.5deg);
}

@keyframes holo-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.finale-subtitle {
    font-family: 'Baloo 2', sans-serif;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 600;
    color: var(--muted-lilac);
    margin-bottom: 38px;
    letter-spacing: 0.04em;
}

.giggle-button {
    position: relative;
    font-family: 'Bungee', cursive;
    font-size: 1.05rem;
    padding: 18px 44px;
    background: linear-gradient(135deg, var(--glow-origin), var(--electric-magenta));
    color: var(--bright-cream);
    border: none;
    border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
    cursor: pointer;
    transition: transform 0.4s var(--spring), box-shadow 0.4s ease;
    box-shadow: 0 0 35px rgba(108, 43, 217, 0.45);
    letter-spacing: 0.06em;
    overflow: hidden;
    animation: bubble-morph 8s ease-in-out infinite;
}

.giggle-button:hover {
    transform: scale(1.1) rotate(-3deg);
    box-shadow: 0 0 60px rgba(255, 46, 204, 0.6);
}

.giggle-button:active {
    transform: scale(0.94);
}

.giggle-button.jiggling {
    animation: jiggle 0.5s var(--spring);
}

@keyframes jiggle {
    0%, 100% { transform: rotate(0); }
    25%      { transform: rotate(3deg) scale(1.05); }
    50%      { transform: rotate(-3deg) scale(0.97); }
    75%      { transform: rotate(2deg) scale(1.03); }
}

.giggle-trail {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 225, 58, 0.4) 0%, transparent 40%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.giggle-button:hover .giggle-trail {
    opacity: 1;
}

/* ---------- footer particles ---------- */
.footer-particles {
    position: relative;
    width: 100%;
    height: 90px;
    margin: 50px auto 30px;
    pointer-events: auto;
}

.footer-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bright-cream);
    transition: transform 0.6s var(--spring);
    will-change: transform;
}

.footer-meta {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: rgba(240, 230, 255, 0.45);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.dot-sep {
    color: var(--electric-magenta);
}

/* ---------- squiggle divider ---------- */
.squiggle-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 5;
    pointer-events: none;
}

.squiggle-path {
    fill: none;
    stroke: var(--electric-magenta);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
    animation: squiggle-draw 4s var(--spring) forwards, squiggle-wave 3.5s ease-in-out 4s infinite;
}

.squiggle-path.alt {
    stroke: var(--burst-cyan);
}

@keyframes squiggle-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes squiggle-wave {
    0%, 100% { d: path("M0 30 Q 75 0 150 30 T 300 30 T 450 30 T 600 30 T 750 30 T 900 30 T 1050 30 T 1200 30"); }
    50%      { d: path("M0 30 Q 75 60 150 30 T 300 30 T 450 30 T 600 30 T 750 30 T 900 30 T 1050 30 T 1200 30"); }
}

/* ---------- responsive ---------- */
@media (max-width: 768px) {
    .chapter {
        padding: 90px 22px 90px;
    }

    .ha-display {
        gap: 10px;
    }

    .bubble-cluster {
        gap: 16px;
    }

    .bubble-large  { width: 90px; height: 90px; }
    .bubble-medium { width: 70px; height: 70px; }
    .bubble-small  { width: 50px; height: 50px; }

    .radial-nav {
        top: 18px;
        right: 18px;
        width: 54px;
        height: 54px;
    }

    .nav-toggle {
        width: 54px;
        height: 54px;
    }

    .echo-stats {
        font-size: 0.78rem;
        padding: 16px 18px;
    }

    .footer-meta {
        gap: 6px;
        font-size: 0.7rem;
    }

    .dot-sep { display: none; }
}
