* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

.noise {
    pointer-events: none;
    position: fixed;
    inset: 0;
    opacity: var(--noiseOpacity);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

/* Top bar */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    backdrop-filter: blur(14px);
    background: rgba(0,0,0,0.35);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    color: var(--text);
    text-decoration: none;
    font-weight: 900;
    letter-spacing: 0.2px;
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(255,255,255,0.05);
}

.muted { color: var(--muted); }

/* Deck / slides */
.wrapped { height: 100vh; padding-top: 56px; }

.deck {
    height: calc(100vh - 56px);
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    touch-action: pan-y;

}

.slide {
    position: relative;
    height: calc(100vh - 56px);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
}

.slide-bg {
    position: absolute;
    inset: 0;
    background:
            radial-gradient(900px 420px at 15% 20%, rgba(255,90,31,0.35), transparent 60%),
            radial-gradient(760px 380px at 85% 35%, rgba(46,197,255,0.28), transparent 60%),
            radial-gradient(700px 420px at 45% 85%, rgba(124,255,107,0.16), transparent 65%),
            linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.01));
    filter: saturate(1.15);
}

.slide-inner {
    position: relative;
    height: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 28px 18px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}

.meta { display: flex; justify-content: flex-end; }

.counter {
    font-weight: 900;
    color: rgba(242,245,247,0.9);
    font-size: 12px;
    letter-spacing: 0.06em;
}

.slide-title {
    margin: 0;
    font-size: clamp(26px, 4vw, 44px);
    letter-spacing: -0.02em;
}

.big {
    font-size: clamp(64px, 10vw, 140px);
    line-height: 0.95;
    font-weight: 1000;
    letter-spacing: -0.04em;
    margin: 0;
}

/* Intro slide */
.intro-kicker {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    width: fit-content;
}

.intro-name {
    margin: 10px 0 0;
    font-size: clamp(38px, 6vw, 76px);
    letter-spacing: -0.03em;
}

.intro-title {
    margin: 0;
    font-size: clamp(22px, 3vw, 34px);
    color: rgba(242,245,247,0.92);
}

.intro-sub {
    margin: 0;
    color: var(--muted);
    max-width: 60ch;
}

/* ===== Unified text system: caption + flavour (used for ALL slides) ===== */
.slide-text {
    margin-top: 16px;
    max-width: 62ch;
}

.slide-text__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 900;
    color: rgba(242,245,247,0.92);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    width: fit-content;
    margin-bottom: 10px;
}

.slide-text__caption {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(242,245,247,0.92);
    margin: 0;
}

.slide-text__flavour {
    margin-top: 10px;
    padding-left: 12px;
    border-left: 2px solid rgba(255,255,255,0.12);
}

.slide-text__line {
    display: block;               /* forces line breaks */
    font-size: 14px;
    line-height: 1.55;
    color: rgba(242,245,247,0.72);
    margin-top: 6px;
}

/* Make italic actually noticeable */
.slide-text em {
    font-style: italic;
    color: rgba(242,245,247,0.88);
}

/* Tiles */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.tile {
    padding: 16px;
    border-radius: 22px;
    background: rgba(0,0,0,0.20);
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(10px);
}

.tile .k {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.tile .v {
    margin-top: 8px;
    font-size: 34px;
    font-weight: 1000;
    letter-spacing: -0.02em;
}

.tile .s {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(169,180,191,0.9);
}

/* Ranked list */
.ranked {
    margin-top: 6px;
    display: grid;
    gap: 10px;
    max-width: 760px;
}

.row {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(0,0,0,0.20);
    border: 1px solid rgba(255,255,255,0.10);
}

.pos { font-weight: 1000; opacity: 0.9; }
.label { font-weight: 800; }
.value { font-weight: 1000; color: rgba(242,245,247,0.9); }

/* Charts */
.chart-card {
    margin-top: 10px;
    padding: 16px 16px 12px;
    border-radius: 26px;
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(10px);
    max-width: 720px;
    box-shadow: 0 22px 70px rgba(0,0,0,0.35);
}

.chart-card.wide { max-width: 940px; }

/* Centre charts without breaking normal layouts */
.chart-card {
    display: grid;
    place-items: center;
}

.chart {
    width: 100% !important;
    height: 360px !important;
}

.chart-card .chart {
    width: min(560px, 100%) !important;
    aspect-ratio: 1 / 1;
    height: auto !important;
    max-height: 52vh;
}

/* Bars/line keep their wider aspect */
.chart-card.wide .chart {
    aspect-ratio: auto;
    height: 360px !important;
    width: 100% !important;
}

@media (max-width: 520px) {
    .chart { height: 300px !important; }
    .chart-card.wide .chart { height: 300px !important; }
}

/* Donut legend (Wrapped style) */
.chart-legend {
    margin-top: 12px;
    display: grid;
    gap: 8px;
    width: 100%;
    max-width: 720px;
}

.legend-row {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.06);
}

.legend-name {
    font-weight: 800;
    color: rgba(242,245,247,0.92);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend-right {
    font-weight: 800;
    color: rgba(169,180,191,0.95);
    font-size: 12px;
}

/* Progress dots */
.progress {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,0.24);
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(10px);
}

.progress .dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.22);
}

.progress .dot.active {
    background: var(--accent2);
    box-shadow: 0 0 0 4px rgba(46,197,255,0.18);
}

@media (prefers-reduced-motion: reduce) {
    .deck { scroll-behavior: auto; }
}

/* Avatar */

.tile .avatar,
.card .avatar,
.avatar {
    /* was 52 */
    position: relative;              /* REQUIRED for ::before/::after anchoring */
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
    max-width: 52px !important;
    max-height: 52px !important;

    border-radius: 999px !important; /* circular */
    overflow: hidden;

    display: grid;
    place-items: center;
    flex-shrink: 0;

    background: rgba(255,255,255,0.06);
}

/* The actual image always fills the circle */
.tile .avatar img,
.card .avatar img,
.avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 999px;            /* ensure rounding even if overflow fails somewhere */
}

/* Gradient ring like Spotify (outer ring) */
.tile .avatar::before,
.card .avatar::before,
.avatar::before {
    content: "";
    position: absolute;
    inset: -3px;                     /* thickness of ring */
    border-radius: 999px;
    background: conic-gradient(
            from 200deg,
            var(--accent),
            var(--accent2),
            var(--accent3),
            var(--accent)
    );
    filter: saturate(1.2);
    opacity: 0.95;
    z-index: -1;                     /* sit behind the avatar */
}

/* Inner subtle border/glass */
.tile .avatar::after,
.card .avatar::after,
.avatar::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;
    pointer-events: none;
    box-shadow:
            inset 0 0 0 1px rgba(255,255,255,0.18),
            0 10px 28px rgba(0,0,0,0.45);
}
