/* ==========================================================================
   ALIC — Annual Lakeside Inter-Schools Championship · player registration
   ========================================================================== */

:root {
    --pitch-950: #04170e;
    --pitch-900: #06281a;
    --pitch-800: #0a3a26;
    --pitch-700: #0f5134;
    --pitch-600: #146c44;
    --green: #16a34a;
    --green-soft: #e7f6ec;
    --accent: #d4f53c;
    --accent-hover: #c4e82a;
    --accent-ink: #1a2a05;

    --ink: #0c1712;
    --text: #22302a;
    --muted: #66766e;
    --line: #e2e8e4;
    --line-strong: #cfd8d3;
    --bg: #f2f5f3;
    --card: #ffffff;

    --danger: #dc2626;
    --danger-soft: #fdecec;
    --warn: #b45309;
    --warn-soft: #fef5e6;
    --info: #1d4ed8;
    --info-soft: #ebf1fe;

    --pos-GK: #f59e0b;
    --pos-DEF: #2563eb;
    --pos-MID: #16a34a;
    --pos-FWD: #e11d48;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(12, 23, 18, .06);
    --shadow: 0 1px 2px rgba(12, 23, 18, .05), 0 8px 24px -6px rgba(12, 23, 18, .10);
    --shadow-lg: 0 2px 4px rgba(12, 23, 18, .06), 0 24px 48px -12px rgba(12, 23, 18, .22);

    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Barlow Condensed", "Inter", system-ui, sans-serif;
    --header-h: 68px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--pitch-600); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--pitch-800); }
h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0; }
p { margin: 0; }
button { font: inherit; cursor: pointer; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

[hidden] { display: none !important; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 100;
    background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 10px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

.icon { width: 18px; height: 18px; flex: none; }
.icon-inline { width: 14px; height: 14px; vertical-align: -2px; }
.inline-form { display: inline; margin: 0; }

/* ---------- Buttons ---------- */
.btn {
    --btn-bg: var(--pitch-700);
    --btn-fg: #fff;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px;
    border: 1px solid transparent; border-radius: 12px;
    background: var(--btn-bg); color: var(--btn-fg);
    font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
    transition: background .15s, transform .15s, box-shadow .15s, border-color .15s, color .15s;
}
.btn:hover { color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn-primary { --btn-bg: var(--pitch-700); box-shadow: 0 6px 16px -6px rgba(15, 81, 52, .55); }
.btn-primary:hover { --btn-bg: var(--pitch-800); }
.btn-accent { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); box-shadow: 0 6px 18px -6px rgba(212, 245, 60, .6); }
.btn-accent:hover { --btn-bg: var(--accent-hover); }
.btn-ghost { --btn-bg: transparent; --btn-fg: rgba(255, 255, 255, .88); }
.btn-ghost:hover, .btn-ghost.is-active { --btn-bg: rgba(255, 255, 255, .1); --btn-fg: #fff; }
.btn-outline-light { --btn-bg: transparent; --btn-fg: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-outline-light:hover { --btn-bg: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .6); }
.btn-ghost-dark { --btn-bg: #fff; --btn-fg: var(--ink); border-color: var(--line-strong); }
.btn-ghost-dark:hover { --btn-bg: var(--bg); border-color: var(--muted); }
.btn-danger { --btn-bg: #fff; --btn-fg: var(--danger); border-color: #f3c4c4; }
.btn-danger:hover { --btn-bg: var(--danger); --btn-fg: #fff; border-color: var(--danger); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-xs { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-xs .icon { width: 15px; height: 15px; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(6, 40, 26, .96);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; min-width: 0; margin-right: auto; }
.brand:hover { color: #fff; }
.brand-mark {
    display: grid; place-items: center; width: 40px; height: 40px; flex: none;
    border-radius: 12px; background: var(--accent); color: var(--accent-ink);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12);
}
.brand-mark .icon { width: 24px; height: 24px; }
.brand-mark--sm { width: 28px; height: 28px; border-radius: 8px; }
.brand-mark--sm .icon { width: 17px; height: 17px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.brand-text strong {
    font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: 1.5px; line-height: 1;
    text-transform: uppercase; white-space: nowrap;
}
.brand-text small {
    color: rgba(255, 255, 255, .62); font-size: 12px; font-weight: 500; margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.site-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 14px; border-radius: 10px;
    color: rgba(255, 255, 255, .78); text-decoration: none; font-weight: 500;
    transition: background .15s, color .15s;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav-link.is-active { color: #fff; background: rgba(255, 255, 255, .12); }
.nav-link.is-active .icon { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: 12px; padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, .12); }
.nav-user { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 500; font-size: 14px; max-width: 220px; }
.nav-user > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-toggle {
    display: none; width: 44px; height: 44px; border: 0; border-radius: 12px;
    background: rgba(255, 255, 255, .08); color: #fff; place-items: center;
}
.nav-toggle .icon { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-open .nav-toggle .icon-open { display: none; }
.nav-open .nav-toggle .icon-close { display: block; }

@media (max-width: 860px) {
    .nav-toggle { display: grid; }
    .site-nav {
        position: fixed; inset: var(--header-h) 0 auto 0;
        flex-direction: column; align-items: stretch; gap: 4px;
        padding: 12px 16px 20px;
        background: var(--pitch-900);
        border-bottom: 1px solid rgba(255, 255, 255, .08);
        box-shadow: 0 24px 40px -12px rgba(0, 0, 0, .5);
        transform: translateY(-8px); opacity: 0; visibility: hidden;
        transition: opacity .2s, transform .2s, visibility .2s;
    }
    .nav-open .site-nav { transform: none; opacity: 1; visibility: visible; }
    .nav-link { padding: 14px; font-size: 16px; }
    .nav-actions { flex-direction: column; align-items: stretch; margin: 8px 0 0; padding: 12px 0 0; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .1); }
    .nav-actions .btn { width: 100%; min-height: 48px; }
    .nav-actions .inline-form { display: block; }
    .nav-user { max-width: none; padding: 8px 4px; }
}
@media (max-width: 420px) {
    .brand-text small { white-space: normal; font-size: 11px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .brand-text strong { font-size: 22px; }
    .brand-mark { width: 36px; height: 36px; }
}

/* ---------- Flash messages & alerts ---------- */
.flash-stack { display: grid; gap: 8px; margin-top: 16px; position: relative; z-index: 5; }
.flash, .alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; border-radius: 12px;
    border: 1px solid transparent; font-size: 14px; font-weight: 500;
}
.flash .icon, .alert .icon { margin-top: 1px; }
.flash p, .alert p { flex: 1; }
.flash { box-shadow: var(--shadow); animation: slide-in .3s ease-out; }
.flash-success { background: #effbf3; border-color: #bfe8cc; color: #11552f; }
.flash-error, .alert-error { background: var(--danger-soft); border-color: #f6caca; color: #8f1c1c; }
.flash-info, .alert-info { background: var(--info-soft); border-color: #cbd9fb; color: #1e3a8a; }
.alert-warn { background: var(--warn-soft); border-color: #f6dfb6; color: #7c3d07; }
.alert-muted { background: #fff; border-color: var(--line); color: var(--muted); }
.flash-close { border: 0; background: transparent; color: inherit; opacity: .6; padding: 2px; border-radius: 6px; display: grid; }
.flash-close:hover { opacity: 1; }
.flash.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Home hero ---------- */
.hero {
    position: relative; overflow: hidden; color: #fff;
    background:
        radial-gradient(1000px 420px at 85% -10%, rgba(212, 245, 60, .16), transparent 60%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 90px, transparent 90px 180px),
        linear-gradient(160deg, var(--pitch-900) 0%, var(--pitch-700) 100%);
    margin-top: -1px;
}
.pitch-lines { position: absolute; inset: 0; opacity: .14; pointer-events: none; }
.pitch-lines svg { width: 100%; height: 100%; }
.pitch-lines svg * { fill: none; stroke: #fff; stroke-width: 2; }
.pitch-lines .dot { fill: #fff; }
.hero-inner {
    position: relative; display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: end;
    padding-top: 72px; padding-bottom: 88px;
}
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--pitch-600);
    margin-bottom: 6px;
}
.eyebrow--light {
    color: var(--accent); background: rgba(212, 245, 60, .1); border: 1px solid rgba(212, 245, 60, .25);
    padding: 6px 12px; border-radius: 999px; margin-bottom: 20px;
}
.eyebrow .icon { width: 16px; height: 16px; }
.hero h1 {
    font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
    font-size: clamp(40px, 6.2vw, 76px); line-height: .94; letter-spacing: .5px; color: #fff;
    text-wrap: balance;
}
.hero-lead { margin-top: 20px; max-width: 560px; font-size: 18px; color: rgba(255, 255, 255, .78); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0;
    background: rgba(255, 255, 255, .12); border-radius: var(--radius-lg); overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(6px);
}
.hero-stats div { padding: 22px 16px; background: rgba(4, 23, 14, .45); text-align: center; }
.hero-stats dt { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: rgba(255, 255, 255, .6); font-weight: 600; }
.hero-stats dd { margin: 4px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 48px; line-height: 1; color: #fff; }
.hero-stats div:first-child dd { color: var(--accent); }

@media (max-width: 860px) {
    .hero-inner { grid-template-columns: 1fr; gap: 32px; padding-top: 48px; padding-bottom: 72px; }
    .hero-lead { font-size: 16px; }
}
@media (max-width: 480px) {
    .hero-cta .btn { flex: 1 1 100%; }
    .hero-stats dd { font-size: 38px; }
    .hero-stats div { padding: 16px 8px; }
}

/* ---------- Steps ---------- */
.steps {
    position: relative; z-index: 2;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
    margin-top: -40px;
}
.step {
    display: flex; gap: 14px; padding: 20px;
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    border: 1px solid var(--line);
}
.step-num {
    display: grid; place-items: center; width: 36px; height: 36px; flex: none;
    border-radius: 10px; background: var(--pitch-900); color: var(--accent);
    font-family: var(--font-display); font-weight: 800; font-size: 20px;
}
.step h3 { font-size: 16px; margin-bottom: 4px; }
.step p { font-size: 14px; color: var(--muted); }
@media (max-width: 860px) {
    .steps { grid-template-columns: 1fr; gap: 10px; }
    .step { padding: 16px; }
}

/* ---------- Sections ---------- */
.section { padding-top: 40px; padding-bottom: 64px; }
.section > * + * { margin-top: 20px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--font-display); font-size: 32px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.section-head .muted { margin-top: 2px; font-size: 14px; }
.section-head--tools { align-items: center; flex-wrap: nowrap; }
.section-head--tools .chips { min-width: 0; flex: 1 1 auto; }
.section-head--tools .btn { flex: none; }
@media (max-width: 600px) { .section-head--tools .btn span { display: none; } .section-head--tools .btn { padding: 0 11px; } }

.search {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--line-strong); border-radius: 12px;
    padding: 0 12px; min-height: 44px; width: min(320px, 100%); color: var(--muted);
}
.search:focus-within { border-color: var(--pitch-600); box-shadow: 0 0 0 4px rgba(20, 108, 68, .12); }
.search input { border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); width: 100%; min-height: 42px; }
.empty-search { text-align: center; color: var(--muted); padding: 32px 0; }

/* ---------- School badge ---------- */
.badge-school {
    --hue: 150;
    display: grid; place-items: center; flex: none;
    width: 48px; height: 48px; border-radius: 14px;
    background: linear-gradient(145deg, hsl(var(--hue) 62% 44%), hsl(calc(var(--hue) + 30) 70% 30%));
    color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: .5px;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15), 0 4px 10px -4px hsl(var(--hue) 60% 30% / .6);
}
.badge-school--sm { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
.badge-school--lg { width: 72px; height: 72px; border-radius: 20px; font-size: 30px; }
.badge-admin { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); }
.badge-admin .icon { width: 34px; height: 34px; }

/* ---------- Team cards ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.team-card {
    position: relative; display: flex; flex-direction: column; gap: 14px;
    padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm);
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.team-card:hover { color: var(--text); transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.team-card.is-mine { border-color: var(--pitch-600); box-shadow: 0 0 0 3px rgba(20, 108, 68, .12); }
.team-card-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.team-card-title { min-width: 0; }
.team-card h3 { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.team-card-title p { font-size: 13px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-card-count { display: flex; align-items: center; justify-content: space-between; font-size: 14px; color: var(--muted); }
.team-card-count strong { font-size: 18px; color: var(--ink); font-weight: 700; }
.team-card-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--pitch-600); margin-top: auto; }
.team-card-link .icon { width: 16px; height: 16px; transition: transform .18s; }
.team-card:hover .team-card-link .icon { transform: translateX(3px); }

/* ---------- Tags, meters ---------- */
.tag {
    display: inline-flex; align-items: center; gap: 4px; flex: none;
    padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: var(--bg); color: var(--muted); border: 1px solid var(--line);
}
.tag .icon { width: 13px; height: 13px; }
.tag-success { background: var(--green-soft); color: #11612f; border-color: #c4e9d0; }
.tag-accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.meter { height: 8px; background: #e7ece9; border-radius: 999px; overflow: hidden; }
.meter span {
    display: block; height: 100%; border-radius: inherit;
    background: linear-gradient(90deg, var(--pitch-600), var(--green));
    transition: width .6s cubic-bezier(.2, .8, .2, 1);
}
.meter.is-full span { background: linear-gradient(90deg, var(--green), #65d02f); }
.meter--lg { height: 10px; }

.ring { position: relative; width: 96px; height: 96px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-track { stroke: rgba(255, 255, 255, .14); }
.ring-value { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1); }
.ring-label { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 28px; color: #fff; }
.ring-label strong { font-family: var(--font-display); font-size: 34px; font-weight: 800; line-height: 1; }
.ring-label small { font-size: 14px; color: rgba(255, 255, 255, .6); font-weight: 600; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
    color: #fff;
    background:
        radial-gradient(700px 260px at 90% 0%, rgba(212, 245, 60, .14), transparent 60%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 90px, transparent 90px 180px),
        linear-gradient(160deg, var(--pitch-900), var(--pitch-700));
}
.page-hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 36px; padding-bottom: 36px; flex-wrap: wrap; }
.page-hero .eyebrow { color: var(--accent); margin-bottom: 4px; }
.page-hero h1 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: clamp(30px, 4.5vw, 46px); color: #fff; letter-spacing: .3px; line-height: 1; }
.hero-sub { color: rgba(255, 255, 255, .7); margin-top: 6px; font-size: 14px; }
.team-ident { display: flex; align-items: center; gap: 18px; min-width: 0; }
.team-ident > div { min-width: 0; }
.team-ident h1 { overflow-wrap: anywhere; }
.hero-ring { display: flex; align-items: center; gap: 14px; }
.hero-ring p { color: rgba(255, 255, 255, .75); font-weight: 500; font-size: 14px; max-width: 110px; line-height: 1.3; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; margin-bottom: 6px; }
.back-link:hover { color: #fff; }
.back-link .icon { width: 15px; height: 15px; }
@media (max-width: 600px) {
    .page-hero-inner { padding-top: 24px; padding-bottom: 24px; gap: 18px; }
    .badge-school--lg { width: 56px; height: 56px; border-radius: 16px; font-size: 24px; }
    .badge-admin .icon { width: 28px; height: 28px; }
    .team-ident { gap: 14px; }
    .hero-ring { width: 100%; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .12); }
    .hero-ring p { max-width: none; }
    .ring { width: 76px; height: 76px; }
    .ring-label { padding-top: 22px; }
    .ring-label strong { font-size: 26px; }
    .page-hero-inner > .btn { width: 100%; }
}

/* ---------- Cards & split layout ---------- */
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); padding: 24px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; }
.card-head h2 .icon { width: 20px; height: 20px; color: var(--pitch-600); }

.layout-split { display: grid; grid-template-columns: 380px 1fr; gap: 28px; align-items: start; padding-top: 28px; padding-bottom: 64px; }
.split-side, .split-main { min-width: 0; }
.split-side { position: sticky; top: calc(var(--header-h) + 20px); }
.split-main > * + * { margin-top: 18px; }
@media (max-width: 960px) {
    .layout-split { grid-template-columns: 1fr; gap: 32px; }
    .split-side { position: static; }
}

.card-state { text-align: center; padding: 36px 24px; }
.card-state h2 { font-size: 22px; margin: 14px 0 8px; }
.card-state p { color: var(--muted); margin-bottom: 20px; }
.state-icon { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: var(--bg); color: var(--muted); }
.state-icon .icon { width: 28px; height: 28px; }
.card-state--success .state-icon { background: var(--green-soft); color: var(--green); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; }
.form > .card-head { margin-bottom: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; gap: 18px; } }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; border: 0; padding: 0; margin: 0; }
.field label, .field legend { font-size: 14px; font-weight: 600; color: var(--ink); padding: 0; }
.field legend { margin-bottom: 8px; }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="tel"], .field input[type="number"], .field input[type="date"], .field select {
    width: 100%; min-height: 48px; padding: 0 14px;
    font: inherit; font-size: 16px; color: var(--ink);
    background: #fff; border: 1px solid var(--line-strong); border-radius: 12px;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none; appearance: none;
}
.field input[type="date"] { padding-right: 10px; }
.field input::placeholder { color: #9aa8a1; }
.field input:hover { border-color: #aebbb4; }
.field input:focus { outline: 0; border-color: var(--pitch-600); box-shadow: 0 0 0 4px rgba(20, 108, 68, .14); }
.field-hint { font-size: 13px; color: var(--muted); min-height: 0; }
.field-hint:empty { display: none; }
.field-hint.is-warn { color: var(--warn); font-weight: 600; }
.field-error { font-size: 13px; color: var(--danger); font-weight: 500; }
.has-error input { border-color: var(--danger) !important; }
.has-error input:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, .14) !important; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--text); cursor: pointer; font-weight: 400 !important; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--pitch-700); }
.field-check { padding: 14px; border-radius: 12px; background: var(--warn-soft); border: 1px solid #f6dfb6; }
.field-check.has-error { border-color: var(--danger); background: var(--danger-soft); }

/* Photo dropzone */
.dropzone {
    display: flex; align-items: center; gap: 16px;
    padding: 14px; border: 2px dashed var(--line-strong); border-radius: 16px;
    background: #fafcfb; cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--pitch-600); background: var(--green-soft); }
.field-photo.has-error .dropzone { border-color: var(--danger); }
.dropzone-preview {
    display: grid; place-items: center; flex: none;
    width: 76px; height: 76px; border-radius: 50%; overflow: hidden;
    background: linear-gradient(145deg, var(--pitch-700), var(--pitch-900)); color: var(--accent);
    box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--line);
}
.dropzone-preview img { width: 100%; height: 100%; object-fit: cover; }
.dropzone-icon { width: 28px; height: 28px; }
.dropzone-text { display: grid; gap: 2px; }
.dropzone-text strong { font-size: 15px; color: var(--ink); }
.dropzone-text small { font-size: 12.5px; color: var(--muted); line-height: 1.45; font-weight: 400; }
.dropzone.has-file { border-style: solid; border-color: var(--pitch-600); background: #fff; }
input[type="file"]:focus-visible + .field-error, input[type="file"]:focus-visible { outline: none; }
.field-photo:focus-within .dropzone { border-color: var(--pitch-600); box-shadow: 0 0 0 4px rgba(20, 108, 68, .14); }

/* Position picker */
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.segment { position: relative; cursor: pointer; }
.segment input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segment span {
    --c: var(--pitch-600);
    display: grid; justify-items: center; gap: 1px;
    padding: 10px 4px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.segment strong { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.segment small { font-size: 11px; color: var(--muted); font-weight: 500; }
.segment:hover span { border-color: #aebbb4; }
.segment input:focus-visible + span { box-shadow: 0 0 0 4px rgba(20, 108, 68, .2); }
.segment input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); box-shadow: inset 0 0 0 1px var(--c); }
.segment input:checked + span strong { color: var(--c); }
.segment.pos-GK span { --c: var(--pos-GK); }
.segment.pos-DEF span { --c: var(--pos-DEF); }
.segment.pos-MID span { --c: var(--pos-MID); }
.segment.pos-FWD span { --c: var(--pos-FWD); }
.has-error .segment span { border-color: #f1b4b4; }
@media (max-width: 360px) { .segment small { display: none; } }

/* ---------- Filter chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    min-height: 38px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--line-strong); background: #fff; color: var(--text); font-size: 14px; font-weight: 500;
    transition: background .15s, color .15s, border-color .15s;
}
.chip span { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 1px 7px; }
.chip:hover { border-color: var(--muted); }
.chip.is-active { background: var(--pitch-900); color: #fff; border-color: var(--pitch-900); }
.chip.is-active span { background: var(--accent); color: var(--accent-ink); }

/* ---------- Player cards ---------- */
.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
@media (max-width: 480px) { .player-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

.player-card {
    position: relative; display: flex; flex-direction: column;
    background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
    box-shadow: var(--shadow-sm); cursor: pointer;
    transition: transform .18s, box-shadow .18s;
    animation: card-in .35s ease-out both;
}
.player-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.player-card:focus-visible { outline: 3px solid var(--pitch-600); outline-offset: 2px; }
.player-card.is-hidden { display: none; }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } }

.player-photo {
    position: relative; aspect-ratio: 1 / 1; overflow: hidden;
    background:
        radial-gradient(circle at 50% 120%, rgba(212, 245, 60, .25), transparent 60%),
        linear-gradient(160deg, var(--pitch-700), var(--pitch-950));
}
.player-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.player-card:hover .player-photo img { transform: scale(1.04); }
.player-photo::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(4, 23, 14, .45) 0%, transparent 32%, transparent 70%, rgba(4, 23, 14, .3) 100%);
    pointer-events: none;
}
.player-initials {
    position: absolute; inset: 0; display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 800; font-size: 56px; color: rgba(255, 255, 255, .9);
    letter-spacing: 1px;
}
.player-number {
    position: absolute; top: 8px; left: 12px; z-index: 1;
    font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1;
    color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}
.pos-chip {
    --c: var(--pitch-600);
    display: inline-flex; align-items: center;
    padding: 3px 8px; border-radius: 7px;
    background: var(--c); color: #fff;
    font-size: 11px; font-weight: 700; letter-spacing: .6px;
}
.player-photo .pos-chip { position: absolute; top: 12px; right: 12px; z-index: 1; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.pos-GK { --c: var(--pos-GK); }
.pos-DEF { --c: var(--pos-DEF); }
.pos-MID { --c: var(--pos-MID); }
.pos-FWD { --c: var(--pos-FWD); }
.pos-chip.pos-GK { color: #3b2503; }

.player-body { position: relative; padding: 12px 14px 14px; }
.player-name { font-size: 15px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; padding-right: 18px; }
.player-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.player-lock { position: absolute; right: 12px; top: 15px; color: #a7b5ae; display: grid; }
.player-lock .icon { width: 14px; height: 14px; }
.player-admin { padding: 0 14px 14px; margin-top: -4px; }
.player-admin .btn { width: 100%; }

/* ---------- Empty state ---------- */
.empty {
    text-align: center; padding: 48px 24px;
    background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
}
.empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--green-soft); color: var(--pitch-600); margin-bottom: 14px; }
.empty-icon .icon { width: 30px; height: 30px; }
.empty h3 { font-size: 19px; margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 380px; margin: 0 auto; }
.empty .btn { margin-top: 18px; }

/* ---------- Modals ---------- */
.modal {
    width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
    padding: 0; border: 0; border-radius: var(--radius-lg); background: transparent;
    overflow: visible; color: var(--text);
}
.modal::backdrop { background: rgba(4, 23, 14, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal[open] { animation: modal-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-card {
    position: relative; background: #fff; border-radius: var(--radius-lg); padding: 24px;
    box-shadow: var(--shadow-lg); max-height: calc(100dvh - 32px); overflow-y: auto;
}
.modal-close {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    display: grid; place-items: center; width: 38px; height: 38px;
    border: 0; border-radius: 50%; background: rgba(12, 23, 18, .06); color: var(--ink);
}
.modal-close:hover { background: rgba(12, 23, 18, .12); }
.modal h2 { font-size: 22px; margin-bottom: 18px; }
.modal-warn {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px;
    padding: 6px 12px; border-radius: 999px; background: var(--warn-soft); color: var(--warn);
    font-size: 13px; font-weight: 600;
}
.modal-warn .icon { width: 15px; height: 15px; }
.review { display: flex; gap: 18px; align-items: center; padding: 16px; background: var(--bg); border-radius: 16px; }
.review-photo {
    width: 96px; height: 96px; flex: none; border-radius: 50%; overflow: hidden;
    display: grid; place-items: center;
    background: linear-gradient(145deg, var(--pitch-700), var(--pitch-900));
    color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 34px;
}
.review-photo img { width: 100%; height: 100%; object-fit: cover; }
.review-list, .pm-facts { margin: 0; display: grid; gap: 8px; min-width: 0; }
.review-list div, .pm-facts div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; font-size: 14px; }
.review-list dt, .pm-facts dt { color: var(--muted); }
.review-list dd, .pm-facts dd { margin: 0; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions .btn { flex: 1; }
@media (max-width: 480px) {
    .review { flex-direction: column; text-align: left; align-items: stretch; }
    .review-photo { margin: 0 auto; }
    .modal-actions { flex-direction: column-reverse; }
}

.modal--player { width: min(420px, calc(100% - 32px)); }
.modal--player .modal-card { padding: 0; overflow: hidden auto; }
.modal--player .modal-close { background: rgba(255, 255, 255, .85); }
.pm-photo {
    aspect-ratio: 1 / 1; display: grid; place-items: center;
    background: radial-gradient(circle at 50% 120%, rgba(212, 245, 60, .25), transparent 60%), linear-gradient(160deg, var(--pitch-700), var(--pitch-950));
    color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 96px;
}
.pm-photo img { width: 100%; height: 100%; object-fit: cover; }
.pm-body { padding: 20px 24px 24px; }
.pm-top { display: flex; align-items: center; gap: 10px; }
.pm-number { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; color: var(--pitch-700); }
.pm-number::before { content: "#"; font-size: 24px; color: var(--muted); margin-right: 2px; vertical-align: 8px; }
.modal--player h2 { font-size: 24px; margin: 8px 0 16px; overflow-wrap: anywhere; }
.pm-lock { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pm-lock .icon { width: 15px; height: 15px; }

/* ---------- Auth pages ---------- */
.page-auth main {
    background:
        radial-gradient(900px 400px at 50% -10%, rgba(20, 108, 68, .14), transparent 70%),
        var(--bg);
}
.auth-wrap { display: grid; place-items: center; padding: 48px 16px 72px; }
.auth-card {
    width: 100%; max-width: 440px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: 32px;
}
.auth-card--wide { max-width: 560px; }
.auth-card > * + * { margin-top: 20px; }
.auth-head { text-align: center; }
.auth-icon {
    display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px;
    background: var(--pitch-900); color: var(--accent); margin-bottom: 14px;
}
.auth-icon .icon { width: 28px; height: 28px; }
.auth-head h1 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 34px; letter-spacing: .3px; }
.auth-head p { color: var(--muted); margin-top: 6px; }
.auth-foot { text-align: center; font-size: 14px; color: var(--text); line-height: 1.8; }
.auth-foot a { font-weight: 600; }
@media (max-width: 480px) {
    .auth-wrap { padding: 20px 12px 48px; }
    .auth-card { padding: 22px 18px; }
}

/* ---------- Organizer dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat {
    display: flex; align-items: center; gap: 14px; padding: 18px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.stat-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--green-soft); color: var(--pitch-600); flex: none; }
.stat strong { display: block; font-family: var(--font-display); font-size: 32px; font-weight: 800; line-height: 1; color: var(--ink); }
.stat span:not(.stat-icon) { font-size: 13px; color: var(--muted); }
@media (max-width: 960px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .stat { padding: 14px; gap: 10px; } .stat-icon { width: 38px; height: 38px; } .stat strong { font-size: 26px; } }

.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 960px) { .admin-grid { grid-template-columns: 1fr; } }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.toggle-row:first-of-type { border-top: 0; padding-top: 0; }
.toggle-row h3 { font-size: 15px; }
.toggle-row p { font-size: 13px; margin-top: 2px; }
.toggle-row form { margin: 0; flex: none; }
.switch { display: inline-flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px; border-radius: 999px; }
.switch-track { position: relative; width: 52px; height: 30px; border-radius: 999px; background: #cfd8d3; transition: background .2s; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch.is-on .switch-track { background: var(--green); }
.switch.is-on .switch-thumb { transform: translateX(22px); }
.switch-label { font-size: 13px; font-weight: 700; color: var(--muted); min-width: 48px; text-align: left; }
.switch.is-on .switch-label { color: var(--green); }

.card-collapsible > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
.card-collapsible > summary::-webkit-details-marker { display: none; }
.card-collapsible[open] > summary { margin-bottom: 8px; }
.summary-hint { font-size: 13px; font-weight: 600; color: var(--pitch-600); }
.card-collapsible[open] .summary-hint { font-size: 0; }
.card-collapsible[open] .summary-hint::after { content: "Hide"; font-size: 13px; }
.card-collapsible .form { margin-top: 18px; }

.card-warn { border-color: #f6dfb6; background: #fffbf3; }
.card-warn .card-head h2 .icon { color: var(--warn); }
.dupe-list { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }

.reveal { display: flex; gap: 18px; align-items: flex-start; border-color: #c4e9d0; background: linear-gradient(135deg, #f1fbf4, #fff); }
.reveal-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px; background: var(--accent); color: var(--accent-ink); }
.reveal h2 { font-size: 19px; }
.reveal-body > p { color: var(--muted); margin-top: 4px; font-size: 14px; }
.reveal-creds { margin: 14px 0 0; display: grid; gap: 8px; }
.reveal-creds div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.reveal-creds dt { width: 80px; color: var(--muted); font-size: 14px; }
.reveal-creds dd { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reveal-creds code { font-size: 16px; padding: 6px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line-strong); color: var(--ink); font-weight: 600; word-break: break-all; }
@media (max-width: 480px) { .reveal { flex-direction: column; } }

/* Responsive data table */
.table-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
    text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600;
    padding: 12px 16px; background: #f8faf9; border-bottom: 1px solid var(--line);
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfb; }
.t-right { text-align: right !important; }
.cell-school { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.cell-school a { color: var(--ink); text-decoration: none; }
.cell-school a:hover { color: var(--pitch-600); text-decoration: underline; }
.cell-stack { display: grid; }
.cell-stack small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.cell-meter { display: grid; gap: 6px; min-width: 90px; font-weight: 600; }
.row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions form { margin: 0; }
@media (max-width: 860px) {
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
    .data-table tbody tr:last-child { border-bottom: 0; }
    .data-table td { padding: 6px 0; border: 0; display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; }
    .data-table td::before { content: attr(data-label); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; }
    .data-table td:first-child { grid-template-columns: 1fr; padding-bottom: 8px; }
    .data-table td:first-child::before { display: none; }
    .data-table td.t-right { text-align: left !important; grid-template-columns: 1fr; padding-top: 10px; }
    .data-table td.t-right::before { display: none; }
    .row-actions { justify-content: flex-start; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--pitch-950); color: rgba(255, 255, 255, .6); font-size: 13px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 22px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; }
.footer-note { display: flex; align-items: center; gap: 8px; }
.footer-note .icon { width: 15px; height: 15px; color: var(--accent); flex: none; }

/* ---------- Print (team sheet) ---------- */
.print-sheet { display: none; }
@media print {
    @page { margin: 14mm; }
    body { background: #fff; display: block; }
    .site-header, .site-footer, .flash-stack, .alert, .chips, .section-head--tools, .player-grid, .modal, .back-link, .hero-ring { display: none !important; }
    .page-hero { background: none !important; color: #000; }
    .page-hero h1, .hero-sub { color: #000 !important; }
    .print-sheet { display: table; width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px !important; }
    .print-sheet caption { text-align: left; font-weight: 700; font-size: 14px; padding-bottom: 8px; }
    .print-sheet th, .print-sheet td { border: 1px solid #999; padding: 6px 8px; text-align: left; vertical-align: middle; }
    .print-sheet img { width: 44px; height: 44px; object-fit: cover; }
    .print-sheet tr { break-inside: avoid; }
}

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