:root{
    /* ===== Modern Blue theme - the ONLY place the brand colours are defined ===== */
    --navy:#14213D;          /* sidebar, header, headings, hero panels */
    --navy-2:#1d2f55;        /* raised/hover on navy */
    --blue:#3B82F6;          /* highlights, active states, focus ring, fills */
    --blue-600:#2563EB;      /* button fills + links/text on white (passes AA) */
    --blue-700:#1D4ED8;
    --blue-soft:#EAF2FF;     /* selected items, subtle panels, info */
    --white:#FFFFFF;

    /* surfaces + text (light scope - the default) */
    --page:#F3F6FB;
    --panel:#FFFFFF;
    --field:#FFFFFF;
    --field-soft:#F6F9FE;
    --line:#D5DEEC;
    --line-soft:#E4EBF5;
    --text:#14213D;
    --muted:#52617A;
    --faint:#5E6C85;
    --brand:#2563EB;         /* blue accents on light surfaces */
    --brand-strong:#1D4ED8;
    --accent-soft:#EAF2FF;   /* tinted fill behind blue accents */
    --accent-line:rgba(59,130,246,0.45);
    --accent-text:#1D4ED8;
    --tint:rgba(20,33,61,0.035);
    --tint-2:rgba(20,33,61,0.08);

    /* status colours: soft fill + readable text */
    --green:#16A34A;  --green-soft:#DCFCE7;  --green-text:#166534;
    --amber:#F59E0B;  --amber-soft:#FEF3C7;  --amber-text:#92400E;
    --danger:#DC2626; --danger-soft:#FEE2E2; --danger-text:#B91C1C;

    --radius:16px;
    --radius-sm:10px;
    --shadow:0 1px 2px rgba(20,33,61,0.05), 0 10px 28px rgba(20,33,61,0.07);
    --shadow-sm:0 1px 2px rgba(20,33,61,0.06);
    --shadow-lg:0 24px 60px rgba(20,33,61,0.22);
    --ring:0 0 0 3px rgba(59,130,246,0.38);
    --ease:cubic-bezier(.2,.7,.2,1);
    --font-display:"Sora","Inter",system-ui,sans-serif;
    --font-body:"Inter",system-ui,-apple-system,sans-serif;
}

/* Dark surfaces (the navy header/sidebar, the team hero, the front-page hero):
   they swap the same tokens, so everything inside just works. */
.app-header, .team-hero, .lp-hero, .lp-final{
    --text:#FFFFFF;
    --muted:#C5D1E8;
    --faint:#93A5C6;
    --line:rgba(255,255,255,0.18);
    --line-soft:rgba(255,255,255,0.12);
    --panel:rgba(255,255,255,0.07);
    --field:rgba(255,255,255,0.09);
    --field-soft:rgba(255,255,255,0.06);
    --brand:#8DB8FF;
    --brand-strong:#6CA2FF;
    --accent-soft:rgba(59,130,246,0.24);
    --accent-line:rgba(141,184,255,0.5);
    --accent-text:#C4DAFF;
    --tint:rgba(255,255,255,0.06);
    --tint-2:rgba(255,255,255,0.12);
    --shadow:none;
    color:var(--text);
}
/* ...and the few light panels that sit inside a dark one swap back */
.account-menu, .lp-phone-screen{
    --text:#14213D;
    --muted:#52617A;
    --faint:#5E6C85;
    --line:#D5DEEC;
    --line-soft:#E4EBF5;
    --panel:#FFFFFF;
    --field:#FFFFFF;
    --field-soft:#F6F9FE;
    --brand:#2563EB;
    --brand-strong:#1D4ED8;
    --accent-soft:#EAF2FF;
    --accent-line:rgba(59,130,246,0.45);
    --accent-text:#1D4ED8;
    --tint:rgba(20,33,61,0.035);
    --tint-2:rgba(20,33,61,0.08);
    --shadow:0 1px 2px rgba(20,33,61,0.05), 0 10px 28px rgba(20,33,61,0.07);
    color:var(--text);
}

*{ box-sizing:border-box; }
html{ min-height:100%; overflow-x:hidden; }
body{
    margin:0;
    min-height:100%;
    overflow-x:hidden;
    font-family:var(--font-body);
    background:var(--page);
    color:var(--text);
    -webkit-font-smoothing:antialiased;
    line-height:1.5;
}
h1,h2,h3{ color:var(--text); }

/* keyboard users and screen-reader users get a clear focus ring; people who
   asked their device for less motion get none */
:focus-visible{ outline:none; box-shadow:var(--ring); border-radius:inherit; }
@media (prefers-reduced-motion: reduce){
    *,*::before,*::after{ animation-duration:0.01ms !important; transition-duration:0.01ms !important; scroll-behavior:auto !important; }
}

.app-header{
    border-bottom:1px solid rgba(255,255,255,0.08);
    background:var(--navy);
}
.header-inner{
    width:min(880px,100%);
    margin:0 auto;
    display:flex;
    align-items:center;
    gap:14px;
    padding:20px 18px;
}
/* official app logo - the image already has its own rounded-badge artwork
   and transparent corners, so this just sizes it (object-fit:contain keeps
   its aspect ratio - it's a square asset, but this guards against ever
   swapping in a non-square one) without adding another background/shadow
   on top of what's already baked into the image. */
.brand-mark{
    width:44px; height:44px; flex:none;
    object-fit:contain;
}
.app-header h1{ margin:0; font-family:var(--font-display); font-size:22px; font-weight:800; letter-spacing:-0.01em; }
.app-header p{ margin:4px 0 0; color:var(--muted); font-size:12px; font-weight:600; letter-spacing:0.02em; text-transform:uppercase; }

/* ---------- shared page frame (organiser/owner pages): shell.js ---------- */
.app-header.shell{ position:sticky; top:0; z-index:40; }
.app-header.wide .shell-inner{ width:min(1040px,100%); }
.shell-inner{ width:min(880px,100%); margin:0 auto; display:flex; align-items:center; gap:10px; padding:10px 18px; min-height:60px; }
.brand-link{ display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--text); flex:none; }
.brand-link .brand-mark{ width:36px; height:36px; }
.brand-name{ font-family:var(--font-display); font-weight:800; font-size:17px; letter-spacing:-0.01em; white-space:nowrap; }
.shell-spacer{ flex:1; }
.nav-links{ display:flex; gap:2px; margin-left:10px; }
.nav-link{
    padding:8px 13px; border-radius:999px; color:var(--muted); text-decoration:none;
    font-weight:700; font-size:13.5px; white-space:nowrap; transition:color .12s var(--ease), background .12s var(--ease);
}
.nav-link .icon{ display:none; }
.nav-link:hover{ color:var(--text); background:rgba(255,255,255,0.08); }
.nav-link.active{ color:#fff; background:var(--blue-600); }
.account-links{ display:flex; align-items:center; gap:6px; }
.account{ position:relative; }
.account-btn{
    display:flex; align-items:center; gap:8px; min-height:42px; padding:4px 12px 4px 4px;
    background:transparent; border:1px solid var(--line); border-radius:999px; color:var(--text);
    font-family:var(--font-body); cursor:pointer; transition:border-color .12s var(--ease);
}
.account-btn:hover,.account-btn[aria-expanded="true"]{ border-color:var(--blue); background:rgba(255,255,255,0.06); }
.avatar{
    width:32px; height:32px; border-radius:50%; display:grid; place-items:center; flex:none;
    background:linear-gradient(135deg,var(--blue),var(--blue-600)); color:#fff; font-weight:800; font-size:12.5px;
}
.avatar-loading{ background:rgba(255,255,255,0.12); }
.account-name{ font-weight:700; font-size:13px; max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-menu{
    position:absolute; right:0; top:calc(100% + 8px); min-width:250px; z-index:70; padding:8px;
    background:var(--panel); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow-lg);
}
.account-menu[hidden]{ display:none; }
.menu-head{ padding:8px 10px 12px; border-bottom:1px solid var(--line-soft); margin-bottom:6px; }
.menu-name{ font-weight:800; font-family:var(--font-display); overflow-wrap:anywhere; }
.menu-head .menu-role{ margin:8px 0 0; }
.menu-item{
    display:flex; align-items:center; width:100%; min-height:44px; padding:10px 12px; border:0; border-radius:10px;
    background:none; color:var(--text); font-family:var(--font-body); font-weight:600; font-size:14px;
    text-decoration:none; cursor:pointer; text-align:left;
}
.menu-item:hover{ background:var(--accent-soft); }
.menu-logout{ color:var(--danger-text); margin-top:4px; border-top:1px solid var(--line-soft); border-radius:0 0 10px 10px; }
.app-footer{
    width:min(880px,100%); margin:0 auto; padding:18px; display:flex; justify-content:space-between; gap:8px 16px; flex-wrap:wrap;
    border-top:1px solid var(--line-soft); color:var(--faint); font-size:12.5px;
}
@media (max-width: 430px){
    /* signed-out header: brand + Log in + Sign up must fit a small phone */
    .brand-name{ font-size:14px; }
    .brand-link{ gap:8px; }
    .shell-inner{ gap:6px; }
    .account-links{ gap:2px; }
    .account-links .nav-link{ padding:8px 8px; }
    .account-links .btn.small{ padding:8px 12px; }
}
@media (max-width: 640px){
    .nav-links{ display:none; }
    .account-name{ display:none; }
    .account-btn{ padding:3px; }
    .brand-name{ font-size:15px; }
    .shell-inner{ padding:8px 14px; min-height:56px; }
    .account-menu{ position:fixed; left:12px; right:12px; top:60px; min-width:0; }
}

/* ---------- signed-in sidebar (wide screens only) ---------- */
@media (min-width: 1024px){
    body.has-sidebar{ padding-left:256px; }
    body.has-sidebar .app-header.shell{
        position:fixed; left:0; top:0; bottom:0; width:256px; z-index:50;
        border-bottom:0; border-right:1px solid rgba(255,255,255,0.06);
        background:linear-gradient(180deg,var(--navy),#101a33);
        display:flex; flex-direction:column;
    }
    body.has-sidebar .shell-inner{
        width:100%; min-height:100%; margin:0; padding:22px 14px 16px;
        flex-direction:column; align-items:stretch; gap:22px;
    }
    body.has-sidebar .brand-link{ padding:0 6px; }
    body.has-sidebar .brand-name{ white-space:normal; line-height:1.15; font-size:16px; }
    body.has-sidebar .nav-links{ flex-direction:column; margin:0; gap:4px; }
    body.has-sidebar .nav-link{
        display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:12px; font-size:14px;
    }
    body.has-sidebar .nav-link .icon{ display:inline-flex; opacity:0.9; }
    body.has-sidebar .nav-link.active{ box-shadow:0 4px 14px rgba(37,99,235,0.4); }
    body.has-sidebar .account{ width:100%; }
    body.has-sidebar .account-btn{ width:100%; border-radius:14px; padding:8px 10px 8px 8px; justify-content:flex-start; background:rgba(255,255,255,0.05); }
    body.has-sidebar .account-name{ display:block; flex:1; text-align:left; max-width:none; }
    body.has-sidebar .account-menu{ top:auto; bottom:calc(100% + 8px); left:0; right:0; min-width:0; }
    body.has-sidebar .container{ width:min(1040px,100%); padding-top:30px; }
    body.has-sidebar .app-footer{ width:min(1040px,100%); }
}

.container{ width:min(880px,100%); margin:0 auto; padding:22px 18px 48px; flex:1 0 auto; }
/* the page is a column so the footer sits at the bottom even on a short page */
body{ display:flex; flex-direction:column; min-height:100vh; min-height:100dvh; }

.card{
    position:relative;
    background:var(--panel);
    border:1px solid var(--line-soft);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:20px;
    margin-bottom:16px;
}
.card h2{ margin:0 0 14px; font-family:var(--font-display); font-size:19px; }
.card h3{ margin:0 0 12px; font-family:var(--font-display); font-size:16px; }

.stack{ display:flex; flex-direction:column; gap:10px; }

.muted{ color:var(--muted); }
.small{ font-size:12.5px; }
.empty-state{ color:var(--faint); font-size:13.5px; padding:8px 2px; }
.loading{ color:var(--muted); padding:20px 0; }

/* forms */
.field{ display:flex; flex-direction:column; gap:6px; flex:1; font-size:13px; color:var(--muted); font-weight:600; }
.field-row{ display:flex; gap:12px; margin-bottom:12px; flex-wrap:wrap; }
.field-row.three > .field{ min-width:150px; }
.input{
    background:var(--field);
    border:1px solid var(--line);
    border-radius:var(--radius-sm);
    color:var(--text);
    padding:10px 12px;
    /* 16px minimum - iOS Safari auto-zooms the whole page on focus for any
       input with a smaller computed font-size, which reads as a jarring
       unwanted jump/zoom the instant you tap a score field. */
    font-size:16px;
    font-family:var(--font-body);
    width:100%;
    height:44px;
    line-height:normal;
}
.input[type="date"]{
    color-scheme:light;
}
.input::placeholder{ color:var(--faint); opacity:0.8; }
.input:focus{ outline:none; border-color:var(--blue); box-shadow:var(--ring); }
.form-error{ color:var(--danger); font-size:13px; margin:0 0 10px; }
.save-confirm{ color:var(--green); font-size:13px; font-weight:600; }

.btn{
    border:1px solid var(--line);
    background:var(--panel);
    color:var(--text);
    border-radius:999px;
    padding:10px 18px;
    min-height:44px;
    font-weight:700;
    font-size:13.5px;
    cursor:pointer;
    font-family:var(--font-body);
    white-space:nowrap;
}
.btn{ box-shadow:var(--shadow-sm); transition:transform .12s var(--ease), filter .12s var(--ease), border-color .12s var(--ease), background .12s var(--ease), box-shadow .12s var(--ease); }
.btn:hover:not(:disabled){ border-color:var(--blue); background:var(--accent-soft); }
.btn:active:not(:disabled){ transform:scale(0.98); }
a.btn{ display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
.btn.block{ width:100%; display:flex; align-items:center; justify-content:center; gap:8px; }
.btn:disabled{ opacity:0.4; cursor:not-allowed; }
.btn-primary{
    background:var(--blue-600);
    border-color:transparent;
    color:#fff;
    box-shadow:0 1px 2px rgba(37,99,235,0.35), 0 6px 16px rgba(37,99,235,0.22);
}
.btn-primary:hover:not(:disabled){ background:var(--blue-700); border-color:transparent; box-shadow:0 2px 4px rgba(37,99,235,0.4), 0 10px 22px rgba(37,99,235,0.28); }
.btn-danger{ border-color:rgba(220,38,38,0.35); color:var(--danger-text); background:var(--danger-soft); }
.btn-danger:hover:not(:disabled){ background:#FECACA; border-color:var(--danger); }
.btn-ghost{ background:transparent; box-shadow:none; }
/* still comfortably tappable (~38px) despite the "small" label - these sit
   several to a row (Edit/Fixtures/Delete etc.), so they can't match the
   44px full-size minimum without breaking that layout, but the old 27px was
   too cramped for a thumb on a real phone. */
.btn.small{ padding:8px 14px; min-height:38px; font-size:12.5px; }
/* "Record forfeit" next to "Enter score" - a real 38px tap target like any
   other .small button, but text-only/no border so it visibly reads as the
   secondary, less-reached-for action rather than competing with it. */
.btn-subtle{ background:transparent; border-color:transparent; box-shadow:none; color:var(--faint); padding:8px 10px; min-height:38px; font-size:12.5px; }
.btn-subtle:hover:not(:disabled){ color:var(--text); background:var(--tint); border-color:transparent; }

/* icons, loading placeholders, empty states */
.icon{ display:inline-flex; line-height:0; vertical-align:middle; }
.skeleton-page{ display:flex; flex-direction:column; gap:14px; padding-top:6px; }
.skeleton{
    border-radius:var(--radius);
    background:linear-gradient(90deg,var(--tint),var(--tint-2),var(--tint));
    background-size:200% 100%; animation:shimmer 1.4s linear infinite;
}
.skeleton-hero{ height:170px; }
.skeleton-line{ height:16px; border-radius:8px; }
.skeleton-line.short{ width:60%; }
.skeleton-block{ height:120px; }
@keyframes shimmer{ from{ background-position:200% 0; } to{ background-position:-200% 0; } }
.empty-card{ display:flex; flex-direction:column; align-items:center; gap:8px; text-align:center; padding:22px 12px; color:var(--faint); }
.empty-card p{ margin:0; font-size:14px; max-width:34ch; }

/* leagues list */
.league-row{
    display:flex; align-items:center; justify-content:space-between;
    padding:12px 14px; border:1px solid var(--line-soft); border-radius:var(--radius-sm);
    text-decoration:none; color:var(--text);
}
.league-row{ background:var(--panel); transition:border-color .12s var(--ease), box-shadow .12s var(--ease), transform .12s var(--ease); }
.league-row:hover{ border-color:var(--blue); box-shadow:var(--shadow); }
.league-row::after{
    content:""; flex:none; width:8px; height:8px; margin-left:14px;
    border-right:2px solid var(--faint); border-top:2px solid var(--faint); transform:rotate(45deg);
}
.league-row-name{ font-weight:700; font-family:var(--font-display); }

/* badges */
.badge{
    display:inline-block; padding:3px 10px; border-radius:999px; font-size:11px; font-weight:700;
    text-transform:uppercase; letter-spacing:0.03em; margin-left:8px; white-space:nowrap;
}
.badge-neutral{ background:var(--tint-2); color:var(--muted); }
.badge-blue{ background:var(--blue-soft); color:var(--blue-700); }
.badge-amber{ background:var(--amber-soft); color:var(--amber-text); }
.badge-green{ background:var(--green-soft); color:var(--green-text); }
.badge-danger{ background:var(--danger-soft); color:var(--danger-text); }

/* page title row + numbered form sections */
.page-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px 20px; flex-wrap:wrap; margin:0 0 20px; }
.page-head h2{ margin:0; font-family:var(--font-display); font-weight:800; font-size:clamp(24px,4vw,30px); letter-spacing:-0.01em; line-height:1.15; }
.page-head p{ margin:6px 0 0; max-width:62ch; }
.page-head-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.form-sections .card{ margin-bottom:14px; }
.form-section > .field{ margin-bottom:14px; }
.section-head{ display:flex; align-items:flex-start; gap:12px; margin-bottom:16px; }
.section-head h3{ margin:3px 0 2px; }
.section-head p{ margin:0; }
.section-num{
    flex:none; width:28px; height:28px; border-radius:50%; display:inline-grid; place-items:center;
    background:var(--blue-soft); color:var(--blue-700); font-family:var(--font-display); font-weight:800; font-size:13px;
}
details.form-section > summary{ gap:12px; justify-content:flex-start; }
details.form-section > summary::after{ margin-left:auto; }
.summary-title{ font-family:var(--font-display); font-weight:700; font-size:16px; }
.summary-hint{ color:var(--muted); font-size:12.5px; font-weight:500; font-family:var(--font-body); }
details.form-section[open] > summary{ margin-bottom:14px; }
.form-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:6px; }
.form-actions .btn{ min-height:50px; padding:12px 28px; font-size:15px; }
@media (max-width: 480px){
    .form-actions .btn{ width:100%; }
    .summary-hint{ display:none; }
}

/* league detail */
.detail-header{ display:flex; align-items:center; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.detail-header h2{ margin:0; font-family:var(--font-display); font-size:22px; }
.detail-header .badge{ margin-left:0; }
.back-link{ color:var(--muted); text-decoration:none; font-size:13px; width:100%; }
.back-link:hover{ color:var(--text); }

/* Section tabs. Every tab is always visible: on a phone they wrap onto a
   second line instead of scrolling sideways (a hidden, scrolling row made
   people think the extra tabs didn't exist). Each tab is a visible button. */
.tabs-inline{ display:flex; flex-wrap:wrap; gap:8px; margin:0 0 18px; padding:0; }
.tab-inline{
    padding:9px 16px; border-radius:999px; text-decoration:none; color:var(--text); flex:none;
    font-weight:700; font-size:13.5px; white-space:nowrap;
    background:var(--panel); border:1px solid var(--line); box-shadow:var(--shadow-sm);
    transition:background .12s var(--ease), color .12s var(--ease), border-color .12s var(--ease);
}
@media (hover:hover){ .tab-inline:hover{ border-color:var(--blue); background:var(--accent-soft); } }
.tab-inline.active{ background:var(--blue-600); border-color:transparent; color:#fff; box-shadow:0 1px 2px rgba(37,99,235,0.35), 0 4px 12px rgba(37,99,235,0.22); }
@media (max-width: 480px){
    .tabs-inline{ gap:6px; }
    .tab-inline{ padding:8px 13px; font-size:13px; }
}
/* ---------- league sections on a phone: bottom bar + "More" sheet ----------
   Wide screens keep the tab row above; phones get an app-style bar fixed to
   the bottom (a thumb's reach) whose highlight glides between the buttons,
   with a sheet that slides up for the sections that don't fit. */
.league-nav-wrap{ display:none; }
.league-section{ min-width:0; }
@media (max-width: 640px){
    .tabs-inline{ display:none; }
    .league-nav-wrap{ display:block; }
    #app.with-league-nav{ padding-bottom:calc(96px + env(safe-area-inset-bottom, 0px)); }
    #app.with-league-nav ~ .app-footer{ margin-bottom:calc(84px + env(safe-area-inset-bottom, 0px)); }

    .league-nav{
        position:fixed; left:10px; right:10px; z-index:70;
        bottom:calc(10px + env(safe-area-inset-bottom, 0px));
        display:grid; grid-template-columns:repeat(4, 1fr);
        padding:6px; border-radius:22px;
        background:rgba(255,255,255,0.94); -webkit-backdrop-filter:blur(16px); backdrop-filter:blur(16px);
        border:1px solid var(--line-soft);
        box-shadow:0 10px 32px rgba(20,33,61,0.22), 0 2px 6px rgba(20,33,61,0.08);
    }
    /* the sliding highlight: one pill behind the four buttons */
    .league-nav-pill{
        position:absolute; top:6px; bottom:6px; left:6px; width:calc((100% - 12px) / 4);
        border-radius:16px; background:var(--blue-600);
        box-shadow:0 6px 16px rgba(37,99,235,0.38);
        transition:transform .38s cubic-bezier(.34,1.45,.5,1);
        pointer-events:none;
    }
    .league-nav-item{
        position:relative; z-index:1;
        display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
        min-height:56px; padding:6px 2px; border:0; border-radius:16px; background:none;
        color:var(--muted); font-family:var(--font-body); font-weight:700; font-size:11.5px; cursor:pointer;
        -webkit-tap-highlight-color:transparent;
        transition:color .2s var(--ease), transform .12s var(--ease);
    }
    .league-nav-item:active{ transform:scale(0.92); }
    .league-nav-item.active{ color:#fff; }
    .league-nav-item.active .icon{ animation:navPop .42s cubic-bezier(.34,1.56,.5,1) both .12s; }
    .league-nav-label{ max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .nav-count{
        position:absolute; top:3px; left:calc(50% + 6px); min-width:19px; height:19px; padding:0 5px;
        border-radius:999px; display:grid; place-items:center;
        background:var(--amber); color:#3b2300; font-size:11px; font-weight:800; line-height:1;
        border:2px solid #fff; box-sizing:content-box;
        animation:navBadge 1.8s ease-in-out infinite;
    }

    .more-backdrop{
        position:fixed; inset:0; z-index:80; background:rgba(12,20,40,0.5);
        opacity:0; visibility:hidden; transition:opacity .25s var(--ease), visibility 0s linear .25s;
    }
    .more-backdrop.open{ opacity:1; visibility:visible; transition:opacity .25s var(--ease); }
    .more-sheet{
        position:fixed; left:0; right:0; bottom:0; z-index:90;
        padding:10px 14px calc(24px + env(safe-area-inset-bottom, 0px));
        background:var(--panel); border-radius:26px 26px 0 0;
        box-shadow:0 -12px 40px rgba(12,20,40,0.28);
        transform:translateY(105%); visibility:hidden;
        transition:transform .38s cubic-bezier(.2,.85,.25,1), visibility 0s linear .38s;
    }
    .more-sheet.open{ transform:none; visibility:visible; transition:transform .38s cubic-bezier(.2,.85,.25,1); }
    .more-sheet-handle{ width:42px; height:5px; border-radius:3px; background:var(--line); margin:0 auto 12px; }
    .more-sheet-title{ margin:0 4px 10px; color:var(--muted); font-size:11px; font-weight:800; letter-spacing:0.07em; text-transform:uppercase; }
    .more-item{
        display:flex; align-items:center; gap:14px; padding:12px; margin-bottom:8px;
        border-radius:16px; border:1px solid var(--line-soft); background:var(--panel);
        color:var(--text); text-decoration:none; -webkit-tap-highlight-color:transparent;
        opacity:0; transform:translateY(14px);
        transition:background .15s var(--ease), transform .12s var(--ease), opacity .3s var(--ease);
    }
    .more-sheet.open .more-item{ opacity:1; transform:none; }
    .more-sheet.open .more-item:nth-of-type(1){ transition-delay:.06s; }
    .more-sheet.open .more-item:nth-of-type(2){ transition-delay:.11s; }
    .more-sheet.open .more-item:nth-of-type(3){ transition-delay:.16s; }
    .more-sheet.open .more-item:nth-of-type(4){ transition-delay:.21s; }
    .more-item:active{ background:var(--blue-soft); }
    .more-item.active{ border-color:var(--blue); background:var(--blue-soft); }
    .more-item-icon{
        flex:none; width:44px; height:44px; border-radius:14px; display:grid; place-items:center;
        background:var(--blue-soft); color:var(--blue-600);
    }
    .more-item.active .more-item-icon{ background:var(--blue-600); color:#fff; }
    .more-item.urgent .more-item-icon{ background:var(--danger-soft); color:var(--danger-text); }
    .more-item-text{ flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
    .more-item-text strong{ font-family:var(--font-display); font-size:15.5px; }
    .more-item-text small{ color:var(--muted); font-size:12.5px; }
    .more-item-count{
        flex:none; min-width:24px; height:24px; padding:0 7px; border-radius:999px; display:grid; place-items:center;
        background:var(--amber); color:#3b2300; font-size:12.5px; font-weight:800;
    }
    .more-item.urgent .more-item-count{ background:var(--danger); color:#fff; }
    .more-item > .icon:last-child{ flex:none; color:var(--faint); }
    body.sheet-open{ overflow:hidden; }
}
@keyframes navPop{ 0%{ transform:scale(0.6) translateY(4px); } 100%{ transform:none; } }
@keyframes navBadge{ 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.14); } }

/* a new section glides in from the side it sits on (only when it changes) */
.league-section.slide-right{ animation:slideFromRight .34s var(--ease) both; }
.league-section.slide-left{ animation:slideFromLeft .34s var(--ease) both; }
@keyframes slideFromRight{ from{ opacity:0; transform:translateX(34px); } to{ opacity:1; transform:none; } }
@keyframes slideFromLeft{ from{ opacity:0; transform:translateX(-34px); } to{ opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce){
    .league-nav-pill, .more-sheet, .more-backdrop, .more-item{ transition:none !important; }
    .league-section, .nav-count, .league-nav-item.active .icon{ animation:none !important; }
}

/* teams */
.team-row{ border:1px solid var(--line-soft); border-radius:var(--radius-sm); padding:14px; }
.team-row-header{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.team-row-name{ font-weight:700; font-family:var(--font-display); }
.row-actions{ display:flex; gap:6px; flex-wrap:wrap; }
.team-link-row{ display:flex; align-items:center; gap:8px; margin-top:10px; flex-wrap:wrap; }
.code-chip{
    background:var(--field); border:1px solid var(--line); border-radius:8px; padding:4px 8px;
    font-size:12px; color:var(--muted); word-break:break-all;
}

/* fixtures */
.fixture-row{ display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:var(--radius-sm); background:var(--tint); }
.court-tag{
    background:var(--accent-soft); color:var(--accent-text); padding:3px 9px; border-radius:999px;
    font-size:11.5px; font-weight:700; white-space:nowrap;
}

.fixture-block{ display:flex; flex-direction:column; gap:8px; padding:8px 10px; border-radius:var(--radius-sm); background:var(--tint); }
.fixture-block .fixture-row{ background:transparent; padding:0; }

/* Submit result (primary) + View availability (secondary) grouped together
   so the two are never mistaken for the same kind of action - primary/
   secondary button styling does the rest of the work (see .btn-primary /
   .btn-ghost). */
.fixture-actions{ display:flex; flex-wrap:wrap; align-items:flex-start; gap:8px 10px; }
.fixture-actions .avail-summary{ margin-top:0; min-width:0; }
/* the "View <opponent>'s availability" label now includes the team's real
   name, which can run long - .btn defaults to white-space:nowrap, so this
   overrides it to wrap onto a second line instead of overflowing the
   fixture card on a narrow phone. */
.avail-toggle{ white-space:normal; overflow-wrap:break-word; max-width:100%; line-height:1.25; }

/* two-team matchup (admin's Fixtures/Playoffs/Confirmations/Disputes views,
   which show both sides of a fixture rather than "vs opponent" from one
   team's perspective) - reuses .opponent-block for each side. */
.matchup{ display:flex; flex-direction:column; gap:4px; min-width:0; flex:1; }
.matchup-vs{ color:var(--faint); font-size:10.5px; text-transform:uppercase; letter-spacing:0.04em; font-weight:700; }
.inline-form{ margin:0; padding:12px; box-shadow:none; background:var(--field-soft); }
.inline-form .field-row{ margin-bottom:8px; }

/* opponent tracker */
.opponent-split{ display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:12px; }
.opponent-list-title{ font-weight:700; font-size:12.5px; text-transform:uppercase; letter-spacing:0.03em; color:var(--muted); margin-bottom:6px; }
.opponent-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; font-size:13.5px; }
.opponent-list li{ display:flex; align-items:flex-start; gap:6px; }
.opponent-list-icon{ flex:none; line-height:1.5; }

/* team name + its two players, shown wherever an opponent is displayed on
   the player-facing team.html link - always read from the team's existing
   player1/player2 record, never duplicated. */
.opponent-block{ display:flex; flex-direction:column; gap:1px; min-width:0; }
.opponent-block-name{ font-weight:700; overflow-wrap:break-word; }
.opponent-block-players{ color:var(--muted); font-size:12px; overflow-wrap:break-word; }
.opp-players{ color:var(--muted); font-size:13px; margin-top:2px; }

/* compact 3-set score entry (team.html "Submit result") - a 2-row grid
   (your team / opponent) x 3 columns (S1/S2/S3) instead of 6 full-width
   stacked fields, so the whole score fits on screen without scrolling even
   at 320px. The name column shrinks first (team/player text wraps via
   .opponent-block) - the three score columns stay a fixed, comfortably
   tappable width. */
.score-grid{
    display:grid; grid-template-columns:minmax(0,1fr) repeat(3, 44px);
    column-gap:6px; row-gap:10px; align-items:center; margin-bottom:12px;
}
.score-grid-head{
    text-align:center; font-size:10.5px; font-weight:800; text-transform:uppercase;
    letter-spacing:0.03em; color:var(--muted);
}
.score-grid-team{ min-width:0; }
.score-input{
    width:100%; height:44px; padding:8px 2px; text-align:center;
    font-size:16px; /* 16px minimum avoids iOS Safari's auto-zoom-on-focus */
}
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.score-input{ -moz-appearance:textfield; }

.team-hero{ text-align:center; }
/* "YOUR TEAM" identity - the strongest thing on the page, so the viewer
   knows whose dashboard this is before anything else, including the next
   opponent below it (see .next-match .opp, deliberately smaller/lighter). */
.my-team-label{ font-size:11px; text-transform:uppercase; letter-spacing:0.04em; color:var(--muted); font-weight:700; margin-top:4px; }
/* display:inline-block so the h2's own width tracks the team name's text
   width (not the full centered card), letting the ::after accent line size
   itself relative to the name instead of a fixed pixel value - a decorative
   bar, not a real text-decoration underline (so the name never reads as a
   clickable link). Opponent names (.next-match .opp) intentionally don't
   get this treatment - it's reserved for the viewer's own team identity. */
.team-hero h2{
    display:inline-block; position:relative;
    margin:2px 0 2px; padding-bottom:9px;
    font-size:25px; font-weight:800; letter-spacing:-0.01em;
}
.team-hero h2::after{
    content:""; position:absolute; left:50%; bottom:0; transform:translateX(-50%);
    width:70%; height:3px; border-radius:999px; background:var(--brand);
}

/* stats strip */
.stats-strip{
    display:grid; grid-template-columns:repeat(auto-fit, minmax(76px, 1fr)); gap:8px;
    margin-bottom:16px;
}
.stat-tile{
    position:relative; overflow:hidden;
    background:var(--panel); border:1px solid var(--line-soft); border-radius:var(--radius-sm);
    padding:12px 4px 10px; text-align:center; box-shadow:var(--shadow-sm);
}
/* a small coloured accent along the top of each statistic */
.stat-tile::before{ content:""; position:absolute; left:0; right:0; top:0; height:3px; background:var(--tile-accent, var(--blue)); }
.stat-tile:nth-child(4n+2){ --tile-accent:var(--green); }
.stat-tile:nth-child(4n+3){ --tile-accent:var(--amber); }
.stat-tile:nth-child(4n+4){ --tile-accent:#8B5CF6; }
.stat-value{ font-family:var(--font-display); font-weight:800; font-size:18px; }
.stat-value.stat-value-text{ font-size:12.5px; line-height:24px; white-space:nowrap; }
.stat-label{ color:var(--muted); font-size:10.5px; text-transform:uppercase; letter-spacing:0.03em; margin-top:2px; }

/* standings table - Pos/Team stay pinned while the stat columns scroll
   underneath, so context (which row you're looking at) is never lost even
   though all 8 columns can't fit on a narrow phone without some scroll. */
.standings-table{ overflow-x:auto; }
.standings-row{
    display:grid; grid-template-columns:32px 1fr 30px 30px 30px 40px 40px 48px;
    align-items:center; gap:4px; padding:9px 6px; font-size:13px; min-width:420px;
    border-bottom:1px solid var(--line-soft);
}
.standings-row:last-child{ border-bottom:none; }
.standings-row > *:nth-child(1),
.standings-row > *:nth-child(2){
    position:sticky; z-index:1;
    background:var(--panel);
}
.standings-row > *:nth-child(1){ left:0; }
.standings-row > *:nth-child(2){ left:32px; }
.standings-me > *:nth-child(1),
.standings-me > *:nth-child(2){
    background:var(--blue-soft);
}
.standings-header{ color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:0.02em; font-weight:700; }
.standings-header > *:nth-child(1),
.standings-header, .standings-header > *{ background:var(--field-soft); }
.standings-header{ border-radius:8px; }
.standings-team{ font-weight:700; display:flex; align-items:center; gap:4px; }
.standings-pts{ font-weight:800; color:var(--brand); }
.standings-me{ background:var(--blue-soft); border-radius:8px; border-bottom-color:transparent; }

/* team dashboard summary */
.summary-grid{ display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:8px; margin-top:14px; }
.summary-grid .stat-tile{ padding:10px 4px; }
.next-match{
    margin-top:14px; padding:12px; border-radius:var(--radius-sm); border:1px dashed var(--accent-line);
    background:var(--accent-soft); text-align:center;
}
.next-match .label{ font-size:11px; text-transform:uppercase; letter-spacing:0.03em; color:var(--muted); font-weight:700; }
/* opponent identity - deliberately lighter than .team-hero h2 (the
   viewer's own team) so it reads as "who you're playing next", not a
   second, competing identity on the page. */
.next-match .opp-label{ font-size:10px; text-transform:uppercase; letter-spacing:0.04em; color:var(--faint); font-weight:700; margin-top:8px; }
.next-match .opp{ font-family:var(--font-display); font-size:16px; font-weight:700; margin:2px 0; }

/* champion */
.champion-card{
    text-align:center; background:linear-gradient(180deg,#FFF4D6,var(--panel));
    border-color:rgba(245,158,11,0.5);
}

/* pending/suspended account notices (register.html/login.html) - a neutral
   heads-up tone, distinct from .form-error which is reserved for actual
   input mistakes the visitor can immediately fix. */
.notice{ text-align:center; }
.notice-warn{ border-color:rgba(245,158,11,0.5); background:linear-gradient(180deg,#FFF8E6,var(--panel)); }

/* owner dashboard - organiser + league management rows (owner.html). Same
   "bordered div row" idiom as .league-row/.team-row rather than a <table>,
   for the same reason those use it: it degrades to stacked content on a
   narrow phone without a horizontal-scroll table ever being needed. */
.manage-row{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:12px 14px; border:1px solid var(--line-soft); border-radius:var(--radius-sm);
  flex-wrap:wrap;
}
.manage-row-name{ font-weight:700; font-family:var(--font-display); }
.manage-row-meta{ color:var(--muted); font-size:12.5px; margin-top:2px; }
.manage-row-assign{ display:flex; align-items:center; gap:8px; }
.manage-row-assign .input{ width:auto; min-width:160px; }

/* Scorer Lab (owner.html only, prototype) - two huge tap zones. Deliberately
   plain <button>s rather than anything fancier so the whole area is one big
   tap target on touch/watch-sized screens, not just a small label inside a
   bigger box. Stays side-by-side (never stacks) even on a narrow phone -
   two thumbs, one per side, is the actual use case this is designed for. */
.scorer-court{ display:flex; gap:10px; margin-bottom:16px; }
.scorer-side{
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:6px; min-height:200px; border-radius:var(--radius); border:2px solid transparent;
  cursor:pointer; font-family:var(--font-body); padding:16px 8px;
  /* Rapid repeated tapping is the whole point of this control, and mobile
     Safari reads a fast double-tap as "zoom in" by default, plus adds its
     own ~300ms tap delay while it waits to see if a second tap is coming -
     both wrong here. touch-action:manipulation tells the browser this
     element only cares about single taps/panning, which removes both the
     double-tap-zoom gesture AND that delay, without touching the page's
     normal pinch-to-zoom (that's a separate gesture, untouched, and this
     property only applies to this element, not the whole page). The
     select/callout/tap-highlight suppressions below are the same "rapid
     tapping shouldn't look or feel like a text/link interaction" idea. */
  touch-action:manipulation;
  -webkit-user-select:none; user-select:none;
  -webkit-touch-callout:none;
  -webkit-tap-highlight-color:transparent;
}
.scorer-side:disabled{ opacity:0.6; cursor:not-allowed; }
.scorer-side.team-a{ background:var(--green-soft); border-color:rgba(22,163,74,0.45); color:#14532D; }
.scorer-side.team-b{ background:var(--blue-soft); border-color:rgba(59,130,246,0.5); color:#1E3A8A; }
.scorer-serving{ font-size:11.5px; font-weight:800; letter-spacing:0.03em; text-transform:uppercase; min-height:14px; }
/* Deuce/Advantage/Golden Point banner, shown above the court. Golden Point
   gets its own gold treatment (and the court itself gets a matching glow
   via .scorer-court.golden below) since it's the deciding point of the
   game and the brief specifically calls for it to stand out. */
.scorer-phase-banner{
  text-align:center; font-family:var(--font-display); font-weight:800; font-size:15px;
  letter-spacing:0.03em; text-transform:uppercase; padding:10px; border-radius:var(--radius-sm);
  background:var(--tint-2); color:var(--muted); margin-bottom:-4px;
}
.scorer-phase-banner.golden{
  background:linear-gradient(135deg,#FDE9B0,#FFF4D6);
  color:var(--amber-text); border:1px solid rgba(245,158,11,0.6);
}
.scorer-court.golden .scorer-side{ border-color:rgba(245,158,11,0.6); box-shadow:0 0 0 1px rgba(245,158,11,0.3); }
.scorer-team-name{ font-family:var(--font-display); font-weight:800; font-size:16px; text-align:center; overflow-wrap:break-word; }
.scorer-point{ font-family:var(--font-display); font-weight:800; font-size:56px; line-height:1; }
.scorer-games{ font-size:13px; color:var(--muted); }
@media (max-width: 480px){
  .scorer-side{ min-height:150px; padding:10px 4px; }
  .scorer-point{ font-size:40px; }
  .scorer-team-name{ font-size:13px; }
}

/* Scorer Lab landscape takeover - a phone rotated sideways while actually
   playing/testing should feel like a dedicated scoring device, not a
   webpage. Everything here is scoped under .scorer-live-root (the live
   scorer's own root element, only rendered by scorer-lab-view.js) so it can
   never affect any other page or the Owner Dashboard's own tabs - nothing
   outside Scorer Lab's own markup is touched.
   This is pure CSS, keyed off orientation+height media features rather
   than any JS resize/orientation listener - rotating the phone just makes
   the browser re-evaluate these rules against the same unchanged DOM tree
   and the same in-memory `match` object, so there is no re-render, no
   re-fetch, no reset, and no navigation on rotation, ever.
   The height cap (not just orientation:landscape) is what keeps this from
   also firing on a landscape tablet or a wide desktop window, where the
   normal Dashboard-style layout is still what you want. */
@media (orientation: landscape) and (max-height: 500px){
  .scorer-live-root{
    position:fixed; inset:0; z-index:500;
    display:flex; flex-direction:column; gap:0;
    background:var(--page); padding:0; margin:0;
    overflow:hidden;
  }
  /* Long headings, match history, and the testing readout are exactly the
     "unnecessary dashboard/test information" the brief asks to hide here -
     the two scoring sides plus the compact state banner are all that's
     essential mid-point. */
  .scorer-live-root .scorer-header,
  .scorer-live-root .scorer-overview-card,
  .scorer-live-root .scorer-testing-card{ display:none; }

  .scorer-live-root .scorer-winner-banner{ margin:8px; padding:10px; }
  .scorer-live-root .scorer-winner-banner h2{ font-size:20px; margin:4px 0; }

  .scorer-live-root .scorer-phase-banner{
    flex:none; margin:0; border-radius:0; padding:4px;
    font-size:12px; letter-spacing:0.02em;
  }

  .scorer-live-root .scorer-court{
    flex:1; margin:0; gap:2px; min-height:0;
  }
  .scorer-live-root .scorer-side{
    min-height:0; height:100%; border-radius:0; border-width:0;
    padding:4px 8px;
    /* Leaves room at the bottom for the floating Undo/Reset controls so
       they never sit on top of - or get mistaken for part of - the tap
       target itself. */
    padding-bottom:calc(40px + env(safe-area-inset-bottom, 0px));
  }
  .scorer-live-root .scorer-side.team-a{ border-right:1px solid var(--line); }
  .scorer-live-root .scorer-serving{ font-size:10px; }
  .scorer-live-root .scorer-team-name{ font-size:12px; }
  /* The point score is deliberately the biggest thing on the whole
     screen - vh-based so it scales with the phone's actual landscape
     height instead of a single fixed size. */
  .scorer-live-root .scorer-point{ font-size:min(30vh,25vw); line-height:1; }
  .scorer-live-root .scorer-games{ font-size:12px; }

  /* Small, centered, and out of the main tap flow on purpose - accessible
     for a genuine undo/reset, not something a fast rapid-tap could hit by
     accident. */
  .scorer-live-root .scorer-actions{
    position:absolute; left:50%; bottom:env(safe-area-inset-bottom, 4px); transform:translateX(-50%);
    z-index:5; gap:6px; margin:0;
  }
  .scorer-live-root .scorer-actions .btn{
    min-height:26px; padding:2px 10px; font-size:10.5px;
    background:rgba(255,255,255,0.9); backdrop-filter:blur(4px);
  }
}

/* League rules (create-league form, Settings tab, and the team link's
   accept screen / rules card) */
.rules-heading{ margin:18px 0 6px; }
.rules-editor{ display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.rules-group-title{
    margin-top:10px; font-size:11px; font-weight:800; text-transform:uppercase;
    letter-spacing:0.04em; color:var(--muted);
}
.rules-row{
    display:flex; align-items:flex-start; gap:10px; padding:9px 10px;
    border:1px solid var(--line-soft); border-radius:var(--radius-sm);
    font-size:13.5px; line-height:1.5;
}
.rules-row.locked{ background:var(--field-soft); color:var(--muted); }
.rules-row input[type="checkbox"]{ flex:none; width:18px; height:18px; margin-top:3px; accent-color:var(--brand); }
.rules-lock{ flex:none; font-size:13px; line-height:1.6; }
.rules-text{ min-width:0; overflow-wrap:break-word; }
/* the {blanks} inside a rule - small inline inputs in the sentence, not the
   full-width 44px form input */
.rules-blank{
    display:inline-block; width:64px; height:30px; padding:2px 6px; margin:0 3px;
    font-size:14px; text-align:center; vertical-align:middle;
}
.rules-blank[type="text"]{ width:130px; }
.rules-custom{ height:auto; min-height:84px; padding:10px 12px; resize:vertical; }
.rules-list{ margin:12px 0; padding-left:22px; font-size:14px; line-height:1.55; }
.rules-list li{ margin-bottom:8px; overflow-wrap:break-word; }
.rules-card summary{ cursor:pointer; font-family:var(--font-display); font-weight:700; font-size:16px; }
.rules-card p{ margin:10px 0 0; }
.rules-gate h2{ margin-bottom:8px; }
.rules-gate .field{ margin:14px 0 10px; }

/* entry-fee payment screen on the team link */
.pay-gate h2{ margin-bottom:8px; }
.pay-price{ margin:16px 0 8px; padding:16px; border:1px solid var(--accent-line); border-radius:var(--radius-sm); background:var(--accent-soft); text-align:center; }
.pay-amount{ font-family:var(--font-display); font-weight:800; font-size:34px; color:var(--brand); }
.pay-waiting{ padding:10px 12px; border-radius:var(--radius-sm); background:var(--amber-soft); border:1px solid rgba(245,158,11,0.45); color:var(--amber-text); }
.pay-gate .btn{ margin-top:6px; }

/* organiser entry-fee fields and the Owner's payout ledger */
.price-callout{ margin:12px 0 4px; padding:14px 16px; border:1px solid var(--accent-line); border-radius:var(--radius-sm); background:var(--accent-soft); }
.price-callout-label{ color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:0.04em; }
.price-callout-amount{ font-family:var(--font-display); font-weight:800; font-size:36px; line-height:1.1; color:var(--brand); margin:4px 0 6px; }
.price-callout-detail{ font-size:14px; }
.ledger-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:8px; margin:10px 0; }
.ledger-owed{ font-family:var(--font-display); font-weight:800; font-size:20px; }

/* danger zone */
.danger-card{ border-color:rgba(220,38,38,0.35); background:linear-gradient(180deg,#FFF5F5,var(--panel)); }
.danger-card .input{ margin:10px 0; }
.champion-card h2{ margin:6px 0; font-size:26px; }

/* result-submit confirmation modal */
.modal-backdrop{
    position:fixed; inset:0; z-index:1000;
    background:rgba(20,33,61,0.55); backdrop-filter:blur(3px);
    display:flex; align-items:center; justify-content:center;
    padding:16px;
}
.modal-card{ max-width:400px; width:100%; margin:0; box-shadow:var(--shadow-lg); }
.modal-list{ margin:8px 0 0; padding-left:20px; font-size:14px; line-height:1.5; }
.modal-list li{ margin-bottom:4px; overflow-wrap:break-word; }
.modal-actions{ margin-top:16px; justify-content:flex-end; }

/* pill ON/OFF switch (admin Settings - "Team availability") */
.switch{ display:inline-flex; align-items:center; gap:10px; cursor:pointer; user-select:none; }
.switch input{ position:absolute; opacity:0; width:1px; height:1px; }
.switch-track{
    position:relative; flex:none; width:44px; height:26px; border-radius:999px;
    background:#C3CEE0; transition:background .15s ease;
}
.switch-track::after{
    content:""; position:absolute; top:3px; left:3px; width:20px; height:20px;
    border-radius:50%; background:#fff; transition:transform .15s ease;
    box-shadow:0 1px 3px rgba(20,33,61,0.35);
}
.switch input:checked + .switch-track{ background:var(--blue-600); }
.switch input:checked + .switch-track::after{ transform:translateX(18px); }
.switch input:focus-visible + .switch-track{ outline:2px solid var(--brand); outline-offset:2px; }
.switch-label{ font-weight:700; font-size:14px; }
.toggle-row{ display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }

/* team availability board */
/* one editable availability entry - a small bordered card so several
   entries (each now up to 3 rows: type toggle, day picker(s), time+remove)
   read as distinct items instead of running together. */
.avail-entry{
    display:flex; flex-direction:column; gap:8px;
    padding:10px; border-radius:var(--radius-sm);
    background:var(--field-soft); border:1px solid var(--line-soft);
}
.avail-type-toggle{ display:flex; gap:6px; }
.avail-type-btn{ flex:1 1 0; }
.avail-type-btn.active{ background:var(--blue-soft); border-color:var(--blue); color:var(--blue-700); }
.avail-day-row{ display:flex; gap:8px; flex-wrap:wrap; }
.avail-day-row .field{ min-width:120px; }
.avail-row{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.avail-row .input{ flex:1 1 110px; min-width:96px; width:auto; }
.avail-row .btn{ flex:none; }
/* 24h hour/minute <select> pair standing in for <input type="time"> - see
   timeUnit() in team-view.js for why a native time input can't be trusted
   to show 24h on every device. */
.avail-time{ display:inline-flex; align-items:center; gap:4px; flex:none; }
.avail-time-h, .avail-time-m{
    background:var(--field); border:1px solid var(--line); border-radius:var(--radius-sm);
    color:var(--text); font-family:var(--font-body); font-size:16px; padding:10px 4px;
    height:44px; width:60px; text-align:center;
}
.avail-time-sep{ color:var(--faint); font-weight:700; }
.avail-chips{ display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.avail-chip{
    background:var(--accent-soft); border:1px solid var(--accent-line); color:var(--accent-text);
    padding:4px 10px; border-radius:999px; font-size:12.5px; font-weight:700; white-space:nowrap;
}
.avail-note{ margin-top:6px; overflow-wrap:break-word; }
.avail-hint{ margin-top:10px; }
.avail-summary{ margin-top:8px; }
.next-match .avail-summary .avail-chips{ justify-content:center; }

/* ---------- player's team page ---------- */

/* Section bar: fixed to the bottom of a phone like a native app (a thumb's
   reach), and a centred pill bar at the top of wider screens. */
.team-nav{
    position:fixed; left:0; right:0; bottom:0; z-index:60;
    display:flex; gap:2px;
    padding:6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background:rgba(255,255,255,0.96); backdrop-filter:blur(14px);
    border-top:1px solid var(--line);
    box-shadow:0 -6px 24px rgba(20,33,61,0.08);
}
.team-nav-item{
    position:relative; flex:1; min-width:0;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
    min-height:54px; padding:6px 2px; border:0; border-radius:12px; background:none;
    color:var(--faint); font-family:var(--font-body); font-weight:700; font-size:11px; cursor:pointer;
    transition:color .12s var(--ease), background .12s var(--ease);
}
.team-nav-item:hover{ color:var(--muted); }
.team-nav-item.active{ color:var(--blue-600); }
.team-nav-item.active::before{
    content:""; position:absolute; top:-6px; left:28%; right:28%; height:3px;
    border-radius:0 0 4px 4px; background:var(--blue);
}
.team-nav-label{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; }
.nav-dot{
    position:absolute; top:6px; left:calc(50% + 7px); width:10px; height:10px; border-radius:50%;
    background:var(--amber); border:2px solid #fff;
}
#app.with-nav{ padding-bottom:calc(92px + env(safe-area-inset-bottom, 0px)); }
.team-section{ animation:sectionIn .25s var(--ease); }
@keyframes sectionIn{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }

@media (min-width: 720px){
    .team-nav{
        position:sticky; top:10px; bottom:auto; left:auto; right:auto;
        width:fit-content; max-width:100%; margin:0 auto 18px; padding:6px;
        border:1px solid var(--line-soft); border-radius:999px; background:var(--panel);
        box-shadow:var(--shadow);
    }
    .team-nav-item{ flex:none; flex-direction:row; gap:8px; min-height:44px; padding:8px 18px; border-radius:999px; font-size:13.5px; }
    .team-nav-item.active{ background:var(--blue-soft); color:var(--blue-700); }
    .team-nav-item.active::before{ display:none; }
    .nav-dot{ position:static; margin-left:2px; }
    #app.with-nav{ padding-bottom:48px; }
}

/* hero: whose page this is, and where they stand */
.team-hero{
    padding:24px 20px; border-color:transparent;
    background:
        radial-gradient(circle at 100% 0%,rgba(59,130,246,0.38),transparent 52%),
        linear-gradient(160deg,#14213D,#1b2d57);
    box-shadow:var(--shadow-lg);
}
.hero-eyebrow{ font-size:11px; font-weight:800; letter-spacing:0.06em; text-transform:uppercase; color:var(--muted); }
.hero-rank{ display:flex; align-items:baseline; justify-content:center; gap:8px; margin:10px 0 2px; }
.rank-badge{ font-family:var(--font-display); font-weight:800; font-size:44px; line-height:1; color:var(--brand); }
.progress-wrap{ margin-top:16px; text-align:left; }
.progress{ height:8px; border-radius:999px; background:var(--tint-2); overflow:hidden; margin-top:6px; }
.progress > span{ display:block; height:100%; border-radius:999px; background:linear-gradient(90deg,var(--brand),var(--blue)); transition:width .4s var(--ease); }

/* the thing that needs doing next */
.next-card{ border-color:var(--accent-line); background:linear-gradient(180deg,var(--blue-soft),var(--panel) 70%); }
.next-card .next-eyebrow{ font-size:11px; font-weight:800; letter-spacing:0.06em; text-transform:uppercase; color:var(--blue-700); }
.next-card .next-opp{ font-family:var(--font-display); font-weight:800; font-size:22px; line-height:1.2; margin:6px 0 2px; overflow-wrap:break-word; }
.next-card .btn.block{ margin-top:14px; }
.next-status{ margin:12px 0 0; padding:10px 12px; border-radius:var(--radius-sm); background:var(--tint); font-size:14px; }
.attention-card{ border-color:rgba(245,158,11,0.55); background:linear-gradient(180deg,#FFF3D6,var(--panel) 75%); }
.attention-card h3{ display:flex; align-items:center; gap:8px; color:var(--amber-text); }

/* grouped lists on the Matches section */
.group-title{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.group-count{ font-size:12px; font-weight:800; color:var(--muted); background:var(--tint-2); border-radius:999px; padding:2px 10px; }
details.card > summary{ cursor:pointer; font-family:var(--font-display); font-weight:700; font-size:16px; list-style:none; display:flex; align-items:center; justify-content:space-between; }
details.card > summary::-webkit-details-marker{ display:none; }
details.card > summary::after{ content:"+"; color:var(--muted); font-size:20px; line-height:1; }
details.card[open] > summary::after{ content:"\2212"; }
.info-list{ display:grid; grid-template-columns:auto 1fr; gap:8px 16px; margin:0; font-size:14px; }
.info-list dt{ color:var(--muted); }
.info-list dd{ margin:0; font-weight:600; overflow-wrap:break-word; }

/* On a phone the league table shows Pos, Team, P, W, L and PTS - everything
   fits, so Points is never hidden off to the right. (Sets won/lost still
   decide ties; the note under the table says so.) */
.table-note{ margin:12px 0 0; }
@media (max-width: 520px){
    .standings-row{ grid-template-columns:28px minmax(0,1fr) 28px 28px 28px 44px; min-width:0; }
    .standings-row > *:nth-child(6),
    .standings-row > *:nth-child(7){ display:none; }
    .standings-row > *:nth-child(1),
    .standings-row > *:nth-child(2){ position:static; background:none; }
    .standings-me > *:nth-child(1),
    .standings-me > *:nth-child(2){ background:none; }
    .standings-header > *:nth-child(1),
    .standings-header > *:nth-child(2){ background:none; }
}

@media (max-width: 640px){
    .opponent-split{ grid-template-columns:1fr; }
    .field-row.three{ flex-direction:column; }
}
@media (max-width: 480px){
    .header-inner{ padding:16px; }
    .app-header h1{ font-size:18px; }
    .field-row{ flex-direction:column; }
    .field-row > .field{ width:100%; }
    .stat-value{ font-size:16px; }
    .fixture-row{ flex-direction:column; align-items:flex-start; gap:6px; }
    /* narrow phones nest the score grid inside several padded cards, leaving
       little room for the name column - trim the score columns a touch so
       team/player names get enough width to wrap at word boundaries instead
       of breaking mid-word. */
    .score-grid{ grid-template-columns:minmax(0,1fr) repeat(3, 36px); column-gap:4px; }
}

/* ---------- front page (index.html) ---------- */
.landing{ flex:1 0 auto; }
.lp-wrap{ width:min(1040px,100%); margin:0 auto; padding:0 18px; }
.lp-narrow{ max-width:760px; }
.lp-section{ padding:56px 0; }
.lp-alt{ background:var(--panel); border-top:1px solid var(--line-soft); border-bottom:1px solid var(--line-soft); }
.lp-eyebrow{ margin:0 0 10px; color:var(--brand); font-weight:800; font-size:12px; letter-spacing:0.08em; text-transform:uppercase; }
.lp-title{ margin:0 0 16px; font-family:var(--font-display); font-weight:800; font-size:clamp(32px,6vw,52px); line-height:1.08; letter-spacing:-0.02em; }
.lp-lead{ margin:0 0 22px; color:var(--muted); font-size:clamp(16px,2.2vw,18.5px); line-height:1.6; max-width:34em; }
.lp-h2{ margin:0 0 8px; font-family:var(--font-display); font-weight:800; font-size:clamp(24px,4vw,34px); line-height:1.15; letter-spacing:-0.01em; }
.lp-sub{ margin:0 0 28px; color:var(--muted); font-size:16px; }
.lp-cta{ display:flex; flex-wrap:wrap; gap:10px; }
.lp-cta-center{ justify-content:center; }
.lp-cta .btn{ min-height:50px; padding:12px 26px; font-size:15px; }
.lp-note{ margin:12px 0 0; color:var(--faint); font-size:13.5px; }

.lp-hero{
    position:relative; overflow:hidden; padding:48px 0 60px;
    background:
        radial-gradient(circle at 88% 8%,rgba(59,130,246,0.40),transparent 46%),
        radial-gradient(circle at 0% 100%,rgba(59,130,246,0.18),transparent 40%),
        linear-gradient(180deg,#14213D,#0F1A33);
}
.lp-hero::before{
    content:""; position:absolute; inset:0; opacity:0.5; pointer-events:none;
    background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='320' viewBox='0 0 520 320' fill='none' stroke='%238DB8FF' stroke-opacity='0.16' stroke-width='2'%3E%3Crect x='10' y='10' width='500' height='300' rx='10'/%3E%3Cpath d='M260 10v300M10 160h500M10 85h500M10 235h500'/%3E%3C/svg%3E") no-repeat right -60px center / 760px auto;
}
.lp-hero-grid{ position:relative; display:grid; grid-template-columns:1.15fr 0.85fr; gap:40px; align-items:center; }
.lp-find{ margin-top:30px; padding:16px; border:1px solid var(--line); border-radius:var(--radius); background:var(--panel); max-width:460px; }
.lp-find label{ display:block; margin-bottom:10px; color:var(--muted); font-size:13.5px; font-weight:600; }
.lp-find-row{ display:flex; gap:8px; }
.lp-find-row .input{ text-transform:uppercase; letter-spacing:0.08em; }

/* the phone picture */
.lp-hero-visual{ display:flex; justify-content:center; }
.lp-phone{
    width:min(280px,100%); border-radius:34px; padding:10px; background:#0B1326;
    border:1px solid rgba(255,255,255,0.18); box-shadow:0 30px 70px rgba(4,10,28,0.55), 0 0 0 6px rgba(255,255,255,0.05);
}
.lp-phone-screen{ border-radius:26px 26px 6px 6px; background:linear-gradient(180deg,#FFFFFF,#EEF4FF); padding:20px 14px 16px; text-align:center; }
.mock-eyebrow{ font-size:9.5px; font-weight:800; letter-spacing:0.06em; text-transform:uppercase; color:var(--muted); }
.mock-team{ margin:6px 0 2px; font-family:var(--font-display); font-weight:800; font-size:22px; }
.mock-rank{ font-family:var(--font-display); font-weight:800; font-size:34px; color:var(--brand); line-height:1.1; }
.mock-rank span{ font-family:var(--font-body); font-weight:600; font-size:11px; color:var(--muted); margin-left:4px; }
.mock-tiles{ display:grid; grid-template-columns:repeat(4,1fr); gap:5px; margin:14px 0; }
.mock-tiles div{ background:var(--panel); border:1px solid var(--line-soft); border-radius:9px; padding:7px 2px; font-size:8.5px; text-transform:uppercase; letter-spacing:0.03em; color:var(--muted); }
.mock-tiles b{ display:block; font-family:var(--font-display); font-size:15px; color:var(--text); }
.mock-next{ padding:12px; border:1px solid var(--accent-line); border-radius:12px; background:var(--accent-soft); }
.mock-next small{ display:block; font-size:8.5px; font-weight:800; letter-spacing:0.06em; text-transform:uppercase; color:var(--blue-700); }
.mock-next b{ display:block; margin:4px 0 10px; font-family:var(--font-display); font-size:17px; }
.mock-btn{ border-radius:999px; padding:9px; background:var(--blue-600); color:#fff; font-weight:800; font-size:12px; }
.mock-nav{ display:flex; justify-content:space-around; padding:10px 4px 4px; font-size:9.5px; font-weight:700; color:var(--faint); }
.mock-nav .on{ color:var(--blue-600); }

/* how it works */
.lp-steps{ list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.lp-steps li{ padding:22px; border:1px solid var(--line-soft); border-radius:var(--radius); background:var(--panel); box-shadow:var(--shadow); }
.lp-steps h3, .lp-feature h3, .lp-card-note h3{ margin:10px 0 6px; font-family:var(--font-display); font-size:17px; }
.lp-steps p, .lp-feature p, .lp-card-note p{ margin:0; color:var(--muted); font-size:14.5px; line-height:1.6; }
.lp-step-n{ display:inline-grid; place-items:center; width:34px; height:34px; border-radius:50%; background:var(--blue-soft); color:var(--blue-700); font-family:var(--font-display); font-weight:800; }

.lp-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.lp-feature{ padding:20px; border:1px solid var(--line-soft); border-radius:var(--radius); background:var(--panel); box-shadow:var(--shadow-sm); }
.lp-feature h3{ margin-top:0; }

.lp-split{ display:grid; grid-template-columns:1.2fr 0.8fr; gap:32px; align-items:center; }
.lp-ticks{ list-style:none; margin:0 0 4px; padding:0; display:flex; flex-direction:column; gap:10px; }
.lp-ticks li{ position:relative; padding-left:30px; color:var(--text); font-size:15px; line-height:1.5; }
.lp-ticks li::before{
    content:""; position:absolute; left:0; top:3px; width:18px; height:18px; border-radius:50%;
    background:var(--blue-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563EB' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.lp-card-note{ padding:22px; border:1px dashed var(--accent-line); border-radius:var(--radius); background:var(--accent-soft); }
.lp-card-note h3{ margin-top:0; }

.lp-pricing{ display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:stretch; }
.lp-price-card{ padding:26px; border:1px solid var(--line-soft); border-radius:var(--radius); background:var(--panel); box-shadow:var(--shadow); }
.lp-price-card:first-child{ border-color:var(--blue); box-shadow:0 0 0 1px var(--blue), var(--shadow); }
.lp-price-label{ color:var(--muted); font-size:12px; font-weight:800; letter-spacing:0.06em; text-transform:uppercase; margin-bottom:8px; }
.lp-price{ font-family:var(--font-display); font-weight:800; font-size:46px; line-height:1.05; color:var(--brand); margin-bottom:16px; }
.lp-price span{ font-family:var(--font-body); font-weight:600; font-size:14px; color:var(--muted); margin-left:6px; }
.lp-price-card .btn.block{ margin-top:20px; min-height:50px; }
.lp-price-text{ margin:0 0 14px; color:var(--muted); font-size:15px; line-height:1.6; }
.lp-small{ font-size:13.5px; margin:14px 0 0; }
.lp-example{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.lp-example div{ padding:12px 8px; border:1px solid var(--line-soft); border-radius:var(--radius-sm); background:var(--field); text-align:center; }
.lp-example span{ display:block; color:var(--muted); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.03em; margin-bottom:4px; }
.lp-example b{ font-family:var(--font-display); font-size:20px; }
.lp-example div:nth-child(2) b{ color:var(--brand); }

.lp-faq{ display:flex; flex-direction:column; gap:10px; }
.lp-faq details{ border:1px solid var(--line-soft); border-radius:var(--radius-sm); background:var(--panel); box-shadow:var(--shadow-sm); padding:0 16px; }
.lp-faq summary{ cursor:pointer; list-style:none; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 0; font-weight:700; }
.lp-faq summary::-webkit-details-marker{ display:none; }
.lp-faq summary::after{ content:"+"; color:var(--muted); font-size:22px; line-height:1; flex:none; }
.lp-faq details[open] summary::after{ content:"\2212"; }
.lp-faq p{ margin:0 0 16px; color:var(--muted); line-height:1.6; }

.lp-final{ padding:64px 0 72px; text-align:center; background:radial-gradient(circle at 50% 0%,rgba(59,130,246,0.35),transparent 60%), linear-gradient(180deg,#14213D,#0F1A33); }
.lp-final .lp-sub{ margin-bottom:24px; }

@media (max-width: 820px){
    .lp-hero{ padding:28px 0 36px; }
    .lp-hero-grid, .lp-split, .lp-pricing{ grid-template-columns:1fr; }
    .lp-hero-visual{ order:2; margin-top:8px; }
    .lp-steps, .lp-grid{ grid-template-columns:1fr; }
    .lp-section{ padding:40px 0; }
    .lp-cta .btn{ flex:1 1 150px; }
    .lp-find-row{ flex-direction:column; }
}

/* ---------- legal pages (terms.html, privacy.html) ---------- */
.legal{ line-height:1.7; }
.legal h2{ font-family:var(--font-display); font-size:30px; margin:6px 0 4px; }
.legal h3{ margin:28px 0 8px; font-family:var(--font-display); font-size:17px; }
.legal p, .legal li{ color:#33425F; font-size:15px; }
.legal ul{ padding-left:20px; }
.legal li{ margin-bottom:8px; }
.legal a{ color:var(--brand); }
.footer-links{ display:flex; gap:16px; }
.footer-links a{ color:var(--muted); text-decoration:none; }
.footer-links a:hover{ color:var(--text); text-decoration:underline; }

/* ---------- sign in / sign up ---------- */
.auth-layout{ display:grid; grid-template-columns:0.9fr 1.1fr; gap:28px; align-items:start; }
.auth-aside{ padding:8px 6px; }
.auth-aside h2{ margin:0 0 10px; font-family:var(--font-display); font-weight:800; font-size:30px; line-height:1.15; letter-spacing:-0.01em; }
.auth-aside > p{ margin:0 0 20px; color:var(--muted); line-height:1.6; }
.auth-form{ display:flex; flex-direction:column; gap:14px; margin:0; }
.auth-form h2{ margin:0; }
.auth-form .field{ margin:0; }
.auth-form .field-sub{ margin:-6px 0 0; }
.auth-form .btn.block{ min-height:50px; font-size:15px; }
.input-group{ position:relative; }
.input-group .input{ padding-right:68px; }
.input-toggle{
    position:absolute; right:6px; top:50%; transform:translateY(-50%); height:32px; padding:0 12px;
    border:0; border-radius:999px; background:var(--tint-2); color:var(--muted);
    font-family:var(--font-body); font-weight:700; font-size:12px; cursor:pointer;
}
.input-toggle:hover{ color:var(--text); }
.auth-switch{ margin:0; text-align:center; }
.auth-switch a{ color:var(--brand); font-weight:700; }
@media (max-width: 760px){
    .auth-layout{ grid-template-columns:1fr; }
    .auth-aside{ display:none; }
}

/* ===== demo mode (demo-admin.html / demo-team.html) ===== */
/* A strip under the header that says this is a practice league, switches
   between the organiser and player views, and holds Simulate / Reset. */
.demo-bar{ background:var(--amber-soft); color:var(--amber-text); border-bottom:1px solid rgba(245,158,11,0.35); padding:10px 16px; }
.demo-bar-top, .demo-bar-actions{ width:min(880px,100%); margin:0 auto; display:flex; flex-wrap:wrap; align-items:center; gap:8px 10px; }
.demo-bar-actions{ margin-top:8px; }
.demo-tag{ background:var(--amber-text); color:#fff; font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; padding:3px 8px; border-radius:999px; }
.demo-text{ flex:1 1 120px; min-width:0; font-size:13px; font-weight:600; line-height:1.3; }
.demo-view{ font-size:13px; font-weight:700; color:var(--amber-text); text-decoration:none; padding:7px 12px; border-radius:999px; border:1px solid rgba(146,64,14,0.3); min-height:34px; display:inline-flex; align-items:center; }
.demo-view.active{ background:var(--amber-text); color:#fff; border-color:var(--amber-text); }
.demo-bar .btn.btn-ghost{ background:rgba(255,255,255,0.7); color:var(--amber-text); border-color:rgba(146,64,14,0.35); }
.demo-picker{ width:auto; min-width:0; max-width:100%; min-height:34px; padding:4px 10px; font-size:13px; }
.demo-msg{ flex:1 1 100%; font-size:13px; font-weight:600; }
.demo-msg:empty{ display:none; }
.demo-warn{ width:min(880px,100%); margin:8px auto 0; font-size:13px; font-weight:700; color:var(--danger-text); }
.demo-bar .btn.small{ min-height:34px; padding:6px 12px; font-size:13px; }

/* ===== Club hub (club.html / demo-club.html) - the "control room" look =====
   Organisers running a club get a dark page with a lime (padel-ball) accent,
   so it never looks like the bright blue pages players see. It swaps the same
   design tokens as every other page, so cards, inputs and badges just work. */
body.theme-club{
    --page:#0B1220;
    --panel:#121B2E;
    --field:#0F1828;
    --field-soft:#162036;
    --line:rgba(255,255,255,0.12);
    --line-soft:rgba(255,255,255,0.07);
    --text:#F2F5FA;
    --muted:#A9B6CC;
    --faint:#7F8DA6;
    --lime:#C6F432;
    --lime-dark:#A6D61A;
    --brand:#C6F432;
    --brand-strong:#D7FF5A;
    --accent-soft:rgba(198,244,50,0.12);
    --accent-line:rgba(198,244,50,0.45);
    --accent-text:#D7FF5A;
    --tint:rgba(255,255,255,0.05);
    --tint-2:rgba(255,255,255,0.1);
    --blue-soft:rgba(59,130,246,0.2);
    --blue-700:#9CC2FF;
    --amber-soft:rgba(245,158,11,0.18);
    --amber-text:#FCD34D;
    --green-soft:rgba(22,163,74,0.2);
    --green-text:#86EFAC;
    --shadow:0 1px 0 rgba(255,255,255,0.04) inset, 0 14px 34px rgba(0,0,0,0.35);
    --shadow-sm:none;
    --ring:0 0 0 3px rgba(198,244,50,0.35);
    background:var(--page);
    color:var(--text);
}
body.theme-club .btn-primary{ background:var(--lime); color:#0B1220; box-shadow:0 6px 18px rgba(198,244,50,0.25); }
body.theme-club .btn-primary:hover:not(:disabled){ background:var(--brand-strong); box-shadow:0 8px 22px rgba(198,244,50,0.32); }
body.theme-club .btn:hover:not(:disabled){ border-color:var(--lime); }
body.theme-club .input:focus{ border-color:var(--lime); }
body.theme-club a{ color:var(--accent-text); }
body.theme-club .avatar{ background:linear-gradient(135deg,var(--lime),#7FB800); color:#0B1220; }

.club-header{ position:sticky; top:0; z-index:40; background:rgba(11,18,32,0.88); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); border-bottom:1px solid var(--line-soft); padding-top:env(safe-area-inset-top); }
.club-header-inner{ width:min(880px,100%); margin:0 auto; padding:12px 18px; display:flex; align-items:center; gap:12px; min-height:60px; }
.club-crest{ width:40px; height:40px; border-radius:12px; display:grid; place-items:center; flex:none; background:var(--lime); color:#0B1220; font-family:var(--font-display); font-weight:800; font-size:15px; letter-spacing:.02em; }
.club-name{ font-family:var(--font-display); font-weight:800; font-size:18px; line-height:1.1; }
.club-powered{ font-size:11.5px; color:var(--faint); font-weight:600; letter-spacing:.03em; margin-top:2px; }
.club-header .shell-spacer{ flex:1; }
.club-user{ display:flex; align-items:center; gap:8px; background:var(--tint); border:1px solid var(--line); color:var(--text); border-radius:999px; padding:4px 12px 4px 4px; font:inherit; font-size:12.5px; font-weight:700; cursor:pointer; min-height:40px; }
.club-user:hover{ border-color:var(--lime); }

.club-container{ padding-top:26px; }
.club-card h2{ font-family:var(--font-display); margin:0 0 8px; }
.club-login{ max-width:460px; margin:6vh auto 0; display:flex; flex-direction:column; gap:12px; }
.club-login .field{ margin:0; }
.club-eyebrow{ margin:0; color:var(--lime); font-size:12px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.club-person{ display:flex; align-items:center; gap:12px; width:100%; text-align:left; background:var(--field-soft); border:1px solid var(--line); color:var(--text); border-radius:var(--radius-sm); padding:12px 14px; font:inherit; cursor:pointer; min-height:56px; transition:border-color .12s var(--ease), transform .12s var(--ease); }
.club-person:hover{ border-color:var(--lime); }
.club-person:active{ transform:scale(0.99); }
.club-person-name{ flex:1; font-weight:700; }

.club-hello h2{ font-family:var(--font-display); font-weight:800; font-size:clamp(26px,6vw,34px); margin:6px 0 2px; letter-spacing:-0.01em; }
.club-ask{ margin:0 0 16px; color:var(--muted); font-size:16px; font-weight:600; }

.format-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:28px; }
@media (min-width:760px){ .format-grid{ grid-template-columns:repeat(4,minmax(0,1fr)); } }
.format-tile{ position:relative; display:flex; flex-direction:column; align-items:flex-start; gap:6px; text-align:left; padding:16px; min-height:150px; border-radius:var(--radius); border:1px solid var(--line); background:var(--panel); color:var(--text); font:inherit; cursor:pointer; overflow:hidden; transition:transform .14s var(--ease), border-color .14s var(--ease), box-shadow .14s var(--ease); }
.format-tile::before{ content:""; position:absolute; inset:0; background:radial-gradient(120% 80% at 100% 0%, var(--tile-glow,rgba(198,244,50,0.14)), transparent 60%); pointer-events:none; }
.format-tile:hover{ border-color:var(--tile-color,var(--lime)); box-shadow:0 10px 26px rgba(0,0,0,0.35); }
.format-tile:active{ transform:scale(0.98); }
.format-league{ --tile-color:#C6F432; --tile-glow:rgba(198,244,50,0.18); }
.format-americano{ --tile-color:#38BDF8; --tile-glow:rgba(56,189,248,0.18); }
.format-mexicano{ --tile-color:#FB923C; --tile-glow:rgba(251,146,60,0.18); }
.format-day{ --tile-color:#C084FC; --tile-glow:rgba(192,132,252,0.18); }
.format-icon{ width:44px; height:44px; border-radius:12px; display:grid; place-items:center; background:rgba(255,255,255,0.06); color:var(--tile-color); margin-bottom:4px; }
.format-title{ font-family:var(--font-display); font-weight:800; font-size:17px; }
.format-text{ font-size:12.5px; color:var(--muted); line-height:1.35; }
.format-soon{ margin-top:auto; font-size:10.5px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:var(--faint); }

.club-section{ background:var(--panel); border:1px solid var(--line-soft); border-radius:var(--radius); padding:16px; margin-bottom:16px; }
.club-section-head, .club-finished summary{ display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.club-section h3{ margin:0; font-family:var(--font-display); font-size:16px; }
.club-finished summary{ cursor:pointer; list-style:none; margin-bottom:0; }
.club-finished summary::-webkit-details-marker{ display:none; }
.club-finished[open] summary{ margin-bottom:12px; }
.club-finished summary::after{ content:"▾"; margin-left:auto; color:var(--faint); }
.club-count{ min-width:24px; height:24px; padding:0 7px; border-radius:999px; display:inline-grid; place-items:center; background:var(--tint-2); color:var(--muted); font-size:12px; font-weight:800; }
.club-empty{ color:var(--faint); font-size:13.5px; margin:0 0 12px; }

.event-row, .member-row{ display:flex; align-items:center; gap:12px; padding:12px; border-radius:var(--radius-sm); border:1px solid var(--line-soft); background:var(--field-soft); color:var(--text); text-decoration:none; }
body.theme-club a.event-row{ color:var(--text); }
a.event-row:hover{ border-color:var(--lime); }
.event-kind{ width:36px; height:36px; border-radius:10px; display:grid; place-items:center; flex:none; background:rgba(198,244,50,0.12); color:var(--lime); }
.event-main{ display:flex; flex-direction:column; min-width:0; flex:1; }
.event-name{ font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.event-meta{ font-size:12.5px; color:var(--muted); }

.club-add-title{ margin:18px 0 6px; font-size:14px; }
.club-add-row{ display:flex; gap:8px; flex-wrap:wrap; }
.club-add-row .input{ flex:1 1 180px; width:auto; }
.club-add-row .club-role-select{ flex:0 1 140px; }

.club-sheet-overlay{ position:fixed; inset:0; z-index:90; background:rgba(3,7,15,0.6); display:flex; align-items:flex-end; justify-content:center; animation:club-fade .15s var(--ease); }
.club-sheet{ width:min(520px,100%); background:var(--panel); border:1px solid var(--line); border-radius:20px 20px 0 0; padding:22px 20px calc(22px + env(safe-area-inset-bottom)); animation:club-up .2s var(--ease); }
.club-sheet h3{ margin:0 0 8px; font-family:var(--font-display); font-size:19px; }
.club-sheet-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
@media (min-width:640px){ .club-sheet-overlay{ align-items:center; } .club-sheet{ border-radius:20px; } }
@keyframes club-fade{ from{ opacity:0; } }
@keyframes club-up{ from{ transform:translateY(24px); opacity:0; } }

/* My leagues: a link into a club the organiser belongs to. */
.club-banner{ display:flex; align-items:center; justify-content:space-between; gap:12px; text-decoration:none; color:inherit; border-color:var(--accent-line); background:linear-gradient(135deg,var(--accent-soft),var(--panel)); }
.club-demo-tag{ margin-left:8px; vertical-align:middle; background:var(--amber); color:#0B1220; font-family:var(--font-body); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; padding:2px 7px; border-radius:999px; }
.club-user-name{ white-space:nowrap; }
.event-meta{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.member-row .badge{ flex:none; }
@media (max-width:420px){ .member-row .event-meta{ display:none; } }
