/* Briar's Big Walk — styles. Loads after gamekit.css.
   Fresh late-summer-morning palette: sky blue + sunshine cream + lane green
   + school red + chalk yellow. Golden banner + glowing star stay gold. */

:root {
    --sky: #BFE3F5;
    --sky-deep: #35708E;
    --sky-high: #8FC7E8;
    --cream: #FFF3C9;
    --lane: #7FA65A;
    --hedge: #4E7A3A;
    --path-tan: #D9C49A;
    --school-red: #C0392B;
    --school-red-deep: #93281D;
    --gold: #E8A928;
    --gold-light: #F5C95E;
    --chalk: #F2C24E;
    --mailbox: #4A7FB5;
    --bark: #6B5B4E;
    --bark-deep: #4E4237;
    --bark-light: #A08B76;
    --paper: #FFF9E8;
    --paper-deep: #F5E9C8;
    --ink: #3A3128;
    --dd-font: 'Comic Sans MS', 'Chalkboard SE', 'Segoe UI', Arial, sans-serif;
}

body { font-family: var(--dd-font); background: var(--sky-deep); overflow: hidden; color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

#app { position: fixed; inset: 0; overflow: hidden; }
#app > section { position: absolute; inset: 0; overflow: hidden; }
.depth { position: absolute; inset: 0; pointer-events: none; }

.bg-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fg-svg { z-index: 4; pointer-events: none; }

/* ══════════════════════════════════════════════════════════════
   TITLE
   ══════════════════════════════════════════════════════════════ */
#screen-title {
    display: flex; flex-direction: column; align-items: center;
    background:
        radial-gradient(120% 60% at 50% 108%, rgba(255, 243, 201, 0.55) 0%, rgba(255, 243, 201, 0) 60%),
        linear-gradient(180deg, var(--sky-deep) 0%, var(--sky-high) 40%, var(--sky) 62%, var(--lane) 100%);
}
#title-inner {
    flex: 1; width: 100%;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; justify-content: safe center;
    overflow-y: auto; overscroll-behavior: contain;
    gap: clamp(8px, 1.6vh, 16px);
    padding: 16px 12px calc(var(--gk-corner-clear) + 4px);
}
#title-art { width: min(88vw, 430px); }
#title-art svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 24px rgba(30, 52, 66, 0.45)); }

.game-title {
    font-size: clamp(1.9rem, 7.2vw, 3.4rem); font-weight: 800; text-align: center; line-height: 1.05;
    color: var(--gold-light);
    text-shadow: 0 3px 0 var(--school-red-deep), 0 7px 18px rgba(30, 52, 66, 0.55);
    animation: dd-title-bob 5s ease-in-out infinite;
}
.game-title .amp { font-size: 0.55em; color: var(--paper); display: inline-block; margin: 0 2px; }
@keyframes dd-title-bob { 0%, 100% { transform: rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1deg); } }

.tagline { color: #FFFDF4; font-size: clamp(1rem, 3.4vw, 1.3rem); font-weight: 700; text-shadow: 0 2px 6px rgba(30, 52, 66, 0.5); }

#btn-start, #btn-resume { min-width: min(78vw, 320px); }
#btn-book { min-height: 52px; padding: 8px 26px; font-size: clamp(1rem, 3.4vw, 1.2rem); }

#title-stickers { display: flex; gap: 8px; margin-top: 2px; }
.mini-sticker {
    width: clamp(42px, 10vw, 56px); height: clamp(42px, 10vw, 56px); border-radius: 50%;
    background: rgba(255, 249, 232, 0.18); border: 2px dashed rgba(255, 249, 232, 0.6);
    display: flex; align-items: center; justify-content: center;
}
.mini-sticker.owned { background: var(--paper); border-style: solid; border-color: var(--gold); box-shadow: 0 3px 10px rgba(30, 52, 66, 0.4); }
.mini-sticker svg { width: 88%; height: 88%; }
.mini-sticker .q { color: rgba(255, 249, 232, 0.9); font-weight: 800; font-size: 1.2rem; }

#golden-note {
    background: linear-gradient(180deg, #F5CE3C, #E8A928); color: var(--bark-deep);
    font-weight: 800; padding: 8px 18px; border-radius: 20px; font-size: clamp(0.9rem, 3vw, 1.05rem);
    box-shadow: 0 4px 14px rgba(232, 169, 40, 0.5);
    animation: dd-glow-pulse 2.6s ease-in-out infinite;
}
@keyframes dd-glow-pulse { 0%, 100% { box-shadow: 0 4px 14px rgba(232,169,40,0.5); } 50% { box-shadow: 0 4px 26px rgba(245,206,60,0.85); } }

#info-btn {
    position: absolute; left: var(--gk-corner-inset); bottom: var(--gk-corner-inset); z-index: 8;
    min-height: 52px; padding: 10px 18px; border: none; border-radius: 30px;
    background: rgba(255, 249, 232, 0.2); color: #FFFDF4; font-size: 0.95rem; font-weight: 700;
    cursor: pointer; backdrop-filter: blur(4px); font-family: inherit;
}

/* keep the title column below the fixed HUD on phones */
@media (max-width: 719px) {
    #title-inner { padding-top: calc(var(--gk-hud-clear-top) + 4px); justify-content: flex-start; justify-content: safe center; }
}
/* short phones: shrink the tableau so the golden banner clears the corner pill */
@media (max-height: 620px) {
    #title-inner { gap: 6px; }
    #title-art { width: min(76vw, 340px); }
}

/* ══════════════════════════════════════════════════════════════
   STORY — stage on top, sunshine-cream panel below
   ══════════════════════════════════════════════════════════════ */
#screen-story { display: flex; flex-direction: column; }

#stage { position: relative; flex: 1 1 40%; min-height: 168px; overflow: hidden; background: var(--sky-deep); }

#cast { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.char-slot {
    position: absolute; transform: translate(-50%, -50%) scale(var(--s, 1));
    transform-origin: center bottom; border: none; background: none; padding: 0; cursor: pointer;
    pointer-events: auto; width: clamp(96px, 17vw, 168px);
    animation: dd-bob 3.4s ease-in-out infinite;
}
.char-slot svg { width: 100%; height: auto; display: block; overflow: visible; pointer-events: none; }
.char-mama { width: clamp(106px, 19vw, 188px); animation-duration: 3.9s; }
.char-steady { width: clamp(110px, 20vw, 192px); animation-duration: 4.8s; }
.char-marigold { width: clamp(104px, 19vw, 184px); animation-duration: 4.3s; }
.char-waddles { width: clamp(72px, 13vw, 128px); animation-duration: 3s; }
@keyframes dd-bob {
    0%, 100% { transform: translate(-50%, -50%) scale(var(--s, 1)); }
    50% { transform: translate(-50%, calc(-50% - 6px)) scale(var(--s, 1)); }
}
.char-slot.talking { animation: dd-talk 0.7s ease-in-out infinite; }
@keyframes dd-talk {
    0%, 100% { transform: translate(-50%, -50%) scale(var(--s, 1)) rotate(-1.5deg); }
    50% { transform: translate(-50%, calc(-50% - 5px)) scale(var(--s, 1)) rotate(1.5deg); }
}
.char-slot.react { animation: dd-react 0.7s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes dd-react {
    0% { transform: translate(-50%, -50%) scale(var(--s, 1)); }
    40% { transform: translate(-50%, calc(-50% - 14px)) scale(calc(var(--s, 1) * 1.08)); }
    100% { transform: translate(-50%, -50%) scale(var(--s, 1)); }
}

/* ── living scenes: ambience overlay (dandelion fluff / butterflies / chalk) ──
   Sparse, unhurried, pure transform+opacity, pointer-events:none, and built
   only when the device has not asked for reduced motion (JS gates it). */
#ambience { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.amb-fluff { position: absolute; top: -8%; width: clamp(10px, 2.4vw, 16px); opacity: 0; animation: dd-amb-fall linear infinite; will-change: transform; }
.amb-fluff svg { width: 100%; height: auto; display: block; }
@keyframes dd-amb-fall {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
    8%   { opacity: 0.9; }
    45%  { transform: translate3d(4vw, 22vh, 0) rotate(140deg); }
    92%  { opacity: 0.8; }
    100% { transform: translate3d(-3vw, 46vh, 0) rotate(300deg); opacity: 0; }
}
/* the tummy-butterflies made visible — a cute, loopy flutter near Briar */
.amb-btf { position: absolute; width: clamp(12px, 2.6vw, 18px); opacity: 0; animation: dd-amb-btf 5.2s ease-in-out infinite; will-change: transform; }
.amb-btf svg { width: 100%; height: auto; display: block; }
@keyframes dd-amb-btf {
    0%   { transform: translate3d(0, 0, 0) rotate(0); opacity: 0; }
    12%  { opacity: 0.95; }
    35%  { transform: translate3d(9px, -11px, 0) rotate(9deg); }
    60%  { transform: translate3d(-5px, -19px, 0) rotate(-8deg); opacity: 0.9; }
    85%  { opacity: 0.6; }
    100% { transform: translate3d(6px, -29px, 0) rotate(6deg); opacity: 0; }
}
/* chalk-dust motes drifting down a light shaft at school */
.amb-chalk {
    position: absolute; width: 5px; height: 5px; border-radius: 50%;
    background: rgba(255, 249, 232, 0.85); box-shadow: 0 0 6px rgba(255, 249, 232, 0.8);
    opacity: 0; animation: dd-amb-chalk 7s ease-in-out infinite; will-change: transform;
}
@keyframes dd-amb-chalk {
    0%   { transform: translate3d(0, 0, 0) scale(1); opacity: 0; }
    25%  { opacity: 0.7; }
    100% { transform: translate3d(8px, 34px, 0) scale(0.6); opacity: 0; }
}

/* soft crossfade between scenes (instant under reduced motion) */
#scene-bg, #cast, #ambience { transition: opacity 0.28s ease; }
#stage.fading #scene-bg, #stage.fading #cast, #stage.fading #ambience { opacity: 0; transition-duration: 0.16s; }

/* subtle parallax: the foreground plate drifts against the backdrop — art only, never text */
.dd-parallax .fg-svg { animation: dd-parallax 18s ease-in-out infinite alternate; }
@keyframes dd-parallax { from { transform: translateX(-5px); } to { transform: translateX(5px); } }

/* the current speaker bounces; everyone else settles while a line plays */
#cast.speaking .char-slot:not(.talking):not(.react) { animation-play-state: paused; }

#chapter-badge {
    position: absolute; left: 10px; top: var(--gk-hud-inset-top); z-index: 5;
    display: flex; align-items: center; gap: 6px;
    background: rgba(58, 49, 40, 0.78); color: var(--paper);
    font-weight: 800; font-size: 0.85rem; padding: 6px 12px 6px 8px; border-radius: 16px;
}
#chapter-badge svg { width: 18px; height: 20px; }

/* dandelion-fluff page-turn wipe (same id/behavior as the old leaf wipe) */
#leaf-wipe { position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0; }
#leaf-wipe.go { animation: dd-wipe 0.6s ease-out; }
#leaf-wipe.go::before {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(circle at 15% 30%, rgba(255, 255, 255, 0.95), transparent 11%),
        radial-gradient(circle at 35% 65%, rgba(255, 243, 201, 0.95), transparent 10%),
        radial-gradient(circle at 55% 25%, rgba(242, 194, 78, 0.9), transparent 11%),
        radial-gradient(circle at 75% 60%, rgba(255, 255, 255, 0.9), transparent 10%),
        radial-gradient(circle at 90% 35%, rgba(191, 227, 245, 0.95), transparent 11%),
        linear-gradient(100deg, rgba(127, 166, 90, 0.95) 30%, rgba(127, 166, 90, 0) 70%);
    animation: dd-wipe-move 0.6s ease-out;
}
@keyframes dd-wipe { from { opacity: 1; } to { opacity: 0; } }
@keyframes dd-wipe-move { from { transform: translateX(-105%); } to { transform: translateX(115%); } }

/* ── the sunshine-cream panel ── */
#panel {
    position: relative; z-index: 7; flex: none;
    max-height: 66%;
    overflow-y: auto; overscroll-behavior: contain;
    background: linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
    border-top: 5px solid var(--bark);
    box-shadow: 0 -8px 24px rgba(30, 52, 66, 0.35);
    padding: 10px clamp(10px, 3vw, 22px) 10px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}

#choose-banner {
    background: linear-gradient(180deg, var(--gold-light), var(--gold));
    color: var(--bark-deep); font-weight: 800; font-size: clamp(1.05rem, 4vw, 1.5rem);
    padding: 8px 24px; border-radius: 20px; border: 3px solid var(--bark);
    box-shadow: 0 5px 14px rgba(78, 66, 55, 0.3);
}
#choose-banner.pop { animation: dd-boing 0.6s cubic-bezier(0.2, 1.7, 0.4, 1); }
@keyframes dd-boing { 0% { transform: translateY(-40px) scale(0.6); } 60% { transform: translateY(4px) scale(1.08); } 100% { transform: translateY(0) scale(1); } }

#story-card {
    position: relative; width: min(100%, 680px);
    background: #FFFDF4; border: 3px solid var(--bark-light); border-radius: 20px;
    padding: 20px 64px 14px 16px; min-height: 84px;
    box-shadow: 0 6px 16px rgba(78, 66, 55, 0.18);
}
#story-card.line-in { animation: dd-line-in 0.35s ease-out; }
@keyframes dd-line-in { from { opacity: 0.3; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

#speaker-chip {
    position: absolute; top: -14px; left: 14px;
    color: #FFF; font-weight: 800; font-size: 0.85rem;
    padding: 4px 14px; border-radius: 14px; background: var(--bark);
    box-shadow: 0 3px 8px rgba(58, 49, 40, 0.35);
}
#story-text { font-size: clamp(1.02rem, 3.4vw, 1.38rem); font-weight: 700; line-height: 1.45; color: var(--ink); cursor: pointer; }

/* read-along karaoke: each word lights as it is spoken (transition collapses
   to an instant step under reduced motion via the global media query) */
.dd-w { border-radius: 6px; padding: 0 2px; margin: 0 -2px; transition: background-color 0.16s ease; }
.dd-w.lit { background-color: rgba(242, 194, 78, 0.65); }

#ear-btn {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border: none; border-radius: 50%;
    background: var(--mailbox); color: #fff; font-size: 1.35rem; cursor: pointer;
    box-shadow: 0 3px 8px rgba(74, 127, 181, 0.4);
    animation: dd-ear 2.6s ease-in-out infinite;
}
@keyframes dd-ear { 0%, 100% { transform: translateY(-50%) rotate(-4deg); } 50% { transform: translateY(-50%) scale(1.07) rotate(4deg); } }

/* ── choices: big picture rows ── */
#choice-area { width: min(100%, 680px); display: flex; flex-direction: column; gap: 10px; }
.choice-btn {
    display: flex; align-items: center; gap: 14px;
    width: 100%; min-height: 92px; padding: 10px 16px;
    background: linear-gradient(180deg, #FFFDF4, var(--paper));
    border: 4px solid var(--bark); border-radius: 24px; cursor: pointer;
    box-shadow: 0 8px 18px rgba(78, 66, 55, 0.25);
    font-family: inherit; text-align: left;
    transition: transform 0.25s, opacity 0.35s;
    animation: dd-choice-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) backwards;
}
.choice-btn:nth-child(2) { animation-delay: 0.12s; }
@keyframes dd-choice-in { from { opacity: 0; transform: translateY(18px) scale(0.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
.choice-btn .ch-art { flex: none; width: clamp(56px, 12vw, 72px); }
.choice-btn .ch-art svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 3px 5px rgba(58, 49, 40, 0.3)); }
.choice-btn .ch-label { font-size: clamp(1.1rem, 4.2vw, 1.5rem); font-weight: 800; color: var(--ink); }
.choice-btn.wiggle { animation: dd-cardwig 0.6s ease-in-out; }
@keyframes dd-cardwig { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-1.6deg) scale(1.02); } 75% { transform: rotate(1.6deg) scale(1.02); } }
.choice-btn.faded { opacity: 0.18; transform: scale(0.94); pointer-events: none; }
.choice-btn.picked { border-color: var(--gold); box-shadow: 0 10px 26px rgba(232, 169, 40, 0.55); animation: dd-picked 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
@keyframes dd-picked { to { transform: scale(1.05); } }
.choice-btn:active { transform: scale(0.97); }
.choice-btn.nudge { animation: dd-cardwig 0.5s ease; }
.choice-btn.halo { border-color: var(--gold); animation: dd-halo 1.1s ease-in-out infinite; }
@keyframes dd-halo { 0%, 100% { box-shadow: 0 0 0 4px rgba(232, 169, 40, 0.45); } 50% { box-shadow: 0 0 0 12px rgba(232, 169, 40, 0.15); } }

/* find-the-wiggly-stone + recall rows */
.find-row { display: flex; gap: 12px; justify-content: center; width: 100%; }
.find-row .choice-btn { width: auto; min-width: 96px; min-height: 92px; justify-content: center; }
.recall-icon { font-size: 2.6rem; line-height: 1; width: auto !important; }
.find-spot {
    flex: 1; max-width: 130px; min-height: 92px; border: 4px solid var(--bark);
    border-radius: 22px; background: linear-gradient(180deg, #FFFDF4, var(--paper));
    cursor: pointer; box-shadow: 0 6px 14px rgba(78, 66, 55, 0.25);
    animation: dd-choice-in 0.4s ease-out backwards;
}
.find-spot:nth-child(2) { animation-delay: 0.1s; }
.find-spot:nth-child(3) { animation-delay: 0.2s; }
.find-spot svg { width: 74%; height: auto; margin: auto; display: block; }
.find-spot.is-correct svg { filter: drop-shadow(0 0 8px rgba(242, 194, 78, 0.95)); }
.find-spot.found { border-color: var(--gold); animation: dd-picked 0.5s ease forwards; }
.find-spot.faded { opacity: 0.2; pointer-events: none; }
.find-spot.nudge { animation: dd-cardwig 0.5s ease; }
.find-spot.halo { animation: dd-halo 1.1s ease-in-out infinite; }

/* ── the glowing-star page-turn button ── */
#next-btn {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    margin: 2px 4px 8px auto; padding: 4px 10px;
    border: none; background: none; cursor: pointer; z-index: 8;
    font-family: inherit;
}
#panel #next-btn { flex: none; }
#next-btn svg { width: 86px; height: 86px; filter: drop-shadow(0 0 14px rgba(245, 201, 94, 0.85)) drop-shadow(0 5px 8px rgba(58, 49, 40, 0.35)); animation: dd-star-pulse 1.3s ease-in-out infinite; }
@keyframes dd-star-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
#next-btn:active svg { transform: scale(0.92); }
#next-word { font-weight: 800; color: var(--bark-deep); font-size: 0.95rem; }
#next-btn.hooray #next-word { color: var(--school-red); font-size: 1.1rem; }

#howto {
    align-self: flex-end; margin: 2px 18px -4px 0;
    background: var(--gold-light); color: var(--bark-deep); font-weight: 800;
    padding: 8px 14px; border-radius: 18px; border: 3px solid var(--bark);
    box-shadow: 0 6px 16px rgba(58, 49, 40, 0.35);
    animation: dd-howto 1.4s ease-in-out infinite;
    pointer-events: none;
}
.howto-hand { display: inline-block; animation: dd-hand 1.4s ease-in-out infinite; }
@keyframes dd-howto { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(8px); } }
@keyframes dd-hand { 0%, 100% { transform: rotate(0) translateY(0); } 50% { transform: rotate(14deg) translateY(-3px); } }

/* ══════════════════════════════════════════════════════════════
   STICKER BOOK + GROWN-UPS
   ══════════════════════════════════════════════════════════════ */
#book-overlay, #info-overlay {
    position: fixed; inset: 0; z-index: 930; background: rgba(30, 52, 66, 0.62);
    display: flex; align-items: center; justify-content: center; animation: gk-fade-in 0.25s;
    padding: 12px;
}
#book-card, #info-card {
    position: relative; width: min(94vw, 560px); max-height: min(88vh, 640px); overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--paper); text-align: left;
    border: 4px solid var(--bark);
}
#book-card h2, #info-card h2 { color: var(--school-red); margin-bottom: 6px; padding-right: 56px; }
.book-hint { margin-bottom: 12px; font-weight: 700; }
#book-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.book-slot {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: #FFFDF4; border: 3px dashed var(--bark-light); border-radius: 18px;
    padding: 10px 6px; min-height: 128px; cursor: pointer; font-family: inherit;
}
.book-slot.owned { border-style: solid; border-color: var(--gold); box-shadow: inset 0 0 18px rgba(232, 169, 40, 0.18); }
.book-slot .slot-art { width: clamp(64px, 16vw, 84px); height: clamp(64px, 16vw, 84px); display: flex; align-items: center; justify-content: center; }
.book-slot .slot-art svg { width: 100%; height: 100%; }
.book-slot .q { font-size: 2rem; font-weight: 800; color: var(--bark-light); }
.book-slot .slot-name { font-weight: 800; font-size: clamp(0.82rem, 2.6vw, 0.98rem); color: var(--ink); text-align: center; line-height: 1.2; }
.book-slot.golden.owned { background: linear-gradient(180deg, #FFF7DC, #F5E3A8); }
.book-slot.stamp { animation: dd-stamp 0.7s cubic-bezier(0.2, 1.8, 0.4, 1); }
@keyframes dd-stamp { 0% { transform: scale(2) rotate(-8deg); opacity: 0; } 55% { transform: scale(0.92) rotate(3deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.slot-talk {
    font-size: 0.72rem; font-weight: 600; color: var(--bark); line-height: 1.3;
    text-align: left; opacity: 0.92; padding: 0 2px;
}

/* ── "your path" recap strip inside the celebration card ── */
.dd-path-wrap { margin: 4px 0 8px; }
.dd-path { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; }
.dd-path-node {
    width: clamp(34px, 9vw, 46px); height: clamp(34px, 9vw, 46px); flex: none;
    background: var(--paper); border: 2px solid var(--bark-light); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; padding: 3px;
}
.dd-path-node svg { width: 100%; height: 100%; display: block; }
.dd-path-node.dd-path-end { width: clamp(44px, 12vw, 58px); height: clamp(44px, 12vw, 58px); border-color: var(--gold); background: #FFF7DC; }
.dd-path-arrow { color: var(--bark-light); font-size: 0.85rem; font-weight: 800; }
.dd-try {
    margin-top: 10px; min-height: 52px; padding: 8px 20px;
    border: 3px solid var(--bark); border-radius: 26px;
    background: linear-gradient(180deg, var(--gold-light), var(--gold));
    color: var(--bark-deep); font-weight: 800; font-family: inherit; font-size: 1rem; cursor: pointer;
    box-shadow: 0 4px 12px rgba(78, 66, 55, 0.25);
}
.dd-try:active { transform: scale(0.96); }

#book-close, #info-close {
    position: absolute; right: 10px; top: 10px; width: 52px; height: 52px;
    border: none; border-radius: 50%; background: var(--paper-deep);
    font-size: 1.2rem; cursor: pointer; font-family: inherit;
}

#info-card p { line-height: 1.5; margin-bottom: 6px; }
.info-block { margin-top: 14px; padding-top: 12px; border-top: 2px dashed var(--bark-light); }
.info-block h3 { color: var(--school-red); font-size: 1.05rem; margin-bottom: 4px; }
.info-fine { font-size: 0.9rem; opacity: 0.85; margin-top: 8px; }
#level-picker { display: flex; gap: 10px; margin: 10px 0; }
.lvl-btn {
    flex: 1; min-height: 76px; padding: 8px; border: 3px solid var(--bark-light); border-radius: 18px;
    background: #FFFDF4; color: var(--ink); font-family: inherit; font-size: 0.85rem;
    cursor: pointer; line-height: 1.35;
}
.lvl-btn.sel { border-color: var(--school-red); background: #FBE3CE; box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3); }

/* ══════════════════════════════════════════════════════════════
   scene art animations (classes emitted by art.js)
   ══════════════════════════════════════════════════════════════ */
.dd-drift { animation: dd-drift 14s ease-in-out infinite alternate; }
@keyframes dd-drift { from { transform: translateX(-8px); } to { transform: translateX(10px); } }
.dd-sway { animation: dd-sway 4.5s ease-in-out infinite; }
@keyframes dd-sway { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }
.dd-flag { animation: dd-flagwave 2.2s ease-in-out infinite; }
@keyframes dd-flagwave { 0%, 100% { transform: skewY(0deg); } 50% { transform: skewY(-6deg); } }
.dd-leaf { animation: dd-leaffall 7s ease-in-out infinite; }
@keyframes dd-leaffall {
    0%, 100% { transform: translate(0, 0) rotate(0); opacity: 0.9; }
    50% { transform: translate(9px, 14px) rotate(24deg); opacity: 1; }
}
.dd-smoke { animation: dd-smoke 5s ease-in-out infinite; }
@keyframes dd-smoke { 0%, 100% { transform: translateY(0); opacity: 0.9; } 50% { transform: translateY(-9px); opacity: 0.6; } }
.dd-steam { animation: dd-smoke 4s ease-in-out infinite; }
.dd-twinkle { animation: dd-twinkleA 2.4s ease-in-out infinite; }
@keyframes dd-twinkleA { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.dd-shimmer { animation: dd-shimmerA 3s ease-in-out infinite; }
@keyframes dd-shimmerA { 0%, 100% { opacity: 0.9; transform: translateX(0); } 50% { opacity: 0.5; transform: translateX(6px); } }
.dd-bell { animation: dd-bellswing 1.6s ease-in-out infinite; }
@keyframes dd-bellswing { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
.dd-eyes { animation: dd-blink 4.4s infinite; transform-origin: center; }
@keyframes dd-blink { 0%, 92%, 100% { transform: scaleY(1); } 95%, 97% { transform: scaleY(0.1); } }
.dd-tail { animation: dd-tailsway 3.4s ease-in-out infinite; }
@keyframes dd-tailsway { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(8deg); } }
.dd-ear-l { animation: dd-earflick 5.4s ease-in-out infinite; transform-origin: 42px 38px; }
.dd-ear-r { animation: dd-earflick 6.2s ease-in-out infinite; transform-origin: 78px 38px; }
@keyframes dd-earflick { 0%, 90%, 100% { transform: rotate(0); } 94% { transform: rotate(-9deg); } }
.dd-dash { animation: dd-dashflick 0.5s linear infinite alternate; }
@keyframes dd-dashflick { from { opacity: 0.35; } to { opacity: 0.95; } }
.dd-peek { animation: dd-peekbob 2.4s ease-in-out infinite; }
@keyframes dd-peekbob { 0%, 100% { transform: translateY(4px); } 50% { transform: translateY(-4px); } }
.dd-tear { animation: dd-teardrop 2.2s ease-in-out infinite; }
@keyframes dd-teardrop { 0%, 100% { transform: translateY(0); opacity: 0.9; } 60% { transform: translateY(6px); opacity: 0.3; } }
.dd-wing-l, .dd-wing-r { animation: dd-wingidle 3.2s ease-in-out infinite; }
@keyframes dd-wingidle { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-4deg); } }
.dd-flap { animation: dd-flapA 0.7s ease-in-out infinite alternate !important; }
.dd-flap2 { animation: dd-flapB 0.7s ease-in-out infinite alternate !important; }
@keyframes dd-flapA { from { transform: rotate(-14deg); } to { transform: rotate(10deg); } }
@keyframes dd-flapB { from { transform: rotate(14deg); } to { transform: rotate(-10deg); } }
.dd-splash { animation: dd-splashA 1.1s ease-out infinite; transform-origin: 100px 80px; }
@keyframes dd-splashA { 0% { transform: scale(0.6); opacity: 0; } 40% { opacity: 1; } 100% { transform: scale(1.15) translateY(-6px); opacity: 0; } }
.dd-ripple { animation: dd-rippleA 3.2s ease-in-out infinite; }
@keyframes dd-rippleA { 0%, 100% { transform: translateX(0); opacity: 0.7; } 50% { transform: translateX(7px); opacity: 1; } }
.dd-boat { animation: dd-boatrock 3.6s ease-in-out infinite; }
@keyframes dd-boatrock { 0%, 100% { transform: rotate(-2.4deg) translateY(0); } 50% { transform: rotate(2.4deg) translateY(-3px); } }
.dd-wheel { animation: dd-wheelspin 1.6s linear infinite; }
@keyframes dd-wheelspin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.dd-btf { animation: dd-btfflit 3.2s ease-in-out infinite; }
@keyframes dd-btfflit { 0%, 100% { transform: translate(0, 0) rotate(-4deg); } 50% { transform: translate(6px, -8px) rotate(5deg); } }
.dd-spike { animation: dd-sway 3.8s ease-in-out infinite; }
.dd-scarf { animation: dd-sway 3.2s ease-in-out infinite; }
.dd-ptail { animation: dd-tailsway 3.8s ease-in-out infinite; }
.dd-phead { animation: dd-headbob 4.2s ease-in-out infinite; }
@keyframes dd-headbob { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(2.4deg); } }
.dd-sign { animation: dd-sway 5.2s ease-in-out infinite; }
.dd-door { animation: dd-doorglow 3s ease-in-out infinite; }
@keyframes dd-doorglow { 0%, 100% { opacity: 0.85; } 50% { opacity: 1; } }

/* ══════════════════════════════════════════════════════════════
   reduced motion — settle everything on its rest pose, first paint
   ══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0s !important;
        transition-duration: 0.01ms !important;
    }
    #leaf-wipe.go, #leaf-wipe.go::before { animation: none; opacity: 0; }
    .dd-splash { opacity: 0.6; }
}

/* short phones: keep the stage visible above a tall choice stack */
@media (max-height: 620px) {
    #stage { min-height: 148px; }
    #panel { max-height: 70%; }
    #story-card { padding-top: 16px; min-height: 68px; }
    #next-btn svg { width: 72px; height: 72px; }
    .choice-btn { min-height: 88px; }
}

/* ── art.js animation hooks (fd-*) ─────────────────────────────────────────
   The artwork tags small elements with these classes; each gets a gentle,
   GPU-cheap transform/opacity loop. All of them die under reduced motion. */
.fd-twinkle  { animation: fd-tw 2.6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.fd-steam    { animation: fd-rise 3.4s ease-in-out infinite; transform-box: fill-box; }
.fd-smoke    { animation: fd-rise 4.6s ease-in-out infinite; transform-box: fill-box; }
.fd-sway,
.fd-fluff    { animation: fd-swy 4s ease-in-out infinite alternate; transform-origin: bottom center; transform-box: fill-box; }
.fd-flag     { animation: fd-swy 2.4s ease-in-out infinite alternate; transform-origin: left center; transform-box: fill-box; }
.fd-bell     { animation: fd-swy 3.2s ease-in-out infinite alternate; transform-origin: top center; transform-box: fill-box; }
.fd-flutter  { animation: fd-flut 1.1s ease-in-out infinite alternate; transform-origin: center; transform-box: fill-box; }
.fd-boatbob  { animation: fd-bobb 2.8s ease-in-out infinite; transform-box: fill-box; }
.fd-drift,
.fd-shimmer  { animation: fd-shm 3.6s ease-in-out infinite alternate; transform-box: fill-box; }
.fd-dash     { animation: fd-shm 0.5s linear infinite alternate; transform-box: fill-box; }
.fd-headbob  { animation: fd-bobb 3.1s ease-in-out infinite; transform-box: fill-box; }
.fd-peek     { animation: fd-bobb 3.8s ease-in-out infinite; transform-box: fill-box; }
.fd-snail    { animation: fd-shm 6s ease-in-out infinite alternate; transform-box: fill-box; }
.fd-wheel    { animation: fd-spin 1.6s linear infinite; transform-origin: center; transform-box: fill-box; }
.fd-eyes     { animation: fd-blink 5.2s step-end infinite; transform-box: fill-box; }
.fd-ear-l    { animation: fd-swy 3.4s ease-in-out infinite alternate; transform-origin: bottom center; transform-box: fill-box; }
.fd-ear-r    { animation: fd-swy 3.4s ease-in-out 0.4s infinite alternate; transform-origin: bottom center; transform-box: fill-box; }
.fd-wing-l   { animation: fd-flut 1.4s ease-in-out infinite alternate; transform-origin: right center; transform-box: fill-box; }
.fd-wing-r   { animation: fd-flut 1.4s ease-in-out 0.2s infinite alternate; transform-origin: left center; transform-box: fill-box; }
@keyframes fd-tw    { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.82); } }
@keyframes fd-rise  { 0% { transform: translateY(0); opacity: 0.7; } 100% { transform: translateY(-14px); opacity: 0; } }
@keyframes fd-swy   { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes fd-flut  { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
@keyframes fd-bobb  { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes fd-shm   { from { transform: translateX(-3px); opacity: 0.85; } to { transform: translateX(3px); opacity: 1; } }
@keyframes fd-spin  { to { transform: rotate(360deg); } }
@keyframes fd-blink { 0%, 92%, 100% { transform: scaleY(1); } 94%, 98% { transform: scaleY(0.1); } }
@media (prefers-reduced-motion: reduce) {
    [class*="fd-"] { animation: none !important; }
}
