/* ==========================================================================
   Bira-Biro · shared styles
   --------------------------------------------------------------------------
   Everything the shelf (`/play`) and the player use, plus the tokens and the
   two faces the landing page builds on. No build step: the same PHP process
   that serves the API serves these pages.

   The palette is the app's wood theme (lib/app/theme/wood_theme.dart) with the
   characters' own paints - Bira's teal and Biro's purple - as the two accents.
   ========================================================================== */

@font-face {
    font-family: "Baloo 2";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("../fonts/baloo2-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("../fonts/nunito-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    color-scheme: light;

    --cream: #fffcf5;
    --parchment: #fff6e6;
    --timber-highlight: #f6dfb8;
    --timber-light: #e7c08c;
    --timber: #c98b4b;
    --timber-dark: #9a6132;
    --timber-edge: #6b4226;

    /* Deep plum, never black: softer on a child's eyes and warmer on cream. */
    --ink: #3b2447;
    --ink-soft: #6f5a7b;

    --leaf: #6fbf4a;
    --leaf-deep: #2f7a3e;
    --sky: #7ec8e3;
    --sky-deep: #3b7dd8;
    --sun: #ffc63e;
    --berry: #e2557b;
    --plum: #7c5cd6;
    --clay: #e4813a;

    /* The characters' own colours, sampled from the shipped artwork. */
    --bira: #47b8a2;
    --bira-deep: #1f7e6c;
    --biro: #994e9e;
    --biro-deep: #6f3374;

    --radius-lg: 28px;
    --radius: 20px;
    --radius-sm: 14px;

    --shadow-card: 0 3px 0 var(--timber-light), 0 16px 26px -22px rgb(59 36 71 / 55%);
    --shadow-lift: 0 5px 0 var(--timber-light), 0 26px 36px -26px rgb(59 36 71 / 65%);

    --font-display: "Baloo 2", ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display",
        "Segoe UI", system-ui, "Noto Sans Ethiopic", sans-serif;
    --font-body: "Nunito", ui-rounded, "Segoe UI Variable Text", "Segoe UI", system-ui,
        -apple-system, "Noto Sans Ethiopic", sans-serif;
    --font: var(--font-body);
}

/* ── Base ───────────────────────────────────────────────────────────────── */

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

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

body.site {
    margin: 0;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--cream);
    background-image:
        radial-gradient(60% 40% at 12% -6%, rgb(255 198 62 / 18%), transparent 70%),
        radial-gradient(50% 36% at 92% 2%, rgb(126 200 227 / 16%), transparent 72%);
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin: 0;
}

p {
    margin: 0;
}

a {
    color: var(--leaf-deep);
}

.wrap {
    width: min(1180px, 100% - clamp(28px, 6vw, 80px));
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -100px;
    z-index: 100;
    padding: 10px 18px;
    border-radius: 0 0 12px 12px;
    background: var(--ink);
    color: var(--cream);
    text-decoration: none;
    font-weight: 700;
    transition: top 0.15s ease;
}

.skip-link:focus-visible {
    top: 0;
}

:focus-visible {
    outline: 3px solid var(--sky-deep);
    outline-offset: 3px;
    border-radius: 8px;
}

.kicker {
    margin: 0 0 0.35rem;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--timber-dark);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
    --btn-bg: linear-gradient(#ffe08a, #ffc23d);
    --btn-fg: #3b2447;
    --btn-shadow: #c98b2b;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.75rem 1.35rem;
    border: 0;
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font: inherit;
    font-weight: 800;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--btn-shadow), 0 14px 20px -14px rgb(59 36 71 / 55%);
    transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.btn:hover {
    transform: translateY(-1px);
    filter: saturate(1.05);
}

.btn:active {
    transform: translateY(3px) scale(0.98);
    box-shadow: 0 1px 0 var(--btn-shadow);
}

.btn--lg {
    padding: 0.95rem 1.7rem;
    font-size: 1.05rem;
}

.btn--sm {
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
}

.btn--leaf {
    --btn-bg: linear-gradient(#8bdc63, #4fa83d);
    --btn-fg: #10290b;
    --btn-shadow: #2f7a3e;
}

.btn--sun {
    --btn-bg: linear-gradient(#ffe08a, #ffc23d);
    --btn-fg: #3b2447;
    --btn-shadow: #c98b2b;
}

.btn--ghost {
    --btn-bg: var(--cream);
    --btn-fg: var(--ink);
    --btn-shadow: var(--timber-light);

    box-shadow: inset 0 0 0 2px var(--timber-light), 0 4px 0 var(--timber-light);
}

.btn--quiet {
    --btn-bg: transparent;
    --btn-fg: var(--ink-soft);
    --btn-shadow: transparent;

    box-shadow: none;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn__icon {
    display: grid;
    place-items: center;
    width: 1.6em;
    height: 1.6em;
    border-radius: 999px;
    background: rgb(255 255 255 / 55%);
    font-size: 0.8em;
}

/* ── Top bar ────────────────────────────────────────────────────────────── */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgb(255 252 245 / 96%);
    border-bottom: 1px solid rgb(201 139 75 / 22%);
    backdrop-filter: blur(14px) saturate(1.15);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 76px;
    padding-block: 0.6rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: inherit;
    text-decoration: none;
}

.brand__mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    box-shadow: 0 6px 14px -8px rgb(59 36 71 / 70%);
}

.brand__text {
    display: grid;
    line-height: 1.1;
}

.brand__text strong {
    font-family: var(--font-display);
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}

.brand__text small {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.topbar__nav {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.topbar__link {
    padding: 0.5rem 0.7rem;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
    border-radius: 999px;
}

.topbar__link:hover {
    background: rgb(201 139 75 / 14%);
}

.lang {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: rgb(201 139 75 / 14%);
}

.lang__option {
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.lang__option.is-active {
    background: var(--cream);
    color: var(--ink);
    box-shadow: 0 2px 8px -4px rgb(59 36 71 / 50%);
}

/* ── Cards (the shelf) ──────────────────────────────────────────────────── */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
    gap: clamp(12px, 1.7vw, 22px);
}

.card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.6rem 0.6rem 0.85rem;
    border-radius: var(--radius);
    border: 2px solid var(--timber-light);
    background: var(--cream);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow-card);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.card:hover {
    transform: translateY(-4px) rotate(-0.4deg);
    box-shadow: var(--shadow-lift);
}

.card:active {
    transform: translateY(1px);
}

.card__art {
    position: relative;
    display: block;
    /* The pack's card art is 810 x 1080 - a portrait poster, the same shape the
       app's week rail shows. Cropping it to a landscape box would cut the title
       off the thumbnail. */
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-sm);
    background: linear-gradient(160deg, var(--parchment), var(--timber-highlight));
    background: color-mix(in srgb, var(--tint) 16%, var(--parchment));
}

.card__art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Rounded on the image itself rather than by clipping the box: one less
       compositing layer, and the poster keeps its corners. */
    border-radius: inherit;
}

.card__glyph {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 2.4rem;
}

.card__chapter {
    position: absolute;
    left: 0.45rem;
    bottom: 0.45rem;
    z-index: 2;
    padding: 0.16rem 0.6rem;
    border-radius: 999px;
    background: rgb(255 252 245 / 94%);
    border: 1px solid rgb(59 36 71 / 10%);
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--ink);
}

.card__body {
    display: grid;
    gap: 0.15rem;
    padding-inline: 0.3rem;
}

.card__title {
    font-family: var(--font-display);
    font-size: 1rem;
    line-height: 1.25;
}

.card__meta {
    font-size: 0.78rem;
    color: var(--ink-soft);
}

/* ── Library ────────────────────────────────────────────────────────────── */

.pagehead {
    padding: clamp(26px, 4vw, 54px) 0 clamp(10px, 1.5vw, 18px);
}

.pagehead__inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
}

.pagehead__title {
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.02em;
}

.pagehead__lead {
    margin-top: 0.4rem;
    color: var(--ink-soft);
}

.pagehead__count {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: rgb(111 191 74 / 14%);
    border: 1px solid rgb(47 122 62 / 20%);
    color: var(--leaf-deep);
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.week {
    padding: clamp(18px, 2.4vw, 30px) 0;
}

.week__title {
    margin-bottom: 1rem;
}

.week__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: var(--timber-highlight);
    border: 1px solid var(--timber-light);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--timber-edge);
}

.empty {
    display: grid;
    justify-items: center;
    gap: 0.6rem;
    padding: clamp(40px, 8vw, 90px) 0;
    text-align: center;
}

.empty img {
    border-radius: 24px;
    box-shadow: 0 20px 40px -28px rgb(59 36 71 / 60%);
}

.empty p {
    max-width: 46ch;
    color: var(--ink-soft);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.footer {
    margin-top: clamp(24px, 5vw, 60px);
    padding: clamp(28px, 4vw, 44px) 0;
    border-top: 1px solid rgb(201 139 75 / 22%);
    background: var(--parchment);
}

.footer__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr));
    gap: clamp(18px, 2.6vw, 36px);
    align-items: start;
}

.footer__brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.footer__brand img {
    border-radius: 10px;
}

.footer__brand strong {
    font-family: var(--font-display);
    font-size: 1.1rem;
}

.footer__brand p {
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.footer__col {
    display: grid;
    justify-items: start;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.footer__heading {
    margin: 0 0 0.15rem;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.footer__col a {
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.footer__col a:hover {
    color: var(--leaf-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer__social {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.footer__glyph {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgb(201 139 75 / 16%);
    font-size: 0.7rem;
    font-weight: 800;
}

.footer__note {
    grid-column: 1 / -1;
    margin-top: 0.4rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgb(201 139 75 / 20%);
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.footer__dot {
    margin-inline: 0.35rem;
}

/* ==========================================================================
   The player
   --------------------------------------------------------------------------
   A dark room so the activity is the only bright thing in it, a wooden bezel
   around the 1920 x 1080 stage, and the activity scaled to fit whatever the
   device offers.
   ========================================================================== */

body.player {
    margin: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--font-body);
    color: var(--cream);
    background: radial-gradient(90% 70% at 50% -10%, #4a3222 0%, #2b1d12 48%, #150d06 100%);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

.player__bar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: none;
    min-height: 62px;
    padding: 0.5rem clamp(10px, 2vw, 24px);
    padding-top: max(0.5rem, env(safe-area-inset-top));
    background: rgb(21 13 6 / 55%);
    border-bottom: 1px solid rgb(246 223 184 / 12%);
    backdrop-filter: blur(10px);
}

.player__back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgb(246 223 184 / 10%);
    color: var(--cream);
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.player__back:hover {
    background: rgb(246 223 184 / 18%);
}

.player__heading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex: 1;
}

.player__title {
    font-family: var(--font-display);
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player__chip {
    flex: none;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tint) 42%, transparent);
    border: 1px solid rgb(255 255 255 / 22%);
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--cream);
    white-space: nowrap;
}

.player__tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: none;
}

.voices {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: rgb(246 223 184 / 10%);
}

.voices__btn {
    padding: 0.3rem 0.7rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgb(255 252 245 / 65%);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.voices__btn[aria-pressed="true"] {
    background: var(--cream);
    color: var(--ink);
}

.iconbtn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgb(246 223 184 / 18%);
    border-radius: 999px;
    background: rgb(246 223 184 / 8%);
    color: var(--cream);
    cursor: pointer;
}

.iconbtn:hover {
    background: rgb(246 223 184 / 16%);
}

.iconbtn svg {
    width: 20px;
    height: 20px;
}

.player__area {
    flex: 1;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: clamp(8px, 1.4vw, 22px);
    padding-bottom: max(clamp(8px, 1.4vw, 22px), env(safe-area-inset-bottom));
}

.frame {
    position: relative;
    width: max-content;
    padding: clamp(6px, 0.9vw, 14px);
    border-radius: calc(clamp(6px, 0.9vw, 14px) + 14px);
    background: linear-gradient(160deg, #d59a5c 0%, var(--timber) 35%, var(--timber-dark) 100%);
    box-shadow:
        0 40px 70px -30px rgb(0 0 0 / 85%),
        inset 0 1px 0 rgb(255 255 255 / 35%),
        inset 0 -6px 0 rgb(0 0 0 / 22%);
}

.frame__inner {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: #0d0a07;
    box-shadow: inset 0 0 0 2px rgb(0 0 0 / 45%), inset 0 0 30px rgb(0 0 0 / 70%);
}

.stage {
    width: 1920px;
    height: 1080px;
    transform-origin: top left;
}

.stage iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #0d0a07;
}

.frame__screw {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffe9c6, #8a5a2e 70%);
    box-shadow: inset 0 -1px 1px rgb(0 0 0 / 45%);
    opacity: 0.9;
}

.frame__screw--tl {
    top: 4px;
    left: 4px;
}

.frame__screw--tr {
    top: 4px;
    right: 4px;
}

.frame__screw--bl {
    bottom: 4px;
    left: 4px;
}

.frame__screw--br {
    bottom: 4px;
    right: 4px;
}

.frame__loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 0.8rem;
    align-content: center;
    color: rgb(255 252 245 / 70%);
    font-size: 0.9rem;
    font-weight: 700;
    transition: opacity 0.3s ease;
}

.frame__loading.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.frame__spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgb(246 223 184 / 25%);
    border-top-color: var(--sun);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Portrait: ask for the wide side ────────────────────────────────────── */

.rotate {
    display: none;
}

.rotate__card {
    display: grid;
    justify-items: center;
    gap: 0.6rem;
    max-width: 22rem;
    padding: 2rem 1.6rem;
    text-align: center;
    border-radius: var(--radius-lg);
    background: rgb(255 252 245 / 96%);
    color: var(--ink);
    box-shadow: 0 30px 60px -30px rgb(0 0 0 / 80%);
}

.rotate__card h2 {
    font-size: 1.4rem;
}

.rotate__card p {
    font-size: 0.92rem;
    color: var(--ink-soft);
}

.rotate__device {
    position: relative;
    width: 62px;
    height: 104px;
    border: 4px solid var(--ink);
    border-radius: 12px;
    animation: tilt 2.4s ease-in-out infinite;
}

.rotate__screen {
    position: absolute;
    inset: 6px 4px;
    border-radius: 5px;
    background: linear-gradient(160deg, var(--sky), var(--leaf));
}

@keyframes tilt {
    0%,
    40% {
        transform: rotate(0deg);
    }
    65%,
    100% {
        transform: rotate(90deg);
    }
}

@media (orientation: portrait) and (max-width: 1024px) {
    .player__area {
        visibility: hidden;
    }

    .rotate {
        display: grid;
        place-items: center;
        position: fixed;
        inset: 62px 0 0;
        z-index: 30;
        padding: 1.5rem;
        background: rgb(21 13 6 / 92%);
    }
}

/* ── The reward ─────────────────────────────────────────────────────────── */

.reward {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 1.2rem;
    background: rgb(21 13 6 / 72%);
    backdrop-filter: blur(6px);
    animation: fade-in 0.25s ease both;
}

.reward[hidden] {
    display: none;
}

.reward__card {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    width: min(34rem, 100%);
    padding: clamp(1.6rem, 4vw, 2.6rem);
    text-align: center;
    border-radius: var(--radius-lg);
    background: radial-gradient(120% 100% at 50% 0%, #ffffff 0%, var(--cream) 45%, var(--parchment) 100%);
    border: 3px solid var(--timber-light);
    color: var(--ink);
    box-shadow: 0 40px 80px -40px rgb(0 0 0 / 90%), inset 0 0 0 6px rgb(255 255 255 / 60%);
    animation: pop-in 0.32s cubic-bezier(0.22, 1.4, 0.5, 1) both;
    overflow: hidden;
}

.reward__burst {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    margin-bottom: 0.2rem;
    border-radius: 50%;
    font-size: 2.2rem;
    background: radial-gradient(circle at 35% 30%, #ffe9a6, var(--sun) 70%);
    box-shadow: 0 14px 26px -14px rgb(244 165 28 / 90%), inset 0 -4px 0 rgb(201 139 43 / 45%);
}

.reward__title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.reward__xp {
    padding: 0.28rem 1rem;
    border-radius: 999px;
    background: rgb(111 191 74 / 18%);
    color: var(--leaf-deep);
    font-weight: 800;
    font-size: 0.95rem;
}

.reward__next {
    max-width: 34ch;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.reward__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1rem;
}

.confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti span {
    position: absolute;
    top: -12%;
    left: var(--x, 50%);
    width: 10px;
    height: 16px;
    border-radius: 3px;
    background: var(--tone, var(--sun));
    opacity: 0;
    animation: fall 2.6s ease-in var(--delay, 0s) infinite;
}

@keyframes fall {
    0% {
        opacity: 0;
        transform: translateY(-10px) rotate(0deg);
    }
    12% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(78vh) rotate(var(--spin, 240deg));
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
}

@keyframes pop-in {
    from {
        opacity: 0;
        transform: scale(0.86) translateY(12px);
    }
}

/* ── Small screens ──────────────────────────────────────────────────────── */

@media (max-width: 980px) {
    .pagehead__inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    body.site {
        font-size: 16px;
    }

    .topbar__inner {
        min-height: 66px;
    }

    .brand__text small {
        display: none;
    }

    .topbar__link,
    .topbar__nav .btn {
        display: none;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .player__back-text,
    .voices {
        display: none;
    }

    .player__done {
        padding-inline: 0.8rem;
    }

    .footer__inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer__brand {
        grid-column: 1 / -1;
    }

    .footer__links {
        font-size: 0.85rem;
    }
}

@media (max-width: 460px) {
    .footer__inner {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* A phone held sideways has no room to spare: the bezel thins out and the bar
   shrinks so the activity keeps as much of the height as it can. */
@media (orientation: landscape) and (max-height: 540px) {
    .player__bar {
        min-height: 46px;
        padding-block: 0.2rem;
    }

    .player__back-text,
    .player__chip {
        display: none;
    }

    .player__area {
        padding: 4px 10px;
        padding-bottom: max(4px, env(safe-area-inset-bottom));
    }

    .frame {
        padding: 4px;
        border-radius: 14px;
    }

    .frame__inner {
        border-radius: 10px;
    }

    .frame__screw {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
