/* Bible-studies list page. Colours come from the shared tokens in theme.css. Logical properties
   (inline/block) keep the layout correct in right-to-left languages (Arabic). */
body {
    font-family: Inter, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
}

.studies-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.studies-header-inner {
    max-width: 64rem; margin-inline: auto; padding: 0.75rem 1rem;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem;
}

.studies-footer {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 1.5rem 1rem calc(2rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
}
.studies-footer a { color: var(--text-muted); }

.studies-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.875rem;
}

.studies-nav a {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-block-size: 2.75rem;
}

.studies-nav a:hover { color: var(--text); }

.studies-nav a.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.shell-active .studies-nav { display: none; } /* hidden only where the bottom bar replaces it, never leaving a page without navigation */

.studies-main {
    max-width: 64rem;
    margin-inline: auto;
    padding: 1.25rem 1rem 2rem;
}

.studies-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-block-end: 1rem;
}

.studies-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
}

.studies-count {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* Hero */
.study-hero {
    background: var(--accent-soft); border: 1px solid var(--border); border-radius: 0.75rem;
    padding: 1rem; margin-block-end: 1rem; display: grid; gap: 0.75rem;
}

.study-hero-label {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
}

.study-hero-main {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.study-hero-text { min-inline-size: 0; }

.study-hero-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    overflow-wrap: anywhere;
}

.study-hero-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.study-hero-bar { flex: 1; }

.study-hero-percent {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    min-inline-size: 2.5rem;
    text-align: end;
}

.study-hero-button {
    justify-self: start; min-block-size: 2.75rem; padding: 0.5rem 1.25rem; border: 0; border-radius: 0.375rem;
    background: var(--accent); color: var(--bg); font-weight: 700; cursor: pointer;
}
.study-hero-button:hover { opacity: 0.85; }

/* Progress bars */
.study-card-progress, .study-hero-bar {
    block-size: 0.375rem;
    background: var(--border);
    border-radius: 9999px;
    overflow: hidden;
}
.study-card-progress { margin-block-start: 0.5rem; }

.study-progress-fill {
    display: block;
    block-size: 100%;
    background: var(--accent);
}

/* Filter chips: sticky, horizontally scrollable, no scrollbar */
.studies-chips-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg);
    padding-block: 0.5rem;
    margin-block-end: 0.5rem;
}

.study-chips {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.study-chips::-webkit-scrollbar { display: none; }

.study-chip {
    flex: none; display: inline-flex; align-items: center; gap: 0.5rem; min-block-size: 2.75rem; padding: 0.25rem 0.875rem;
    border: 1px solid var(--border); border-radius: 9999px; background: var(--surface); color: var(--text);
    font-size: 0.875rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}

.study-chip[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.study-chip-count {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Grid: 1 column on phones, 2 on tablets, 3 on desktop */
.study-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
}

@media (width >= 560px) { .study-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (width >= 960px) { .study-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.study-card {
    position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 0.75rem;
    min-inline-size: 0; display: flex; flex-direction: column;
}

.study-card-open {
    display: flex; gap: 0.75rem; align-items: flex-start; flex: 1; padding: 1rem; padding-inline-end: 5.5rem;
    background: none; border: 0; color: inherit; font: inherit; text-align: start; cursor: pointer; border-radius: 0.75rem;
}
.study-card-open:hover { background: var(--accent-soft); }

.study-card-emoji {
    font-size: 1.75rem;
    line-height: 1;
    flex: none;
}

.study-card-body {
    min-inline-size: 0;
    flex: 1;
}

.study-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    overflow-wrap: anywhere;
}

.study-card-subtitle {
    color: var(--text-muted); font-size: 0.875rem; margin: 0.25rem 0 0; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.study-card-meta {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0.5rem 0 0;
}

.study-badge {
    position: absolute; inset-block-end: 0.75rem; inset-inline-end: 0.75rem; padding: 0.125rem 0.5rem; border-radius: 9999px;
    font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; pointer-events: none;
}

.badge-new {
    background: var(--highlight);
    color: var(--bg);
}

.badge-current {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.badge-completed {
    background: var(--accent);
    color: var(--bg);
}

.study-card-actions {
    position: absolute;
    inset-block-start: 0.25rem;
    inset-inline-end: 0.25rem;
    display: flex;
}

.study-fav, .study-share {
    inline-size: 2.75rem; block-size: 2.75rem; display: inline-flex; align-items: center; justify-content: center;
    background: none; border: 0; color: var(--text-muted); cursor: pointer; border-radius: 9999px;
}
.study-fav:hover, .study-share:hover { color: var(--accent); }

.study-fav svg, .study-share svg {
    inline-size: 1.25rem;
    block-size: 1.25rem;
}
.study-fav[aria-pressed="true"] { color: var(--highlight); }
.study-fav[aria-pressed="true"] svg { fill: currentcolor; }

.study-confirm {
    border-block-start: 1px solid var(--border);
    padding: 0.75rem 1rem;
    display: grid;
    gap: 0.5rem;
}

.study-confirm p {
    margin: 0;
    font-size: 0.875rem;
}

.study-confirm-actions {
    display: flex;
    gap: 0.5rem;
}

.study-confirm-yes, .study-confirm-no, .study-retry {
    min-block-size: 2.75rem; padding: 0.25rem 1rem; border-radius: 0.375rem; font-weight: 600; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
}

.study-confirm-yes, .study-retry {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.study-message {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    display: grid;
    gap: 0.75rem;
    justify-items: center;
}
.study-message p { margin: 0; }

.study-message-title {
    color: var(--text);
    font-weight: 700;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.toast {
    position: fixed; inset-inline: 1rem; inset-block-end: calc(1rem + env(safe-area-inset-bottom)); margin-inline: auto; max-inline-size: 24rem;
    padding: 0.75rem 1rem; border-radius: 0.5rem; background: var(--text); color: var(--bg); text-align: center; font-size: 0.875rem;
    opacity: 0; pointer-events: none; transition: opacity .15s ease; z-index: 50;
}
.toast.is-visible { opacity: 1; }
.toast-error { background: var(--highlight); }

@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* Study reader */
.study-detail-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-block-end: 1rem;
}

.study-detail-title {
    font-size: 1.375rem;
    font-weight: 800;
    margin: 0;
    overflow-wrap: anywhere;
}

.study-detail-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0.25rem 0 0;
}

/* A page sliding in (or dragged) overhangs the viewport for a moment: clip it so the page never gains a horizontal scroll */
#studies-detail-view {
    overflow-x: clip;
}

/* Carousel dots (UiPagerDots): a 1.75rem tap target around a slim bar; the current dot is wider */
.pager-dots {
    display: flex;
    gap: 0.25rem;
    margin-block-end: 0.5rem;
}

.pager-dot {
    position: relative;
    flex: 1;
    min-block-size: 1.75rem;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    transition: flex-grow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pager-dot::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-start: calc(50% - 0.1875rem);
    block-size: 0.375rem;
    border-radius: 9999px;
    background: var(--border);
    transition: background-color 0.2s;
}

.pager-dot.is-done::before {
    background: var(--accent);
}

.pager-dot.is-current {
    flex-grow: 2.4;
}

/* One-time hint on the first page; only for touch (a mouse has the buttons and arrow keys) */
.study-swipe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.study-swipe-chevron {
    inline-size: 0.5rem;
    block-size: 0.5rem;
    border: solid currentcolor;
    border-width: 0.125rem 0.125rem 0 0;
    transform: rotate(45deg);
    animation: study-nudge 1.4s ease-in-out 3;
}

:root[dir="rtl"] .study-swipe-chevron {
    transform: rotate(-135deg);
}

@media (hover: hover) and (pointer: fine) {
    .study-swipe-hint {
        display: none;
    }
}

.study-page {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: grid;
    gap: 0.875rem;
    outline: none;
    touch-action: pan-y; /* vertical scroll stays native; horizontal belongs to the swipe */
    transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}

:root {
    --slide: 2.5rem; /* distance a new page travels in from; mirrored for RTL */
}

:root[dir="rtl"] {
    --slide: -2.5rem;
}

.study-page.slide-in-next {
    animation: study-slide-next 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.study-page.slide-in-prev {
    animation: study-slide-prev 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes study-slide-next {
    from {
        opacity: 0;
        transform: translateX(var(--slide));
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes study-slide-prev {
    from {
        opacity: 0;
        transform: translateX(calc(var(--slide) * -1));
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes study-nudge {
    0%,
    100% {
        translate: 0;
    }

    50% {
        translate: calc(var(--slide) * 0.14);
    }
}

.study-page > * {
    margin: 0;
    min-inline-size: 0;
    overflow-wrap: anywhere;
}

.study-page-icon {
    font-size: 3rem;
    line-height: 1;
}

.study-page-title {
    font-size: 1.375rem;
    font-weight: 800;
}
.study-page-subtitle { color: var(--text-muted); }

.study-page-content {
    white-space: pre-line;
    line-height: 1.6;
}

/* Key verse card, shared by the Bible-studies and Encounters readers (key-verse-card.js). */
.key-verse-card {
    margin: 0;
    padding: 1.5rem 1.25rem;
    border: 1px solid var(--accent-soft);
    border-radius: 1rem;
    background: linear-gradient(160deg, var(--accent-soft), transparent);
    text-align: center;
}

.key-verse-card-label {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.key-verse-card-text {
    margin: 0.75rem 0;
    font-size: 1.25rem;
    font-style: italic;
    line-height: 1.6;
}

.key-verse-card-ref {
    margin: 0;
    color: var(--text-muted);
    font-weight: 700;
}

.key-verse-card-share {
    margin-block-start: 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.key-verse-card-share:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.study-revelation,
.study-anchor,
.study-verse,
.study-word,
.study-question,
.study-prayer,
.study-step,
.study-timeline-item {
    border-inline-start: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.study-revelation p,
.study-verse p,
.study-word p,
.study-question p,
.study-prayer p,
.study-step p,
.study-timeline-item p,
.study-anchor p { margin: 0; }

.study-revelation-label,
.study-questions-title,
.study-prayer-title {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.study-verse-ref,
.study-anchor-ref,
.study-word-term,
.study-timeline-event,
.study-step-title { font-weight: 700; }

.study-identity {
    font-weight: 700;
    text-align: center;
    font-size: 1.125rem;
}

.study-word-strong {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.study-question-category {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
}
.study-question-text { font-weight: 600; }

.study-footer {
    display: grid;
    gap: 0.75rem;
    margin-block-start: 1rem;
}

.reader-complete {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-block-size: 2.75rem;
    border: 0;
    border-radius: 0.375rem;
    background: var(--accent);
    color: var(--bg);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease;
}

/* Done state: solid green with a check (dark enough for white text at 4.5:1) */
.reader-complete:disabled {
    background: #1f7a50;
    color: #fff;
    cursor: default;
}

.reader-complete:active:not(:disabled) {
    transform: scale(0.97);
}

.reader-complete-check {
    position: relative;
    order: -1;
    inline-size: 1rem;
    block-size: 1rem;
}

.reader-complete-check::after {
    content: "";
    position: absolute;
    inset-inline-start: 0.33rem;
    inset-block-start: 0.05rem;
    inline-size: 0.3rem;
    block-size: 0.62rem;
    border: solid currentcolor;
    border-width: 0 0.16rem 0.16rem 0;
    transform: rotate(45deg);
}

/* Just completed: a green wipe fills the button, the check draws itself, one spring pop, one gold halo */
.reader-complete.is-just-done {
    animation: study-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), study-halo 0.8s ease-out;
}

.reader-complete.is-just-done:disabled {
    background: var(--accent);
}

.reader-complete.is-just-done::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: #1f7a50;
    animation: study-wipe 0.5s ease-out forwards;
}

.reader-complete.is-just-done .reader-complete-check::after {
    animation: study-check 0.35s ease-out 0.3s backwards;
}

@keyframes study-wipe {
    from {
        clip-path: circle(0 at 50% 50%);
    }

    to {
        clip-path: circle(80% at 50% 50%);
    }
}

@keyframes study-check {
    from {
        clip-path: inset(0 0 100% 0);
    }

    to {
        clip-path: inset(0);
    }
}

@keyframes study-pop {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.06);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes study-halo {
    from {
        box-shadow: 0 0 0 0 rgba(245, 179, 1, 0.6);
    }

    to {
        box-shadow: 0 0 0 0.9rem rgba(245, 179, 1, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .study-page,
    .pager-dot,
    .pager-dot::before,
    .reader-complete {
        transition: none;
    }

    .study-page.slide-in-next,
    .study-page.slide-in-prev,
    .study-swipe-chevron {
        animation: none;
    }

    .reader-complete.is-just-done,
    .reader-complete.is-just-done .reader-complete-check::after {
        animation: none;
    }

    .reader-complete.is-just-done::before {
        display: none;
    }

    .reader-complete.is-just-done:disabled {
        background: #1f7a50;
    }
}

.study-copyright {
    color: var(--text-muted);
    font-size: 0.6875rem;
    line-height: 1.4;
    margin: 0;
}

.reader-nav {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-block-start: 1rem;
    padding-block-end: env(safe-area-inset-bottom);
}

.reader-prev,
.reader-next,
.reader-exit,
.study-back {
    min-block-size: 2.75rem;
    min-inline-size: 6rem;
    padding: 0.25rem 1.25rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
}

.reader-exit,
.study-back {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

/* Previous/Next are the fallback to swiping: quiet ghost buttons (still 44px tall) */
.reader-prev,
.reader-next {
    border-color: transparent;
    background: transparent;
    color: var(--text-muted);
}

.reader-prev:disabled {
    opacity: 0.4;
    cursor: default;
}

.sr-only {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Study completion celebration (UiCelebration): confetti falls from the top, each piece styled by position */
.celebration {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 60;
}

.confetti-piece {
    position: absolute;
    inset-block-start: -1rem;
    inline-size: 0.5rem;
    block-size: 0.9rem;
    border-radius: 0.1rem;
    background: var(--accent);
    opacity: 0;
    animation: confetti-fall 2s ease-in forwards;
}

.confetti-piece:nth-child(5n+1) {
    background: var(--accent);
}

.confetti-piece:nth-child(5n+2) {
    background: var(--highlight);
}

.confetti-piece:nth-child(5n+3) {
    background: #f5b301;
}

.confetti-piece:nth-child(5n+4) {
    background: #2e9e6b;
}

.confetti-piece:nth-child(5n) {
    background: #3b82f6;
}

.confetti-piece:nth-child(7n+1) {
    --drift: -9rem;
    --spin: 540deg;
}

.confetti-piece:nth-child(7n+2) {
    --drift: 6rem;
    --spin: -420deg;
}

.confetti-piece:nth-child(7n+3) {
    --drift: -3rem;
    --spin: 720deg;
}

.confetti-piece:nth-child(7n+4) {
    --drift: 10rem;
    --spin: -600deg;
}

.confetti-piece:nth-child(7n+5) {
    --drift: -6rem;
    --spin: 360deg;
}

.confetti-piece:nth-child(7n+6) {
    --drift: 3rem;
    --spin: -720deg;
}

.confetti-piece:nth-child(7n) {
    --drift: 0rem;
    --spin: 480deg;
}

.confetti-piece:nth-child(1) {
    inset-inline-start: 5.7%;
    animation-delay: 0.07s;
}

.confetti-piece:nth-child(2) {
    inset-inline-start: 9.4%;
    animation-delay: 0.14s;
}

.confetti-piece:nth-child(3) {
    inset-inline-start: 13.1%;
    animation-delay: 0.21s;
}

.confetti-piece:nth-child(4) {
    inset-inline-start: 16.8%;
    animation-delay: 0.28s;
}

.confetti-piece:nth-child(5) {
    inset-inline-start: 20.5%;
    animation-delay: 0.35s;
}

.confetti-piece:nth-child(6) {
    inset-inline-start: 24.2%;
    animation-delay: 0.42s;
}

.confetti-piece:nth-child(7) {
    inset-inline-start: 27.9%;
    animation-delay: 0.49s;
}

.confetti-piece:nth-child(8) {
    inset-inline-start: 31.6%;
    animation-delay: 0.56s;
}

.confetti-piece:nth-child(9) {
    inset-inline-start: 35.3%;
    animation-delay: 0.03s;
}

.confetti-piece:nth-child(10) {
    inset-inline-start: 39.0%;
    animation-delay: 0.1s;
}

.confetti-piece:nth-child(11) {
    inset-inline-start: 42.7%;
    animation-delay: 0.17s;
}

.confetti-piece:nth-child(12) {
    inset-inline-start: 46.4%;
    animation-delay: 0.24s;
}

.confetti-piece:nth-child(13) {
    inset-inline-start: 50.1%;
    animation-delay: 0.31s;
}

.confetti-piece:nth-child(14) {
    inset-inline-start: 53.8%;
    animation-delay: 0.38s;
}

.confetti-piece:nth-child(15) {
    inset-inline-start: 57.5%;
    animation-delay: 0.45s;
}

.confetti-piece:nth-child(16) {
    inset-inline-start: 61.2%;
    animation-delay: 0.52s;
}

.confetti-piece:nth-child(17) {
    inset-inline-start: 64.9%;
    animation-delay: 0.59s;
}

.confetti-piece:nth-child(18) {
    inset-inline-start: 68.6%;
    animation-delay: 0.06s;
}

.confetti-piece:nth-child(19) {
    inset-inline-start: 72.3%;
    animation-delay: 0.13s;
}

.confetti-piece:nth-child(20) {
    inset-inline-start: 76.0%;
    animation-delay: 0.2s;
}

.confetti-piece:nth-child(21) {
    inset-inline-start: 79.7%;
    animation-delay: 0.27s;
}

.confetti-piece:nth-child(22) {
    inset-inline-start: 83.4%;
    animation-delay: 0.34s;
}

.confetti-piece:nth-child(23) {
    inset-inline-start: 87.1%;
    animation-delay: 0.41s;
}

.confetti-piece:nth-child(24) {
    inset-inline-start: 90.8%;
    animation-delay: 0.48s;
}

.confetti-piece:nth-child(25) {
    inset-inline-start: 94.5%;
    animation-delay: 0.55s;
}

.confetti-piece:nth-child(26) {
    inset-inline-start: 2.2%;
    animation-delay: 0.02s;
}

.confetti-piece:nth-child(27) {
    inset-inline-start: 5.9%;
    animation-delay: 0.09s;
}

.confetti-piece:nth-child(28) {
    inset-inline-start: 9.6%;
    animation-delay: 0.16s;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translate3d(0, 0, 0) rotate(0);
    }

    100% {
        opacity: 0;
        transform: translate3d(var(--drift, 0), 105vh, 0) rotate(var(--spin, 360deg));
    }
}

@media (prefers-reduced-motion: reduce) {
    .celebration {
        display: none;
    }
}
