/* Plus Jakarta Sans — self-hosted (two subset files, ~49KB total) rather than
   a Google Fonts CDN link, so this app keeps making zero requests to a third
   party. Variable font: one @font-face per subset covers the whole weight
   range (200-800, this family's actual variable axis). */
@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("/static/fonts/plusjakarta-latin-var.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: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("/static/fonts/plusjakarta-latin-ext-var.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
        U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
        U+2C60-2C7F, U+A720-A7FF;
}

/* Color system. Light values live on the bare :root; dark values are defined
   twice — once inside the prefers-color-scheme media query (system default,
   guarded so an explicit light choice can still win) and once under
   :root[data-theme="dark"] (the manual toggle, wins regardless of system
   preference). Keep both dark blocks in sync — see the theme-toggle section
   below for the script that sets data-theme. --chart-* tokens are tuned
   separately from their UI-token counterparts for contrast as chart marks
   (established pattern — see the comment above MEDAL_COLORS in charts.py). */
:root {
    --bg: #F6F5F8;
    --card-bg: #FFFFFF;
    --surface-raised: #F0ECF3;
    --text: #201423;
    --muted: #6F6873;
    --border: #DDD7E2;
    --accent: #37003C;
    --action-green: #00E676;
    --cyan: #04C9D7;
    --pink: #C61B50;
    --price-up: #087A45;
    --price-down: #B42345;
    --shame: #B42345;
    --shame-bg: #FFF0F4;
    --gold: #A87400;
    --gold-bg: #FFF8E1;
    --disabled-bg: #F1EFF2;
    --disabled-text: #8B838E;
    --selected-bg: #E8FFF3;
    --selected-border: #00E676;
    --btn-secondary-text: #37003C;
    --btn-secondary-border: #37003C;
    --chart-gold: #B78103;
    --chart-silver: #9aa5b1;
    --chart-bronze: #8b4225;
    --chart-shame: #a5282e;
    /* slate: the ownership/club pie "Others" slice (charts.py OTHERS_COLOR) —
       deliberately neutral/desaturated, distinct from --muted (body text) and
       the medal colors. violet/green/cyan/pink: still unused, reserved for a
       future categorical chart with more than a handful of series. */
    --chart-violet: #7C3AED;
    --chart-green: #00A85A;
    --chart-cyan: #008CA0;
    --chart-pink: #D12B61;
    --chart-slate: #64748B;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #100713;
        --card-bg: #1C1021;
        --surface-raised: #28172E;
        --text: #F8F6FA;
        --muted: #B8AFBB;
        --border: #402D46;
        --accent: #A855F7;
        --action-green: #00FF87;
        --cyan: #04F5FF;
        --pink: #FF4F87;
        --price-up: #4ADE80;
        --price-down: #FF6B8F;
        --shame: #FF6B8F;
        --shame-bg: #2B111B;
        --gold: #FFD44A;
        --gold-bg: #2A220E;
        --disabled-bg: #241A28;
        --disabled-text: #6F6873;
        --selected-bg: #153227;
        --selected-border: #00FF87;
        --btn-secondary-text: #F8F6FA;
        --btn-secondary-border: #76577E;
        --chart-gold: #FFD44A;
        --chart-silver: #8a94a3;
        --chart-bronze: #9c3d1c;
        --chart-shame: #cf6679;
        --chart-violet: #B784FF;
        --chart-green: #4ADE80;
        --chart-cyan: #31E6F2;
        --chart-pink: #FF5C8A;
        --chart-slate: #9AA4B2;
    }
}

:root[data-theme="dark"] {
    --bg: #100713;
    --card-bg: #1C1021;
    --surface-raised: #28172E;
    --text: #F8F6FA;
    --muted: #B8AFBB;
    --border: #402D46;
    --accent: #A855F7;
    --action-green: #00FF87;
    --cyan: #04F5FF;
    --pink: #FF4F87;
    --price-up: #4ADE80;
    --price-down: #FF6B8F;
    --shame: #FF6B8F;
    --shame-bg: #2B111B;
    --gold: #FFD44A;
    --gold-bg: #2A220E;
    --disabled-bg: #241A28;
    --disabled-text: #6F6873;
    --selected-bg: #153227;
    --selected-border: #00FF87;
    --btn-secondary-text: #F8F6FA;
    --btn-secondary-border: #76577E;
    --chart-gold: #FFD44A;
    --chart-silver: #8a94a3;
    --chart-bronze: #9c3d1c;
    --chart-shame: #cf6679;
    --chart-violet: #B784FF;
    --chart-green: #4ADE80;
    --chart-cyan: #31E6F2;
    --chart-pink: #FF5C8A;
    --chart-slate: #9AA4B2;
}

* {
    box-sizing: border-box;
}

/* Any component rule below that sets its own `display` (flex/inline-flex/etc.)
   would otherwise silently defeat JS's `el.hidden = true` — an author-stylesheet
   `display` declaration beats the UA stylesheet's `[hidden] { display: none }`
   regardless of specificity. This one rule makes `hidden` always win, for every
   element, present and future — the standard fix for this exact interaction. */
[hidden] {
    display: none !important;
}

html,
body {
    /* Nothing may make the page wider than the viewport — otherwise a phone
       (especially pinch-zoomed out) shows the page not filling the screen and
       full-bleed things like the KPI ticker stop short of the edges. `clip`
       (not `hidden`) doesn't create a scroll container, so the sticky ticker
       still works. iOS Safari honours this more reliably on <body> than on
       the root, so set it on both. */
    overflow-x: clip;
}

body {
    margin: 0;
    max-width: 100vw;
    background: var(--bg);
    color: var(--text);
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* Sticky footer: body is a full-height flex column, <main> grows to fill
       whatever's left so the footer always sits at the bottom of the screen
       on short pages (landing) instead of floating right under the content —
       and just flows after everything as normal on long pages (awards/league-stats),
       since <main> only ever grows, never shrinks below its own content. */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Soft, fixed color blobs behind everything — glassmorphism needs something
   with texture behind a translucent+blurred card, or the blur has nothing to
   do and the "glass" cards just look like flat, slightly-faded ones. Fixed
   (not absolute), so it stays put as the page scrolls; low-opacity so it
   reads as ambient tint, not a loud background. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--accent) 35%, transparent) 0%, transparent 42%),
        radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--gold) 30%, transparent) 0%, transparent 38%),
        radial-gradient(circle at 82% 82%, color-mix(in srgb, var(--action-green) 25%, transparent) 0%, transparent 38%),
        radial-gradient(circle at 15% 85%, color-mix(in srgb, var(--cyan) 25%, transparent) 0%, transparent 38%);
    pointer-events: none;
}

.ticker {
    /* Pin to the full viewport width regardless of what the flex column or any
       stray overflow does to <body>'s computed width — so the bar always runs
       edge to edge, including pinch-zoomed out on a phone. */
    width: 100vw;
    background: var(--accent);
    background: color-mix(in srgb, var(--accent) 60%, transparent);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    overflow: hidden;
    white-space: nowrap;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 10;
}

.ticker-track {
    display: inline-flex;
    width: max-content;
    animation: ticker-scroll 35s linear infinite;
}

/* Hover-slows-to-half-speed is handled in _ticker.html via the Web Animations
   API's playbackRate — NOT animation-duration here. Changing animation-duration
   on a running animation recalculates its progress against elapsed real time,
   which snaps the scroll to a different point in the loop the instant it
   changes (the actual bug reported); playbackRate has no such jump. */

.ticker-item {
    display: inline-block;
    padding: 0.55rem 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

@keyframes ticker-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ticker-track {
        animation: none;
    }
}

/* Manual light/dark toggle — fixed top-right on every page, above the sticky
   ticker (z-index 10). Checkbox + label is the standard accessible switch
   pattern; see _theme_toggle.html for the script that flips data-theme. */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 30;
}

/* Pages with the sticky KPI ticker (~2.2rem tall) need the toggle pushed
   below it, or the two overlap in the top-right corner. */
.theme-toggle--below-ticker {
    top: 3.25rem;
}

/* Phones: pinned, the toggle floated over nav pills and cards as the page
   scrolled under it (e.g. "Skip to reveal all cards"). Let it scroll away with
   the header instead; it's only needed at the top. */
@media (max-width: 600px) {
    .theme-toggle {
        position: absolute;
    }
}

.theme-toggle-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.theme-toggle-track {
    display: flex;
    align-items: center;
    width: 3.1rem;
    height: 1.7rem;
    padding: 0.15rem;
    border-radius: 999px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s ease;
}

.theme-toggle-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}

.theme-toggle-thumb .icon-dark {
    display: none;
}

.theme-toggle-input:checked + .theme-toggle-track {
    background: var(--accent);
    justify-content: flex-end;
}

.theme-toggle-input:checked + .theme-toggle-track .icon-light {
    display: none;
}

.theme-toggle-input:checked + .theme-toggle-track .icon-dark {
    display: inline;
}

.theme-toggle-input:focus-visible + .theme-toggle-track {
    outline: 2px solid var(--action-green);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .theme-toggle-track,
    .theme-toggle-thumb {
        transition: none;
    }
}

main {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    width: 100%;
    flex: 1 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

h1 {
    margin: 0;
    color: var(--accent);
    font-size: 1.75rem;
}

/* LL logo beside the "League Lore" wordmark in the landing-page <h1> —
   sized to sit with the text, not tower over it (transparent PNG) */
.brand-logo {
    height: 1em;
    width: auto;
    vertical-align: -0.13em;
    margin-right: 0.35em;
}

.brand-home:hover span {
    text-decoration: underline;
}

.subtitle {
    color: var(--muted);
    margin-top: 0.25rem;
}

.empty {
    text-align: center;
    color: var(--muted);
}

.empty code {
    background: var(--card-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.feature-awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.section-heading {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 1rem;
}

.section-heading.fame-heading {
    color: var(--gold);
}

.section-heading.shame-heading {
    color: var(--shame);
}

.section-heading.league-stats-heading {
    margin: 2rem 0 1.25rem;
    text-align: center;
}

.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.award-card {
    background: var(--card-bg); /* fallback for browsers without color-mix()/backdrop-filter */
    background: color-mix(in srgb, var(--card-bg) 68%, transparent);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.award-card.skipped {
    background: var(--disabled-bg);
    border-color: var(--disabled-text);
    color: var(--disabled-text);
}

.award-card.skipped h2 {
    color: var(--disabled-text);
}

/* Special Ones — brand-purple border, distinct from the neutral default. */
.awards-grid .award-card {
    border-color: var(--accent);
}

.awards-grid .award-card.skipped {
    border-color: var(--disabled-text);
}

.award-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.award-card h2 {
    font-size: 1.05rem;
    margin: 0 0 0.5rem;
    color: var(--accent);
}

.award-subtitle {
    color: var(--muted);
    font-size: 0.75rem;
    font-style: italic;
    margin: -0.35rem 0 0.5rem;
}

.fame-award-card,
.shame-award-card {
    padding: 1.75rem 1.25rem;
}

.fame-award-card .award-icon,
.shame-award-card .award-icon {
    font-size: 2.5rem;
}

.fame-award-card h2,
.shame-award-card h2 {
    font-size: 1.2rem;
}

.fame-award-card .winner,
.shame-award-card .winner {
    font-size: 1.1rem;
}

.fame-award-card {
    background: var(--gold-bg);
    background: color-mix(in srgb, var(--gold-bg) 75%, transparent);
    border: 1px solid var(--gold);
}

.fame-award-card h2 {
    color: var(--gold);
}

.shame-award-card {
    background: var(--shame-bg);
    background: color-mix(in srgb, var(--shame-bg) 75%, transparent);
    border: 1px solid var(--shame);
}

.shame-award-card h2 {
    color: var(--shame);
}

.winner {
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.detail {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Navigation */

.page-nav {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.55rem 1.1rem;
}

/* Each nav item is its own outlined pill, so e.g. "Home" and "League Stats"
   read as two distinct controls rather than one run-on line of text. */
.page-nav a {
    color: var(--accent);
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 600;
    padding: 0.28rem 0.7rem;
    border: 1px solid var(--btn-secondary-border);
    border-radius: 999px;
}

.page-nav a:hover {
    background: var(--surface-raised);
    text-decoration: none;
}

/* flex gap handles spacing now — drop the old inline left-margins */
.page-nav .share-btn,
.page-nav .pint-link,
.page-nav .show-link-nav {
    margin-left: 0;
}

/* The one "look here, something's ready" moment in the app — uses the
   selected/highlighted treatment rather than the gold Hall-of-Fame color. */
.wrapped-banner {
    text-align: center;
    background: var(--selected-bg);
    border: 1px solid var(--selected-border);
    border-radius: 10px;
    padding: 0.85rem;
    margin-bottom: 2rem;
}

.wrapped-banner a {
    color: var(--price-up);
    font-weight: 700;
    text-decoration: none;
}

.wrapped-banner a:hover {
    text-decoration: underline;
}

/* Charts */

.chart-section {
    margin-bottom: 2.5rem;
}

.chart-section h2 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
    color: var(--accent);
}

.chart-caption {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0 0 1rem;
}

/* Best XI of the Gameweek — the same in-page SVG jerseys as the team page
   (.kit-pitch / .kit, from _kit.html; see "Jersey cards" below), plus Manager of
   the Gameweek "on the sideline" as a dugout card. */
.best-xi-layout {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    flex-wrap: wrap;
}

/* The pitch keeps a real formation width and never compresses below it; if the
   screen is narrower than that, this wrapper scrolls sideways instead of
   squishing the cards. */
.pitch-wrap {
    flex: 1 1 480px;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.kit-pitch.kit-pitch--best-xi {
    /* a real formation width; .pitch-wrap scrolls sideways below it */
    min-width: 330px;
    padding-bottom: 1.25rem;
}

.dugout {
    flex: 0 1 220px;
    min-width: 200px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.dugout-label {
    color: var(--muted);
    font-size: 0.72rem;
    margin: 0 0 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dugout-name {
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0 0 0.15rem;
    overflow-wrap: anywhere;
}

.dugout-score {
    color: var(--gold);
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 0.6rem;
}

.dugout-score span {
    font-size: 1rem;
    color: var(--muted);
    font-weight: 500;
}

.dugout-caption {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 640px) {
    .best-xi-layout {
        flex-direction: column;
    }
    /* in a column, the desktop flex-basis would become a min *height* (a gap) */
    .best-xi-layout > .pitch-wrap,
    .best-xi-layout > .dugout {
        flex-basis: auto;
    }
    .kit-pitch.kit-pitch--best-xi {
        min-width: 300px;
        padding-bottom: 1rem;
    }
    /* points only on a phone: a 5-across row has no room for the price too */
    .kit-pitch--best-xi .kit-meta-cost {
        display: none;
    }
}

/* A quiet, low-pressure ask at the very end of the page — not a nav item. */
.league-stats-tip {
    text-align: center;
    max-width: 480px;
    margin: 2.5rem auto 0;
}

.league-stats-tip-text {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.6;
    margin: 0 0 1rem;
}

.league-stats-tip-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

.chart-card {
    background: var(--card-bg);
    background: color-mix(in srgb, var(--card-bg) 68%, transparent);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    overflow-x: auto;
}

.chart-card svg {
    display: block;
    max-width: 100%;
    height: auto;
}

.chart-legend {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.chart-table {
    margin-top: 1rem;
    font-size: 0.8rem;
}

/* Both cap a big league's rendering (chart grows one row per manager, the
   table grows one row per manager x one column per gameweek) at a sane
   on-screen height and scroll internally instead — a small league is short
   enough that the cap never engages, so nothing changes for it. No pagination
   / extra routes / JS needed either way. */
.chart-scroll {
    max-height: 620px;
    overflow-y: auto;
}

.chart-table-scroll {
    max-height: 360px;
    overflow-y: auto;
}

.chart-table thead th {
    position: sticky;
    top: 0;
    background: var(--card-bg);
}

.chart-table summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 600;
}

.chart-table table {
    border-collapse: collapse;
    margin-top: 0.75rem;
    width: 100%;
}

.chart-table th,
.chart-table td {
    border: 1px solid var(--border);
    padding: 0.35rem 0.6rem;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.chart-table th {
    color: var(--muted);
    font-weight: 600;
}

.pie-chart-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

/* Glass donut: clipped to a circle (matching the ring's own shape, no square
   "window" edge) so backdrop-filter blurs the card's own glass surface behind
   it — the wedges themselves are semi-transparent (fill-opacity in charts.py)
   so that blur is actually visible through them, not just decorative. */
.pie-svg-wrap {
    display: inline-block;
    border-radius: 50%;
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
}

.pie-svg-wrap svg {
    display: block;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.18));
}

.pie-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
}

.pie-legend li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.pie-legend li:hover {
    background: var(--surface-raised);
}

.pie-legend .legend-swatch {
    width: 13px;
    height: 13px;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.pie-legend .legend-label {
    font-weight: 600;
    color: var(--text);
}

.pie-legend .legend-value {
    color: var(--muted);
}

/* Price movers */

.price-movers {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.pm-col {
    flex: 1 1 260px;
    min-width: 0;
}

.pm-col h3 {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.pm-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.pm-col li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.15rem 0.75rem;
    font-size: 0.85rem;
}

.pm-name {
    font-weight: 600;
    color: var(--text);
}

.pm-club {
    color: var(--muted);
    font-weight: 400;
    font-size: 0.75rem;
}

.pm-delta {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.pm-delta.price-up {
    color: var(--price-up, #087a45);
}

.pm-delta.price-down {
    color: var(--price-down, #b42345);
}

.pm-meta {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 0.75rem;
}

.pm-empty {
    color: var(--muted);
    font-style: italic;
}

/* Wrapped reveal */

.wrapped-scroller {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100vh;
}

.wrapped-slide {
    scroll-snap-align: start;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background: var(--bg);
}

.wrapped-slide:nth-child(odd) {
    background: var(--card-bg);
}

.wrapped-slide.wrapped-skip {
    opacity: 0.5;
}

.wrapped-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.wrapped-slide h1 {
    font-size: 2.25rem;
}

.wrapped-slide h2 {
    color: var(--accent);
    font-size: 1.75rem;
    margin: 0 0 0.5rem;
}

.wrapped-kicker {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.wrapped-range {
    color: var(--muted);
    margin-top: 0.5rem;
}

.wrapped-scroll-hint {
    margin-top: 2.5rem;
    color: var(--muted);
    font-size: 0.85rem;
    animation: bounce 2s infinite;
}

.wrapped-subtitle {
    color: var(--muted);
    font-style: italic;
    margin: -0.25rem 0 0.75rem;
}

.wrapped-winner {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.wrapped-detail {
    color: var(--muted);
    max-width: 420px;
}

.wrapped-back {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.wrapped-back:hover {
    text-decoration: underline;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
    .wrapped-scroll-hint {
        animation: none;
    }
    .wrapped-scroller {
        scroll-snap-type: none;
    }
}

/* ------------------------------------------------------------------------- */
/* MVP 4: landing page, share button, backfill "pending" state, site footer  */
/* ------------------------------------------------------------------------- */

/* Landing page: one centred column, the league-ID field as the focal point.
   Wider than the secondary widgets below it (Your leagues / My team, each
   capped at 440px) so the league-ID box reads as the clear priority. */
.landing {
    max-width: 680px;
    text-align: center;
    /* Override <main>'s generous generic padding — this page should fit in one
       screen, no scrolling, so it doesn't get the same breathing room the
       longer content pages (awards/league-stats) get. */
    padding-top: 1.25rem;
    padding-bottom: 1rem;
}

.landing header {
    margin-bottom: 1.25rem;
}

.landing .subtitle {
    font-size: 1rem;
    line-height: 1.5;
    margin-top: 0.6rem;
}

.league-form {
    background: var(--card-bg);
    background: color-mix(in srgb, var(--card-bg) 68%, transparent);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem 2.25rem;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    text-align: center;
}

.league-form label {
    font-weight: 700;
    font-size: 1rem;
}

.league-form input {
    width: 100%;
    font-size: 1.3rem;
    text-align: center;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
}

.league-form button {
    width: 100%;
    margin-top: 0.15rem;
    padding: 0.65rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    background: var(--action-green);
    color: #19051D;
    cursor: pointer;
}

.league-form button:hover {
    opacity: 0.92;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.5;
    margin: 0.35rem 0 0;
}

/* Was unstyled — fell back to the browser's default blue/visited-purple link
   color, which isn't tied to the theme and reads poorly against the dark-mode
   background. Use the same accent link treatment as the rest of the app. */
.form-hint a,
.form-hint a:visited {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
}

.form-hint a:hover {
    text-decoration: none;
}

.form-hint code {
    background: var(--bg);
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
}

.form-error {
    /* Fixed strong red regardless of theme — dark mode's tuned "danger" text
       color (#FF6B8F) is too light to hold contrast with white text on a
       solid fill, so this alert banner intentionally doesn't follow --shame. */
    background: #B42345;
    color: #fff;
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    margin: 0 auto 1rem;
    font-size: 0.9rem;
    line-height: 1.45;
}

/* "Where's my team ID?" — collapsed help under the form hint (MVP Bravo 1
   follow-up), mainly for FPL-app users, whose app never shows the ID. */
.id-help {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
    width: 100%;
}

.id-help summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 600;
}

.id-help-shot {
    margin: 0.6rem 0 0;
}

.id-help-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    text-align: left;
}

.id-help-dots {
    display: inline-flex;
    gap: 4px;
    flex: none;
}

.id-help-dots i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.id-help-url {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    color: var(--text);
    overflow-wrap: anywhere;
}

.id-help-url mark {
    color: var(--text);
    background: none;
    font-weight: 700;
    padding: 0.05rem 0.3rem;
    border: 2px solid #E8442E;
    border-radius: 999px;
}

.id-help-shot figcaption {
    margin-top: 0.3rem;
    font-size: 0.75rem;
}

.id-help ol {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    text-align: left;
}

.id-help li + li {
    margin-top: 0.4rem;
}

.id-help a,
.id-help a:visited {
    color: var(--accent);
    font-weight: 600;
}

.id-help code {
    background: var(--bg);
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    overflow-wrap: anywhere;
}

/* Nested inside .league-form, right under the how-to-find-your-ID hint — the
   divider marks it as a distinct "or" alternative, not part of the hint. */
.demo-link {
    font-size: 0.9rem;
    color: var(--muted);
    padding-top: 1.1rem;
    width: 100%;
    border-top: 1px solid var(--border);
}

/* "Your leagues" — populated from localStorage, hidden when empty. */
.your-leagues {
    max-width: 480px;
    margin: 0 auto 1.25rem;
    text-align: left;
}

.your-leagues-label {
    margin: 0 0 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.your-leagues-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.your-leagues-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--card-bg);
    background: color-mix(in srgb, var(--card-bg) 68%, transparent);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
}

.your-leagues-list a {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.your-leagues-list a:hover {
    text-decoration: underline;
}

.your-leagues-list .forget {
    flex: none;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
}

.your-leagues-list .forget:hover {
    color: var(--shame);
    background: var(--surface-raised);
    border-radius: 4px;
}

.landing-info {
    max-width: 600px;
    margin: 0.75rem auto 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

/* MVP Bravo 1 — /t/{team_id}: league strip on top, then your lineup (big,
   jersey cards + transfer planner) beside the PPM XI. */
.brand-home {
    color: inherit;
    text-decoration: none;
}

.landing.team-page {
    max-width: 1440px;
}

.team-col-heading {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}

/* --- league strip: equal-width buttons in one row, scrolls sideways --- */
.team-leagues-section {
    text-align: center;
    margin-bottom: 2rem;
}

.team-leagues-strip {
    list-style: none;
    margin: 0;
    padding: 0 0 0.5rem;
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    /* scrollbar only shows while hovering the strip */
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.team-leagues-strip:hover,
.team-leagues-strip:focus-within {
    scrollbar-color: var(--border) transparent;
}

.team-leagues-strip::-webkit-scrollbar {
    height: 6px;
}

.team-leagues-strip::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
}

.team-leagues-strip:hover::-webkit-scrollbar-thumb {
    background: var(--border);
}

.team-leagues-strip > li {
    flex: 0 0 260px;
    scroll-snap-align: start;
    text-align: left;
}

/* Centred when the buttons fit; auto margins (unlike justify-content: center)
   still let an overflowing strip scroll back to its first button. */
.team-leagues-strip > li:first-child {
    margin-left: auto;
}

.team-leagues-strip > li:last-child {
    margin-right: auto;
}

.team-leagues-strip form {
    margin: 0;
    height: 100%;
}

/* Name on top, manager count underneath, arrow on the right — so the name gets
   the full button width inside an equal-size strip button. */
.team-league {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0.1rem;
    text-align: left;
    font: inherit;
    color: var(--text);
    background: var(--card-bg);
    background: color-mix(in srgb, var(--card-bg) 68%, transparent);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    cursor: pointer;
}

button.team-league:hover {
    border-color: var(--accent);
}

/* Up to two lines before the ellipsis, so long names still read with the
   "you're 1st ▲5" line underneath; the full name is in the title tooltip. */
.team-league-name {
    grid-column: 1;
    min-width: 0;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow-wrap: anywhere;
}

.team-league-meta {
    grid-column: 1;
    font-size: 0.8rem;
    color: var(--muted);
}

.team-league-meta strong {
    color: var(--text);
}

.rank-move {
    font-weight: 700;
    font-size: 0.75rem;
}

.rank-up { color: #1E9E5A; }
.rank-down { color: var(--shame); }

.team-league-go {
    grid-column: 2;
    grid-row: 1 / span 2;
    color: var(--accent);
    font-weight: 700;
}

.team-league--disabled {
    cursor: default;
    opacity: 0.6;
}

.team-empty,
.team-switch {
    margin: 0.75rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.team-empty a,
.team-switch a {
    color: var(--accent);
    font-weight: 600;
}

/* --- lineup (wider) beside the PPM XI --- */
.team-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
    text-align: left;
}

.team-panel + .team-panel {
    margin-top: 1.75rem;
}

.team-panel-sub {
    margin: -0.35rem 0 0.75rem;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.45;
}

.team-panel .pitch-wrap {
    width: 100%;
}

.team-summary {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

.team-summary strong {
    color: var(--text);
}

.armband {
    display: inline-block;
    min-width: 1.1em;
    padding: 0 0.2em;
    font-size: 0.7em;
    line-height: 1.4;
    text-align: center;
    color: #19051D;
    background: var(--action-green);
    border-radius: 3px;
    vertical-align: 0.1em;
}

.armband--vice {
    background: #fff;
}

/* Jersey cards, FPL-style: shirt on top, white name plate, dark points strip. */
.kit-pitch {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding: 1.25rem 0.75rem 0;
    background:
        repeating-linear-gradient(180deg, rgba(255,255,255,0.05) 0 44px, transparent 44px 88px),
        linear-gradient(180deg, #2f9e44 0%, #2b8a3e 100%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    overflow: hidden;
}

.kit-row {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
}

.kit {
    position: relative;
    flex: 0 1 108px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    border-radius: 8px;
}

button.kit {
    cursor: pointer;
}

button.kit:hover .kit-shirt,
button.kit:focus-visible .kit-shirt {
    transform: translateY(-2px);
}

.kit-shirt-wrap {
    position: relative;
    display: block;
}

.kit-shirt {
    display: block;
    width: 64px;
    height: 60px;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
    transition: transform 0.12s ease;
}

.kit-stripes {
    display: none;
}

.kit-shirt--striped .kit-stripes {
    display: inline;
}

.kit-outline {
    stroke: rgba(0, 0, 0, 0.35);
    stroke-width: 1;
}

.kit-armband {
    position: absolute;
    top: 2px;
    right: -6px;
    font-size: 0.7rem;
}

.kit-name,
.kit-meta {
    display: block;
    width: 100%;
    padding: 0.18rem 0.3rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kit-name {
    margin-top: 0.15rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #201423;
    background: #fff;
    border-radius: 5px 5px 0 0;
}

.kit-meta {
    font-size: 0.68rem;
    font-weight: 600;
    color: #fff;
    background: #37003C;
    border-radius: 0 0 5px 5px;
}

.kit--selected .kit-name {
    background: #FFE08A;
}

.kit--selected .kit-shirt {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 6px #FFE08A);
}

.kit--in .kit-meta {
    background: #0B8A4A;
}

.kit-bench {
    margin: 0.4rem -0.75rem 0;
    padding: 0.6rem 0.75rem 0.9rem;
    background: rgba(0, 0, 0, 0.22);
}

.kit-bench-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
}

/* --- transfer planner --- */
.planner-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.85rem;
    color: var(--muted);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.planner-bar strong {
    color: var(--text);
}

.planner-bar strong.planner-over {
    color: var(--shame);
}

.planner-bar select {
    margin-left: 0.35rem;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.1rem 0.3rem;
}

.planner-reset,
.planner-undo,
.planner-cancel {
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
}

.planner-reset {
    margin-left: auto;
}

.planner-picker {
    margin-top: 0.75rem;
    padding: 0.8rem;
    background: var(--card-bg);
    border: 1px solid var(--accent);
    border-radius: 10px;
}

.planner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.6rem 0 0.2rem;
}

.planner-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
}

.planner-action .armband {
    position: static;
}

.planner-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.planner-picker-or {
    margin: 0.5rem 0 0.35rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.planner-lineup-text {
    color: var(--text);
}

/* Substitution mode: the player being moved, and who they can swap with. */
.kit--sub-from .kit-shirt {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 6px #FFE08A);
}

.kit--sub-target .kit-shirt {
    filter: drop-shadow(0 0 6px #00FF85);
}

.kit--sub-target .kit-name {
    outline: 2px solid #00FF85;
}

.planner-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.planner-picker-title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
}

.planner-search {
    width: 100%;
    margin: 0.6rem 0;
    padding: 0.5rem 0.7rem;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.planner-options {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.4rem;
}

.planner-option {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0.45rem 0.6rem;
    font: inherit;
    text-align: left;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}

.planner-option:hover:not(:disabled) {
    border-color: var(--accent);
}

.planner-option:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.planner-option-name {
    font-weight: 700;
    font-size: 0.85rem;
}

.planner-option-meta,
.planner-empty {
    font-size: 0.72rem;
    color: var(--muted);
}

.planner-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.planner-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.planner-out {
    color: var(--shame);
    text-decoration: line-through;
}

.planner-in {
    font-weight: 700;
}

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

.planner-undo {
    margin-left: auto;
}

.planner-note {
    margin: 0.75rem 0 0;
    font-size: 0.72rem;
    color: var(--muted);
}

.kit-defs {
    position: absolute;
}

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

@media (max-width: 640px) {
    .team-leagues-strip > li {
        flex-basis: 220px;
    }
    .kit-pitch {
        padding: 1rem 0.35rem 0;
        gap: 0.8rem;
    }
    .kit-row {
        gap: 0.25rem;
    }
    .kit-shirt {
        width: 44px;
        height: 41px;
    }
    .kit-name {
        font-size: 0.64rem;
        padding: 0.12rem 0.15rem;
    }
    .kit-meta {
        font-size: 0.56rem;
        padding: 0.12rem 0.15rem;
        white-space: normal;
        line-height: 1.25;
    }
    .kit-bench {
        margin: 0.3rem -0.35rem 0;
        padding: 0.5rem 0.35rem 0.75rem;
    }
    .planner-reset {
        margin-left: 0;
    }
}

/* /stats — private usage rollup */
.stats-summary {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.stats-table th,
.stats-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.stats-table th {
    color: var(--muted);
    font-weight: 700;
}

.stats-table td a {
    color: var(--accent);
    text-decoration: none;
}

.stats-table tbody tr:hover,
.chart-table tbody tr:hover {
    background: var(--surface-raised);
}

.landing-info p {
    margin: 0.5rem 0;
}

/* Landing tutorial clip — a touch narrower than the 600px team-ID card above it. */
.tutorial {
    width: 90%;
    max-width: 560px;
    margin: 2.25rem auto 0.5rem;
}

.tutorial-video {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card-bg);
}

.tutorial figcaption {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.45;
}

.tutorial-frame {
    position: relative;
}

.tutorial-toggle {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 1;
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    cursor: pointer;
}

.tutorial-toggle:hover,
.tutorial-toggle:focus-visible {
    background: rgba(0, 0, 0, 0.8);
}

/* Enlarged: fixed overlay, video as big as the viewport allows at its own
   1280×832 shape (832/1280 = 0.65 → width ≤ 88vh ÷ 0.65). */
.tutorial.is-expanded {
    position: fixed;
    inset: 0;
    z-index: 100;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 2, 14, 0.9);
}

.tutorial.is-expanded .tutorial-frame {
    width: min(96vw, calc(88vh / 0.65), 1280px);
}

.tutorial.is-expanded figcaption {
    color: #ddd;
}

body.tutorial-open {
    overflow: hidden;
}

.demo-link a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.demo-link a:hover {
    text-decoration: underline;
}

.share-btn {
    margin-left: 0.75rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--btn-secondary-border);
    border-radius: 6px;
    background: transparent;
    color: var(--btn-secondary-text);
    cursor: pointer;
}

.share-btn:hover {
    background: var(--surface-raised);
}

.pending-panel {
    background: var(--card-bg);
    background: color-mix(in srgb, var(--card-bg) 68%, transparent);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    max-width: 520px;
    margin: 2rem auto;
    line-height: 1.55;
}

.pending-panel .muted-note {
    color: var(--muted);
    font-size: 0.85rem;
}

.pending-panel .muted-note a {
    color: var(--accent);
}

.retry-btn {
    margin: 0.6rem 0 0.2rem;
    padding: 0.55rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    background: var(--action-green);
    color: #19051D;
    cursor: pointer;
}

.retry-btn:hover {
    opacity: 0.92;
}

.spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto 1rem;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .spinner { animation-duration: 3s; }
}

.site-footer {
    max-width: 900px;
    margin: 1.5rem auto 1rem;
    padding: 1rem 1.25rem 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.6;
    text-align: center;
}

.site-footer a {
    color: var(--muted);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.pint-link {
    color: var(--gold);
    font-weight: 700;
}

.page-nav .pint-link {
    margin-left: 0.75rem;
    color: var(--gold);
    font-size: 0.85rem;
}

.show-link-nav {
    margin-left: 0.75rem;
    padding: 0;
    min-height: auto;
    vertical-align: middle;
}

.site-footer .dot {
    margin: 0 0.4rem;
    opacity: 0.6;
}

/* ------------------------------------------------------------------------- */
/* Awards show — sequential reveal on /l/{id}/. Every slide is server-       */
/* rendered (Jinja, autoescaped) and JS only toggles [hidden]/classes — see  */
/* awards_show.js. Reuses the shared color tokens above; no new palette.     */
/* ------------------------------------------------------------------------- */

.awards-show {
    max-width: 900px;
    margin: 0 auto;
}

.show-slide {
    text-align: center;
}

.show-slide:not([hidden]) {
    animation: show-enter 350ms ease both;
}

.show-card {
    position: relative;
    background: var(--card-bg);
    background: color-mix(in srgb, var(--card-bg) 62%, transparent);
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 3rem 2rem;
    overflow: hidden;
    transform: scale(1);
    transition: transform 400ms ease;
    /* The focal point of the page — big and scales with the screen, content
       centered within it regardless of how little a given slide has to say. */
    min-height: min(68vh, 640px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Stage light — a soft radial glow behind the card's content, category-
   colored, dimmer in the teaser state and brighter once revealed. z-index -1
   (a negative-z-index positioned box paints *before* normal-flow content in
   CSS's stacking order) so it sits behind the icon/text/buttons without
   needing to touch any of them. */
.show-card::before {
    content: "";
    position: absolute;
    top: -55%;
    left: 50%;
    width: 170%;
    aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.12;
    z-index: -1;
    transition: opacity 500ms ease;
    pointer-events: none;
}

.show-award--fame .show-card::before,
.show-category--fame .show-card::before { background: radial-gradient(circle, var(--gold) 0%, transparent 70%); }
.show-award--shame .show-card::before,
.show-category--shame .show-card::before { background: radial-gradient(circle, var(--shame) 0%, transparent 70%); }
.show-award--special .show-card::before,
.show-category--special .show-card::before { background: radial-gradient(circle, var(--accent) 0%, transparent 70%); }

.show-award.is-revealed .show-card {
    transform: scale(1.035);
}

.show-award.is-revealed .show-card::before {
    opacity: 0.5;
}

/* Spotlight ray — a cone of light narrowing to a point above the stage and
   widening as it reaches the card, like a stage light snapping on to find the
   winner. Lives on .show-award (the slide), not .show-card, because the card
   has overflow:hidden (to contain the confetti) which would clip a beam
   meant to extend above it. */
.show-award {
    position: relative;
}

.show-award::before {
    content: "";
    position: absolute;
    top: -260px;
    left: 50%;
    width: 380px;
    height: 320px;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, transparent 0%, var(--accent) 100%);
    clip-path: polygon(48% 0%, 52% 0%, 90% 100%, 10% 100%);
    filter: blur(20px);
    opacity: 0;
    z-index: -1;
    transition: opacity 500ms ease;
    pointer-events: none;
}

.show-award--fame::before { background: linear-gradient(to bottom, transparent 0%, var(--gold) 100%); }
.show-award--shame::before { background: linear-gradient(to bottom, transparent 0%, var(--shame) 100%); }
.show-award--special::before { background: linear-gradient(to bottom, transparent 0%, var(--accent) 100%); }

.show-award.is-revealed::before {
    opacity: 0.55;
}

.show-kicker {
    margin: 0 0 0.4rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
    font-weight: 700;
}

.show-title {
    margin: 0 0 0.3rem;
    color: var(--accent);
    font-size: 1.6rem;
}

.show-sub {
    margin: 0 0 0.75rem;
    color: var(--muted);
}

.show-tagline {
    max-width: 380px;
    margin: 0 auto 1.75rem;
    color: var(--muted);
}

/* Buttons — shared primary/secondary treatment, min 44px tall (mobile hit
   target). Reuses the same brand-green/secondary-outline system as the rest
   of the app. */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.8rem 1.75rem;
    border: none;
    border-radius: 999px;
    background: var(--action-green);
    color: #19051D;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary:hover {
    opacity: 0.92;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.7rem 1.4rem;
    border: 1px solid var(--btn-secondary-border);
    border-radius: 999px;
    background: transparent;
    color: var(--btn-secondary-text);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--surface-raised);
}

.show-link {
    background: none;
    border: none;
    padding: 0.5rem;
    min-height: 44px;
    color: var(--muted);
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
}

.show-link:hover {
    color: var(--text);
}

/* Category transition slides */
/* Award-envelope motif — category cards only (not the per-award reveal
   cards): an inset double-line frame (border + offset outline) and an
   embossed medallion, echoing the classic gold Oscars-envelope look. */
.show-envelope::after {
    content: "";
    position: absolute;
    inset: 50px 14px 14px 14px;
    border: 1px solid var(--border);
    outline: 1px solid var(--border);
    outline-offset: 4px;
    border-radius: 10px;
    opacity: 0.5;
    pointer-events: none;
}

.show-category--fame .show-envelope::after {
    border-color: var(--gold);
    outline-color: var(--gold);
}

.show-category--shame .show-envelope::after {
    border-color: var(--shame);
    outline-color: var(--shame);
}

.show-category--special .show-envelope::after {
    border-color: var(--accent);
    outline-color: var(--accent);
}

.show-emblem {
    width: 84px;
    height: 84px;
    margin: 0 auto 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 2.4rem;
    line-height: 1;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.4), transparent 60%),
        linear-gradient(145deg, var(--gold), var(--gold));
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.5),
        inset 0 -3px 5px rgba(0, 0, 0, 0.35),
        0 6px 14px rgba(0, 0, 0, 0.35);
}

.show-category--fame .show-emblem {
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.45), transparent 60%),
        linear-gradient(145deg, #ffe9a8, var(--gold));
}

.show-category--shame .show-emblem {
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 60%),
        linear-gradient(145deg, #ff9fb6, var(--shame));
}

.show-category--special .show-emblem {
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 60%),
        linear-gradient(145deg, #d9afff, var(--accent));
}

.show-category-title {
    margin: 0 0 0.4rem;
    font-size: 1.5rem;
}

.show-category-tagline {
    max-width: 360px;
    margin: 0 auto 1.75rem;
    color: var(--muted);
}

.show-category--fame .show-category-title { color: var(--gold); }
.show-category--shame .show-category-title { color: var(--shame); }
.show-category--special .show-category-title { color: var(--accent); }

/* Award teaser + reveal */
/* The category "seal" — a solid banner across the top of the card, clipped to
   its rounded corners by .show-card's own overflow:hidden. Differentiates
   Fame/Shame/Special at a glance, not just by border/text color. */
.show-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    text-align: center;
    z-index: 1;
}

.show-category .show-card,
.show-award .show-card {
    padding-top: 4.5rem;
}

.show-category--fame .show-ribbon,
.show-award--fame .show-ribbon {
    background: var(--gold);
    color: #2A220E;
}

.show-category--shame .show-ribbon,
.show-award--shame .show-ribbon {
    background: var(--shame);
    color: #2B111B;
}

.show-category--special .show-ribbon,
.show-award--special .show-ribbon {
    background: var(--accent);
    color: #F8F6FA;
}

.show-award-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.show-award-name {
    margin: 0 0 0.3rem;
    font-size: 1.6rem;
}

.show-award-subtitle {
    margin: -0.2rem 0 0.75rem;
    color: var(--muted);
    font-style: italic;
    font-size: 0.9rem;
}

.show-award-blurb {
    max-width: 400px;
    margin: 0 auto 1.75rem;
    color: var(--muted);
    line-height: 1.5;
}

.show-award--fame .show-card { border-color: var(--gold); }
.show-award--fame .show-award-name { color: var(--gold); }
.show-award--shame .show-card { border-color: var(--shame); }
.show-award--shame .show-award-name { color: var(--shame); }
.show-award--special .show-card { border-color: var(--accent); }
.show-award--special .show-award-name { color: var(--accent); }
.show-award--special .show-eyebrow { color: var(--cyan); }

.show-reveal-panel {
    margin-top: 1rem;
}

.show-reveal-panel:not([hidden]) {
    animation: show-reveal 550ms ease both;
}

.show-reveal-kicker {
    margin: 0 0 0.3rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 700;
}

.show-reveal-winner {
    margin: 0 0 0.4rem;
    font-size: 1.9rem;
    font-weight: 800;
    overflow-wrap: break-word;
}

.show-award--fame .show-reveal-winner { color: var(--gold); }
.show-award--shame .show-reveal-winner { color: var(--shame); }
.show-award--special .show-reveal-winner { color: var(--accent); }

.show-reveal-detail {
    max-width: 400px;
    margin: 0 auto 1.5rem;
    color: var(--muted);
}

.show-award--fame .show-card { background: color-mix(in srgb, var(--gold-bg) 70%, transparent); }
.show-award--shame .show-card { background: color-mix(in srgb, var(--shame-bg) 70%, transparent); }

/* Extra ring, on top of the generic spotlight above — Fame gets a little more
   celebration than Shame/Special once revealed. */
.show-award--fame.is-revealed .show-card {
    box-shadow: 0 0 0 1px var(--gold), 0 0 32px -4px var(--gold);
}

/* Shame: a restrained shake, max 350ms, never looping. */
.show-shake {
    animation: show-card-shake 300ms ease;
}

/* Confetti — Hall of Fame only, JS-appended pieces, cleaned up after ~1s so
   it can never loop. */
.show-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: 45%;
    left: 50%;
    width: 7px;
    height: 10px;
    border-radius: 2px;
    opacity: 0;
    animation: confetti-fall 800ms ease-out both;
    animation-delay: var(--delay, 0ms);
}

/* Progress controls */
.show-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.show-back {
    min-height: 44px;
    padding: 0 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}

.show-back:hover {
    background: var(--surface-raised);
}

.show-progress-count {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.show-progress-dots {
    display: flex;
    gap: 0.1rem;
}

/* A real <button> now (click to jump to that award). This project sets
   `* { box-sizing: border-box }` globally, so width/height are the TOTAL box
   — the visible dot has to come from padding shrinking the content-box
   inward (background-clip: content-box), not from width/height directly, or
   the padding alone eats the whole box and the dot paints at zero size
   (invisible, not just small — that was the actual bug: 7px box - 18px of
   padding = a collapsed, invisible content-box). 25px box, 9px padding on
   each side, leaves the intended 7px visible dot with a comfortably large
   click target. */
.show-dot {
    width: 25px;
    height: 25px;
    padding: 9px;
    border: none;
    border-radius: 50%;
    background: var(--border);
    background-clip: content-box;
    cursor: pointer;
}

.show-dot:hover {
    background: var(--muted);
    background-clip: content-box;
}

.show-dot.is-done {
    background: var(--accent);
    background-clip: content-box;
}

.show-dot.is-current {
    background: var(--action-green);
    background-clip: content-box;
    transform: scale(1.3);
}

/* Summary slide */
.show-summary-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

/* Final "all results" grid — the existing card grid, shown after the show or
   via Skip/View all. Structurally unchanged from before this feature. */
.awards-grid-summary {
    max-width: 960px;
    margin: 0 auto;
}

.awards-grid-summary .show-summary-return {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Focus visibility inside the show — buttons/links keep a clear ring. */
#awards-show button:focus-visible,
#awards-show a:focus-visible,
.awards-grid-summary button:focus-visible,
.awards-grid-summary a:focus-visible {
    outline: 2px solid var(--action-green);
    outline-offset: 2px;
}

@keyframes show-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes show-reveal {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes show-card-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(3px); }
}

@keyframes confetti-fall {
    0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
    100% {
        opacity: 0;
        transform: translate(var(--x, 0), 140px) rotate(var(--rot, 180deg));
    }
}

@media (prefers-reduced-motion: reduce) {
    .show-slide:not([hidden]),
    .show-reveal-panel:not([hidden]),
    .show-shake,
    .confetti-piece {
        animation: none !important;
    }

    /* The reveal moment still gets bigger/brighter — just instantly, not
       animated into place. */
    .show-card,
    .show-card::before,
    .show-award::before {
        transition: none !important;
    }
}

@media (max-width: 420px) {
    .show-card {
        padding: 2rem 1.25rem;
        min-height: min(60vh, 520px);
    }

    .show-award-icon {
        font-size: 2.5rem;
    }

    .show-reveal-winner {
        font-size: 1.5rem;
    }

    /* Scaled down so the beam can't overflow a narrow viewport horizontally
       — it's position:absolute, so a full-size beam here would cause a
       sideways scrollbar rather than just clipping. */
    .show-award::before {
        top: -160px;
        width: 220px;
        height: 190px;
        filter: blur(14px);
    }
}

/* --- Best Value-for-Money XI: smaller jerseys in the narrower column --- */
.kit-pitch--compact {
    gap: 0.8rem;
    padding: 1rem 0.5rem 1rem;
}

.kit-pitch--compact .kit-row {
    gap: 0.35rem;
}

.kit-pitch--compact .kit {
    flex-basis: 92px;
}

.kit-pitch--compact .kit-shirt {
    width: 50px;
    height: 47px;
}

.kit-pitch--compact .kit-name {
    font-size: 0.7rem;
}

.kit-pitch--compact .kit-meta {
    font-size: 0.6rem;
    background: #0B8A4A;
}

/* Waiting for "tap who to replace" after + in the player list. */
.kit--eligible .kit-shirt {
    filter: drop-shadow(0 0 7px #FFE08A);
}

.kit--eligible .kit-name {
    background: #FFE08A;
}

/* --- player list --- */
.pl-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.pl-filters label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.pl-filters select {
    width: 100%;
    font: inherit;
    font-size: 0.85rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.35rem 0.4rem;
}

.pl-filters .planner-search {
    grid-column: 1 / -1;
    margin: 0.1rem 0 0;
}

.pl-count {
    margin: 0.5rem 0 0.35rem;
    font-size: 0.72rem;
    color: var(--muted);
}

.pl-table-wrap {
    max-height: 460px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
}

.pl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.pl-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.45rem 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: var(--surface-raised, var(--card-bg));
    border-bottom: 1px solid var(--border);
}

.pl-table th:nth-child(2) {
    text-align: left;
}

.pl-table td {
    padding: 0.35rem 0.4rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.pl-table tr:last-child td {
    border-bottom: 0;
}

.pl-table td.pl-name {
    text-align: left;
    white-space: normal;
}

.pl-name strong {
    display: block;
    font-size: 0.82rem;
}

.pl-name span {
    font-size: 0.68rem;
    color: var(--muted);
}

.pl-table td.pl-ppm {
    font-weight: 700;
    color: var(--action-green);
}

.pl-add {
    width: 1.7rem;
    height: 1.7rem;
    font: inherit;
    font-weight: 700;
    line-height: 1;
    color: #19051D;
    background: var(--action-green);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.pl-add:disabled {
    cursor: default;
    color: var(--muted);
    background: var(--border);
}

/* Muted text, not opacity — a see-through pinned cell would show the scrolled stats behind it. */
.pl-owned td,
.pl-owned .pl-name strong,
.pl-owned td.pl-ppm {
    color: var(--muted);
}

.pl-toast {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    z-index: 50;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: calc(100vw - 2rem);
    padding: 0.65rem 0.9rem;
    font-size: 0.85rem;
    color: #fff;
    background: #37003C;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.pl-toast .planner-cancel {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 640px) {
    .pl-filters {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .pl-table th:nth-child(6),
    .pl-table td:nth-child(6),
    .pl-table th:nth-child(7),
    .pl-table td:nth-child(7) {
        display: none;
    }
    .kit-pitch--compact .kit-shirt {
        width: 40px;
        height: 37px;
    }
}

/* --- next-fixture chips (FPL difficulty colours) --- */
.fdr {
    display: inline-block;
    min-width: 0;
    padding: 0.05rem 0.15rem;
    font-size: 0.56rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    border-radius: 3px;
}

.fdr-1 { background: #375523; color: #fff; }
.fdr-2 { background: #01FC7A; color: #0B1A0F; }
.fdr-3 { background: #E7E7E7; color: #1F1F1F; }
.fdr-4 { background: #FF1751; color: #fff; }
.fdr-5 { background: #80072D; color: #fff; }

.kit-fix {
    display: flex;
    width: 100%;
    gap: 1px;
    margin-top: 2px;
}

.kit-fix:empty {
    display: none;
}

.kit-fix .fdr {
    flex: 1 1 0;
    overflow: hidden;
    padding: 0.05rem 0;
}

.fdr-legend {
    margin: 0.4rem 0 0;
    font-size: 0.72rem;
    color: var(--muted);
}

.fdr-legend .fdr {
    width: 1.1rem;
    margin-left: 2px;
}

/* --- player list: stats scroll sideways, + and player name stay pinned --- */
.pl-table {
    min-width: 640px;
}

.pl-table th:first-child,
.pl-table td:first-child,
.pl-table th:nth-child(2),
.pl-table td:nth-child(2) {
    position: sticky;
    z-index: 2;
    background: var(--card-bg);
}

.pl-table th:first-child,
.pl-table td:first-child {
    left: 0;
    width: 2.4rem;
    min-width: 2.4rem;
}

.pl-table th:nth-child(2),
.pl-table td:nth-child(2) {
    left: 2.4rem;
    min-width: 8.5rem;
    max-width: 8.5rem;
    box-shadow: 6px 0 6px -6px rgba(0, 0, 0, 0.5);
}

.pl-table thead th:first-child,
.pl-table thead th:nth-child(2) {
    z-index: 3;  /* the pinned corner sits above both sticky header and sticky column */
    background: var(--surface-raised, var(--bg));
}

.pl-table td.pl-name strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-table th.pl-fix-head {
    text-align: left;
}

.pl-table td.pl-fix {
    text-align: left;
}

.pl-table td.pl-fix .fdr {
    width: 2rem;
    margin-right: 2px;
    font-size: 0.62rem;
}

/* Phones: five chips can't fit under a ~60px jersey, so show the next three. */
@media (max-width: 640px) {
    .kit-fix .fdr {
        font-size: 0.5rem;
    }
    .kit-fix .fdr:nth-child(n + 4) {
        display: none;
    }
}

/* Compact (value XI) jerseys: all-caps initials need a touch smaller type to fit 5. */
.kit-pitch--compact .kit-fix {
    gap: 1px;
}

.kit-pitch--compact .kit-fix .fdr {
    font-size: 0.46rem;
    letter-spacing: -0.02em;
}

/* --- /l/{id}/hub: pick awards show or league stats --- */
.league-hub {
    max-width: 760px;
    text-align: center;
}

.hub-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 0.5rem;
}

.hub-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 2rem 1.25rem;
    color: var(--text);
    text-decoration: none;
    background: var(--card-bg);
    background: color-mix(in srgb, var(--card-bg) 68%, transparent);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: border-color 0.12s ease, transform 0.12s ease;
}

a.hub-choice:hover,
a.hub-choice:focus-visible {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.hub-choice-icon {
    font-size: 2.4rem;
    line-height: 1;
}

.hub-choice-title {
    font-size: 1.2rem;
    font-weight: 800;
}

.hub-choice-sub {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.4;
}

.hub-choice--disabled {
    opacity: 0.55;
}

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

/* Manager of the Gameweek dugout: runner-up + third under the winner. */
.dugout-podium {
    list-style: none;
    margin: 0.6rem 0 0.2rem;
    padding: 0.55rem 0 0;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    text-align: left;
}

.dugout-podium li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
}

.dugout-podium-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dugout-podium-score {
    font-weight: 700;
    color: var(--muted);
}

/* /stats Features tables */
.feature-table {
    margin-bottom: 1rem;
}

.feature-table tr.feature-unused td {
    color: var(--muted);
}

/* --- MVP Bravo 2: share an award as a sticker ------------------------------ */
.award-share {
    margin-top: 1rem;
    text-align: center;
}

.award-share .share-btn {
    margin-left: 0;
}

.award-share-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.award-share-menu .btn-secondary,
.award-share-menu .btn-primary {
    min-height: 40px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.award-share-menu .btn-primary[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.award-share-status {
    flex-basis: 100%;
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.award-share-status:empty {
    display: none;
}

.show-reveal-commentary,
.share-commentary {
    max-width: 420px;
    margin: -0.75rem auto 1.25rem;
    font-style: italic;
    font-weight: 600;
    line-height: 1.45;
}

.show-award--fame .show-reveal-commentary { color: var(--gold); }
.show-award--shame .show-reveal-commentary { color: var(--shame); }
.show-award--special .show-reveal-commentary { color: var(--accent); }

.award-card .award-share {
    margin-top: 0.6rem;
}

/* The share page: one sealed sticker, tap to burst it open. */
.share-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 1.5rem 16px 2rem;
    text-align: center;
}

.share-stage {
    --share-accent: var(--accent);
    position: relative;
    padding: 1.5rem 1rem 2rem;
    border: 2px solid var(--share-accent);
    border-radius: 20px;
    background: var(--card-bg);
    overflow: hidden;
}

.share-stage--fame { --share-accent: var(--gold); }
.share-stage--shame { --share-accent: var(--shame); }
.share-stage--special { --share-accent: var(--cyan); }

.share-award-name {
    margin: 0 0 0.3rem;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--share-accent);
}

.share-award-blurb {
    max-width: 420px;
    margin: 0 auto 1.25rem;
    color: var(--muted);
}

.share-sticker {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    padding: 0.5rem;
    border: none;
    background: none;
    color: var(--text);
    cursor: pointer;
    animation: share-wobble 1.6s ease-in-out infinite;
}

.share-sticker-disc {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(62vw, 240px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: #37003C;
    border: 22px solid var(--share-accent);
    box-shadow: 0 0 0 9px #F8F6FA, 0 14px 30px rgba(0, 0, 0, 0.35);
}

.share-sticker-icon {
    font-size: min(22vw, 5.5rem);
    line-height: 1;
}

.share-sticker-hint {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--share-accent);
}

.share-stage.is-open .share-sticker {
    animation: share-pop 420ms ease-in forwards;
}

.share-burst {
    position: absolute;
    top: 45%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}

.share-shard {
    position: absolute;
    width: 10px;
    height: 7px;
    border-radius: 2px;
    animation: share-shard 1s cubic-bezier(0.1, 0.7, 0.3, 1) forwards;
}

.share-reveal:not([hidden]) {
    animation: show-reveal 550ms ease both;
}

.share-winner {
    margin: 0 0 0.4rem;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--share-accent);
    overflow-wrap: break-word;
}

.share-detail {
    max-width: 420px;
    margin: 0 auto 1.5rem;
    color: var(--muted);
}

.share-commentary {
    margin-top: -0.5rem;
    color: var(--share-accent);
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

@keyframes share-wobble {
    0%, 100% { transform: rotate(0deg) scale(1); }
    20% { transform: rotate(-4deg) scale(1.02); }
    40% { transform: rotate(3deg) scale(1); }
    60% { transform: rotate(-2deg) scale(1.02); }
    80% { transform: rotate(1deg) scale(1); }
}

@keyframes share-pop {
    0% { transform: scale(1); opacity: 1; }
    60% { transform: scale(1.25) rotate(8deg); opacity: 1; }
    100% { transform: scale(1.7); opacity: 0; }
}

@keyframes share-shard {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .share-sticker,
    .share-stage.is-open .share-sticker,
    .share-reveal:not([hidden]) {
        animation: none !important;
    }
}
.share-actions a,
.award-share-menu a {
    text-decoration: none;
}

/* "Sunil Ramjali's" — small, above the winning team name on a reveal. */
.show-reveal-manager {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
    overflow-wrap: break-word;
}

/* Grid card: the manager in small type above the team, like the reveal. */
.winner-manager {
    margin: 0 0 0.1rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    overflow-wrap: break-word;
}

/* "You" — the viewer's own team, matched in the browser by me_highlight.js
   against the team ID saved on the team page. */
.me-badge {
    display: inline-block;
    flex: none;
    margin-left: 0.4em;
    padding: 0.1em 0.5em;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.6em;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
    line-height: 1.5;
}

.award-card.has-me,
.dugout.has-me {
    box-shadow: 0 0 0 2px var(--accent);
}

text.is-me {
    font-weight: 700;
    text-decoration: underline;
}

tr.is-me th,
tr.is-me td {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    font-weight: 700;
}
