:root {
    --ink: #f8f4e8;
    --muted: rgba(248, 244, 232, 0.72);
    --quiet: rgba(248, 244, 232, 0.48);
    --panel: rgba(10, 12, 18, 0.48);
    --line: rgba(255, 255, 255, 0.18);
    --gold: #ffd166;
    --mint: #57e5a7;
    --cyan: #4dd6ff;
    --pink: #ff4d8d;
    --violet: #8a7cff;
    --shadow: 0 20px 80px rgba(0, 0, 0, 0.55);
}

* {
    box-sizing: border-box;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
    overscroll-behavior-x: none;
    background: #07080d;
    color: var(--ink);
}

button,
a {
    font: inherit;
}

.wrapped-app {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    overscroll-behavior-x: none;
    background:
        linear-gradient(140deg, rgba(255, 77, 141, 0.22), transparent 32%),
        linear-gradient(320deg, rgba(77, 214, 255, 0.18), transparent 38%),
        linear-gradient(180deg, #161a2b 0%, #07080d 100%);
}

.wrapped-app::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, transparent, black 18%, black 84%, transparent);
    opacity: 0.28;
}

.wrapped-app::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, transparent 0 42%, rgba(255, 209, 102, 0.1) 48%, transparent 54%),
        linear-gradient(245deg, transparent 0 58%, rgba(77, 214, 255, 0.08) 64%, transparent 70%);
    background-size: 180% 180%, 160% 160%;
    opacity: 0.5;
    animation: ambientSweep 14s ease-in-out infinite alternate;
}

.start-screen {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 16px;
    padding: 28px;
    text-align: center;
    background:
        linear-gradient(145deg, rgba(255, 209, 102, 0.22), transparent 34%),
        linear-gradient(315deg, rgba(87, 229, 167, 0.16), transparent 40%),
        rgba(7, 8, 13, 0.94);
    transition: opacity 260ms ease, transform 260ms ease, visibility 260ms ease;
}

.start-screen.hidden {
    opacity: 0;
    transform: scale(1.03);
    visibility: hidden;
    pointer-events: none;
}

.start-media {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 8px;
}

.start-disc {
    width: 108px;
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 24px;
    font-weight: 900;
    color: #10131d;
    background:
        radial-gradient(circle at center, #10131d 0 12%, transparent 13%),
        conic-gradient(from 15deg, var(--gold), var(--pink), var(--cyan), var(--mint), var(--gold));
    box-shadow: var(--shadow);
    animation: spin 8s linear infinite;
}

.start-lines {
    display: grid;
    gap: 8px;
    width: 96px;
}

.start-lines span {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold), var(--pink));
}

.start-lines span:nth-child(2) {
    width: 74%;
    background: linear-gradient(90deg, var(--cyan), var(--mint));
}

.start-lines span:nth-child(3) {
    width: 52%;
    background: linear-gradient(90deg, var(--violet), var(--gold));
}

.start-kicker,
.slide-kicker {
    width: min(100%, var(--fit-width, 100%));
    min-width: 0;
    margin: 0;
    color: var(--gold);
    font-size: clamp(0.76rem, 1.2vw, 0.95rem);
    font-size: calc(clamp(0.76rem, 1.2vw, 0.95rem) * var(--fit-scale, 1));
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
    hyphens: manual;
}

.start-screen h1 {
    margin: 0;
    font-size: clamp(4rem, 14vw, 9rem);
    line-height: 0.85;
    font-weight: 900;
    letter-spacing: 0;
}

.start-copy {
    max-width: 420px;
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.start-btn,
.finale-btn {
    width: auto;
    min-width: 170px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    padding: 15px 22px;
    cursor: pointer;
    color: #10131d;
    background: linear-gradient(135deg, var(--gold), var(--mint));
    font-size: 0.92rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-decoration: none;
    box-shadow: 0 12px 36px rgba(255, 209, 102, 0.28);
}

.slide-stage {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.slide {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
    align-items: center;
    gap: clamp(24px, 5vw, 72px);
    padding: calc(env(safe-area-inset-top, 0px) + 96px) clamp(22px, 6vw, 96px) calc(env(safe-area-inset-bottom, 0px) + 92px);
    opacity: 0;
    transform: translateX(48px) scale(0.98);
    overflow-x: hidden;
    overscroll-behavior-x: none;
    pointer-events: none;
    transition: opacity 380ms ease, transform 380ms ease;
}

.slide.active {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

.slide.active .slide-content {
    animation: riseIn 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.slide.active .slide-media {
    animation: mediaIn 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both, subtleFloat 7s ease-in-out 800ms infinite;
}

.slide.active .gallery-window,
.slide.active .timeline-panel,
.slide.active .calendar-panel,
.slide.active .multi-image-grid {
    animation: mediaIn 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.slide.active .stat-pill,
.slide.active .leaderboard-row,
.slide.active .location-row,
.slide.active .calendar-day {
    animation: riseIn 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.slide.active .stat-pill:nth-child(2),
.slide.active .leaderboard-row:nth-child(2),
.slide.active .location-row:nth-child(2) {
    animation-delay: 80ms;
}

.slide.active .stat-pill:nth-child(3),
.slide.active .leaderboard-row:nth-child(3),
.slide.active .location-row:nth-child(3) {
    animation-delay: 140ms;
}

.slide.active .calendar-day {
    animation-delay: calc(80ms + var(--day-order, 0) * 18ms);
}

.slide.reverse {
    transform: translateX(-48px) scale(0.98);
}

.slide.active.reverse {
    transform: translateX(0) scale(1);
}

.slide-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 720px;
    min-width: 0;
    overflow: hidden;
    display: grid;
    gap: 18px;
}

.slide-title {
    width: min(100%, var(--fit-width, 100%));
    min-width: 0;
    max-width: 100%;
    margin: 0;
    font-size: clamp(2.5rem, 8vw, 7.8rem);
    font-size: calc(clamp(2.5rem, 8vw, 7.8rem) * var(--fit-scale, 1));
    line-height: 0.9;
    font-weight: 900;
    letter-spacing: 0;
    text-wrap: balance;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: manual;
}

.slide-body {
    width: min(100%, var(--fit-width, 100%));
    min-width: 0;
    max-width: 620px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.55vw, 1.35rem);
    line-height: 1.45;
    font-weight: 700;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: manual;
}

.slide-media {
    position: relative;
    z-index: 1;
    min-width: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--line);
    aspect-ratio: 4 / 5;
}

.slide-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
}

.image-caption {
    position: absolute;
    left: 14px;
    right: 14px;
    width: min(calc(100% - 28px), var(--fit-width, calc(100% - 28px)));
    max-width: calc(100% - 28px);
    bottom: 14px;
    padding: 9px 11px;
    border-radius: 8px;
    background: rgba(7, 8, 13, 0.68);
    color: var(--ink);
    font-size: 0.78rem;
    font-size: calc(0.78rem * var(--fit-scale, 1));
    font-weight: 800;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: manual;
    backdrop-filter: blur(14px);
}

.stat-grid {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.stat-pill {
    min-width: 0;
    overflow: hidden;
    min-height: 92px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 16px;
    border-radius: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.stat-value {
    width: min(100%, var(--fit-width, 100%));
    min-width: 0;
    font-size: clamp(1.55rem, 4vw, 3rem);
    font-size: calc(clamp(1.55rem, 4vw, 3rem) * var(--fit-scale, 1));
    line-height: 0.95;
    color: var(--gold);
    font-weight: 900;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: manual;
}

.stat-label {
    width: min(100%, var(--fit-width, 100%));
    min-width: 0;
    overflow: hidden;
    color: var(--quiet);
    font-size: 0.72rem;
    font-size: calc(0.72rem * var(--fit-scale, 1));
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
    hyphens: manual;
}

.story-badge {
    width: min(max-content, var(--fit-width, 100%));
    max-width: 100%;
    padding: 9px 11px;
    border-radius: 8px;
    background: rgba(255, 209, 102, 0.12);
    border: 1px solid rgba(255, 209, 102, 0.34);
    color: var(--gold);
    font-size: 0.72rem;
    font-size: calc(0.72rem * var(--fit-scale, 1));
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
    hyphens: manual;
}

.date-range-panel {
    width: min(620px, 100%);
    display: grid;
    grid-template-columns: auto minmax(48px, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin-top: 2px;
    padding: 16px;
    border-radius: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
}

.date-node {
    display: grid;
    gap: 4px;
}

.date-node:last-child {
    text-align: right;
}

.date-label {
    width: min(100%, var(--fit-width, 100%));
    min-width: 0;
    overflow: hidden;
    color: var(--quiet);
    font-size: 0.7rem;
    font-size: calc(0.7rem * var(--fit-scale, 1));
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.date-node strong {
    width: min(100%, var(--fit-width, 100%));
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: clamp(1.35rem, 3vw, 2.5rem);
    font-size: calc(clamp(1.35rem, 3vw, 2.5rem) * var(--fit-scale, 1));
    line-height: 1;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.date-line {
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold), var(--pink), var(--cyan));
    box-shadow: 0 0 24px rgba(255, 209, 102, 0.22);
}

.leaderboard-list,
.location-list {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.leaderboard-row,
.location-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
}

.rank-number {
    width: 36px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--pink));
    color: #11131d;
    font-weight: 900;
}

.leader-name,
.location-name {
    width: min(100%, var(--fit-width, 100%));
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: normal;
    font-size: 1rem;
    font-size: calc(1rem * var(--fit-scale, 1));
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
    hyphens: manual;
}

.leader-meta,
.location-meta {
    color: var(--quiet);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.leader-score,
.location-score {
    color: var(--mint);
    font-size: 1.1rem;
    font-weight: 900;
    text-align: right;
}

.timeline-slide {
    grid-template-columns: minmax(280px, 0.62fr) minmax(0, 1.38fr);
}

.timeline-panel {
    min-width: 0;
    display: grid;
    gap: 12px;
    align-self: center;
    padding: 16px;
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 209, 102, 0.08), transparent 38%),
        rgba(7, 8, 13, 0.54);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.timeline-chart {
    width: 100%;
    max-height: min(52vh, 520px);
    height: auto;
    display: block;
    overflow: visible;
}

.timeline-grid line {
    stroke: rgba(255, 255, 255, 0.18);
    stroke-width: 2;
}

.timeline-grid text {
    fill: var(--quiet);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.timeline-checkpoint-label {
    display: none;
}

.timeline-checkpoint-label.is-edge,
.timeline-checkpoint-label.is-midpoint {
    display: block;
}

.timeline-series polyline {
    fill: none;
    stroke: var(--series-color);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.38));
}

.timeline-series circle {
    fill: #07080d;
    stroke: var(--series-color);
    stroke-width: 4;
    opacity: 0;
}

.slide.active .timeline-series polyline {
    animation: drawTimeline 2200ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--series-delay, 0ms) forwards;
}

.slide.active .timeline-series circle {
    animation: popTimelinePoint 420ms ease-out calc(var(--series-delay, 0ms) + 1600ms) forwards;
}

.timeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
}

.timeline-legend-item span {
    width: 10px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--series-color);
}

.timeline-results {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.timeline-result-row {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3px 8px;
    align-items: center;
    padding: 9px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-result-row span {
    width: 22px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--pink));
    color: #10131d;
    font-size: 0.75rem;
    font-weight: 900;
}

.timeline-result-row strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-result-row em {
    grid-column: 2;
    color: var(--mint);
    font-size: 0.8rem;
    font-style: normal;
    font-weight: 900;
}

.calendar-slide {
    grid-template-columns: minmax(280px, 0.58fr) minmax(0, 1.42fr);
}

.calendar-slide .slide-title {
    font-size: clamp(2.5rem, 5.6vw, 5.4rem);
    font-size: calc(clamp(2.5rem, 5.6vw, 5.4rem) * var(--fit-scale, 1));
    line-height: 0.92;
}

.calendar-panel {
    position: relative;
    min-width: 0;
    display: grid;
    gap: 12px;
    padding: clamp(14px, 2vw, 22px);
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 209, 102, 0.22), transparent 28%),
        radial-gradient(circle at 90% 12%, rgba(77, 214, 255, 0.2), transparent 28%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
        rgba(7, 8, 13, 0.42);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.calendar-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(to bottom, black, transparent 88%);
    opacity: 0.5;
}

.calendar-panel > * {
    position: relative;
    z-index: 1;
}

.calendar-panel-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.calendar-panel-head div:first-child {
    display: grid;
    gap: 3px;
}

.calendar-panel-head span,
.calendar-highlight span {
    color: var(--quiet);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.calendar-panel-head strong {
    color: var(--ink);
    font-size: clamp(1.3rem, 2.7vw, 2.25rem);
    line-height: 1;
    font-weight: 900;
}

.calendar-legend {
    display: grid;
    grid-template-columns: repeat(4, 22px);
    gap: 5px;
    padding-bottom: 3px;
}

.calendar-legend i {
    height: 8px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--gold), var(--pink), var(--cyan));
}

.calendar-legend i:nth-child(1) {
    opacity: 0.22;
}

.calendar-legend i:nth-child(2) {
    opacity: 0.42;
}

.calendar-legend i:nth-child(3) {
    opacity: 0.68;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
}

.calendar-weekdays span {
    color: var(--quiet);
    font-size: 0.68rem;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.calendar-day {
    --day-level: 0;
    min-width: 0;
    min-height: clamp(74px, 8vw, 112px);
    display: grid;
    align-content: space-between;
    gap: 7px;
    padding: clamp(8px, 1.1vw, 12px);
    border-radius: 8px;
    border: 1px solid rgb(255 255 255 / calc(0.1 + var(--day-level) * 0.2));
    background:
        linear-gradient(145deg, rgb(255 209 102 / calc(0.07 + var(--day-level) * 0.34)), rgb(255 77 141 / calc(0.03 + var(--day-level) * 0.2)) 55%, rgb(77 214 255 / calc(0.04 + var(--day-level) * 0.18))),
        rgba(255, 255, 255, 0.055);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 12px 30px rgb(0 0 0 / calc(0.12 + var(--day-level) * 0.16));
}

.calendar-day.is-outside {
    opacity: 0.28;
}

.calendar-day.is-quiet-day:not(.is-outside) {
    background: rgba(255, 255, 255, 0.055);
}

.calendar-day.is-peak-entries,
.calendar-day.is-peak-liters {
    border-color: rgba(255, 209, 102, 0.64);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 0 0 1px rgba(255, 209, 102, 0.18),
        0 16px 34px rgba(255, 209, 102, 0.18);
}

.calendar-day-top {
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 5px;
}

.calendar-day-number {
    color: var(--ink);
    font-size: clamp(1rem, 2vw, 1.45rem);
    line-height: 1;
    font-weight: 900;
}

.calendar-day-month {
    color: var(--quiet);
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
}

.calendar-day-metric {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.calendar-day-metric strong {
    color: var(--gold);
    font-size: clamp(1.3rem, 2.9vw, 2.25rem);
    line-height: 0.9;
    font-weight: 900;
}

.calendar-day-metric span,
.calendar-day-liters {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.calendar-day-liters {
    color: var(--mint);
}

.calendar-highlights {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.calendar-highlight {
    min-width: 0;
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
}

.calendar-highlight strong {
    color: var(--ink);
    font-size: clamp(1.2rem, 2.5vw, 1.75rem);
    line-height: 1;
    font-weight: 900;
}

.calendar-highlight em {
    color: var(--mint);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.gallery-slide {
    grid-template-columns: minmax(280px, 0.65fr) minmax(0, 1.35fr);
}

.gallery-window {
    position: relative;
    min-width: 0;
    width: min(100%, 820px);
    height: min(62vh, 560px);
    overflow: hidden;
    border-radius: 8px;
    justify-self: center;
}

.gallery-window::before,
.gallery-window::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    z-index: 2;
    height: 36px;
    pointer-events: none;
}

.gallery-window::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(7, 8, 13, 0.48), transparent);
}

.gallery-window::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(7, 8, 13, 0.54), transparent);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(6px, 1.1vw, 12px);
    transform: translateY(0);
    will-change: transform;
}

.slide.active .gallery-grid.is-scrollable {
    animation: galleryAutoScroll var(--gallery-scroll-duration, 8500ms) linear infinite alternate;
}

.paused .gallery-grid.is-scrollable {
    animation-play-state: paused;
}

.gallery-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
}

.multi-image-slide {
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
}

.multi-image-grid {
    min-width: 0;
    width: min(100%, 760px);
    height: min(64vh, 620px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: clamp(8px, 1.4vw, 14px);
    align-self: center;
    justify-self: center;
}

.multi-image-grid img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
}

.intro-slide {
    grid-template-columns: minmax(0, 1fr);
}

.intro-slide .slide-content {
    justify-self: center;
    text-align: center;
}

.intro-slide .stat-grid {
    width: min(620px, 100%);
    justify-self: center;
}

.intro-slide .slide-media {
    position: absolute;
    inset: auto 5vw 10vh auto;
    width: min(34vw, 360px);
    opacity: 0.34;
    transform: rotate(5deg);
}

.locations-slide .location-list {
    width: min(680px, 100%);
    margin-inline: auto;
    gap: 8px;
}

.locations-slide .slide-title {
    font-size: clamp(2.6rem, 5vw, 4.8rem);
    font-size: calc(clamp(2.6rem, 5vw, 4.8rem) * var(--fit-scale, 1));
    line-height: 0.92;
}

.locations-slide .location-row {
    min-height: 48px;
    padding: 8px 12px;
}

.finale-slide .slide-title {
    color: var(--gold);
}

.finale-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.finale-btn.secondary {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--line);
    box-shadow: none;
}

.wrapped-topbar,
.wrapped-controls,
.progress-track {
    position: fixed;
    z-index: 20;
}

.wrapped-topbar {
    top: calc(env(safe-area-inset-top, 0px) + 24px);
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

.volume-control {
    height: 38px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 8, 13, 0.56);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    backdrop-filter: blur(18px);
}

.volume-control svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.volume-control[hidden] {
    display: none;
}

.volume-control input {
    width: 62px;
    accent-color: var(--gold);
}

.icon-link,
.icon-btn,
.control-btn {
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 8, 13, 0.56);
    color: var(--ink);
    text-decoration: none;
    font-weight: 900;
    backdrop-filter: blur(18px);
    cursor: pointer;
}

.icon-link,
.icon-btn {
    width: 38px;
    height: 38px;
}

.icon-link {
    pointer-events: auto;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.icon-link svg,
.icon-btn svg,
.control-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wrapped-controls {
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(-50%);
}

.control-btn {
    width: 48px;
    height: 44px;
    font-size: 1.2rem;
}

.slide-counter {
    min-width: 74px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 8, 13, 0.56);
    color: var(--muted);
    text-align: center;
    font-size: 0.82rem;
    font-weight: 900;
    backdrop-filter: blur(18px);
}

.progress-track {
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    left: 14px;
    right: 14px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 5px;
}

.progress-segment {
    height: 4px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.18);
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--pink), var(--cyan));
}

.progress-segment.complete .progress-fill {
    width: 100%;
}

.progress-segment.active .progress-fill {
    animation: fillProgress linear forwards;
    animation-duration: var(--slide-duration, 8500ms);
}

.progress-segment.hold .progress-fill {
    width: 100%;
    animation: none;
}

.paused .progress-segment.active .progress-fill {
    animation-play-state: paused;
}

.tap-zones {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    pointer-events: none;
}

.tap-zone {
    border: 0;
    background: transparent;
    pointer-events: none;
}

.empty-state {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    color: var(--muted);
    text-align: center;
    font-weight: 800;
}

@keyframes fillProgress {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

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

@keyframes ambientSweep {
    from {
        background-position: 0% 30%, 100% 60%;
    }

    to {
        background-position: 100% 60%, 0% 30%;
    }
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mediaIn {
    from {
        opacity: 0;
        transform: scale(0.96) rotate(-0.6deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

@keyframes subtleFloat {
    0%,
    100% {
        translate: 0 0;
    }

    50% {
        translate: 0 -6px;
    }
}

@keyframes drawTimeline {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes popTimelinePoint {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes galleryAutoScroll {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(calc(-1 * var(--gallery-scroll-distance, 0px)));
    }
}

@media (min-width: 761px) and (max-width: 1100px) and (orientation: portrait) {
    .calendar-slide {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 18px;
        padding: calc(env(safe-area-inset-top, 0px) + 86px) clamp(36px, 7vw, 72px) calc(env(safe-area-inset-bottom, 0px) + 86px);
    }

    .calendar-slide .slide-content {
        order: 2;
        width: min(100%, 680px);
        max-width: 680px;
        gap: 10px;
        text-align: center;
    }

    .calendar-slide .slide-title {
        justify-self: center;
        font-size: clamp(2.45rem, 6.1vw, 4rem);
        font-size: calc(clamp(2.45rem, 6.1vw, 4rem) * var(--fit-scale, 1));
        line-height: 0.93;
    }

    .calendar-slide .slide-body {
        justify-self: center;
        max-width: 520px;
        font-size: 0.98rem;
        line-height: 1.34;
    }

    .calendar-slide .story-badge {
        justify-self: center;
    }

    .calendar-slide .stat-grid {
        width: min(520px, 100%);
        justify-self: center;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 0;
    }

    .calendar-slide .stat-pill {
        min-height: 72px;
        padding: 12px;
    }

    .calendar-slide .stat-value {
        font-size: calc(1.7rem * var(--fit-scale, 1));
    }

    .calendar-slide .stat-label {
        font-size: calc(0.62rem * var(--fit-scale, 1));
    }

    .calendar-panel {
        order: 1;
        width: min(100%, 680px);
        gap: 8px;
        padding: 14px;
    }

    .calendar-panel-head strong {
        font-size: 1.45rem;
    }

    .calendar-weekdays,
    .calendar-grid {
        gap: 5px;
    }

    .calendar-day {
        min-height: 56px;
        gap: 3px;
        padding: 6px;
    }

    .calendar-day-number {
        font-size: 0.9rem;
    }

    .calendar-day-month {
        font-size: 0.5rem;
    }

    .calendar-day-metric strong {
        font-size: 1.12rem;
    }

    .calendar-day-metric span,
    .calendar-day-liters {
        font-size: 0.5rem;
        letter-spacing: 0.03em;
    }

    .calendar-highlights {
        display: none;
    }
}

@media (max-width: 760px) {
    .slide {
        display: flex;
        flex-direction: column;
        grid-template-columns: 1fr;
        align-content: start;
        align-items: center;
        justify-items: center;
        gap: 14px;
        overflow-y: auto;
        overflow-x: hidden;
        padding: calc(env(safe-area-inset-top, 0px) + 96px) 16px calc(env(safe-area-inset-bottom, 0px) + 112px);
        overscroll-behavior-x: none;
        scrollbar-width: none;
    }

    .slide,
    .slide.active,
    .slide.reverse,
    .slide.active.reverse {
        transform: none;
    }

    .slide::-webkit-scrollbar {
        display: none;
    }

    .slide-content {
        flex: 0 0 auto;
        width: 100%;
        justify-self: center;
        gap: 13px;
        margin-top: 0;
    }

    .slide.active .slide-media {
        animation: mediaIn 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
    }

    .slide-title {
        font-size: clamp(2.25rem, 12vw, 4.25rem);
        font-size: calc(clamp(2.25rem, 12vw, 4.25rem) * var(--fit-scale, 1));
    }

    .slide-body {
        font-size: 0.98rem;
    }

    .slide-media {
        flex: 0 0 auto;
        order: -1;
        width: min(100%, 420px);
        height: min(27vh, 280px);
        max-height: none;
        aspect-ratio: auto;
        margin-top: 0;
        margin-bottom: 10px;
        align-self: center;
        justify-self: center;
    }

    .date-range-slide .slide-media {
        height: min(19vh, 176px);
        margin-bottom: 2px;
    }

    .date-range-slide .slide-media .image-caption {
        display: none;
    }

    .date-range-slide .slide-content {
        gap: 10px;
    }

    .date-range-slide .slide-title {
        font-size: clamp(2rem, 10vw, 3.45rem);
        font-size: calc(clamp(2rem, 10vw, 3.45rem) * var(--fit-scale, 1));
        line-height: 0.92;
    }

    .date-range-slide .slide-body {
        font-size: 0.88rem;
        line-height: 1.32;
    }

    .date-range-slide .stat-pill {
        min-height: 62px;
        padding: 10px;
    }

    .date-range-slide .stat-grid {
        gap: 8px;
        margin-top: 2px;
    }

    .date-range-slide .stat-value {
        font-size: calc(1.48rem * var(--fit-scale, 1));
        line-height: 0.95;
    }

    .date-range-slide .stat-label {
        font-size: calc(0.58rem * var(--fit-scale, 1));
        letter-spacing: 0.06em;
    }

    .date-range-panel {
        grid-template-columns: minmax(74px, max-content) minmax(24px, 1fr) minmax(74px, max-content);
        gap: 8px;
        padding: 10px 12px;
    }

    .date-node strong {
        font-size: calc(1.16rem * var(--fit-scale, 1));
    }

    .date-label {
        font-size: calc(0.6rem * var(--fit-scale, 1));
        letter-spacing: 0.08em;
    }

    .date-node:last-child {
        text-align: right;
    }

    .date-line {
        width: auto;
        height: 3px;
    }

    .timeline-slide,
    .calendar-slide,
    .multi-image-slide {
        grid-template-columns: 1fr;
    }

    .timeline-panel {
        flex: 0 0 auto;
        order: -1;
        width: min(100%, 430px);
        max-height: 38vh;
        padding: 10px;
        justify-self: center;
        gap: 8px;
        overflow: hidden;
    }

    .timeline-chart {
        max-height: 22vh;
    }

    .timeline-grid text {
        font-size: 20px;
    }

    .timeline-legend {
        gap: 6px;
    }

    .timeline-legend-item {
        padding: 6px 8px;
        font-size: 0.68rem;
    }

    .timeline-results {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }

    .timeline-result-row {
        padding: 7px;
        gap: 2px 6px;
    }

    .timeline-result-row span {
        width: 18px;
        font-size: 0.66rem;
    }

    .timeline-result-row strong,
    .timeline-result-row em {
        font-size: 0.66rem;
    }

    .calendar-panel {
        flex: 0 0 auto;
        order: -1;
        width: min(100%, 430px);
        max-height: none;
        gap: 5px;
        padding: 8px;
        justify-self: center;
    }

    .calendar-panel-head {
        align-items: center;
    }

    .calendar-panel-head span,
    .calendar-highlight span {
        font-size: 0.58rem;
        letter-spacing: 0.07em;
    }

    .calendar-panel-head strong {
        font-size: 1.1rem;
    }

    .calendar-legend {
        grid-template-columns: repeat(4, 16px);
        gap: 4px;
    }

    .calendar-weekdays,
    .calendar-grid {
        gap: 4px;
    }

    .calendar-weekdays span {
        font-size: 0.56rem;
        letter-spacing: 0.04em;
    }

    .calendar-day {
        min-height: 38px;
        gap: 2px;
        padding: 4px;
    }

    .calendar-day-number {
        font-size: 0.76rem;
    }

    .calendar-day-month,
    .calendar-day-metric span {
        display: none;
    }

    .calendar-day-metric strong {
        font-size: 0.9rem;
    }

    .calendar-day-liters {
        font-size: 0.45rem;
        letter-spacing: 0.03em;
    }

    .calendar-highlights {
        display: none;
    }

    .calendar-slide .slide-title {
        font-size: clamp(1.7rem, 7.8vw, 2.55rem);
        font-size: calc(clamp(1.7rem, 7.8vw, 2.55rem) * var(--fit-scale, 1));
        line-height: 0.95;
    }

    .calendar-slide .slide-content {
        gap: 8px;
    }

    .calendar-slide .slide-body,
    .calendar-slide .stat-grid {
        display: none;
    }

    .multi-image-grid {
        flex: 0 0 auto;
        order: -1;
        width: min(100%, 420px);
        height: min(42vh, 360px);
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
        justify-self: center;
    }

    .multi-image-slide .slide-title,
    .locations-slide .slide-title {
        font-size: clamp(2rem, 9.4vw, 3.2rem);
        font-size: calc(clamp(2rem, 9.4vw, 3.2rem) * var(--fit-scale, 1));
        line-height: 0.95;
    }

    .story-badge {
        padding: 8px 9px;
        font-size: 0.66rem;
        font-size: calc(0.66rem * var(--fit-scale, 1));
    }

    .multi-image-slide .slide-body,
    .locations-slide .slide-body {
        font-size: 0.92rem;
    }

    .locations-slide .slide-media {
        height: min(25vh, 220px);
    }

    .locations-slide .slide-media .image-caption {
        display: none;
    }

    .locations-slide {
        gap: 10px;
    }

    .locations-slide .slide-content {
        gap: 10px;
    }

    .locations-slide .location-list {
        max-height: min(25vh, 190px);
        overflow-y: auto;
        gap: 6px;
        padding-right: 2px;
        scrollbar-width: none;
    }

    .locations-slide .location-list::-webkit-scrollbar {
        display: none;
    }

    .locations-slide .location-row {
        min-height: 42px;
        padding: 7px 9px;
        gap: 9px;
    }

    .locations-slide .rank-number {
        width: 30px;
    }

    .locations-slide .location-name {
        font-size: 0.9rem;
    }

    .locations-slide .location-meta {
        font-size: 0.66rem;
    }

    .locations-slide .location-score {
        font-size: 0.86rem;
    }

    .intro-slide .slide-media {
        position: relative;
        inset: auto;
        width: min(100%, 360px);
        height: min(29vh, 320px);
        max-height: none;
        opacity: 0.58;
        transform: none;
    }

    .gallery-slide {
        grid-template-columns: 1fr;
    }

    .gallery-window {
        flex: 0 0 auto;
        position: relative;
        order: -1;
        width: min(100%, 420px);
        max-height: min(42vh, 350px);
        overflow: hidden;
        border-radius: 8px;
        justify-self: center;
    }

    .gallery-window::before,
    .gallery-window::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        z-index: 2;
        height: 28px;
        pointer-events: none;
    }

    .gallery-window::before {
        top: 0;
        background: linear-gradient(to bottom, rgba(7, 8, 13, 0.44), transparent);
    }

    .gallery-window::after {
        bottom: 0;
        background: linear-gradient(to top, rgba(7, 8, 13, 0.5), transparent);
    }

    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        transform: translateY(0);
        will-change: transform;
    }

    .slide.active .gallery-grid.is-scrollable {
        animation: galleryAutoScroll var(--gallery-scroll-duration, 8500ms) linear infinite alternate;
    }

    .paused .gallery-grid.is-scrollable {
        animation-play-state: paused;
    }

    .leaderboard-row,
    .location-row {
        min-height: 56px;
        padding: 10px;
    }

    .leader-score,
    .location-score {
        font-size: 0.94rem;
    }

    .wrapped-topbar {
        top: calc(env(safe-area-inset-top, 0px) + 24px);
    }

    .topbar-actions {
        gap: 6px;
    }

    .volume-control {
        width: 92px;
        padding: 0 8px;
    }

    .volume-control input {
        min-width: 0;
        width: 100%;
    }
}

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

    .gallery-grid.is-scrollable {
        transform: none !important;
    }

    .timeline-series polyline {
        stroke-dashoffset: 0 !important;
        animation: none !important;
    }

    .timeline-series circle {
        opacity: 1 !important;
        animation: none !important;
    }
}
