/*
 * Odyssey's connective tissue. One overlay carries every handoff between orbs:
 *   ceremony  — what you just earned: the orb, its stars, the theme and song it unlocked;
 *   departing — the ceremony fades in place while the world takes over beneath it;
 *   scenic    — a docked briefing over the live world as the path carries you on;
 *   transit   — an opaque, centred briefing when no world can be shown;
 *   chapter   — an untimed arrival: the new place, the next orb and a breathing light.
 * Layout lives in data-layout; data-world-stage, data-covered, data-revealing and
 * data-visibility-held keep their lifecycle meanings. Motion uses Material 3's emphasized
 * curves; every animation has a still reduced-motion composition.
 *
 * The overlay wears a chapter (data-ody-chapter, set by JourneyFlowOverlay.js): its shades and
 * its docked briefing are that chapter's glass (odyssey-shared.css --ody-glass-*), its accents
 * the chapter's light (--ody-flow-color). A chapter arrival is laid LIGHTLY over the world: the
 * world is the picture, and the words stand in a pool of the chapter's night only where they are.
 */
.ody-flow {
    --ody-flow-color: #e8bc92;
    --ody-flow-hold: 3400ms;
    --ody-ease: cubic-bezier(0.2, 0, 0, 1); /* M3 standard */
    --ody-ease-out: cubic-bezier(0.05, 0.7, 0.1, 1);
    --ody-ease-in: cubic-bezier(0.3, 0, 0.8, 0.15);
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: max(28px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    isolation: isolate;
    color: #f7f0e7;
    font-family: var(--sb-font-text, sans-serif);
    transition: opacity 360ms ease;
    /* The inks measured for the chapter's glass and shades (chapter-looks.js). */
    --sb-text-muted: var(--ody-ink-muted);
    --sb-text-faint: var(--ody-ink-faint);
}
.ody-flow [hidden] { display: none !important; }

/* Two scrim layers fade between states instead of cutting: ::before dims, ::after frames. */
.ody-flow::before,
.ody-flow::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 700ms var(--ody-ease);
}
.ody-flow::before { background: rgba(var(--ody-glass-deep-rgb, 7, 6, 18), 0.88); }
.ody-flow::after {
    z-index: -2;
    background: linear-gradient(180deg, transparent 50%, rgba(5, 5, 16, 0.2) 72%, rgba(5, 5, 16, 0.64));
}

/* ---- The orb's world (familiar completions and the opaque cover) ---------------- */
/* The orb just cleared, then the orb ahead, as the navigator draws them (odyssey-shared.css
   .sb-orb-art): its world in a ring, a halo in the chapter's light and its number on a tab. The
   portal's orbits and trails turn around it. A first-time reward brings its own art instead. */
.ody-flow__art {
    --orb-art-size: clamp(92px, min(17vh, 30vw), 172px);
    position: relative;
    isolation: isolate;
    display: none;
    width: var(--orb-art-size);
    height: var(--orb-art-size);
    margin: 0 auto clamp(26px, 4.4vh, 40px);
}
/* Low specificity on purpose: the short-screen rules below hide it with a plain layout selector. */
.ody-flow:where([data-layout='ceremony']:not([data-theme-reward='true']), [data-layout='transit']) .ody-flow__art {
    display: block;
}
.ody-flow[data-layout='ceremony'] .ody-flow__art [data-orb='next'],
.ody-flow[data-layout='transit'] .ody-flow__art [data-orb='done'] { display: none; }
.ody-flow__art > .sb-orb-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.ody-flow__portal {
    position: absolute;
    z-index: -1;
    top: 50%;
    left: 50%;
    width: calc(var(--orb-art-size) * 2.5);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    pointer-events: none;
    color: var(--ody-flow-color);
}
.ody-flow__halo {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, currentColor 0, transparent 63%);
    opacity: 0.11;
    animation: ody-flow-breathe 8s ease-in-out infinite alternate;
}
.ody-flow__orbit {
    position: absolute;
    inset: 8%;
    border: 1px solid currentColor;
    border-radius: 50%;
    opacity: 0.28;
    transform: rotate(-32deg) scaleY(0.56);
}
.ody-flow__orbit--inner { inset: 16%; opacity: 0.32; transform: rotate(32deg) scaleY(0.56); }
.ody-flow__trail {
    position: absolute;
    inset: 24%;
    border-radius: 50%;
    border: 1px solid transparent;
    border-top-color: currentColor;
    opacity: 0.5;
    animation: ody-flow-orbit 18s linear infinite;
}
.ody-flow__trail::after {
    content: '';
    position: absolute;
    top: 14%;
    right: 14%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 20px 3px currentColor;
}
.ody-flow__trail--second { inset: 28%; animation-direction: reverse; animation-duration: 24s; opacity: 0.3; }
/* The world arrives inside its orbits; the cover's destination is already there. */
.ody-flow[data-layout='ceremony'] .ody-flow__art > .sb-orb-art { animation: ody-flow-art 900ms 60ms var(--ody-ease-out) backwards; }

/* ---- Shared copy ---------------------------------------------------------------- */
/* Centred when it fits; auto margins collapse to zero instead of hiding its top. */
.ody-flow__content {
    width: min(640px, 100%);
    margin: auto;
    position: relative;
    text-align: center;
    animation: ody-flow-arrive 550ms var(--ody-ease-out) both;
}
.ody-flow__recognition {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 6px 14px 6px 12px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--sb-gold, #f3d28d) 40%, transparent);
    background: rgba(243, 210, 141, 0.08);
    color: #f2d7ac;
    font: 600 0.7rem / 1.4 var(--sb-font-display, sans-serif);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-wrap: balance;
}
.ody-flow__recognition::before { content: '\2713'; font-size: 0.85rem; letter-spacing: 0; }
.ody-flow__recognition[data-complete='false']::before { display: none; }
.ody-flow__eyebrow {
    margin: 0 0 12px;
    color: var(--ody-flow-color);
    font: 600 0.72rem / 1.5 var(--sb-font-display, sans-serif);
    text-transform: uppercase;
    letter-spacing: 0.22em;
}
.ody-flow__achievement {
    margin: 0;
    font: 500 clamp(1.8rem, min(5vw, 6.4vh), 3.2rem) / 1.06 var(--sb-font-display, sans-serif);
    letter-spacing: -0.02em;
    text-wrap: balance;
    overflow-wrap: anywhere;
    text-shadow: 0 0 42px color-mix(in srgb, var(--ody-flow-color) 32%, transparent);
}
.ody-flow__score { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 18px; margin: 12px 0 2px; }
.ody-flow__stars { display: flex; justify-content: center; gap: 12px; margin: 0; color: #5f5a6e; font-size: 24px; line-height: 1; }
.ody-flow__stars span { display: inline-block; }
.ody-flow__stars .is-earned { color: #f2d7ac; text-shadow: 0 0 18px rgba(242, 215, 172, 0.55); }
.ody-flow__tally { margin: 0; color: #c8c0d7; font-size: 0.82rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
/* Why these stars: the three goals, earned ones lit, then the next star's shortfall. */
.ody-flow__star-notes {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 16px;
    max-width: 54ch;
    margin: 6px auto 0;
    padding: 0;
    color: #8f88a3;
    font-size: 0.78rem;
    line-height: 1.5;
}
.ody-flow__star-notes__tier { display: inline-flex; align-items: center; gap: 6px; }
.ody-flow__star-notes__tier.is-earned { color: #e9dcc2; }
.ody-flow__star-notes__tier.is-earned .ody-flow__star-notes__glyph {
    color: #f2d7ac;
    text-shadow: 0 0 10px rgba(242, 215, 172, 0.45);
}
.ody-flow__star-notes__next { flex-basis: 100%; margin-top: 2px; color: #c8c0d7; font-variant-numeric: tabular-nums; }
.ody-flow__next { display: block; }
.ody-flow__next-label {
    margin: 0 0 6px;
    color: #a6a0b5;
    font: 600 0.68rem / 1.4 var(--sb-font-display, sans-serif);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.ody-flow__dest-art { display: none; }
/* A chapter's breathing reward: the world it opened, and its session, said once. */
.ody-flow__breath-opening {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    box-sizing: border-box;
    margin: 2px 0 12px;
    padding: 5px 14px 5px 5px;
    border: 1px solid color-mix(in srgb, var(--ody-flow-color, #9fe6dc) 38%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--ody-flow-color, #9fe6dc) 9%, #120f1f);
    color: #ece6f2;
    font-size: 0.8rem;
    line-height: 1.35;
    text-align: left;
}
.ody-flow__breath-art {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: center / cover no-repeat #1c1830;
    box-shadow: 0 0 14px color-mix(in srgb, var(--ody-flow-color, #9fe6dc) 35%, transparent);
}
.ody-flow__breath-label {
    flex: 0 0 auto;
    color: var(--ody-flow-color, #9fe6dc);
    font: 600 0.62rem / 1.4 var(--sb-font-display, sans-serif);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.ody-flow__breath-line { min-width: 0; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) {
    .ody-flow__breath-opening { animation: ody-breath-opening 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both 0.6s; }
    @keyframes ody-breath-opening {
        from { opacity: 0; transform: translateY(6px) scale(0.98); }
        to { opacity: 1; transform: none; }
    }
}
.ody-flow__title {
    margin: 0;
    font: 500 clamp(1.75rem, 4.3vw, 3.2rem) / 1.12 var(--sb-font-display, sans-serif);
    letter-spacing: -0.02em;
    text-wrap: balance;
    overflow-wrap: anywhere;
}
.ody-flow__farewell { margin: 10px 0 0; color: #d9d0e4; font-size: 0.86rem; line-height: 1.55; font-style: italic; text-wrap: pretty; }
.ody-flow__destination { margin: 14px 0 0; line-height: 1.6; font-size: 0.94rem; color: #e5deeb; }
.ody-flow__orb-label { display: block; margin-bottom: 4px; color: #a6a0b5; font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ody-flow__goal { display: block; font-size: 1.08rem; font-weight: 600; color: #f7f0e7; }
.ody-flow__changes {
    list-style: none;
    padding: 0;
    margin: 10px auto 0;
    max-width: 48ch;
    color: #c8c0d7;
    font-size: 0.84rem;
    line-height: 1.55;
}
.ody-flow__changes li + li { margin-top: 4px; }
.ody-flow__status { min-height: 1.5em; margin: 20px 0 0; font-size: 0.79rem; line-height: 1.5; color: #c8c0d7; }
.ody-flow__progress { width: min(200px, 55%); height: 1px; margin: 12px auto 0; background: #494252; overflow: hidden; opacity: 0; }
.ody-flow__progress-fill { display: block; height: 100%; background: var(--ody-flow-color); transform-origin: left; transform: scaleX(0); }
.ody-flow__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; }
.ody-flow .sb-btn { min-height: 44px; }
.ody-flow__primary { min-width: min(196px, 100%); overflow: hidden; isolation: isolate; }
.ody-flow__quiet { background: rgba(15, 12, 29, 0.5); }
.ody-flow [data-flow-action='pause'] { min-width: 88px; }
/* Keycaps name what Enter, Escape and the pad really do here. Pause wears its caps only while
   travelling, where it holds focus as the default action; beside Continue they would mislead. */
.ody-flow .sb-btn .sb-kbd { margin-right: -8px; }
.ody-flow[data-layout='ceremony'] [data-flow-action='pause'] .sb-kbd { display: none; }
/* The auto-continue choice stays with the ceremony, but as a quiet aside (the map panel has it too). */
.ody-flow__preference {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 12px;
    min-height: 28px;
    cursor: pointer;
    color: var(--sb-text-faint);
    font-size: 0.7rem;
    line-height: 1.4;
    transition: color 160ms ease;
}
.ody-flow__preference:hover,
.ody-flow__preference:focus-within { color: var(--sb-text-muted); }
.ody-flow__preference input {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    margin: 0;
    accent-color: color-mix(in srgb, var(--ody-flow-color) 60%, #77708a);
}
.ody-flow :focus-visible { outline: 2px solid var(--ody-flow-color); outline-offset: 5px; }
.ody-flow .ody-flow__eyebrow:focus-visible,
.ody-flow .ody-flow__title:focus-visible { outline: none; }
.ody-flow__breath { margin: 0; font-size: 0.77rem; line-height: 1.5; color: #b8afc9; text-align: left; }

/* The Continue button fills while the beat lingers; Pause freezes it where it is. */
.ody-flow__primary::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.4));
    transform-origin: left center;
    transform: scaleX(0);
    opacity: 0;
}
.ody-flow[data-auto-state='running'] .ody-flow__primary::after,
.ody-flow[data-auto-state='held'] .ody-flow__primary::after {
    opacity: 1;
    animation: ody-flow-fill var(--ody-flow-hold) linear both;
}
.ody-flow[data-auto-state='held'] .ody-flow__primary::after { animation-play-state: paused; opacity: 0.55; }

/* ---- Ceremony: what you earned is the hero ------------------------------------- */
.ody-flow[data-layout='ceremony']::before {
    opacity: 1;
    background:
        radial-gradient(ellipse 70% 60% at 50% 36%, rgba(14, 11, 32, 0.62), transparent 72%),
        rgba(6, 5, 16, 0.84);
    animation: ody-flow-scrim-in 700ms var(--ody-ease) both;
}
/* Afterglow: the well just played its showpiece. The scrim dims slowly over its last light and
   the ceremony's words arrive a beat later, so the reel hands over instead of cutting. */
.ody-flow[data-entrance='afterglow'][data-layout='ceremony']::before {
    animation: ody-flow-scrim-in 1300ms var(--ody-ease) both;
}
.ody-flow[data-entrance='afterglow'][data-layout='ceremony'] .ody-flow__eyebrow { animation-delay: 360ms; }
.ody-flow[data-entrance='afterglow'][data-layout='ceremony'] .ody-flow__achievement { animation-delay: 440ms; }
.ody-flow[data-entrance='afterglow'][data-layout='ceremony'] .ody-flow__stars span {
    animation-delay: calc(700ms + var(--i, 0) * 170ms);
}
.ody-flow[data-entrance='afterglow'][data-layout='ceremony'] .ody-flow__tally { animation-delay: 940ms; }
.ody-flow[data-entrance='afterglow'][data-layout='ceremony'] .ody-flow__star-notes { animation-delay: 1080ms; }
.ody-flow[data-entrance='afterglow'][data-layout='ceremony'] .ody-flow__next { animation-delay: 1220ms; }
.ody-flow[data-entrance='afterglow'][data-layout='ceremony'] .ody-flow__preference { animation-delay: 860ms; }
.ody-flow[data-layout='ceremony'] .ody-flow__content { width: min(660px, 100%); }
.ody-flow[data-layout='ceremony'] .ody-flow__eyebrow { animation: ody-flow-rise 520ms 80ms var(--ody-ease-out) backwards; }
.ody-flow[data-layout='ceremony'] .ody-flow__achievement {
    animation: ody-flow-hero 820ms 160ms var(--ody-ease-out) backwards;
}
.ody-flow[data-layout='ceremony'] .ody-flow__stars span {
    animation: ody-flow-star 620ms calc(380ms + var(--i, 0) * 170ms) cubic-bezier(0.2, 0.9, 0.1, 1.15) backwards;
}
.ody-flow[data-layout='ceremony'] .ody-flow__tally { animation: ody-flow-rise 520ms 620ms var(--ody-ease-out) backwards; }
.ody-flow[data-layout='ceremony'] .ody-flow__star-notes { animation: ody-flow-rise 520ms 760ms var(--ody-ease-out) backwards; }
.ody-flow[data-layout='ceremony'] .ody-flow__next {
    margin: 4px auto 0;
    padding-top: 12px;
    max-width: 520px;
    border-top: 1px solid rgba(255, 246, 233, 0.1);
    animation: ody-flow-rise 620ms 900ms var(--ody-ease-out) backwards;
}
.ody-flow[data-layout='ceremony'] .ody-flow__title { font-size: clamp(1.1rem, 2.3vw, 1.45rem); }
.ody-flow[data-layout='ceremony'] .ody-flow__destination { margin-top: 4px; }
.ody-flow[data-layout='ceremony'] .ody-flow__changes { margin-top: 6px; font-size: 0.8rem; }
.ody-flow[data-layout='ceremony'] .ody-flow__status { margin-top: 12px; }
.ody-flow[data-layout='ceremony'] .ody-flow__actions { margin-top: 12px; }
.ody-flow[data-layout='ceremony'] .ody-flow__preference { margin-top: 8px; }
.ody-flow[data-layout='ceremony'] .ody-flow__orb-label { display: none; }
.ody-flow[data-layout='ceremony'][data-crosses-chapter='true'] .ody-flow__orb-label { display: block; }
.ody-flow[data-layout='ceremony'] .ody-flow__goal { font-size: 0.98rem; }
.ody-flow[data-layout='ceremony'] .ody-flow__status,
.ody-flow[data-layout='ceremony'] .ody-flow__actions,
.ody-flow[data-layout='ceremony'] .ody-flow__preference { animation: ody-flow-rise 520ms 540ms var(--ody-ease-out) backwards; }
.ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__next { animation-delay: 1900ms; }
.ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__status,
.ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__actions,
.ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__preference { animation-delay: 1300ms; }

/* ---- Transit: an opaque, centred briefing --------------------------------------- */
.ody-flow[data-layout='transit'] { opacity: 0; }
/* Opaque between orbs: the loading language's void (main.css --sb-void-sky), as every cover. */
.ody-flow[data-layout='transit']::before { opacity: 1; background: var(--sb-void-sky, #080713); transition-duration: 160ms; }
.ody-flow[data-layout='transit'][data-covered='true'] { opacity: 1; }
.ody-flow[data-layout='transit'] .ody-flow__progress,
.ody-flow[data-layout='transit'] .ody-flow__preference { visibility: hidden; }
.ody-flow[data-layout='transit'] .ody-flow__actions { margin-top: 26px; }
.ody-flow[data-layout='transit'] .ody-flow__next-label { display: none; }
.ody-flow[data-layout='transit'] .ody-flow__achievement,
.ody-flow[data-layout='transit'] .ody-flow__stars,
.ody-flow[data-layout='transit'] .ody-flow__tally,
.ody-flow[data-layout='transit'] .ody-flow__star-notes,
.ody-flow[data-layout='transit'] .ody-flow__found,
.ody-flow[data-layout='transit'] .ody-theme-reward { display: none; }
/* Lifecycle states outrank every layout: reveal fades out, a held presence and a retained cover show. */
.ody-flow[data-layout][data-revealing='true'] { opacity: 0; pointer-events: none; }
.ody-flow[data-layout][data-visibility-held='true'] { opacity: 1; pointer-events: auto; }
.ody-flow[data-layout][data-retained='true'] { opacity: 1; pointer-events: auto; transition: none; }
.ody-flow[data-layout][data-retained='true']::before { opacity: 1; background: var(--sb-void-sky, #080713); transition: none; }

/* ---- Scenic: a docked briefing over the real world ------------------------------ */
.ody-flow[data-world-stage] { z-index: 10050; }
.ody-flow[data-layout='scenic'] {
    align-items: flex-end;
    justify-content: flex-start;
    padding: 18px 24px max(18px, env(safe-area-inset-bottom));
}
.ody-flow[data-layout='scenic']::after { opacity: 1; }
.ody-flow[data-layout='scenic'][data-scenic-covered='true']::before {
    opacity: 1;
    background: #080713;
    transition-duration: 120ms;
}
.ody-flow[data-layout='scenic']:not([data-revealing='true']),
.ody-flow[data-layout='scenic'][data-visibility-held='true'] { opacity: 1; pointer-events: auto; }
.ody-flow[data-layout='scenic'] .ody-flow__content {
    display: block;
    width: min(520px, 100%);
    min-width: 0;
    max-height: min(56vh, 440px);
    max-height: min(56dvh, 440px);
    margin: auto 0 0;
    padding: 16px 18px 0;
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
    text-align: left;
    /* The briefing rides over the live world on the chapter's glass. */
    background:
        radial-gradient(90% 60% at 0% 0%, color-mix(in srgb, var(--ody-flow-color) 16%, transparent), transparent 70%),
        var(--ody-glass-fill);
    border: 1px solid color-mix(in srgb, var(--ody-flow-color) 34%, transparent);
    border-radius: 16px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45), var(--ody-glass-sheen);
    animation: ody-flow-dock 620ms var(--ody-ease-out) both;
    scrollbar-width: thin;
}
.ody-flow[data-layout='scenic'] .ody-flow__portal,
.ody-flow[data-layout='scenic'] .ody-flow__eyebrow,
.ody-flow[data-layout='scenic'] .ody-flow__achievement,
.ody-flow[data-layout='scenic'] .ody-flow__stars,
.ody-flow[data-layout='scenic'] .ody-flow__tally,
.ody-flow[data-layout='scenic'] .ody-flow__star-notes,
.ody-flow[data-layout='scenic'] .ody-flow__progress,
.ody-flow[data-layout='scenic'] .ody-flow__preference,
.ody-flow[data-layout='scenic'] .ody-flow__orb-label,
.ody-flow[data-layout='scenic'] .ody-theme-reward { display: none; }
.ody-flow[data-layout='scenic'] .ody-flow__next {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 14px;
    align-items: start;
}
.ody-flow[data-layout='scenic'] .ody-flow__next > * { grid-column: 2; }
.ody-flow[data-layout='scenic'] .ody-flow__dest-art {
    display: block;
    grid-column: 1;
    grid-row: 1 / span 4;
    width: 56px;
    height: 56px;
    margin-top: 2px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid color-mix(in srgb, var(--ody-flow-color) 60%, transparent);
    box-shadow: 0 0 22px color-mix(in srgb, var(--ody-flow-color) 28%, transparent);
    animation: ody-flow-art 900ms 160ms var(--ody-ease-out) backwards;
}
.ody-flow[data-layout='scenic'] .ody-flow__next-label { margin-bottom: 4px; color: var(--ody-flow-color); }
.ody-flow[data-layout='scenic'][data-crosses-chapter='true']:not([data-chapter-shown]) .ody-flow__orb-label {
    display: block;
    margin: 8px 0 2px;
    font-size: 0.68rem;
}
.ody-flow[data-layout='scenic'] .ody-flow__title { font-size: 1.2rem; line-height: 1.25; }
.ody-flow[data-layout='scenic'] .ody-flow__destination { margin: 6px 0 0; line-height: 1.45; }
.ody-flow[data-layout='scenic'] .ody-flow__goal { font-size: 0.94rem; }
.ody-flow[data-layout='scenic'] .ody-flow__changes { max-width: none; margin: 6px 0 0; font-size: 0.78rem; line-height: 1.45; }
.ody-flow[data-layout='scenic'] .ody-flow__farewell { margin-top: 8px; font-size: 0.82rem; }
.ody-flow[data-layout='scenic'] .ody-flow__status { margin: 12px 0 0; font-size: 0.74rem; }
/* A soft light travels under the status while the path carries you. */
.ody-flow[data-layout='scenic'] .ody-flow__status::after {
    content: '';
    display: block;
    height: 2px;
    margin-top: 8px;
    border-radius: 2px;
    background:
        linear-gradient(90deg, transparent, var(--ody-flow-color), transparent) no-repeat,
        rgba(255, 246, 233, 0.08);
    background-size: 38% 100%, 100% 100%;
    animation: ody-flow-travel 1700ms ease-in-out infinite;
}
.ody-flow[data-layout='scenic'][data-visibility-held='true'] .ody-flow__status::after { animation-play-state: paused; opacity: 0.4; }
.ody-flow[data-layout='scenic'] .ody-flow__actions {
    position: sticky;
    z-index: 1;
    bottom: 0;
    justify-content: flex-start;
    gap: 8px;
    margin: 10px -18px 0;
    padding: 8px 18px 12px;
    background: linear-gradient(180deg, rgba(var(--ody-glass-deep-rgb), 0), rgb(var(--ody-glass-deep-rgb)) 30%);
}
.ody-flow[data-layout='scenic'] .sb-btn { min-width: 0; max-width: 100%; white-space: normal; }
.ody-flow[data-layout='scenic'] .ody-flow__quiet { font-size: 0.78rem; }

/* ---- Chapter: an untimed arrival with a breathing light ------------------------- */
.ody-flow[data-layout='chapter'] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 29vw);
    align-items: end;
    gap: 24px;
    /* No bottom padding: the action bar carries it, so it can stay in view as the story scrolls. */
    padding: clamp(20px, 4.4vh, 40px) clamp(24px, 7vw, 110px) 0;
}
/* The world is the picture. The shade is a pool of the chapter's night where the words stand
   (the lower left) and a smaller one under the breathing light; the sky and the far side of the
   view stay clear. It used to be a sheet over the whole frame (0.78 across, solid at the foot). */
.ody-flow[data-layout='chapter']::before {
    opacity: 1;
    background:
        radial-gradient(
            ellipse 62% 74% at 16% 84%,
            rgba(var(--ody-glass-deep-rgb), 0.9) 0%,
            rgba(var(--ody-glass-deep-rgb), 0.78) 46%,
            rgba(var(--ody-glass-deep-rgb), 0.3) 78%,
            rgba(var(--ody-glass-deep-rgb), 0) 100%
        ),
        radial-gradient(
            ellipse 21% 36% at 81% 58%,
            rgba(var(--ody-glass-deep-rgb), 0.64) 0%,
            rgba(var(--ody-glass-deep-rgb), 0.36) 60%,
            rgba(var(--ody-glass-deep-rgb), 0) 100%
        ),
        linear-gradient(180deg, rgba(var(--ody-glass-deep-rgb), 0) 80%, rgba(var(--ody-glass-deep-rgb), 0.5) 100%);
    transition-duration: 1100ms;
}
/* The framing layer's foot shade would dim the whole width again: the pool carries it here. */
.ody-flow[data-layout='chapter']::after { opacity: 0; }
/* Set on the scenery, the words carry a shade of their own as well. */
.ody-flow[data-layout='chapter'] .ody-flow__content {
    isolation: isolate;
    text-shadow: 0 1px 2px rgba(var(--ody-glass-deep-rgb), 0.85), 0 2px 22px rgba(var(--ody-glass-deep-rgb), 0.7);
}
/* And a second, soft shade the size of the words themselves, so the top of a long title or of
   large text is never left standing on bright sky above the pool. Only a shadow: the box that
   casts it stands two views off to the left (where nothing scrolls), so the shade has no edge
   and no hole, is painted once, and adds nothing to the scroll height. */
.ody-flow[data-layout='chapter'] .ody-flow__content::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: -10% 0 0 -6%;
    border-radius: 30%;
    transform: translateX(-200vw);
    box-shadow: 200vw 0 120px 40px rgba(var(--ody-glass-deep-rgb), 0.6);
    pointer-events: none;
}
.ody-flow[data-layout='chapter'] .ody-flow__content .sb-btn { text-shadow: none; }
.ody-flow[data-layout='chapter'] .ody-flow__portal,
.ody-flow[data-layout='chapter'] .ody-flow__achievement,
.ody-flow[data-layout='chapter'] .ody-flow__stars,
.ody-flow[data-layout='chapter'] .ody-flow__tally,
.ody-flow[data-layout='chapter'] .ody-flow__star-notes,
.ody-flow[data-layout='chapter'] .ody-flow__preference,
.ody-flow[data-layout='chapter'] .ody-flow__progress,
.ody-flow[data-layout='chapter'] .ody-flow__next-label,
.ody-flow[data-layout='chapter'] .ody-flow__dest-art,
.ody-flow[data-layout='chapter'] .ody-theme-reward { display: none; }
.ody-flow[data-layout='chapter'] .ody-flow__content {
    grid-column: 1;
    grid-row: 1;
    width: min(760px, 100%);
    margin: 0;
    text-align: left;
    animation: ody-flow-arrive 900ms 200ms var(--ody-ease-out) both;
}
.ody-flow[data-layout='chapter'] .ody-flow__eyebrow { animation: ody-flow-rise 700ms 380ms var(--ody-ease-out) backwards; }
.ody-flow[data-layout='chapter'] .ody-flow__recognition { margin-bottom: clamp(10px, 2vh, 18px); }
.ody-flow[data-layout='chapter'] .ody-flow__eyebrow { margin-bottom: clamp(6px, 1.4vh, 12px); }
.ody-flow[data-layout='chapter'] .ody-flow__title {
    font-size: clamp(1.75rem, min(5vw, 7.4vh), 4rem);
    animation: ody-flow-hero 1000ms 480ms var(--ody-ease-out) backwards;
}
.ody-flow[data-layout='chapter'] .ody-flow__subtitle { animation: ody-flow-rise 700ms 760ms var(--ody-ease-out) backwards; }
.ody-flow[data-layout='chapter'] .ody-flow__narrative { animation: ody-flow-rise 800ms 900ms var(--ody-ease-out) backwards; }
.ody-flow[data-layout='chapter'] .ody-flow__destination,
.ody-flow[data-layout='chapter'] .ody-flow__changes { animation: ody-flow-rise 700ms 1100ms var(--ody-ease-out) backwards; }
/* The untimed note rides inside the action bar, so it rises with it. */
.ody-flow[data-layout='chapter'] .ody-flow__actions { animation: ody-flow-rise 700ms 1250ms var(--ody-ease-out) backwards; }
/* Arrival focuses the static heading for reading; only actions need the focus ring. */
.ody-flow__subtitle { margin: clamp(8px, 1.8vh, 16px) 0 0; color: var(--ody-flow-color); font-size: 1.08rem; line-height: 1.5; }
.ody-flow__narrative {
    max-width: 55ch;
    margin: clamp(8px, 1.8vh, 16px) 0 0;
    color: #e5deeb;
    font-size: 0.95rem;
    line-height: 1.6;
    text-wrap: pretty;
}
/* A first arrival's orientation: how orbs, stars, charms and the pause sheet work. */
.ody-flow__orientation {
    list-style: none;
    max-width: 58ch;
    margin: clamp(10px, 2vh, 18px) 0 0;
    padding: clamp(10px, 1.6vh, 14px) 0 0;
    border-top: 1px solid rgba(255, 246, 233, 0.12);
    color: #c8c0d7;
    font-size: 0.88rem;
    line-height: 1.55;
}
.ody-flow__orientation li { position: relative; padding-left: 18px; text-wrap: pretty; }
.ody-flow__orientation li + li { margin-top: 6px; }
.ody-flow__orientation li::before {
    content: '✦';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--ody-flow-color);
    font-size: 0.7em;
    line-height: 2.2;
}
.ody-flow[data-layout='chapter'] .ody-flow__orientation { animation: ody-flow-rise 800ms 1000ms var(--ody-ease-out) backwards; }
/* What the clear left in the bag: one line under the ceremony, and the first time, its key. */
.ody-flow__found {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
    margin: 10px 0 0;
    color: #f7f0e7;
    font-size: 0.92rem;
    line-height: 1.5;
}
.ody-flow__found-line { display: inline-flex; align-items: center; gap: 6px; color: #c8b2ed; font-weight: 600; }
.ody-flow__found-line .charm-sprite { width: 30px; height: 30px; vertical-align: middle; }
.ody-flow__found-line .charm-sprite__glyph { color: #c8b2ed; font-size: 18px; }
.ody-flow__found-hint { color: #c8c0d7; }
.ody-flow[data-layout='ceremony'] .ody-flow__found { animation: ody-flow-rise 520ms 900ms var(--ody-ease-out) backwards; }
.ody-flow[data-layout='chapter'] .ody-flow__destination {
    border-left: 1px solid var(--ody-flow-color);
    padding-left: 16px;
    margin-top: clamp(12px, 2.6vh, 24px);
}
.ody-flow[data-layout='chapter'] .ody-flow__changes { margin-left: 0; max-width: 55ch; }
.ody-flow[data-layout='chapter'] .ody-flow__status:empty { display: none; }
/* The head is eyebrow → title; what the finished chapter opened is said after its story. */
.ody-flow[data-layout='chapter'] .ody-flow__next { display: flex; flex-direction: column; align-items: flex-start; }
.ody-flow[data-layout='chapter'] .ody-flow__breath-opening { order: 1; margin: clamp(10px, 2vh, 16px) 0 0; }
.ody-flow[data-layout='chapter'] .ody-flow__destination,
.ody-flow[data-layout='chapter'] .ody-flow__changes { order: 2; }
/* Wide arrivals set the orientation's four notes as a two-by-two, half the lines of a list. */
@media (min-width: 900px) {
    .ody-flow[data-layout='chapter'] .ody-flow__orientation {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 28px;
        max-width: 100ch;
    }
    .ody-flow[data-layout='chapter'] .ody-flow__orientation li + li { margin-top: 0; }
}
/* However short the window, Begin chapter and Map stay in view; the story scrolls above them. */
.ody-flow[data-layout='chapter'] .ody-flow__actions {
    position: sticky;
    z-index: 1;
    bottom: 0;
    justify-content: flex-start;
    gap: 10px 12px;
    margin: clamp(14px, 2.6vh, 24px) -16px 0;
    padding: 12px 16px max(clamp(16px, 4.4vh, 40px), env(safe-area-inset-bottom));
}
/* A feathered shade, not a box: it is solid under the buttons and fades out only beyond them,
   so scrolled text vanishes under the bar instead of showing through it. Over the open world
   its far end fades long (from past the buttons to its edge), into the pool the words stand in. */
.ody-flow[data-layout='chapter'] .ody-flow__actions::before {
    content: '';
    position: absolute;
    inset: -32px -56px 0;
    z-index: -1;
    pointer-events: none;
    background: rgb(var(--ody-glass-deep-rgb, 8, 7, 19));
    -webkit-mask-image:
        linear-gradient(180deg, transparent, #000 32px),
        linear-gradient(90deg, transparent, #000 56px, #000 52%, transparent);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(180deg, transparent, #000 32px),
        linear-gradient(90deg, transparent, #000 56px, #000 52%, transparent);
    mask-composite: intersect;
}
.ody-flow[data-layout='chapter'] .ody-flow__breath { flex: 1 1 200px; max-width: 34ch; margin: 0 0 0 6px; text-wrap: balance; }
.ody-flow[data-layout='chapter'] .ody-breath {
    position: relative;
    isolation: isolate;
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: center;
    text-shadow: 0 1px 2px rgba(var(--ody-glass-deep-rgb), 0.85), 0 2px 18px rgba(var(--ody-glass-deep-rgb), 0.7);
}
/* The breathing light's words stand on the scenery too (a cloud, a neon sign): a pool of the
   chapter's night of their own, under the words only, so the light itself stays on the world. */
.ody-flow[data-layout='chapter'] .ody-breath::before {
    content: '';
    position: absolute;
    inset: 52% -26% -14%;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(
        closest-side,
        rgba(var(--ody-glass-deep-rgb), 0.82) 0%,
        rgba(var(--ody-glass-deep-rgb), 0.62) 52%,
        rgba(var(--ody-glass-deep-rgb), 0) 100%
    );
}
.ody-flow[data-layout='chapter'] .ody-breath__hint { color: rgba(255, 246, 233, 0.84); }

/* ---- Departing: the visible composition fades in place ------------------------- */
.ody-flow[data-layout][data-departing='true'] .ody-flow__content,
.ody-flow[data-departing='true'] .ody-flow__portal,
.ody-flow[data-departing='true'] .ody-breath,
.ody-breath[data-leaving='true'] {
    animation: ody-flow-depart 340ms var(--ody-ease-in) forwards;
    pointer-events: none;
}

/* ---- Breathing companion --------------------------------------------------------- */
.ody-breath {
    --breath: 0;
    --ody-breath-tint: var(--ody-breath-accent, var(--ody-flow-color));
    display: grid;
    justify-items: center;
    gap: 10px;
    text-align: center;
    color: #f7f0e7;
    animation: ody-flow-breath-in 1400ms 700ms var(--ody-ease-out) backwards;
}
.ody-breath__orb { position: relative; width: clamp(150px, 19vw, 250px); aspect-ratio: 1; margin-bottom: 6px; }
.ody-breath__orb > span { position: absolute; border-radius: 50%; }
/* The breath is written to --breath every frame and moves these only by transform and opacity:
   as their own compositor layers that is a layer update, not a paint. Unpromoted, each frame
   repainted the whole document layer (760 paints and full re-rasters in 6 s, audit 2026-10-23). */
.ody-breath__orb > span,
.ody-breath__art { will-change: transform, opacity; }
.ody-breath__world::after { will-change: opacity; }
.ody-breath__track {
    inset: 0;
    border: 1px solid color-mix(in srgb, var(--ody-breath-tint) 22%, transparent);
}
.ody-breath__glow {
    inset: -26%;
    background: radial-gradient(circle, color-mix(in srgb, var(--ody-breath-tint) 40%, transparent) 0%, transparent 64%);
    opacity: calc(0.16 + var(--breath) * 0.64);
    transform: scale(calc(0.7 + var(--breath) * 0.36));
}
.ody-breath__ring {
    inset: 0;
    border: 2px solid color-mix(in srgb, var(--ody-breath-tint) 78%, #ffffff);
    box-shadow:
        0 0 30px color-mix(in srgb, var(--ody-breath-tint) 50%, transparent),
        inset 0 0 26px color-mix(in srgb, var(--ody-breath-tint) 32%, transparent);
    opacity: calc(0.5 + var(--breath) * 0.5);
    transform: scale(calc(0.4 + var(--breath) * 0.6));
}
.ody-breath__core {
    inset: 34%;
    background: radial-gradient(circle at 42% 38%, #fffaf0 0%, color-mix(in srgb, var(--ody-breath-tint) 80%, #ffffff) 28%,
        color-mix(in srgb, var(--ody-breath-tint) 34%, transparent) 60%, transparent 72%);
    opacity: calc(0.45 + var(--breath) * 0.55);
    transform: scale(calc(0.62 + var(--breath) * 0.6));
}
/* The chapter's breathing world, seen through the ring: it opens and brightens as the lungs
   fill, and settles back into shadow on the long breath out. */
.ody-breath__world {
    inset: 10%;
    overflow: hidden;
    isolation: isolate;
    opacity: 0;
    background: #0b0a16;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
    transform: scale(calc(0.6 + var(--breath) * 0.4));
    transition: opacity 900ms var(--ody-ease-out, ease-out);
}
.ody-breath[data-world-ready='true'] .ody-breath__world { opacity: 1; }
.ody-breath__art {
    position: absolute;
    inset: 0;
    background: center / cover no-repeat;
    transform: scale(calc(1.18 - var(--breath) * 0.14));
}
/* Glass: a soft highlight and an inner rim, so the world sits inside an orb of its own. */
.ody-breath__world::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    background: radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 40%);
    box-shadow: inset 0 0 22px rgba(4, 3, 12, 0.6);
}
.ody-breath__world::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 50% 42%, transparent 38%, rgba(6, 5, 16, 0.7) 100%),
        rgba(6, 5, 16, 0.42);
    opacity: calc(0.9 - var(--breath) * 0.72);
}
.ody-breath[data-world] .ody-breath__track { inset: 10%; }
.ody-breath[data-world] .ody-breath__ring {
    inset: 10%;
    transform: scale(calc(0.6 + var(--breath) * 0.4));
}
.ody-breath[data-world-ready='true'] .ody-breath__core { opacity: 0; transition: opacity 700ms ease-out; }
.ody-breath__world-name {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 2px 0 0;
    color: #d9d0e4;
    font-size: 0.74rem;
    letter-spacing: 0.02em;
}
.ody-breath__world-new {
    margin-left: 2px;
    padding: 1px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ody-breath-tint) 22%, transparent);
    color: #fff6e9;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.ody-breath__world-name::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ody-breath-tint);
    box-shadow: 0 0 8px var(--ody-breath-tint);
}
.ody-breath__cue {
    margin: 0;
    min-height: 1.3em;
    font: 500 clamp(1rem, 1.5vw, 1.2rem) / 1.3 var(--sb-font-display, sans-serif);
    letter-spacing: 0.03em;
}
.ody-breath__count {
    margin: 0;
    color: color-mix(in srgb, var(--ody-flow-color) 70%, #cfc6dc);
    font: 600 0.66rem / 1.4 var(--sb-font-display, sans-serif);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.ody-breath[data-rested='true'] .ody-breath__count { color: #f2d7ac; }
.ody-breath__hint { margin: 2px 0 0; max-width: 28ch; color: #b8afc9; font-size: 0.75rem; line-height: 1.5; }
.ody-breath[data-running='false'] .ody-breath__cue { opacity: 0.7; }
.ody-breath[data-reduced-motion='true'] .ody-breath__glow,
.ody-breath[data-reduced-motion='true'] .ody-breath__ring,
.ody-breath[data-reduced-motion='true'] .ody-breath__core,
.ody-breath[data-reduced-motion='true'] .ody-breath__world,
.ody-breath[data-reduced-motion='true'] .ody-breath__art { transform: none; }

/* ---- Keyframes -------------------------------------------------------------------- */
@keyframes ody-flow-orbit { to { transform: rotate(360deg); } }
@keyframes ody-flow-breathe { from { opacity: 0.08; transform: scale(0.95); } to { opacity: 0.15; transform: scale(1.05); } }
@keyframes ody-flow-progress { to { transform: scaleX(1); } }
@keyframes ody-flow-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ody-flow-arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ody-flow-scrim-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ody-flow-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes ody-flow-hero {
    from { opacity: 0; transform: translateY(18px) scale(0.96); letter-spacing: 0.02em; filter: blur(6px); }
}
@keyframes ody-flow-star {
    0% { opacity: 0; transform: translateY(-18px) scale(0.2) rotate(-90deg); }
    70% { opacity: 1; transform: translateY(2px) scale(1.25) rotate(8deg); }
}
@keyframes ody-flow-depart { to { opacity: 0; transform: translateY(-14px) scale(0.98); } }
@keyframes ody-flow-dock { from { opacity: 0; transform: translateY(26px) scale(0.98); } }
@keyframes ody-flow-art { from { opacity: 0; transform: scale(0.6); } }
@keyframes ody-flow-travel { from { background-position: -40% 0, 0 0; } to { background-position: 140% 0, 0 0; } }
@keyframes ody-flow-breath-in { from { opacity: 0; transform: scale(0.9); } }

.ody-flow[data-reduced-motion='true'] { transition-duration: 100ms; }
.ody-flow[data-reduced-motion='true']::before,
.ody-flow[data-reduced-motion='true']::after { transition-duration: 100ms; }
.ody-flow[data-reduced-motion='true'] *,
.ody-flow[data-reduced-motion='true']::before { animation: none !important; }
.ody-flow[data-reduced-motion='true'] .ody-flow__progress,
.ody-flow[data-reduced-motion='true'] .ody-flow__primary::after { display: none; }
@media (prefers-reduced-motion: reduce) {
    .ody-flow,
    .ody-flow::before,
    .ody-flow::after { transition-duration: 100ms; }
    .ody-flow *,
    .ody-flow::before { animation: none !important; }
    .ody-flow .ody-flow__progress,
    .ody-flow .ody-flow__primary::after { display: none; }
    .ody-breath .ody-breath__glow,
    .ody-breath .ody-breath__ring,
    .ody-breath[data-world] .ody-breath__ring,
    .ody-breath .ody-breath__core,
    .ody-breath .ody-breath__world,
    .ody-breath .ody-breath__art { transform: none; }
}

/* ---- Responsive -------------------------------------------------------------------- */
@media (max-height: 700px), (max-width: 480px) {
    .ody-flow { align-items: flex-start; }
    .ody-flow__preference { margin-top: 10px; }
    .ody-flow__stars { margin: 10px 0 6px; font-size: 22px; }
}
@media (max-width: 760px) {
    .ody-flow[data-layout='chapter'] {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-content: end;
        align-content: safe end;
        align-items: end;
        gap: 18px;
        padding-top: 32px;
    }
    .ody-flow[data-layout='chapter'] .ody-breath { grid-column: 1; grid-row: 1; }
    .ody-flow[data-layout='chapter'] .ody-flow__content { grid-row: 2; }
    .ody-breath__orb { width: clamp(110px, 30vw, 150px); }
    .ody-breath__hint { display: none; }
    /* A narrow bar keeps to its two buttons: nothing on an arrival counts down, and the note
       would double the bar that stays over the story. */
    .ody-flow[data-layout='chapter'] .ody-flow__breath { display: none; }
}
@media (max-width: 480px) {
    .ody-flow__actions { gap: 8px; }
    /* A phone is touched: its buttons keep their pad caps for a controller, not keyboard caps. */
    .ody-flow .sb-kbd[data-key] { display: none; }
    .ody-flow__primary { min-width: 0; flex: 1 1 150px; padding-inline: 12px; font-size: 0.72rem; }
    .ody-flow__quiet { padding-inline: 12px; font-size: 0.72rem; }
    .ody-flow[data-layout='scenic'] { padding: 12px 12px max(12px, env(safe-area-inset-bottom)); }
    .ody-flow[data-layout='scenic'] .ody-flow__content { padding: 12px 12px 0; }
    .ody-flow[data-layout='scenic'] .ody-flow__actions { margin-inline: -12px; padding-inline: 12px; }
    .ody-flow[data-layout='scenic'] .ody-flow__dest-art { width: 44px; height: 44px; }
}

/* Wide but short windows (a laptop browser, a windowed game, a Steam Deck): the reward and the
   next orb sit side by side so the whole ceremony fits without scrolling and the journey never
   stalls. Named areas keep the charm line under the reward, beside the next orb: placed in
   source order it spanned both columns between them and pushed the next orb a row down. */
@media (min-width: 900px) and (max-height: 860px) and (min-height: 501px) {
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__content {
        display: grid;
        grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
        grid-template-areas:
            'eyebrow eyebrow'
            'hero hero'
            'score score'
            'notes notes'
            'reward next'
            'found next'
            'status status'
            'progress progress'
            'actions actions'
            'pref pref';
        column-gap: 28px;
        width: min(1000px, 100%);
        align-items: center;
    }
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__content > * { grid-column: 1 / -1; }
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__eyebrow { grid-area: eyebrow; }
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__achievement { grid-area: hero; }
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__score { grid-area: score; }
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__star-notes { grid-area: notes; }
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__status { grid-area: status; }
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__progress { grid-area: progress; }
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__actions { grid-area: actions; }
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__preference { grid-area: pref; justify-self: center; }
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-theme-reward {
        grid-area: reward;
        align-self: end;
        width: 100%;
        margin: 12px 0 8px;
    }
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__found { grid-area: found; align-self: start; margin: 0 0 6px; }
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-theme-reward__song-note { display: block; }
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__next {
        grid-area: next;
        align-self: center;
        margin: 0;
        padding: 4px 0 4px 24px;
        border-top: 0;
        border-left: 1px solid rgba(255, 246, 233, 0.12);
        text-align: left;
    }
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__changes { margin-left: 0; }
}
/* Short screens keep a familiar orb's world small, then let the words carry the brief beat. */
@media (max-height: 800px) {
    .ody-flow__art { --orb-art-size: clamp(88px, 14vh, 128px); margin-bottom: clamp(22px, 3.6vh, 32px); }
}
@media (max-height: 640px) {
    .ody-flow__art { --orb-art-size: clamp(72px, 14vh, 96px); margin-bottom: 22px; }
    .ody-flow[data-layout='ceremony'] .ody-flow__art { display: none; }
}

/* On short landscape screens, use the width for goals and keep Pause in view. */
@media (max-height: 500px) and (min-width: 600px) {
    .ody-flow[data-layout='ceremony'],
    .ody-flow[data-layout='transit'] { padding-block: 8px; }
    .ody-flow[data-layout='ceremony'] .ody-flow__preference { min-height: 26px; margin-top: 2px; }
    /* The next orb's rules wait for the journey's briefing (and the HUD), so every control fits. */
    .ody-flow[data-layout='ceremony'] .ody-flow__changes { display: none; }
    .ody-flow[data-layout='ceremony'] .ody-flow__actions { margin-top: 6px; }
    .ody-flow[data-layout='ceremony'] .ody-flow__status { margin-top: 4px; }
    .ody-flow[data-layout='ceremony'] .ody-flow__art,
    .ody-flow[data-layout='transit'] .ody-flow__art { display: none; }
    .ody-flow[data-layout='ceremony'] .ody-flow__content,
    .ody-flow[data-layout='transit'] .ody-flow__content {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 6px 24px;
        width: min(860px, 100%);
        margin-top: 0;
        align-items: center;
    }
    .ody-flow[data-layout='ceremony'] .ody-flow__content > *,
    .ody-flow[data-layout='transit'] .ody-flow__content > * { grid-column: 1; margin: 0; }
    .ody-flow[data-layout='ceremony'] .ody-flow__achievement { font-size: clamp(1.4rem, 3.4vw, 2rem); }
    .ody-flow[data-layout='ceremony'] .ody-theme-reward,
    .ody-flow[data-layout='ceremony'] .ody-flow__next,
    .ody-flow[data-layout='transit'] .ody-flow__next { grid-column: 2; grid-row: 1 / span 4; }
    .ody-flow[data-layout='ceremony'][data-theme-reward='true'] .ody-flow__next { grid-row: 5 / span 2; }
    .ody-flow[data-layout='ceremony'] .ody-flow__next { border-top: 0; padding-top: 0; }
    .ody-flow[data-layout='ceremony'] .ody-flow__status,
    .ody-flow[data-layout='ceremony'] .ody-flow__actions,
    .ody-flow[data-layout='ceremony'] .ody-flow__preference,
    .ody-flow[data-layout='transit'] .ody-flow__status,
    .ody-flow[data-layout='transit'] .ody-flow__actions { grid-column: 1 / -1; }
    .ody-flow[data-layout='ceremony'] .ody-flow__progress,
    .ody-flow[data-layout='transit'] .ody-flow__progress { display: none; }
    .ody-flow[data-layout='scenic'] { padding: 10px 18px; }
    .ody-flow[data-layout='scenic'] .ody-flow__content {
        width: min(780px, 100%);
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        padding-top: 12px;
    }
    .ody-flow[data-layout='scenic'] .ody-flow__next { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.1fr); }
    .ody-flow[data-layout='scenic'] .ody-flow__changes,
    .ody-flow[data-layout='scenic'] .ody-flow__farewell { grid-column: 3; grid-row: 1 / span 4; margin: 0; }
    .ody-flow[data-layout='scenic'] .ody-flow__status { margin-top: 6px; }
    .ody-flow[data-layout='chapter'] { padding-top: 14px; }
    .ody-flow[data-layout='chapter'] .ody-breath { position: sticky; top: 0; align-self: start; }
    .ody-flow[data-layout='chapter'] .ody-breath__orb { width: clamp(96px, 30vh, 140px); }
    .ody-flow[data-layout='chapter'] .ody-breath__hint { display: none; }
}

/* Essential rules remain visible while the optional longer Level guide is shut. */
.odyssey-hud .hud-level-rules {
    list-style: none;
    margin: 7px 0 0;
    padding: 0;
    color: #c8c0d7;
    font-size: 0.75rem;
    line-height: 1.45;
}
.odyssey-hud .hud-level-rules li + li { margin-top: 3px; }

/* Available before the first orb as well as on the completion portal. */
.odyssey-flow-preference {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 18px 0;
    padding: 12px 0;
    cursor: pointer;
    color: var(--sb-text, #f7f0e7);
    text-align: left;
}
.odyssey-flow-preference input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--sb-keystone, #eda890); flex: 0 0 auto; }
.odyssey-flow-preference__copy { font-size: 0.85rem; line-height: 1.5; }
.odyssey-flow-preference__copy small { display: block; margin-top: 3px; color: var(--sb-text-muted, #c8c0d7); font-size: 0.75rem; }
.odyssey-flow-preference input:focus-visible { outline: 2px solid var(--sb-keystone, #eda890); outline-offset: 4px; }

/* ---- Theme + song reward: compact card (Results; the finale uses the ceremony card) ---- */
.ody-theme-reward {
    --ody-reward-color: #ebcb9c;
    --ody-reward-glow: #fff1d3;
    display: flex;
    align-items: center;
    gap: 18px;
    width: min(460px, 100%);
    box-sizing: border-box;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 18px auto 24px;
    padding: 14px 18px 14px 14px;
    border: 1px solid color-mix(in srgb, var(--ody-reward-color) 42%, #242033);
    border-radius: 18px;
    background: linear-gradient(115deg, color-mix(in srgb, var(--ody-reward-color) 13%, #14111e), #100e1b 75%);
    box-shadow: 0 8px 28px #0003, inset 0 1px 0 #ffffff0a;
    color: #f7f0e7;
    text-align: left;
    font-family: var(--sb-font-text, sans-serif);
}
.ody-theme-reward::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 42%, #fff2 49%, transparent 56%);
    opacity: 0;
}
.ody-theme-reward__art {
    width: 88px;
    height: 88px;
    flex: 0 0 auto;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--ody-reward-color) 70%, transparent);
    background: radial-gradient(circle, var(--ody-reward-color), #171421 70%);
    box-shadow: 0 0 24px color-mix(in srgb, var(--ody-reward-color) 16%, transparent);
}
.ody-theme-reward__image { display: block; width: 100%; height: 100%; object-fit: cover; }
.ody-theme-reward [hidden] { display: none !important; }
.ody-theme-reward__seal {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff1d3;
    font-size: 34px;
    background: radial-gradient(circle, #30263de8, #13111dee);
    opacity: 0;
    pointer-events: none;
}
.ody-theme-reward__copy { min-width: 0; flex: 1; }
.ody-theme-reward__eyebrow {
    margin: 0 0 5px;
    color: var(--ody-reward-color);
    font: 600 0.66rem / 1.4 var(--sb-font-display, sans-serif);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}
.ody-theme-reward__name {
    margin: 0;
    font: 500 clamp(1.12rem, 3vw, 1.55rem) / 1.2 var(--sb-font-display, sans-serif);
    overflow-wrap: anywhere;
    text-wrap: balance;
}
.ody-theme-reward__bonus { margin: 6px 0 0; color: #e1d6e7; font-size: 0.75rem; line-height: 1.5; overflow-wrap: anywhere; }
.ody-theme-reward__collection { margin: 8px 0 0; color: #bcb4c9; font-size: 0.7rem; line-height: 1.5; }
.ody-theme-reward--pending { --ody-reward-color: #e8c197; }
.ody-theme-reward__save-title { margin: 0; color: #f4d3af; font-size: 0.88rem; line-height: 1.5; font-weight: 600; }
.ody-theme-reward__save-copy { margin: 6px 0 0; color: #cfc4d8; font-size: 0.77rem; line-height: 1.5; }
.ody-finale .ody-finale__title:focus-visible { outline: none; }
.sb-ody-modal .sb-ody-title:focus-visible { outline: none; }
.ody-theme-reward[data-celebrating='true'] .ody-theme-reward__seal { animation: ody-reward-open 950ms 150ms ease-out both; }
.ody-theme-reward[data-celebrating='true']::after { animation: ody-reward-light 1400ms 150ms ease-out both; }
@keyframes ody-reward-open {
    0%, 16% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.45); }
}
@keyframes ody-reward-light {
    0% { opacity: 0; transform: scaleX(0.25); }
    28% { opacity: 0.8; }
    100% { opacity: 0; transform: scaleX(1); }
}

/* ---- Theme + song reward: the completion ceremony ------------------------------- */
.ody-theme-reward--ceremony {
    width: min(600px, 100%);
    gap: 26px;
    margin: 14px auto 16px;
    padding: 16px 24px 16px 18px;
    overflow: visible;
    border-radius: 24px;
    border-color: color-mix(in srgb, var(--ody-reward-color) 46%, rgba(255, 246, 233, 0.08));
    background:
        radial-gradient(ellipse 60% 120% at 0% 50%, color-mix(in srgb, var(--ody-reward-color) 20%, transparent), transparent 70%),
        linear-gradient(115deg, rgba(24, 19, 40, 0.96), rgba(12, 10, 24, 0.97) 70%);
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: ody-reward-card 760ms 760ms var(--ody-ease-out, ease-out) backwards;
}
.ody-theme-reward--ceremony::after { border-radius: inherit; }
.ody-theme-reward--ceremony .ody-theme-reward__art {
    width: clamp(104px, min(17vw, 18vh), 156px);
    height: clamp(104px, min(17vw, 18vh), 156px);
    overflow: visible;
    border: 0;
    background: none;
    box-shadow: none;
}
.ody-theme-reward--ceremony .ody-theme-reward__image,
.ody-theme-reward--ceremony .ody-theme-reward__seal {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid color-mix(in srgb, var(--ody-reward-color) 75%, #ffffff);
    box-shadow:
        0 0 36px color-mix(in srgb, var(--ody-reward-color) 42%, transparent),
        inset 0 0 18px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
}
.ody-theme-reward--ceremony .ody-theme-reward__image { background: #171421; }
.ody-theme-reward--ceremony .ody-theme-reward__seal { font-size: 44px; }
.ody-theme-reward__halo,
.ody-theme-reward__ring,
.ody-theme-reward__sparks {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.ody-theme-reward__halo {
    inset: -34%;
    background: radial-gradient(circle, color-mix(in srgb, var(--ody-reward-color) 46%, transparent) 0%, transparent 62%);
    opacity: 0.55;
    animation: ody-reward-halo 6s ease-in-out infinite alternate;
}
.ody-theme-reward__ring {
    inset: -9%;
    border: 1px solid color-mix(in srgb, var(--ody-reward-glow) 55%, transparent);
    opacity: 0.4;
}
.ody-theme-reward__ring--outer { inset: -20%; opacity: 0.18; border-style: dashed; animation: ody-flow-orbit 36s linear infinite; }
.ody-theme-reward__sparks { inset: 0; }
.ody-theme-reward__spark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    margin: -2.5px 0 0 -2.5px;
    border-radius: 50%;
    background: var(--ody-reward-glow);
    box-shadow: 0 0 10px 2px color-mix(in srgb, var(--ody-reward-color) 80%, transparent);
    opacity: 0;
}
.ody-theme-reward--ceremony .ody-theme-reward__eyebrow { font-size: 0.7rem; letter-spacing: 0.2em; margin-bottom: 6px; }
.ody-theme-reward--ceremony .ody-theme-reward__name { font-size: clamp(1.45rem, min(3.6vw, 4.6vh), 2.2rem); line-height: 1.12; }
.ody-theme-reward__song {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 0;
    color: #f2e9f4;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
}
.ody-theme-reward__eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 18px; height: 14px; flex: 0 0 auto; }
.ody-theme-reward__eq i {
    display: block;
    width: 3px;
    height: 35%;
    border-radius: 1px;
    background: var(--ody-reward-color);
    transform-origin: bottom;
}
.ody-theme-reward__song[data-now-playing='true'] .ody-theme-reward__eq i { animation: ody-reward-eq 900ms ease-in-out infinite alternate; }
.ody-theme-reward__song[data-now-playing='true'] .ody-theme-reward__eq i:nth-child(2) { animation-duration: 640ms; animation-delay: -200ms; }
.ody-theme-reward__song[data-now-playing='true'] .ody-theme-reward__eq i:nth-child(3) { animation-duration: 1100ms; animation-delay: -420ms; }
.ody-theme-reward__song[data-now-playing='true'] .ody-theme-reward__eq i:nth-child(4) { animation-duration: 760ms; animation-delay: -90ms; }
.ody-theme-reward__song-note { margin: 4px 0 0 28px; color: #bdb3cb; font-size: 0.74rem; line-height: 1.45; }
.ody-theme-reward--ceremony .ody-theme-reward__bonus { margin-top: 8px; font-size: 0.78rem; }
.ody-theme-reward__meter {
    position: relative;
    height: 3px;
    margin: 12px 0 0;
    border-radius: 3px;
    overflow: hidden;
    background: rgba(255, 246, 233, 0.1);
}
.ody-theme-reward__meter-fill {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, color-mix(in srgb, var(--ody-reward-color) 70%, #ffffff), var(--ody-reward-color));
    transform-origin: left center;
    transform: scaleX(var(--meter-to, 0));
}
.ody-theme-reward--ceremony .ody-theme-reward__collection { margin-top: 6px; font-size: 0.72rem; letter-spacing: 0.02em; }

/* The bloom: the card arrives, the seal opens onto the theme, light and sparks escape. */
.ody-theme-reward--ceremony[data-celebrating='true'] .ody-theme-reward__art {
    animation: ody-reward-art 1100ms 900ms cubic-bezier(0.2, 0.9, 0.1, 1.1) backwards;
}
.ody-theme-reward--ceremony[data-celebrating='true'] .ody-theme-reward__image {
    animation: ody-reward-image 1500ms 1000ms var(--ody-ease-out, ease-out) backwards;
}
.ody-theme-reward--ceremony[data-celebrating='true'] .ody-theme-reward__seal { animation: ody-reward-open 1100ms 950ms ease-out both; }
.ody-theme-reward--ceremony[data-celebrating='true'] .ody-theme-reward__ring:not(.ody-theme-reward__ring--outer) {
    animation: ody-reward-ring 1300ms 1050ms var(--ody-ease-out, ease-out) backwards;
}
.ody-theme-reward--ceremony[data-celebrating='true'] .ody-theme-reward__spark {
    animation: ody-reward-spark 1400ms calc(1050ms + var(--spark-delay, 0ms)) var(--ody-ease-out, ease-out) both;
}
.ody-theme-reward--ceremony[data-celebrating='true']::after { animation: ody-reward-light 1500ms 1150ms ease-out both; }
.ody-theme-reward--ceremony[data-celebrating='true'] .ody-theme-reward__copy > * {
    animation: ody-flow-rise 620ms 1150ms var(--ody-ease-out, ease-out) backwards;
}
.ody-theme-reward--ceremony[data-celebrating='true'] .ody-theme-reward__copy > :nth-child(2) { animation-delay: 1250ms; }
.ody-theme-reward--ceremony[data-celebrating='true'] .ody-theme-reward__copy > :nth-child(3) { animation-delay: 1420ms; }
.ody-theme-reward--ceremony[data-celebrating='true'] .ody-theme-reward__copy > :nth-child(4) { animation-delay: 1520ms; }
.ody-theme-reward--ceremony[data-celebrating='true'] .ody-theme-reward__copy > :nth-child(n + 5) { animation-delay: 1640ms; }
.ody-theme-reward--ceremony[data-celebrating='true'] .ody-theme-reward__meter-fill {
    animation: ody-reward-meter 1400ms 1700ms var(--ody-ease, ease) backwards;
}
@keyframes ody-reward-card { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
@keyframes ody-reward-art { from { opacity: 0; transform: scale(0.55) rotate(-12deg); } }
@keyframes ody-reward-image { from { opacity: 0; transform: scale(1.2); filter: saturate(0.4) brightness(1.6); } }
@keyframes ody-reward-ring {
    0% { opacity: 0.9; transform: scale(0.7); border-width: 3px; }
    100% { opacity: 0.4; transform: scale(1); border-width: 1px; }
}
@keyframes ody-reward-spark {
    0% { opacity: 0; transform: rotate(var(--spark-angle, 0deg)) translateX(30%) scale(0.4); }
    18% { opacity: 1; }
    100% { opacity: 0; transform: rotate(var(--spark-angle, 0deg)) translateX(var(--spark-reach, 100%)) scale(1); }
}
@keyframes ody-reward-meter { from { transform: scaleX(var(--meter-from, 0)); } }
@keyframes ody-reward-eq { from { transform: scaleY(0.35); } to { transform: scaleY(2.6); } }
@keyframes ody-reward-halo { from { opacity: 0.4; transform: scale(0.94); } to { opacity: 0.7; transform: scale(1.06); } }

.ody-flow[data-layout='scenic'] .ody-theme-reward,
.ody-flow[data-layout='chapter'] .ody-theme-reward { display: none; }
.ody-theme-reward[data-reduced-motion='true'] *,
.ody-theme-reward[data-reduced-motion='true']::after,
.ody-theme-reward[data-reduced-motion='true'] { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
    .ody-theme-reward,
    .ody-theme-reward *,
    .ody-theme-reward::after { animation: none !important; }
}
@media (max-width: 560px) {
    .ody-theme-reward--ceremony { flex-direction: column; text-align: center; gap: 16px; padding: 22px 18px 18px; }
    .ody-theme-reward--ceremony .ody-theme-reward__song { justify-content: center; }
    .ody-theme-reward--ceremony .ody-theme-reward__song-note { margin-left: 0; }
}
/* Phones: a smaller artwork, and the next orb's rules wait for the journey's briefing (and the
   HUD), so the reward, the next orb and every control fit and the flow carries on. */
@media (max-width: 560px) and (max-height: 900px) {
    .ody-theme-reward--ceremony { gap: 10px; padding: 16px 16px 14px; margin-block: 10px 12px; }
    .ody-theme-reward--ceremony .ody-theme-reward__art { width: 80px; height: 80px; }
    .ody-theme-reward--ceremony .ody-theme-reward__seal { font-size: 30px; }
    .ody-flow[data-layout='ceremony'] .ody-flow__changes { display: none; }
}
@media (max-width: 480px) {
    .ody-theme-reward { gap: 12px; padding: 12px; margin-block: 12px 18px; }
    .ody-theme-reward__art { width: 68px; height: 68px; }
    .ody-theme-reward__eyebrow { font-size: 0.61rem; letter-spacing: 0.1em; }
}
@media (max-height: 700px) and (min-width: 561px) {
    .ody-theme-reward--ceremony { padding: 12px 20px 12px 14px; margin-block: 8px 10px; }
    .ody-theme-reward--ceremony .ody-theme-reward__song-note { display: none; }
}
@media (max-height: 500px) and (min-width: 600px) {
    .ody-flow[data-layout='ceremony'] .ody-theme-reward { margin: 0; gap: 14px; padding: 10px 14px 10px 10px; }
    .ody-flow[data-layout='ceremony'] .ody-theme-reward__art { width: 76px; height: 76px; }
    .ody-flow[data-layout='ceremony'] .ody-theme-reward__song-note,
    .ody-flow[data-layout='ceremony'] .ody-theme-reward__meter { display: none; }
}

/* ---- Ready → Go: the fair start of every orb (src/ui/odyssey/odyssey-start-cue.js) -------- */
.odyssey-start-cue {
    position: fixed;
    inset: 0;
    z-index: 13000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    /* A veil, never a blur: the live scene stays sharp under the cue (no backdrop-filter). */
    background: radial-gradient(circle at var(--cue-well-x, 50%) var(--cue-well-y, 50%),
        rgba(10, 18, 34, 0.06), rgba(2, 6, 18, 0.3) 70%, rgba(0, 0, 0, 0.4) 100%);
    animation: ody-cue-veil 220ms ease-out both;
}
/* The plate sits on the well and never overhangs it onto the HUD: odyssey-start-cue.js measures
   the well (--cue-well-*); without one the plate is centred and capped. */
.odyssey-start-cue__panel {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: min(calc(var(--cue-well-w, 380px) - 24px), calc(100vw - 32px));
    container-type: inline-size;
    padding: 18px 12px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(8, 15, 28, 0.32), rgba(4, 10, 22, 0.16));
    border: 1px solid rgba(255, 246, 233, 0.12);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.22);
    animation: ody-cue-panel 320ms cubic-bezier(0.05, 0.7, 0.1, 1) both;
}
.odyssey-start-cue__ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(240px, 88cqi);
    aspect-ratio: 1;
    translate: -50% -50%;
    border-radius: 50%;
    border: 1.5px solid rgba(158, 232, 237, 0.55);
    box-shadow: 0 0 30px rgba(158, 232, 237, 0.18), inset 0 0 24px rgba(158, 232, 237, 0.12);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.6);
    animation: ody-cue-ready-ring 900ms ease-in-out infinite alternate;
}
.odyssey-start-cue[data-fit='well'] {
    display: block;
    transform-origin: var(--cue-well-x) var(--cue-well-y);
}
.odyssey-start-cue[data-fit='well'] .odyssey-start-cue__panel {
    position: absolute;
    left: var(--cue-well-x);
    top: var(--cue-well-y);
    translate: -50% -50%;
}
.odyssey-start-cue__label {
    position: relative;
    /* Sized by the plate, so READY always fits the well it starts (container query units). */
    font: 700 clamp(28px, 17cqi, 84px) / 1 var(--sb-font-display, 'Unbounded', sans-serif);
    letter-spacing: 0.16em;
    margin-right: -0.16em;
    text-transform: uppercase;
    color: #9ee8ed;
    text-shadow: 0 0 18px rgba(158, 232, 237, 0.85), 0 0 48px rgba(158, 232, 237, 0.4);
    transition: color 140ms ease-out, text-shadow 140ms ease-out;
}
.odyssey-start-cue__subtitle {
    position: relative;
    max-width: 100%;
    font: 400 clamp(11px, 1.1vw, 15px) / 1.4 var(--sb-font-display, 'Unbounded', sans-serif);
    letter-spacing: 0.16em;
    overflow-wrap: anywhere;
    text-transform: uppercase;
    color: rgba(255, 246, 233, 0.78);
    text-align: center;
}
.odyssey-start-cue[data-phase='go'] .odyssey-start-cue__label {
    color: #ffac88;
    text-shadow: 0 0 18px rgba(255, 172, 136, 0.9), 0 0 48px rgba(255, 172, 136, 0.45);
    animation: ody-cue-go 320ms cubic-bezier(0.2, 0.9, 0.1, 1.2) both;
}
.odyssey-start-cue[data-phase='go'] .odyssey-start-cue__subtitle { color: rgba(255, 246, 233, 0.92); }
.odyssey-start-cue[data-phase='go'] .odyssey-start-cue__ring {
    border-color: rgba(255, 172, 136, 0.8);
    box-shadow: 0 0 36px rgba(255, 172, 136, 0.3), inset 0 0 24px rgba(255, 172, 136, 0.16);
    animation: ody-cue-go-ring 560ms cubic-bezier(0.05, 0.7, 0.1, 1) forwards;
}
.odyssey-start-cue--afterglow { pointer-events: none !important; }
.odyssey-start-cue--afterglow,
.odyssey-start-cue--afterglow * { animation: none !important; }
.odyssey-start-cue--afterglow .odyssey-start-cue__label { transform: scale(1.06); }
@keyframes ody-cue-veil { from { opacity: 0; } }
@keyframes ody-cue-panel { from { opacity: 0; transform: scale(0.92); } }
@keyframes ody-cue-ready-ring { from { opacity: 0.16; transform: scale(0.62); } to { opacity: 0.42; transform: scale(0.74); } }
@keyframes ody-cue-go { 0% { transform: scale(0.9); } 55% { transform: scale(1.14); } 100% { transform: scale(1.06); } }
@keyframes ody-cue-go-ring { from { opacity: 0.95; transform: scale(0.72); } to { opacity: 0; transform: scale(2); } }
.odyssey-start-cue[data-reduced-motion='true'],
.odyssey-start-cue[data-reduced-motion='true'] * { animation: none !important; }
.odyssey-start-cue[data-reduced-motion='true'] .odyssey-start-cue__ring { display: none; }
@media (prefers-reduced-motion: reduce) {
    .odyssey-start-cue,
    .odyssey-start-cue * { animation: none !important; }
    .odyssey-start-cue__ring { display: none; }
}

/* ---- The well answers a reached goal (src/ui/odyssey/odyssey-goal-flourish.js) ------------ */
.single-player-stage #single-player-border.odyssey-goal-flare {
    animation: ody-goal-flare 1150ms cubic-bezier(0.2, 0, 0, 1) both;
}
#single-player-container .player-board-section.odyssey-goal-sweep::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    background: linear-gradient(0deg,
        transparent 34%,
        color-mix(in srgb, var(--odyssey-goal-color, #f3d28d) 30%, transparent) 46%,
        rgba(255, 248, 236, 0.3) 50%,
        color-mix(in srgb, var(--odyssey-goal-color, #f3d28d) 30%, transparent) 54%,
        transparent 66%);
    background-size: 100% 300%;
    mix-blend-mode: screen;
    animation: ody-goal-sweep 950ms cubic-bezier(0.3, 0, 0.2, 1) forwards;
}
#single-player-container .player-board-section[data-goal-reduced-motion='true']::after { display: none; }
.player-board-section[data-goal-reduced-motion='true'] #single-player-border.odyssey-goal-flare {
    animation: none;
    border-color: var(--odyssey-goal-wall, var(--odyssey-goal-color, #f3d28d));
}
@keyframes ody-goal-flare {
    18% {
        border-color: #fff8ec;
        box-shadow:
            0 0 22px 2px var(--odyssey-goal-color, #f3d28d),
            0 0 80px 14px color-mix(in srgb, var(--odyssey-goal-color, #f3d28d) 50%, transparent),
            inset 0 0 44px color-mix(in srgb, var(--odyssey-goal-color, #f3d28d) 42%, transparent);
    }
    100% {
        /* The chapter's colour, deepened if light blue (--odyssey-goal-wall, board-walls.js). */
        border-color: var(--odyssey-goal-wall, var(--odyssey-goal-color, #f3d28d));
        box-shadow:
            0 10px 36px -6px color-mix(in srgb, var(--odyssey-goal-color, #f3d28d) 58%, transparent),
            inset 0 0 18px color-mix(in srgb, var(--odyssey-goal-color, #f3d28d) 22%, transparent);
    }
}
@keyframes ody-goal-sweep {
    from { background-position: 0 0%; opacity: 1; }
    80% { opacity: 1; }
    to { background-position: 0 100%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    #single-player-container .player-board-section.odyssey-goal-sweep::after { display: none; }
    .single-player-stage #single-player-border.odyssey-goal-flare {
        animation: none;
        border-color: var(--odyssey-goal-color, #f3d28d);
    }
}
