/* ==========================================================
   TRIPLE F — FANTASY PICKS
   PREMIUM SPORTS APP UI — v2
   CSS ONLY

   Design language:
   - Display type: Archivo Black (headlines, scores)
   - Label type:   Barlow Condensed (eyebrows, nav, badges)
   - Body type:    Inter
   - Signature:    mowed-pitch stripe texture + scoreboard
                   digit treatment for scores/points
========================================================== */

@import url("https://fonts.googleapis.com/css2?family=Archivo+Black&family=Barlow+Condensed:wght@600;700;800&family=Inter:wght@400;500;600;700;800;900&display=swap");


/* ==========================================================
   01. DESIGN SYSTEM
========================================================== */

:root {
    /* Triple F core */
    --fff-purple: #240155;
    --fff-purple-2: #37003c;
    --fff-purple-3: #4e075a;
    --fff-purple-dark: #12001f;

    --fff-teal: #0ca697;
    --fff-teal-bright: #00d6c3;

    /* Signature accent — this is the "loud" color, used with intent */
    --pitch-green: #00ff87;
    --pitch-green-dark: #00b862;

    /* Secondary accents, used sparingly and only where named */
    --electric-blue: #05f0ff;
    --electric-pink: #ff2882;
    --electric-lilac: #953bff;
    --electric-yellow: #ebff00;

    /* Surfaces */
    --white: #ffffff;
    --off-white: #faf9fa;
    --surface-1: #f7f4f8;
    --surface-2: #f0ebf2;
    --surface-3: #e8e0eb;

    /* Scoreboard surfaces (dark, for score/points readouts) */
    --board: #170027;
    --board-2: #260140;

    /* Text */
    --ink: #171118;
    --ink-soft: #55495a;
    --ink-muted: #746a79;

    /* Functional */
    --success: #00c978;
    --danger: #ff285f;
    --warning: #d99400;

    /* Type */
    --font-display: "Archivo Black", "Arial Black", sans-serif;
    --font-label: "Barlow Condensed", "Inter", sans-serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

    /* Layout */
    --shell: 1240px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    --space-9: 48px;
    --space-10: 64px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-card: 0 2px 5px rgba(36, 1, 85, .04), 0 10px 30px rgba(36, 1, 85, .07);
    --shadow-card-hover: 0 5px 12px rgba(36, 1, 85, .08), 0 20px 45px rgba(36, 1, 85, .13);
    --shadow-purple: 0 14px 35px rgba(36, 1, 85, .24);
    --shadow-teal: 0 8px 22px rgba(12, 166, 151, .26);
    --shadow-board: inset 0 0 0 1px rgba(0, 255, 135, .18), 0 8px 20px rgba(0, 0, 0, .35);

    /* Motion */
    --ease: cubic-bezier(.2, .8, .2, 1);

    /* Nav */
    --mobile-nav-height: 72px;

    /* Signature pitch-stripe texture, tuned per-surface via background-size */
    --pitch-stripe: repeating-linear-gradient(
        115deg,
        rgba(255, 255, 255, .035) 0px,
        rgba(255, 255, 255, .035) 34px,
        rgba(255, 255, 255, 0) 34px,
        rgba(255, 255, 255, 0) 68px
    );
}


/* ==========================================================
   02. GLOBAL RESET
========================================================== */

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

html {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: linear-gradient(135deg, #eee8f0 0%, #faf9fa 38%, #f4f0f5 100%);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-variant-numeric: tabular-nums;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    display: block;
}


/* ==========================================================
   03. APP SHELL
========================================================== */

main {
    position: relative;
    width: min(calc(100% - 48px), var(--shell));
    min-height: 100vh;
    margin: 28px auto 80px;
    padding: 0 32px 56px;
    overflow: hidden;
    background: var(--white);
    border: 1px solid rgba(55, 0, 60, .08);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(55, 0, 60, .10);
}


/* ==========================================================
   04. (removed) — the masthead used to duplicate the logo in
   a purple strip above the nav. The logo now lives once,
   inside the header bar itself (see section 07). The purple
   "ground" is now provided by the hero band — .pl-header-banner
   where a page defines one, or the automatic hero rule in
   section 08B for pages that just render a plain <h1>.
========================================================== */


/* ==========================================================
   05. PAGE SYSTEM
========================================================== */

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fff-page-in 220ms var(--ease);
}

@keyframes fff-page-in {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ==========================================================
   06. TYPOGRAPHY
========================================================== */

h1,
h2,
h3,
h4 {
    margin-top: 0;
    color: var(--fff-purple);
    font-family: var(--font-display);
    font-weight: 400; /* Archivo Black is already heavy at 400 */
    line-height: 1.04;
    letter-spacing: -.01em;
    text-transform: uppercase;
}

h1 { font-size: clamp(30px, 4vw, 46px); }
h2 { font-size: clamp(23px, 3vw, 30px); }
h3 { font-size: clamp(17px, 2vw, 21px); }

p {
    color: var(--ink-soft);
    font-family: var(--font-body);
}

/* Eyebrows / section labels — condensed, wide, sits between h-tags and body */
.eyebrow {
    display: inline-block;
    margin-bottom: var(--space-2);
    color: var(--fff-teal);
    font-family: var(--font-label);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}


/* ==========================================================
   HEADER + NAVIGATION
   One clean full-width sports header
========================================================== */

.app-header {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid rgba(55, 0, 60, 0.06);
}

.app-header__inner {
    width: min(calc(100% - 40px), 1240px);
    height: 96px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;
}

#header-logo,
.app-logo {
    width: auto;
    height: 68px;
    max-width: 340px;

    object-fit: contain;
}


/* ==========================================================
   MAIN NAV
========================================================== */

#main-nav {
    position: sticky;
    top: 0;
    z-index: 500;

    width: 100%;

    margin: 0;
    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    background: rgba(255, 255, 255, 0.97);

    border: 0;
    border-bottom: 1px solid rgba(55, 0, 60, 0.10);

    border-radius: 0;
    box-shadow: none;

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}


/* Kill old fake logo */

#main-nav::before {
    display: none !important;
}


/* ==========================================================
   NAV ITEMS
========================================================== */

.nav-btn {
    position: relative;

    min-height: 54px;

    padding: 0 22px;

    border: 0;
    border-radius: 0;

    background: transparent;

    color: var(--ink-muted);

    font-family: var(--font-label);
    font-size: 15px;
    font-weight: 700;

    letter-spacing: 0.04em;
    text-transform: uppercase;

    cursor: pointer;

    transition:
        color 160ms var(--ease),
        background-color 160ms var(--ease);
}

/* ==========================================================
   SIGN IN NAV CTA
========================================================== */

#btn-signin {
    min-height: 40px;

    margin: 6px 8px;

    padding: 0 20px;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            var(--fff-purple) 0%,
            var(--fff-purple-2) 65%,
            #541063 100%
        );

    border: 1px solid rgba(255, 255, 255, 0.12);

    border-radius: 999px;

    box-shadow:
        0 5px 14px rgba(36, 1, 85, 0.22);

    font-weight: 800;

    transition:
        transform 160ms var(--ease),
        box-shadow 160ms var(--ease),
        background 160ms var(--ease);
}


/* Sign-in status accent — real markup, not a pseudo-element */

#btn-signin::before {
    display: none;
}

.signin-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--pitch-green);
    box-shadow: 0 0 8px rgba(0, 255, 135, 0.65);
}

.signin-label {
    line-height: 1;
}


/* Hover */

#btn-signin:hover {
    color: #ffffff;

    transform: translateY(-2px);

    background:
        linear-gradient(
            135deg,
            #2d0169,
            #47034f
        );

    box-shadow:
        0 8px 20px rgba(36, 1, 85, 0.30);
}


/* Don't use the normal active underline */

#btn-signin.active-btn::after {
    display: none;
}


/* Active sign-in page */

#btn-signin.active-btn {
    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            var(--fff-purple),
            var(--fff-purple-2)
        );

    box-shadow:
        0 0 0 3px rgba(0, 255, 135, 0.16),
        0 7px 18px rgba(36, 1, 85, 0.25);
}


/* Press */

#btn-signin:active {
    transform: translateY(0) scale(0.98);
}

.nav-btn:hover {
    color: var(--fff-purple);
    background: rgba(36, 1, 85, 0.035);
}

@media (max-width: 640px) {

    #btn-signin {
        min-height: 36px;

        margin: 7px 3px;

        padding: 0 10px;

        border-radius: 999px;

        font-size: 10px;
    }

    .signin-dot {
        width: 6px;
        height: 6px;
        flex-basis: 6px;
        margin-right: 5px;
    }

}


/* Active page */

.nav-btn.active-btn {
    color: var(--fff-purple);
    background: transparent;
    box-shadow: none;
}

.nav-btn.active-btn::after {
    content: "";

    position: absolute;

    left: 18px;
    right: 18px;
    bottom: 0;

    height: 4px;

    border-radius: 4px 4px 0 0;

    background:
        linear-gradient(
            90deg,
            var(--fff-teal),
            var(--pitch-green)
        );
}


/* ==========================================================
   DESKTOP CONTENT SPACING
========================================================== */

main {
    margin-top: 24px;
}


/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 840px) {

    .app-header__inner {
        height: 84px;
    }

    #header-logo,
    .app-logo {
        height: 58px;
    }

    #main-nav {
        padding: 0 12px;
    }

    .nav-btn {
        min-height: 52px;
        padding: 0 14px;
        font-size: 13px;
    }
}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 640px) {

    .app-header {
        position: relative;
        z-index: 600;
    }

    .app-header__inner {
        width: 100%;
        height: 74px;

        padding: 10px 16px;
    }

    #header-logo,
    .app-logo {
        height: 50px;
        max-width: 250px;
    }


    /* Keep navigation at TOP */

    #main-nav {
        position: sticky;

        top: 0;
        bottom: auto;

        width: 100%;
        min-height: 50px;

        margin: 0;
        padding: 0 4px;

        display: flex;

        background: rgba(255, 255, 255, 0.98);

        border: 0;
        border-bottom: 1px solid rgba(55, 0, 60, 0.10);

        border-radius: 0;

        box-shadow:
            0 4px 14px rgba(36, 1, 85, 0.06);
    }


    .nav-btn {
        flex: 1;

        min-width: 0;
        min-height: 50px;

        padding: 0 4px;

        border-radius: 0;

        font-size: 11px;
        line-height: 1;

        white-space: nowrap;
    }


    .nav-btn.active-btn {
        color: var(--fff-purple);
        background: rgba(12, 166, 151, 0.06);
    }


    .nav-btn.active-btn::after {
        left: 10px;
        right: 10px;

        top: auto;
        bottom: 0;

        width: auto;
        height: 3px;

        transform: none;

        background: var(--pitch-green);
    }


    /* Remove old bottom-nav spacing */

    main {
        padding-bottom: 40px;
    }
}


/* ==========================================================
   08. GAMEWEEK / PAGE HERO
========================================================== */

.pl-header-banner {
    position: relative;
    margin: 0 0 32px;
    padding: 40px 36px;
    overflow: hidden;
    color: var(--white);
    border-radius: var(--radius-lg);
    background:
        var(--pitch-stripe),
        radial-gradient(circle at 83% -30%, rgba(5, 240, 255, .30), transparent 44%),
        radial-gradient(circle at 0% 100%, rgba(0, 255, 135, .20), transparent 34%),
        linear-gradient(120deg, #240155 0%, #37003c 44%, #6820a9 100%);
    box-shadow: var(--shadow-purple);
}

.pl-header-banner::before {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    right: -90px;
    top: -120px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 50%;
}

.pl-header-banner::after {
    content: "";
    position: absolute;
    left: 36px;
    bottom: 0;
    width: 110px;
    height: 4px;
    border-radius: 999px 999px 0 0;
    background: var(--pitch-green);
}

.pl-header-banner h1,
.pl-header-banner h2,
.pl-header-banner h3 {
    position: relative;
    z-index: 2;
    color: var(--white);
}

.pl-header-banner .eyebrow {
    position: relative;
    z-index: 2;
    color: var(--pitch-green);
}

.pl-header-banner p {
    position: relative;
    z-index: 2;
    max-width: 620px;
    color: rgba(255, 255, 255, .82);
}


/* ==========================================================
   08B. AUTO HERO — for pages with a bare page-title <h1>
   Some pages (e.g. Stats) render their title as a plain h1
   with no .pl-header-banner wrapper, so it fell back to dark
   text on white. This targets that exact case — a page-title
   h1 that is a DIRECT child of .page — and gives it the same
   purple/white treatment as .pl-header-banner. It never
   matches an h1 nested inside .pl-header-banner (that h1 is a
   grandchild of .page, not a direct child), so the two rules
   don't fight each other.
========================================================== */

.page.active > h1:first-child {
    position: relative;
    margin: 0 0 32px;
    padding: 36px 32px;
    overflow: hidden;
    color: var(--white);
    border-radius: var(--radius-lg);
    background:
        var(--pitch-stripe),
        radial-gradient(circle at 83% -30%, rgba(5, 240, 255, .30), transparent 44%),
        radial-gradient(circle at 0% 100%, rgba(0, 255, 135, .20), transparent 34%),
        linear-gradient(120deg, #240155 0%, #37003c 44%, #6820a9 100%);
    box-shadow: var(--shadow-purple);
}

.page.active > h1:first-child + p {
    margin-top: -20px;
    margin-bottom: 32px;
}


/* ==========================================================
   09. FIXTURE CONTAINER
========================================================== */

#fixtures-container {
    position: relative;
    width: 100%;
    padding: 4px 0 28px;
}


/* ==========================================================
   10. MATCH CARDS
========================================================== */

.match-card,
.admin-match-card {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    min-height: 94px;
    margin-bottom: 14px;
    padding: 20px 22px 20px 26px;
    overflow: hidden;
    background: linear-gradient(105deg, #ffffff 0%, #ffffff 72%, #fbf9fc 100%);
    border: 1px solid rgba(55, 0, 60, .10);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    isolation: isolate;
    transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}

/* branded edge */
.match-card::before,
.admin-match-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 5px;
    border-radius: 0 999px 999px 0;
    background: linear-gradient(180deg, var(--fff-teal-bright), var(--fff-purple));
}

/* subtle glow */
.match-card::after,
.admin-match-card::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 130px;
    height: 130px;
    right: -55px;
    top: -55px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(12, 166, 151, .10), transparent 70%);
}

.match-card:hover,
.admin-match-card:hover {
    transform: translateY(-3px);
    border-color: rgba(12, 166, 151, .36);
    box-shadow: var(--shadow-card-hover);
}

.match-card strong,
.admin-match-card strong {
    color: var(--fff-purple);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.01em;
}


/* ==========================================================
   11. SCORE INPUTS — scoreboard treatment (signature)
   A stadium scoreboard reads dark with glowing digits.
   The score entry leans into that instead of looking like
   a generic form field, so the most important interaction
   on the page carries the most visual weight.
========================================================== */

input[type="number"] {
    width: 54px;
    height: 54px;
    margin: 0;
    padding: 0;
    appearance: textfield;
    -moz-appearance: textfield;
    text-align: center;
    color: var(--pitch-green);
    background: linear-gradient(180deg, var(--board-2), var(--board));
    border: 1px solid rgba(0, 255, 135, .22);
    border-radius: 11px;
    box-shadow: var(--shadow-board);
    font-family: var(--font-display);
    font-size: 21px;
    font-variant-numeric: tabular-nums;
    transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease), transform 150ms var(--ease);
}

input[type="number"]:hover {
    border-color: var(--pitch-green);
}

input[type="number"]:focus {
    outline: 0;
    transform: translateY(-1px);
    border-color: var(--pitch-green);
    box-shadow: 0 0 0 4px rgba(0, 255, 135, .18), 0 10px 22px rgba(0, 0, 0, .35);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}


/* ==========================================================
   11B. SELECT / DROPDOWN
   These were rendering white text on a white box (invisible)
   — e.g. "Select Gameweek". Given real, visible styling here.
========================================================== */

select {
    min-height: 48px;
    width: 100%;
    max-width: 280px;
    margin: 0;
    padding: 10px 42px 10px 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    color: var(--ink);
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23240155' stroke-width='2'%3E%3Cpath d='M5 7l5 5 5-5'/%3E%3C/svg%3E")
        right 14px center / 14px no-repeat,
        var(--white);
    border: 1px solid rgba(55, 0, 60, .22);
    border-radius: 10px;
    box-shadow: inset 0 1px 2px rgba(55, 0, 60, .04);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

select option {
    color: var(--ink);
    background: var(--white);
}

select:hover {
    border-color: var(--fff-teal);
}

select:focus {
    outline: 0;
    border-color: var(--fff-teal-bright);
    box-shadow: 0 0 0 4px rgba(12, 166, 151, .13);
}



/* ==========================================================
   11C. PAGE CONTENT WIDTHS / SPACING
========================================================== */

.content-column {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.content-column--fixtures,
.content-column--stats,
.content-column--admin {
    max-width: 920px;
}

.content-column--table {
    max-width: 1160px;
}


/* ==========================================================
   11D. SIGN IN / AUTH
========================================================== */

.page--signin .page-hero--signin {
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}

.page--signin .auth-panel {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 36px 20px 56px;
    text-align: center;
}

.auth-panel__content {
    width: 100%;
}

.auth-panel__title {
    margin: 0 0 10px;
    color: var(--fff-purple);
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 36px);
    line-height: 1.05;
    text-transform: none;
}

.auth-panel__copy {
    max-width: 400px;
    margin: 0 auto 30px;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.5;
}

.auth-button {
    appearance: none;
    -webkit-appearance: none;
}

.auth-button--google {
    width: 100%;
    min-height: 52px;
    padding: 0 24px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    color: var(--fff-purple);
    background: transparent;

    border: 1.5px solid var(--fff-purple);
    border-radius: 999px;

    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background-color 160ms var(--ease),
        color 160ms var(--ease),
        border-color 160ms var(--ease),
        box-shadow 160ms var(--ease),
        transform 160ms var(--ease);
}

.auth-button__icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-button__icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

.auth-button__label {
    line-height: 1;
}

.auth-button--google:hover {
    color: var(--fff-purple);
    background: rgba(36, 1, 85, .035);
    border-color: var(--fff-teal);
    box-shadow: 0 5px 18px rgba(36, 1, 85, .10);
    transform: translateY(-1px);
}

.auth-button--google:active {
    transform: translateY(0) scale(.99);
}

.auth-button--google:focus-visible {
    outline: none;
    border-color: var(--fff-teal);
    box-shadow: 0 0 0 4px rgba(12, 166, 151, .13);
}

.user-profile {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--surface-3);
}

.user-profile__welcome {
    margin: 0 0 18px;
    color: var(--ink-soft);
}

.user-profile__welcome strong {
    color: var(--fff-purple);
}


/* ==========================================================
   11E. GENERIC FIELDS / BUTTONS
========================================================== */

.field-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.field-label {
    color: var(--fff-purple);
    font-family: var(--font-label);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.btn-primary,
.btn-secondary {
    min-height: 48px;
    padding: 0 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border-radius: 10px;

    font-family: var(--font-label);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;

    cursor: pointer;

    transition:
        transform 150ms var(--ease),
        box-shadow 150ms var(--ease),
        background-color 150ms var(--ease),
        border-color 150ms var(--ease);
}

.btn-primary {
    color: var(--white);
    background: linear-gradient(105deg, var(--fff-purple), var(--fff-purple-2));
    border: 1px solid transparent;
    box-shadow: 0 8px 20px rgba(36, 1, 85, .20);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(36, 1, 85, .26);
}

.btn-secondary {
    color: var(--fff-purple);
    background: transparent;
    border: 1px solid rgba(55, 0, 60, .28);
}

.btn-secondary:hover {
    background: rgba(36, 1, 85, .04);
    border-color: var(--fff-teal);
}


/* ==========================================================
   11F. STATS PAGE
========================================================== */

.stats-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.stats-summary-card {
    width: 100%;
    margin-bottom: 32px;
    padding: 22px 24px;

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: 24px;

    background: linear-gradient(135deg, var(--board-2), var(--board));
    border: 1px solid rgba(0, 255, 135, .16);
    border-radius: 16px;
    box-shadow: var(--shadow-board);
}

.stat-block {
    min-height: 88px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;

    text-align: center;
}

.stat-block__label {
    color: rgba(255, 255, 255, .68);
    font-family: var(--font-label);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.stat-block__value {
    color: var(--pitch-green);
    font-family: var(--font-display);
    font-size: 34px;
    line-height: 1;
}

.stat-block__status {
    color: var(--white);
    font-family: var(--font-label);
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
}

.stat-divider {
    width: 1px;
    background: rgba(255, 255, 255, .12);
}

.history-panel {
    margin-top: 8px;
}

.section-heading {
    margin-bottom: 16px;
}

.section-heading h2 {
    margin-bottom: 0;
}

.stats-history-container,
.admin-fixtures-container {
    width: 100%;
}

.empty-state {
    margin: 0;
    padding: 24px;

    text-align: center;

    color: var(--ink-muted);
    background: var(--surface-1);

    border: 1px dashed rgba(55, 0, 60, .18);
    border-radius: 12px;
}


/* ==========================================================
   11G. ADMIN PAGE
========================================================== */

.admin-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 28px;
}

.admin-toolbar .field-group {
    flex: 0 0 160px;
}

#admin-gw-input {
    width: 100%;
}

.admin-load-button {
    min-width: 170px;
}


/* ==========================================================
   12. PRIMARY ACTION
========================================================== */

#btn-submit-picks,
.btn-save-official,
button[onclick^="saveOfficial"] {
    position: relative;
    width: 100%;
    min-height: 56px;
    margin-top: 24px;
    padding: 15px 22px;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    color: var(--white);
    background: linear-gradient(105deg, #240155 0%, #37003c 55%, #4b0755 100%);
    box-shadow: 0 10px 28px rgba(36, 1, 85, .25);
    font-family: var(--font-label);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 150ms var(--ease), box-shadow 150ms var(--ease);
}

#btn-submit-picks::after,
.btn-save-official::after,
button[onclick^="saveOfficial"]::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--fff-teal-bright), var(--pitch-green), var(--electric-blue));
}

#btn-submit-picks:hover,
.btn-save-official:hover,
button[onclick^="saveOfficial"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(36, 1, 85, .31);
}

#btn-submit-picks:active,
.btn-save-official:active,
button[onclick^="saveOfficial"]:active {
    transform: translateY(1px) scale(.995);
}

#btn-submit-picks:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* NOTE: button[onclick^="saveOfficial"] is kept only for backward
   compatibility with existing markup. Prefer adding class
   "btn-save-official" to the button and dropping the attribute
   selector — styling should never depend on an inline JS handler. */


/* ==========================================================
   13. STATUS BADGES
========================================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 12px;
    border-radius: 999px;
    font-family: var(--font-label);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.status-open {
    color: var(--fff-purple);
    background: var(--pitch-green);
}

.status-locked {
    color: var(--white);
    background: var(--ink-muted);
}

.status-live {
    position: relative;
    color: var(--white);
    background: var(--electric-pink);
    box-shadow: 0 0 0 4px rgba(255, 40, 130, .12);
}

/* floodlight pulse — the one moving element on the page,
   reserved for "this match is happening right now" */
.status-live::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--white);
    animation: fff-live-pulse 1.4s ease-in-out infinite;
}

@keyframes fff-live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .35; transform: scale(1.4); }
}


/* ==========================================================
   14. TABLE VIEW TOGGLE
========================================================== */

.table-toggle-container {
    padding: 4px 0 20px;
}

.toggle-bg {
    display: flex;
    width: 100%;
    gap: 4px;
    padding: 4px;
    background: var(--surface-1);
    border: 1px solid var(--surface-3);
    border-radius: 12px;
}

.toggle-btn {
    flex: 1;
    min-height: 42px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink-muted);
    font-family: var(--font-label);
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    cursor: pointer;
    transition: color 150ms var(--ease), background 150ms var(--ease);
}

.toggle-btn:hover {
    color: var(--fff-purple);
}

.toggle-btn.active {
    color: var(--fff-purple);
    background: var(--white);
    box-shadow: 0 4px 12px rgba(36, 1, 85, .09);
}


/* ==========================================================
   15. LEADERBOARD CONTAINER
========================================================== */

.table-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--white);
    border: 1px solid rgba(55, 0, 60, .10);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
}

.table-container::before {
    content: "";
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--fff-purple), var(--electric-lilac), var(--fff-teal-bright));
}


/* ==========================================================
   16. LEADERBOARD TABLE
========================================================== */

.standings-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.standings-table thead {
    background: linear-gradient(180deg, #faf8fb, #f5f1f6);
}

.standings-table th {
    padding: 16px 14px;
    color: var(--ink-muted);
    border-bottom: 1px solid var(--surface-3);
    font-family: var(--font-label);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
}

.standings-table td {
    padding: 17px 14px;
    color: var(--ink);
    border-bottom: 1px solid rgba(55, 0, 60, .07);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    text-align: center;
    vertical-align: middle;
    transition: background 130ms var(--ease);
}

.standings-table tbody tr {
    position: relative;
}

.standings-table tbody tr:hover td {
    background: rgba(36, 1, 85, .027);
}

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


/* ==========================================================
   17. PLAYER / POSITION / POINTS COLUMNS
========================================================== */

.standings-table th:nth-child(2),
.col-player {
    text-align: left !important;
}

.col-player strong {
    color: var(--fff-purple);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 800;
}

.col-pos strong {
    font-family: var(--font-label);
    font-weight: 700;
}

.col-pts strong {
    color: var(--fff-purple);
    font-family: var(--font-display);
    font-size: 17px;
}


/* ==========================================================
   18. PLAYER CREST
========================================================== */

.player-crest {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    vertical-align: middle;
    overflow: hidden;
    border-radius: 50%;
    color: var(--white);
    background: linear-gradient(145deg, var(--fff-purple), var(--electric-lilac) 55%, var(--fff-teal));
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
    font-family: var(--font-label);
    font-size: 11px;
    font-weight: 700;
}


/* ==========================================================
   19. TOP THREE LEADERBOARD
   Preferred: apply .rank-1 / .rank-2 / .rank-3 to the <tr>
   from JS/server once the data is sorted, so podium styling
   tracks the athlete's actual rank rather than DOM position.
   The nth-child rules below remain as a fallback only for
   markup that hasn't been updated yet — remove once every
   row carries a rank class.
========================================================== */

.standings-table tbody tr.rank-1 td,
.standings-table tbody tr:nth-child(1):not([class*="rank-"]) td {
    background: linear-gradient(90deg, rgba(235, 255, 0, .10), rgba(255, 255, 255, 0));
}

.standings-table tbody tr.rank-1 .col-pos strong,
.standings-table tbody tr:nth-child(1):not([class*="rank-"]) .col-pos strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--fff-purple);
    background: var(--electric-yellow);
}

.standings-table tbody tr.rank-2 .col-pos strong,
.standings-table tbody tr:nth-child(2):not([class*="rank-"]) .col-pos strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--fff-purple);
    background: #d9d8df;
}

.standings-table tbody tr.rank-3 .col-pos strong,
.standings-table tbody tr:nth-child(3):not([class*="rank-"]) .col-pos strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--white);
    background: #b67553;
}


/* ==========================================================
   20. LAPTOP / SMALL DESKTOP — 841–1099
   (previously an unstyled gap between tablet and desktop —
   this keeps the masthead and nav from feeling oversized on
   split-screen and small-laptop viewports)
========================================================== */

@media (min-width: 841px) and (max-width: 1099px) {

    main {
        padding-left: 28px;
        padding-right: 28px;
    }

    #main-nav {
        width: calc(100% - 8px);
    }

    .match-card,
    .admin-match-card {
        padding-left: 24px;
    }
}


/* ==========================================================
   21. DESKTOP — 1100+
========================================================== */

@media (min-width: 1100px) {

    main {
        padding-left: 40px;
        padding-right: 40px;
    }

    .match-card,
    .admin-match-card {
        min-height: 100px;
        padding-left: 30px;
        padding-right: 28px;
    }
}


/* ==========================================================
   22. TABLET — 641–840
========================================================== */

@media (min-width: 641px) and (max-width: 840px) {

    main {
        width: calc(100% - 24px);
        margin-top: 12px;
        padding: 0 20px 48px;
        border-radius: 20px;
    }

    .nav-btn {
        padding: 0 12px;
        font-size: 14px;
    }

    .match-card,
    .admin-match-card {
        gap: 18px;
        padding: 18px 18px 18px 24px;
    }
}


/* ==========================================================
   23. MOBILE — <=640
   Navigation stays visible at the TOP.
========================================================== */

@media (max-width: 640px) {

    html,
    body {
        background: var(--white);
    }

    main {
        width: 100%;
        margin: 0;
        padding: 0 16px 40px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }


    /* MOBILE HERO */

    .pl-header-banner,
    .page.active > h1:first-child {
        margin: 18px 0 24px;
        padding: 26px 20px;
        border-radius: 16px;
        box-shadow: 0 10px 30px rgba(36, 1, 85, .18);
    }

    .pl-header-banner::after {
        left: 20px;
    }


    /* SIGN IN */

    .page--signin .auth-panel {
        max-width: 100%;
        padding: 28px 4px 44px;
    }

    .auth-panel__title {
        font-size: 28px;
    }

    .auth-panel__copy {
        margin-bottom: 26px;
        font-size: 14px;
    }

    .auth-button--google {
        min-height: 50px;
        padding: 0 18px;
        font-size: 14px;
    }


    /* STATS */

    .stats-toolbar {
        display: block;
        margin-bottom: 20px;
    }

    .stats-toolbar select {
        max-width: 100%;
    }

    .stats-summary-card {
        grid-template-columns: 1fr auto 1fr;
        gap: 14px;
        padding: 18px 14px;
        margin-bottom: 24px;
    }

    .stat-block {
        min-height: 76px;
    }

    .stat-block__label {
        font-size: 11px;
    }

    .stat-block__value {
        font-size: 30px;
    }

    .stat-block__status {
        font-size: 15px;
    }


    /* ADMIN */

    .admin-toolbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 24px;
    }

    .admin-toolbar .field-group {
        width: 100%;
        flex: none;
    }

    .admin-load-button {
        width: 100%;
        min-height: 50px;
    }


    /* MOBILE FIXTURES */

    #fixtures-container {
        padding-bottom: 18px;
    }

    .match-card,
    .admin-match-card {
        grid-template-columns: 1fr;
        gap: 13px;
        min-height: auto;
        margin-bottom: 11px;
        padding: 17px 15px 16px 21px;
        border-radius: 13px;
    }

    .match-card:hover,
    .admin-match-card:hover {
        transform: none;
        box-shadow: var(--shadow-card);
    }

    .match-card::before,
    .admin-match-card::before {
        top: 10px;
        bottom: 10px;
        width: 4px;
    }

    .match-card > div:last-child,
    .admin-match-card > div:last-child {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
    }

    input[type="number"] {
        width: 52px;
        height: 52px;
        font-size: 19px;
    }


    /* MOBILE STICKY SUBMIT */

    #btn-submit-picks {
        position: sticky;
        z-index: 50;
        bottom: 12px;
        min-height: 56px;
        margin-top: 22px;
        box-shadow: 0 10px 30px rgba(36, 1, 85, .31);
    }


    /* MOBILE TABLE */

    .table-container {
        margin-left: -16px;
        width: calc(100% + 32px);
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    .standings-table th {
        padding: 12px 7px;
        font-size: 11px;
    }

    .standings-table td {
        padding: 14px 7px;
        font-size: 12px;
    }

    .col-player strong {
        font-size: 13px;
    }

    .player-crest {
        width: 28px;
        height: 28px;
        margin-right: 6px;
    }

    .view-short .col-detailed {
        display: none;
    }

    .standings-table.view-full {
        min-width: 720px;
    }

    .view-full .col-detailed {
        display: table-cell;
    }

    .table-container:has(.standings-table.view-full) {
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }
}


/* ==========================================================
   24. VERY SMALL PHONE — <=450
========================================================== */

@media (max-width: 450px) {

    main {
        padding-left: 12px;
        padding-right: 12px;
    }

    .pl-header-banner,
    .page.active > h1:first-child {
        padding: 22px 17px;
    }

    .match-card,
    .admin-match-card {
        padding: 15px 13px 15px 19px;
    }

    .table-container {
        margin-left: -12px;
        width: calc(100% + 24px);
    }
}


/* ==========================================================
   25. POINTER / TOUCH BEHAVIOUR
========================================================== */

@media (pointer: coarse) {

    .match-card:hover,
    .admin-match-card:hover,
    .nav-btn:hover,
    #btn-submit-picks:hover,
    .btn-save-official:hover {
        transform: none;
    }
}



/* Keep Sign In visually distinct even while it is the active page */
@media (max-width: 640px) {
    #btn-signin,
    #btn-signin.active-btn {
        color: var(--white);
        background: linear-gradient(135deg, var(--fff-purple), var(--fff-purple-2));
        border-radius: 999px;
        box-shadow: 0 4px 12px rgba(36, 1, 85, .20);
    }

    #btn-signin.active-btn::after {
        display: none;
    }
}


/* ==========================================================
   26. ACCESSIBILITY
========================================================== */

button:focus-visible,
input:focus-visible,
select:focus-visible,
.nav-btn:focus-visible,
.toggle-btn:focus-visible {
    outline: 3px solid rgba(0, 214, 195, .40);
    outline-offset: 3px;
}

/* --ink-muted was #8c818f (~3.9:1 on white) — fails AA at the
   11-13px sizes it's used at for table headers/badges. Darkened
   to #746a79 (~5.3:1) above; keep it at or below this lightness
   if you adjust the palette. */


/* ==========================================================
   27. REDUCED MOTION
========================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* DESKTOP (Wider than 600px) */
@media (min-width: 601px) {
    /* Hide the Short/Full toggle container */
    .table-toggle-container {
        display: none !important;
    }
    
    /* Force all detailed columns to display */
    .col-detailed {
        display: table-cell !important;
    }
}
/* ==========================================================
   MOBILE LEAGUE TABLE — FULL TABLE FITS SCREEN
========================================================== */

@media (max-width: 640px) {

    /* Never horizontally scroll league table */

    .table-container {
        width: calc(100% + 32px);
        margin-left: -16px;

        overflow-x: hidden !important;

        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }


    /* Both table modes remain inside viewport */

    .standings-table,
    .standings-table.view-short,
    .standings-table.view-full {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;

        table-layout: fixed;
    }


    /* ------------------------------------------------------
       COLUMN WIDTHS
    ------------------------------------------------------ */

    .standings-table th:nth-child(1),
    .standings-table td:nth-child(1) {
        width: 8%;
    }

    .standings-table th:nth-child(2),
    .standings-table td:nth-child(2) {
        width: 34%;
    }

    .standings-table th:nth-child(3),
    .standings-table td:nth-child(3),
    .standings-table th:nth-child(4),
    .standings-table td:nth-child(4),
    .standings-table th:nth-child(5),
    .standings-table td:nth-child(5),
    .standings-table th:nth-child(6),
    .standings-table td:nth-child(6) {
        width: 10%;
    }

    .standings-table th:nth-child(7),
    .standings-table td:nth-child(7) {
        width: 18%;
    }


    /* ------------------------------------------------------
       TABLE CELLS
    ------------------------------------------------------ */

    .standings-table th {
        padding: 11px 2px;

        font-size: 10px;
        letter-spacing: 0.02em;

        white-space: nowrap;
    }

    .standings-table td {
        padding: 13px 2px;

        font-size: 11px;

        white-space: nowrap;
    }


    /* ------------------------------------------------------
       PLAYER
    ------------------------------------------------------ */

    .col-player {
        overflow: hidden;

        text-align: left !important;
        white-space: nowrap;
    }

    .col-player strong {
        display: inline-block;

        max-width: calc(100% - 28px);

        overflow: hidden;

        font-size: 11px;

        line-height: 1.2;

        text-overflow: ellipsis;
        white-space: nowrap;

        vertical-align: middle;
    }


    /* Smaller crest */

    .player-crest {
        width: 22px;
        height: 22px;

        flex: 0 0 22px;

        margin-right: 4px;

        font-size: 9px;
    }


    /* ------------------------------------------------------
       POSITION
    ------------------------------------------------------ */

    .col-pos strong {
        font-size: 11px;
    }


    /* Smaller podium circles */

    .standings-table tbody tr.rank-1 .col-pos strong,
    .standings-table tbody tr.rank-2 .col-pos strong,
    .standings-table tbody tr.rank-3 .col-pos strong,
    .standings-table tbody tr:nth-child(1):not([class*="rank-"]) .col-pos strong,
    .standings-table tbody tr:nth-child(2):not([class*="rank-"]) .col-pos strong,
    .standings-table tbody tr:nth-child(3):not([class*="rank-"]) .col-pos strong {

        width: 22px;
        height: 22px;

        font-size: 10px;
    }


    /* ------------------------------------------------------
       POINTS
    ------------------------------------------------------ */

    .col-pts strong {
        font-size: 13px;
    }


    /* ------------------------------------------------------
       TABLE MODES
    ------------------------------------------------------ */

    .standings-table.view-short .col-detailed {
        display: none;
    }

    .standings-table.view-full .col-detailed {
        display: table-cell;
    }

}