/* ═══════════════════════════════════════════════════════════
   Map11 — Brand design system
   Flat · bold · minimal. No blur, no soft shadow, no gradients.
   Hairline borders separate surfaces. One accent used deliberately.
   ═══════════════════════════════════════════════════════════ */
@font-face {
    font-family: 'Ease Double';
    src: url('/fonts/EaseDoubleRounded-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Ease Double';
    src: url('/fonts/EaseDoubleRounded-Black.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'At Aero';
    src: url('/fonts/AtAero-Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'At Aero';
    src: url('/fonts/AtAero-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'At Aero';
    src: url('/fonts/AtAero-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'At Aero';
    src: url('/fonts/AtAero-Retina.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Brand accent — one green, used deliberately. Stays vivid in both themes. */
    --lime:        #92ff4a;
    --lime-strong: #74e828;
    --lime-text:   #2f6b0e;
    --lime-dim:    rgba(146, 255, 74, 0.18);
    --lime-border: rgba(146, 255, 74, 0.7);
    --lime-06:     rgba(146, 255, 74, 0.08);

    /* Foreground — text/borders/"inverted fill" accents. Inverts with theme via --fg-rgb. */
    --fg-rgb: 22, 23, 21;
    --ink:     rgb(var(--fg-rgb));
    --ink-90:  rgba(var(--fg-rgb), 0.9);
    --ink-85:  rgba(var(--fg-rgb), 0.85);
    --ink-75:  rgba(var(--fg-rgb), 0.75);
    --ink-60:  rgba(var(--fg-rgb), 0.6);
    --ink-45:  rgba(var(--fg-rgb), 0.45);
    --ink-35:  rgba(var(--fg-rgb), 0.35);
    --ink-25:  rgba(var(--fg-rgb), 0.25);
    --ink-15:  rgba(var(--fg-rgb), 0.15);
    --ink-10:  rgba(var(--fg-rgb), 0.1);
    --ink-08:  rgba(var(--fg-rgb), 0.08);
    --ink-06:  rgba(var(--fg-rgb), 0.06);
    --ink-04:  rgba(var(--fg-rgb), 0.04);

    /* Fixed dark — never inverts. For text/badges sitting on the (always-bright) lime fill. */
    --ink-fixed: #161715;

    --bg:      #f5f5f5;
    --surface: #ffffff;

    /* Sharp — no rounded corners */
    --r-sm:   0px;
    --r:      0px;
    --r-lg:   0px;
    --r-pill: 0px;

    /* Hairline borders — the primary way surfaces separate, not shadow */
    --line:        1px solid var(--ink-10);
    --line-strong: 1.5px solid var(--ink);

    /* One bold flat offset mark, reserved for primary CTAs only */
    --pop: 3px 3px 0 var(--ink);

    --font-display: 'Ease Double', -apple-system, sans-serif;
    --font-body: 'At Aero', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* ── Dark mode — same tokens, inverted foreground + swapped surfaces ── */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --fg-rgb: 240, 240, 238;
        --bg:      #161715;
        --surface: #201f1c;
        --lime-text: #8fe259;
    }
}
:root[data-theme="dark"] {
    --fg-rgb: 240, 240, 238;
    --bg:      #161715;
    --surface: #201f1c;
    --lime-text: #8fe259;
}

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

/* ── Browser surfaces — themed, not left to defaults ──────── */
::selection { background: var(--lime); color: var(--ink-fixed); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
:root { color-scheme: light; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
:root[data-theme="dark"] { color-scheme: dark; }

html, body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#map { height: 100%; width: 100%; }

/* ── Tech warning banner ─────────────────────────────────── */
#tech-warning-banner {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2200;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: min(92vw, 560px);
    padding: 9px 12px;
    border-radius: var(--r-sm);
    background: var(--surface);
    border: var(--line-strong);
    color: var(--ink);
    font-weight: 600;
    font-size: 12px;
    line-height: 1.35;
}
#tech-warning-banner.hidden { display: none; }
#competition-filter { display: none; }
#tech-warning-close {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
    opacity: 0.7;
}
#tech-warning-close:hover { opacity: 1; }

/* ── Leaflet chrome — use our own fonts, not Leaflet's default ── */
.leaflet-container { font-family: var(--font-body) !important; }
.leaflet-control-attribution { background: var(--surface) !important; color: var(--ink-60) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--ink-75) !important; }

/* ── Leaflet zoom control ─────────────────────────────────── */
.leaflet-top.leaflet-left { left: 440px; top: 20px; transition: left 0.3s ease; }
#clubs-sidebar.hidden ~ #map .leaflet-top.leaflet-left { left: 20px; }
.leaflet-control-zoom { transition: left 0.3s ease; }
.leaflet-control-zoom a {
    border-radius: 0 !important;
    background: var(--surface) !important;
    color: var(--ink) !important;
    border-color: var(--ink-15) !important;
}
.leaflet-control-zoom a:first-child { border-radius: var(--r-sm) var(--r-sm) 0 0 !important; }
.leaflet-control-zoom a:last-child { border-radius: 0 0 var(--r-sm) var(--r-sm) !important; }
.leaflet-bar { border: var(--line-strong) !important; box-shadow: none !important; }

/* ── Popup wrapper — flat card, hard offset mark ─────────── */
.leaflet-popup-content-wrapper {
    position: relative;
    background: var(--surface) !important;
    border: var(--line-strong) !important;
    border-radius: var(--r) !important;
    box-shadow: var(--pop) !important;
    color: var(--ink-85) !important;
    overflow: visible;
    padding: 0 !important;
}
.leaflet-popup-content { margin: 0 !important; font-size: 13px; }
.leaflet-container a.leaflet-popup-close-button {
    color: var(--ink-35) !important;
    top: 8px !important;
    right: 10px !important;
    font-family: var(--font-body);
}
.leaflet-container a.leaflet-popup-close-button:hover { color: var(--ink) !important; }
.leaflet-popup-tip-container { display: none; }
.leaflet-popup-tip { display: none; }

/* Hand-drawn pointer connecting the marker below to the popup above it */
.leaflet-popup-content-wrapper::after {
    content: '';
    position: absolute;
    left: calc(50% - 26px);
    bottom: -44px;
    width: 34px;
    height: 34px;
    transform: translateX(-50%) rotate(-50deg);
    background-color: var(--ink);
    -webkit-mask-image: url('/img/popup-pointer.svg');
    mask-image: url('/img/popup-pointer.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
    pointer-events: none;
}

@keyframes popupSlideIn {
    from { opacity: 0; transform: translateY(10px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.leaflet-popup-content-wrapper {
    animation: popupSlideIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom center;
}

/* ── Map marker icons (functional — do not change size) ──── */
.club-icon { transition: transform 0.2s ease; }
.club-icon:hover { transform: scale(1.12); }
.placeholder-icon {
    background: var(--lime);
    border: 2px solid var(--ink-fixed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}
.placeholder-club-icon {
    font-size: 16px;
    color: var(--ink-fixed);
    text-align: center;
    line-height: 1;
    font-weight: 700;
}
.club-icon-frame {
    width: 50px; height: 50px;
    padding: 6px;
    box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.club-icon-img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; object-position: center; }

/* ═══════════════════════════════════════════════════════════
   Popup content
   ═══════════════════════════════════════════════════════════ */
.popup-content { position: relative; padding: 14px; padding-top: 54px; min-width: 230px; text-align: left; }
.popup-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--club-color, transparent);
}

/* Logo badge — big, centered, half outside the card */
.popup-logo-badge {
    position: absolute;
    top: -48px;
    left: 50%;
    transform: translateX(-50%);
    width: 96px; height: 96px;
    z-index: 2;
}
.popup-logo {
    width: 96px; height: 96px;
    object-fit: contain;
    background: transparent;
    filter: drop-shadow(0 2px 3px rgba(22, 23, 21, 0.25));
}
.popup-logo-placeholder {
    width: 96px; height: 96px;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-25);
}

.popup-header-info { text-align: center; margin-bottom: 10px; }
.popup-header-info .popup-meta { justify-content: center; }

.popup-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 20px;
    color: var(--ink);
    letter-spacing: 0;
    line-height: 1.05;
    margin-bottom: 6px;
}

.popup-meta {
    display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-45);
}
.popup-meta-sep { color: var(--ink-25); }
.popup-meta-country { text-transform: none; letter-spacing: 0; font-weight: 500; }
.popup-meta-founded { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* Tier badge — flat monochrome; the icon shape (and label text here) carries meaning, not a color wheel */
.popup-meta-tier {
    display: inline-flex; align-items: center;
    border-radius: var(--r-sm);
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: var(--ink-06);
    border: 1px solid var(--ink-25);
    color: var(--ink-75);
}

/* Details: stadium + league */
.popup-details { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.popup-detail-row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-60); }
.popup-detail-row svg { color: var(--ink-35); flex-shrink: 0; }
.popup-detail-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.popup-stadium { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-45); margin-bottom: 2px; }

.popup-sep { height: 1px; background: var(--ink-08); margin: 10px 0; }

.popup-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-35); margin-bottom: 6px; }

.popup-rivals { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.popup-rival {
    display: flex; align-items: center; gap: 10px;
    background: var(--ink-04);
    border: var(--line-strong);
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}
.popup-rival:hover { background: var(--ink-08); }
.popup-rival-logo { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.popup-rival-info { display: flex; flex-direction: column; gap: 1px; }
.popup-rival-derby { display: inline-block; font-size: 11px; font-weight: 700; color: var(--lime-text); text-transform: uppercase; letter-spacing: 0.05em; text-decoration: none; }
.popup-rival-derby:hover { text-decoration: underline; }
.popup-rival-name { font-size: 13px; font-weight: 600; color: var(--ink-85); }

/* League — featured, more prominent than a plain detail row */
.popup-league-featured {
    display: flex; align-items: center; gap: 10px;
    background: var(--ink-fixed);
    padding: 9px 11px;
    margin-bottom: 10px;
    text-decoration: none;
    transition: background 0.12s ease;
}
.popup-league-featured:hover { background: #000; }
.popup-league-logo { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0; background: transparent; }
.popup-league-logo-placeholder { width: 26px; height: 26px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--lime); }
.popup-league-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.popup-league-name { font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popup-league-country { font-size: 11px; color: var(--lime); font-weight: 600; }

.popup-loading { font-size: 12px; color: var(--ink-35); font-style: italic; padding: 8px 0; }
.popup-kits-error { font-size: 11px; color: var(--ink-25); margin-top: 6px; }

.popup-socials { display: flex; gap: 6px; margin-top: 10px; }
.popup-social-btn {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    border-radius: var(--r-sm);
    background: var(--surface);
    border: var(--line);
    color: var(--ink-60);
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.popup-social-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ── Action buttons ───────────────────────────────────────── */
.popup-actions-main { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.popup-actions-row { display: flex; gap: 7px; }
.popup-actions-row .popup-btn { flex: 1; }

.popup-btn {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.12s ease;
    border: var(--line);
    background: var(--surface);
    color: var(--ink-75);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.popup-btn:hover { background: var(--ink-06); color: var(--ink); }

/* Shine sweep on filled/colored buttons — flat white diagonal on hover */
.popup-btn.popup-btn-primary,
.popup-btn-visited,
.popup-matches-cta,
.auth-submit,
.form-actions button[type="submit"],
.level-btn.active,
.user-filter-btn.active,
.region-btn.active,
.group-trigger,
.mob-nav-initial,
.auth-user-initial {
    position: relative;
    overflow: hidden;
}
.popup-btn.popup-btn-primary::after,
.popup-btn-visited::after,
.popup-matches-cta::after,
.auth-submit::after,
.form-actions button[type="submit"]::after,
.level-btn.active::after,
.user-filter-btn.active::after,
.region-btn.active::after,
.group-trigger::after,
.mob-nav-initial::after,
.auth-user-initial::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 35%;
    height: 100%;
    background: rgba(255, 255, 255, 0.55);
    transform: skewX(-18deg);
    transition: left 0.4s ease;
    pointer-events: none;
}
.popup-btn.popup-btn-primary:hover::after,
.popup-btn-visited:hover::after,
.popup-matches-cta:hover::after,
.auth-submit:hover:not(:disabled)::after,
.form-actions button[type="submit"]:hover::after,
.level-btn.active:hover::after,
.user-filter-btn.active:hover::after,
.region-btn.active:hover::after,
.group-trigger:hover::after,
.mob-nav-initial:hover::after,
.auth-user-initial:hover::after {
    left: 130%;
}

.popup-btn-fullwidth {
    width: 100%; box-sizing: border-box; justify-content: center;
    padding: 11px 14px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

.popup-btn.popup-btn-primary {
    background: var(--lime);
    border: 1.5px solid var(--ink-fixed);
    color: var(--ink-fixed);
    box-shadow: 3px 3px 0 var(--ink-fixed);
    letter-spacing: 0;
}
.popup-btn.popup-btn-primary:hover {
    background: var(--lime-strong);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--ink-fixed);
    color: var(--ink-fixed);
}
.popup-btn.popup-btn-primary:active { transform: translate(0, 0); box-shadow: 3px 3px 0 var(--ink-fixed); }

.popup-btn-visited { background: var(--lime); border: 1.5px solid var(--ink-fixed); color: var(--ink-fixed); box-shadow: 3px 3px 0 var(--ink-fixed); }
.popup-btn-visited:hover { background: var(--lime-strong); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink-fixed); }
.popup-btn-visited-active { background: var(--ink-fixed); border: 1.5px solid var(--ink-fixed); color: var(--lime); box-shadow: none; }
.popup-btn-visited-active:hover { background: #000; }

.popup-actions-solo { margin-top: 14px; margin-bottom: 6px; }
.popup-actions-solo .popup-btn { width: 100%; }

.popup-actions { display: flex; gap: 6px; margin-top: 0; }

.popup-btn-secondary { background: var(--surface); border: var(--line); color: var(--ink-60); }
.popup-btn-secondary:hover { background: var(--ink-06); color: var(--ink); }

.popup-btn-icon-only { flex: 0 0 auto; width: 32px; padding: 9px; }

.popup-btn-wishlist-active { background: var(--lime); border-color: var(--ink-fixed); color: var(--ink-fixed); }
.popup-btn-wishlist-active:hover { background: var(--lime-strong); }

.popup-actions-report { margin-top: 5px !important; }
.popup-btn-sm { padding: 5px 8px !important; font-size: 11px !important; border-radius: var(--r-sm) !important; }

.popup-btn-report-duplicate, .popup-btn-report-invalid { background: var(--surface); border-color: var(--ink-20, var(--ink-15)); color: var(--ink-60); }
.popup-btn-report-duplicate:hover, .popup-btn-report-invalid:hover { border-color: var(--ink-45); color: var(--ink); }
.popup-btn-pending { background: var(--ink-04); border-color: var(--ink-20, var(--ink-15)); color: var(--ink-60); }

/* Collapsed "Options" — Suggest/Kit/Share + report actions live behind one toggle */
.popup-options-toggle { justify-content: center; font-weight: 600; }
.popup-options-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.45s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease, margin-top 0.45s ease;
}
.popup-options-panel.expanded {
    max-height: 200px;
    opacity: 1;
    margin-top: 6px;
    pointer-events: auto;
}

/* Kits (left) / Matches (right) side panels — flyout beside the popup card */
.popup-side-panel {
    position: absolute;
    top: 0;
    width: 210px;
    background: var(--surface);
    border: var(--line-strong);
    box-shadow: var(--pop);
    padding: 12px;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
}
.popup-side-panel-left { right: calc(100% + 10px); transform: translateX(8px); }
.popup-side-panel-right { left: calc(100% + 10px); transform: translateX(-8px); }
.popup-side-panel.visible { opacity: 1; pointer-events: auto; transform: translateX(0); }

.popup-matches-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-45); margin-bottom: 8px; }
.popup-matches-body { display: flex; flex-direction: column; gap: 6px; }
.popup-match-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: var(--line); font-size: 12px; }
.popup-match-row:last-child { border-bottom: none; }
.popup-match-logo { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.popup-match-logo-placeholder { background: var(--ink-06); }
.popup-match-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.popup-match-teams { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--ink-85); font-weight: 600; }
.popup-match-subteam {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--lime-text);
    background: var(--lime-dim);
    border: 1px solid var(--lime-border);
    padding: 1px 4px;
    margin: 0 3px;
    vertical-align: middle;
}
.popup-match-score { color: var(--ink); font-weight: 700; }
.popup-match-date { color: var(--ink-45); font-size: 11px; }
.popup-matches-empty { font-size: 12px; color: var(--ink-45); line-height: 1.5; }
.popup-match-checkbox {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--ink-75);
    margin-bottom: 6px; cursor: pointer;
}
.popup-matches-cta {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%; margin-top: 8px; padding: 8px 10px;
    background: var(--lime); border: 1.5px solid var(--ink-fixed); color: var(--ink-fixed);
    font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: none; box-sizing: border-box;
}
.popup-matches-cta:hover { background: var(--lime-strong); }
.popup-matches-seemore { background: var(--surface); color: var(--ink-75); }
.popup-matches-seemore:hover { background: var(--ink); color: var(--bg); }

@media (max-width: 900px) {
    .popup-side-panel {
        position: static;
        width: auto;
        max-height: none;
        margin-top: 10px;
        box-shadow: none;
        opacity: 1;
        pointer-events: auto;
        transform: none;
        display: none;
    }
    .popup-side-panel.visible { display: block; }
}
.popup-btn-pending:hover { background: var(--ink-08); color: var(--ink); }

/* ── Kits / equipment ─────────────────────────────────────── */
.equipment-container { margin-top: 15px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.equipment-item { display: flex; flex-direction: column; align-items: center; margin: 5px; }
.equipment-img { width: 50px; height: 50px; object-fit: contain; border-radius: var(--r-sm); border: var(--line); background: var(--ink-04); padding: 5px; }
.equipment-type { font-size: 11px; margin-top: 4px; color: var(--ink-45); text-transform: capitalize; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   Top-right buttons — flat modular tiles, no glass, no blur
   ═══════════════════════════════════════════════════════════ */
#top-right-buttons { position: fixed; top: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 18px; }

.btn-group { position: relative; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.group-trigger {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px;
    background: var(--surface);
    border: var(--line-strong);
    color: var(--ink-75);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
    flex-shrink: 0;
}
.group-trigger:hover { background: var(--ink); color: var(--bg); }
.btn-group.expanded .group-trigger { background: var(--ink-fixed); color: var(--lime); }

.group-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.45s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease, margin-top 0.45s ease;
}
.btn-group.expanded .group-options {
    max-height: 400px;
    opacity: 1;
    margin-top: 6px;
    pointer-events: auto;
}

#submit-button, #kofi-button, #discord-button, #info-button, #filter-button,
#about-button, #news-button, #mapstyle-button, #theme-toggle-button, #random-button, #stats-button,
#latest-button, #auth-button, #current-loc-button, #nearby-button { position: static; }

#submit-button button:not(.add-club-hint-close),
#kofi-button button,
#discord-button a,
#info-button button,
#filter-button button,
#about-button a,
#news-button a,
#mapstyle-button button,
#theme-toggle-button button,
#random-button button,
#stats-button a,
#latest-button a,
#auth-button button,
#current-loc-button button,
#nearby-button button {
    display: flex; align-items: center; justify-content: flex-start;
    width: 42px; height: 42px;
    max-width: 42px;
    padding-left: 11px;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    background: var(--surface);
    border: var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--ink-75);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, max-width 0.45s ease;
}
#submit-button button:not(.add-club-hint-close) svg,
#kofi-button button svg,
#discord-button a svg,
#info-button button svg,
#filter-button button svg,
#about-button a svg,
#news-button a svg,
#mapstyle-button button svg,
#theme-toggle-button button svg,
#random-button button svg,
#stats-button a svg,
#latest-button a svg,
#auth-button button svg,
#current-loc-button button svg,
#nearby-button button svg {
    flex-shrink: 0;
}
#submit-button button:not(.add-club-hint-close)::after,
#kofi-button button::after,
#discord-button a::after,
#info-button button::after,
#filter-button button::after,
#about-button a::after,
#news-button a::after,
#mapstyle-button button::after,
#theme-toggle-button button::after,
#random-button button::after,
#stats-button a::after,
#latest-button a::after,
#auth-button button::after,
#current-loc-button button::after,
#nearby-button button::after {
    content: attr(title);
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    padding-right: 14px;
}

#submit-button button:not(.add-club-hint-close):hover,
#kofi-button button:hover,
#discord-button a:hover,
#info-button button:hover,
#filter-button button:hover,
#about-button a:hover,
#news-button a:hover,
#mapstyle-button button:hover,
#theme-toggle-button button:hover,
#random-button button:hover,
#stats-button a:hover,
#latest-button a:hover,
#auth-button button:hover,
#current-loc-button button:hover,
#nearby-button button:hover {
    background: var(--ink);
    color: var(--bg);
    width: auto;
    max-width: 220px;
}

/* ── Add-club hint bubble ─────────────────────────────────── */
#add-club-hint {
    position: absolute;
    right: calc(100% + 12px);
    top: 21px;
    transform: translateY(-50%);
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--lime);
    border: var(--line-strong);
    border-radius: var(--r-sm);
    padding: 9px 10px 9px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--ink);
    white-space: nowrap;
    box-shadow: 2px 2px 0 var(--ink);
    pointer-events: all;
    z-index: 1500;
    animation: hint-fadein 0.28s ease-out;
}
@keyframes hint-fadein { from { opacity: 0; transform: translateY(-50%) translateX(6px); } to { opacity: 1; transform: translateY(-50%) translateX(0); } }
.add-club-hint-text { line-height: 1.2; }
#add-club-hint::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--ink);
}
#add-club-hint::after {
    content: '';
    position: absolute;
    left: calc(100% - 1.5px);
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: var(--lime);
}
.add-club-hint-close { background: none; border: none; color: var(--ink-60); cursor: pointer; font-size: 14px; line-height: 1; padding: 2px; }
.add-club-hint-close:hover { color: var(--ink); }
.btn-group.expanded #add-club-hint { display: none; }

/* ═══════════════════════════════════════════════════════════
   Sidebar
   ═══════════════════════════════════════════════════════════ */
.sidebar-brand { display: flex; align-items: center; gap: 9px; }
.sidebar-brand-mark { width: 24px; height: 24px; flex-shrink: 0; }
.sidebar-brand-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 21px;
    color: var(--ink);
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

#clubs-sidebar { position: fixed; top: 20px; left: 20px; width: 380px; height: calc(100vh - 40px); z-index: 1000; transition: transform 0.3s ease; }
#clubs-sidebar.hidden { transform: translateX(-100%); }

.sidebar-content {
    background: var(--surface);
    border: var(--line-strong);
    border-radius: var(--r);
    box-shadow: var(--pop);
    height: 100%;
    display: flex; flex-direction: column;
    box-sizing: border-box;
}

.sidebar-header { padding: 14px 16px 12px; flex-shrink: 0; margin-bottom: 0; }
.sidebar-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

.sidebar-close-btn {
    display: none;
    background: var(--surface);
    border: var(--line-strong);
    border-radius: var(--r-sm);
    width: 34px; height: 34px;
    align-items: center; justify-content: center;
    color: var(--ink-75);
    cursor: pointer;
    transition: background 0.12s ease;
}
.sidebar-close-btn:hover { background: var(--ink); color: var(--bg); }

.filter-controls { display: flex; flex-direction: column; gap: 11px; padding-right: 5px; }

.level-filter-label {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 700;
    color: var(--ink-45);
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 0;
}
.level-filter-info { display: inline-flex; align-items: center; color: var(--ink-35); cursor: help; position: relative; }
.level-filter-info:hover { color: var(--ink-75); }
.level-filter-info::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--bg);
    font-size: 11px; font-weight: 400; line-height: 1.5;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    width: 220px;
    white-space: normal; text-transform: none; letter-spacing: 0;
    pointer-events: none; opacity: 0; transition: opacity 0.15s ease;
    z-index: 1000;
}
.level-filter-info:hover::after { opacity: 1; }

/* Tier filter pills — flat, no rainbow. Selected = solid ink invert. */
.level-filter-group { display: flex; flex-wrap: wrap; gap: 5px; }
.level-btn {
    padding: 4px 10px;
    background: var(--surface);
    border: 1px solid var(--ink-20, var(--ink-15));
    border-radius: var(--r-pill);
    color: var(--ink-60);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
    white-space: nowrap;
    display: inline-flex; align-items: center; gap: 4px;
}
.level-btn:hover { border-color: var(--ink-45); color: var(--ink); }
.level-btn.active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
}

/* User filter toggle (visited / watched) + region toggle — same flat pattern */
.user-filter-toggle, .region-toggle { display: flex; flex-wrap: wrap; gap: 8px; }
.user-filter-btn, .region-btn {
    flex: 1;
    min-width: 90px;
    padding: 7px 10px;
    background: var(--surface);
    border: 1px solid var(--ink-20, var(--ink-15));
    border-radius: var(--r-sm);
    color: var(--ink-60);
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.user-filter-btn:hover, .region-btn:hover { border-color: var(--ink-45); color: var(--ink); }
.user-filter-btn.active, .region-btn.active { background: var(--lime); border-color: var(--ink-fixed); color: var(--ink-fixed); }

#club-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ink-20, var(--ink-15));
    border-radius: var(--r-sm);
    background: var(--surface);
    font-size: 13px;
    font-family: inherit;
    color: var(--ink-90);
    box-sizing: border-box;
    transition: border-color 0.12s ease;
}
#club-search:focus { outline: none; border-color: var(--ink); }
#club-search::placeholder { color: var(--ink-35); }

.sidebar-select {
    width: 100%;
    padding: 9px 12px;
    background: var(--surface);
    border: 1px solid var(--ink-20, var(--ink-15));
    border-radius: var(--r-sm);
    color: var(--ink-75);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.12s ease;
    box-sizing: border-box;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='rgba(22,23,21,0.5)'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.sidebar-select:focus { outline: none; border-color: var(--ink); }
.sidebar-select option { background: var(--surface); color: var(--ink-90); }

/* League filter custom dropdown */
.league-filter-selected {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface);
    border: 1px solid var(--ink-20, var(--ink-15));
    border-radius: var(--r-sm);
    padding: 8px 12px;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--ink-90);
}
.league-filter-logo { width: 24px; height: 24px; object-fit: contain; margin-right: 2px; flex-shrink: 0; }
.league-filter-selected.hidden { display: none; }
#league-filter-wrapper { position: relative; }

.league-filter-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--surface);
    border: var(--line-strong);
    border-radius: var(--r-sm);
    z-index: 9999;
    box-shadow: var(--pop);
    overflow: hidden;
}
.league-filter-dropdown.hidden { display: none; }
.league-filter-dropdown-search {
    width: 100%; padding: 10px 14px;
    background: var(--ink-04);
    border: none;
    border-bottom: var(--line);
    color: var(--ink-85);
    font-size: 13px; box-sizing: border-box; font-family: inherit;
}
.league-filter-list { max-height: 200px; overflow-y: auto; }
.league-dropdown-item {
    padding: 9px 14px; font-size: 13px; color: var(--ink-75);
    cursor: pointer; display: flex; align-items: center; gap: 8px;
    transition: background 0.12s;
}
.league-dropdown-item:hover { background: var(--ink-06); color: var(--ink); }

.country-select-wrapper { position: relative; }
.country-search-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--ink-20, var(--ink-15));
    border-radius: var(--r-sm);
    color: var(--ink-75);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.12s ease;
    box-sizing: border-box;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='rgba(22,23,21,0.5)'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.country-search-input:focus { outline: none; border-color: var(--ink); }
.form-group .country-search-input { background: var(--ink-04); border: 1px solid var(--ink-15); border-radius: var(--r-sm); color: var(--ink-85); font-family: inherit; }

.country-dropdown.hidden { display: none; }
.country-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--surface);
    border: var(--line-strong);
    border-radius: var(--r-sm);
    z-index: 9999;
    box-shadow: var(--pop);
    overflow: hidden;
}
.country-dropdown-search {
    width: 100%; padding: 10px 14px;
    background: var(--ink-04);
    border: none;
    border-bottom: var(--line);
    color: var(--ink-85);
    font-size: 13px; box-sizing: border-box; font-family: inherit;
}
.country-dropdown-search:focus { outline: none; background: var(--ink-06); }
.country-dropdown-search::placeholder { color: var(--ink-35); }
.country-dropdown-list { max-height: 200px; overflow-y: auto; }
.country-dropdown-item { padding: 9px 14px; font-size: 13px; color: var(--ink-75); cursor: pointer; transition: background 0.12s; }
.country-dropdown-item:hover { background: var(--ink-06); color: var(--ink); }

.sidebar-login-notice {
    margin: 0 20px 10px 20px;
    align-items: center;
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    background: var(--lime-06);
    border: 1px solid var(--lime-border);
    color: var(--ink-75);
}
#sidebar-login-notice.hidden { display: none; }
.login-notice-text { flex: 1; font-size: 13px; line-height: 1.45; }
.sidebar-login-notice a { color: var(--lime-text); text-decoration: none; font-weight: 700; }
.sidebar-login-notice a:hover { text-decoration: underline; }
.login-notice-close { flex-shrink: 0; background: none; border: none; color: var(--ink-35); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 0 0 6px; align-self: flex-start; }
.login-notice-close:hover { color: var(--ink-75); }

.clubs-list-section { flex: 1; display: flex; flex-direction: column; padding: 0 16px 16px 16px; overflow: hidden; }
.clubs-list-section h3 {
    margin: 0 0 12px 0;
    color: var(--ink-45);
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    flex-shrink: 0;
}

/* Club list — flat rows, hairline dividers, no boxed container */
.clubs-list {
    display: flex; flex-direction: column; gap: 0;
    overflow-y: auto; flex: 1;
    border-top: var(--line);
    scrollbar-width: none;
}
.clubs-list::-webkit-scrollbar { display: none; }

.club-item {
    display: flex; align-items: center;
    gap: 8px;
    padding: 11px 4px;
    background: transparent;
    border: none;
    border-bottom: var(--line);
    cursor: pointer;
    transition: background 0.12s ease;
    flex-shrink: 0;
    position: relative;
}
.club-item:hover { background: var(--ink-04); }
.club-item:active { background: var(--ink-06); }
.club-item::after {
    content: '→';
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-25);
    margin-left: auto;
    flex-shrink: 0;
}

.club-logo {
    width: 34px; height: 34px;
    object-fit: contain;
    object-position: center;
    background: transparent;
    flex-shrink: 0;
}
.club-info { flex: 1; min-width: 0; }
.club-name {
    display: flex; align-items: center; gap: 5px;
    font-size: 14px; font-weight: 600;
    color: var(--ink-90);
    margin-bottom: 1px;
    min-width: 0;
    letter-spacing: 0;
}
.club-name-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }

.club-tier-dot {
    flex-shrink: 0;
    width: 13px; height: 13px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--ink-06);
    border: 1px solid var(--ink-15);
    color: var(--ink-45);
}
/* Tier ladder rendered as one ink ramp — not a color wheel */
.club-tier-dot[data-tier="tier1"] { color: var(--ink-90); }
.club-tier-dot[data-tier="tier2"] { color: var(--ink-75); }
.club-tier-dot[data-tier="tier3"] { color: var(--ink-60); }
.club-tier-dot[data-tier="tier4"] { color: var(--ink-45); }
.club-tier-dot[data-tier="tier5"] { color: var(--ink-35); }
.club-tier-dot[data-tier="tier6plus"] { color: var(--ink-25); }
.club-tier-dot[data-tier="college"] { color: var(--ink-60); }
.club-tier-dot[data-tier="nationalteam"] { color: var(--lime-text); background: var(--lime-dim); border-color: var(--lime-border); }
.club-tier-dot[data-tier="extinct"] { color: var(--ink-25); }
.club-tier-dot[data-tier="nocompetition"] { color: var(--ink-25); }

.club-stadium { font-size: 11px; color: var(--ink-45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0; }

/* ── Pending edits / suggestions panel ───────────────────── */
.pending-edits-empty, .pending-edits-loading { color: var(--ink-45); text-align: center; padding: 24px 0; font-size: 14px; }
.pending-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-45); margin: 14px 0 8px 0; }
.pending-item { background: var(--ink-04); border: var(--line); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 8px; font-size: 13px; }
.pending-item-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--ink-35); font-size: 11px; }
.pending-item-score { background: var(--lime-dim); color: var(--lime-text); border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 700; }
.pending-diff { display: grid; gap: 4px; }
.pending-diff-row { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 6px; align-items: start; font-size: 12px; }
.pending-diff-field { color: var(--ink-45); font-weight: 600; padding-top: 2px; }
.pending-diff-old { color: var(--ink-45); text-decoration: line-through; word-break: break-all; }
.pending-diff-new { color: var(--lime-text); font-weight: 600; word-break: break-all; }
.pending-kit-row { display: flex; align-items: center; gap: 10px; }
.pending-kit-type { color: var(--ink-60); font-size: 12px; font-weight: 600; text-transform: capitalize; min-width: 60px; }
.pending-kit-img { width: 40px; height: 40px; object-fit: contain; border-radius: 4px; background: var(--ink-04); }
.pending-kit-url { color: var(--lime-text); font-size: 11px; word-break: break-all; flex: 1; }

/* Highlight style for missing coordinates */
.form-group.highlight-missing { animation: highlightMissing 1.6s ease-in-out; }
.form-group.highlight-missing input { border-color: var(--ink); box-shadow: 0 0 0 3px var(--lime-dim); }
.form-group.highlight-missing label { color: var(--ink); font-weight: 700; }
@keyframes highlightMissing { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }

/* ═══════════════════════════════════════════════════════════
   Forms / modals (submission, edit, kit, duplicate, invalid,
   create-league) — shared .form-content shell
   ═══════════════════════════════════════════════════════════ */
#create-league-form {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(22, 23, 21, 0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
    opacity: 1; visibility: visible;
    transition: all 0.25s ease;
}
#create-league-form.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#create-league-form.hidden .form-content { transform: translateY(-24px) scale(0.97); }

#submission-form,
#edit-form,
#kit-form,
#duplicate-form,
#invalid-form,
#pending-edits-form,
#rivals-form {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(22, 23, 21, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

#submission-form.hidden,
#edit-form.hidden,
#kit-form.hidden,
#duplicate-form.hidden,
#invalid-form.hidden,
#pending-edits-form.hidden,
#rivals-form.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#submission-form.hidden .form-content,
#edit-form.hidden .form-content,
#kit-form.hidden .form-content,
#duplicate-form.hidden .form-content,
#invalid-form.hidden .form-content,
#pending-edits-form.hidden .form-content,
#rivals-form.hidden .form-content {
    transform: translateY(-24px) scale(0.97);
}

.form-content {
    background: var(--surface);
    border: var(--line-strong);
    border-radius: var(--r);
    box-shadow: var(--pop);
    padding: 20px;
    max-width: 480px;
    width: 90%;
    max-height: 90dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: transform 0.2s ease;
}

.form-content h2 {
    margin: 0 0 16px 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 22px;
    letter-spacing: 0;
    text-align: center;
}

.form-group { margin-bottom: 14px; }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; min-width: 0; }
.form-group label { display: block; margin-bottom: 5px; color: var(--ink-45); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--ink-20, var(--ink-15));
    border-radius: var(--r-sm);
    font-size: 14px;
    color: var(--ink-90);
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.form-group textarea { resize: vertical; min-height: 92px; }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--ink-35); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--lime-strong);
    box-shadow: 0 0 0 3px var(--lime-dim);
}
.form-group select option { background: var(--surface); color: var(--ink-90); }
.form-group small { display: block; margin-top: 4px; font-size: 11px; color: var(--ink-45); }
.form-group small a { color: var(--lime-text); }

.form-optional { border: 1px solid var(--ink-15); border-radius: var(--r-sm); overflow: hidden; position: relative; margin-top: 12px; }
.form-optional summary { color: var(--ink-45); padding: 10px 14px; font-size: 13px; cursor: pointer; list-style: none; user-select: none; transition: color 0.12s; }
.form-optional summary::-webkit-details-marker { display: none; }
.form-optional summary::before { content: '+ '; font-weight: 700; color: var(--ink-25); }
.form-optional[open] summary::before { content: '− '; }
.form-optional summary:hover { color: var(--ink-85); }
.form-optional-body .form-group { margin: 0 14px 14px; }
.form-optional-body .form-row { padding: 0 14px; }

#edit-form.optional-open .form-content { max-width: 840px; }
#edit-form.optional-open #club-edit-form { display: flex; align-items: flex-start; gap: 16px; }
#edit-form.optional-open .form-main-col { flex: 1; min-width: 0; }
#edit-form.optional-open .form-optional { flex: 0 0 300px; margin-top: 0; overflow: visible; align-self: stretch; }
#edit-form.optional-open .form-optional summary {
    font-size: 12px; font-weight: 700; color: var(--ink-45);
    letter-spacing: 0.06em; text-transform: uppercase;
    padding: 10px 14px 8px; cursor: default; pointer-events: none;
}
#edit-form.optional-open .form-optional summary::before { content: ''; }
#edit-form.optional-open .form-optional-body .form-group { margin: 0 10px 12px; }
#edit-form.optional-open .form-optional-body .form-row { padding: 0 10px; }

@media (max-width: 700px) {
    #edit-form.optional-open .form-content { max-width: 480px; }
    #edit-form.optional-open #club-edit-form { flex-direction: column; }
    #edit-form.optional-open .form-optional { flex: none; width: 100%; }
    #edit-form.optional-open .form-optional summary {
        pointer-events: auto; cursor: pointer; text-transform: none;
        font-weight: normal; font-size: 13px; letter-spacing: 0;
    }
    #edit-form.optional-open .form-optional summary::before { content: '− '; }
}

.form-group #duplicate-original-id { margin-top: 8px; min-height: 172px; }

.logo-preview-img {
    display: block; max-width: 64px; max-height: 64px; margin-top: 8px;
    border-radius: var(--r-sm);
    background: var(--ink-04);
    border: var(--line);
    object-fit: contain; padding: 4px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}
.form-actions button {
    padding: 10px 20px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.12s ease;
}

.form-actions button[type="submit"] {
    background: var(--lime);
    border: 1.5px solid var(--ink-fixed);
    color: var(--ink-fixed);
    font-weight: 700;
    letter-spacing: 0;
    box-shadow: 3px 3px 0 var(--ink-fixed);
}
.form-actions button[type="submit"]:hover { background: var(--lime-strong); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink-fixed); }
.form-actions button[type="submit"]:active { transform: translate(0, 0); box-shadow: 3px 3px 0 var(--ink-fixed); }

.form-actions button[type="button"] {
    background: var(--surface);
    border: 1px solid var(--ink-20, var(--ink-15));
    color: var(--ink-60);
}
.form-actions button[type="button"]:hover { border-color: var(--ink-45); color: var(--ink); }

/* Mark as Duplicate button (in edit form actions) */
.btn-duplicate {
    padding: 10px 14px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.12s ease;
    background: var(--surface);
    border: 1px solid var(--ink-20, var(--ink-15));
    color: var(--ink-60);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.btn-duplicate:hover { background: var(--ink-06); border-color: var(--ink-45); color: var(--ink); }
.btn-duplicate:disabled { opacity: 0.4; cursor: default; }

@media (max-width: 600px) {
    #submission-form, #edit-form, #kit-form, #duplicate-form, #invalid-form, #rivals-form { align-items: flex-end; padding: 0; }
    #submission-form.hidden .form-content,
    #edit-form.hidden .form-content,
    #kit-form.hidden .form-content,
    #duplicate-form.hidden .form-content,
    #invalid-form.hidden .form-content,
    #rivals-form.hidden .form-content { transform: translateY(60px) scale(1); }
    .form-content {
        width: 100%; max-width: 100%; max-height: 92dvh;
        border-radius: var(--r-lg) var(--r-lg) 0 0;
        padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
        -webkit-overflow-scrolling: touch;
    }
    .form-content::before {
        content: ''; display: block; width: 36px; height: 4px;
        background: var(--ink-15); border-radius: 2px; margin: 0 auto 18px;
    }
    .form-row { flex-direction: column; gap: 0; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions button { width: 100%; justify-content: center; }
}

/* Rival / league search-and-select rows inside forms */
.rival-results, .league-results {
    position: absolute; z-index: 50;
    background: var(--surface);
    border: var(--line-strong);
    border-radius: var(--r-sm);
    box-shadow: var(--pop);
    overflow-y: auto;
    width: 100%; margin-top: 4px;
}
.rival-results { max-height: 180px; }
.league-results { max-height: 200px; }
.rival-results.hidden, .league-results.hidden { display: none; }
.rival-result-item, .league-result-item {
    padding: 8px 12px; font-size: 13px; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    color: var(--ink-75);
}
.rival-result-item:hover, .league-result-item:hover { background: var(--ink-06); color: var(--ink); }
.rival-result-img { width: 22px; height: 22px; object-fit: contain; border-radius: 3px; flex-shrink: 0; }
.rival-selected, .league-selected {
    margin-top: 6px; display: flex; align-items: center; gap: 8px;
    background: var(--lime-dim); border: 1px solid var(--lime-border);
    border-radius: var(--r-sm); padding: 6px 10px; font-size: 13px;
}
.rival-selected.hidden, .league-selected.hidden { display: none; }
.rival-selected-img { width: 22px; height: 22px; object-fit: contain; border-radius: 3px; }
.rival-selected-name { flex: 1; color: var(--ink-90); }
.rival-clear-btn { background: none; border: none; color: var(--ink-45); cursor: pointer; font-size: 16px; padding: 0 2px; line-height: 1; }
.rival-clear-btn:hover { color: var(--ink-85); }
.league-result-create { color: var(--lime-text); font-style: italic; }
.league-result-create:hover { background: var(--lime-dim); color: var(--lime-text); }
.form-group { position: relative; }

/* ═══════════════════════════════════════════════════════════
   Info modal
   ═══════════════════════════════════════════════════════════ */
#info-modal, #nearby-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(22, 23, 21, 0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 3000;
    opacity: 1; visibility: visible;
    transition: all 0.2s ease;
}
#info-modal.hidden, #nearby-modal.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.info-modal-content {
    background: var(--surface);
    border: var(--line-strong);
    border-radius: var(--r);
    padding: 0; max-width: 460px; width: 90%;
    box-shadow: var(--pop);
    transform: translateY(0) scale(1);
    transition: all 0.2s ease;
    overflow: hidden;
}
#info-modal.hidden .info-modal-content, #nearby-modal.hidden .info-modal-content { transform: translateY(-14px) scale(0.97); }

#nearby-modal-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.nearby-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    background: var(--surface); border: var(--line);
    cursor: pointer; text-align: left;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.nearby-item:hover { background: var(--ink-04); border-color: var(--ink-45); }
.nearby-item-logo { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; background: var(--ink-04); }
.nearby-item-info { flex: 1; min-width: 0; }
.nearby-item-name { font-size: 13px; font-weight: 600; color: var(--ink-90); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nearby-item-meta { font-size: 11px; color: var(--ink-35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nearby-item-distance { font-size: 12px; font-weight: 700; color: var(--ink-45); flex-shrink: 0; }
.info-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 16px; border-bottom: var(--line); }
.info-modal-header h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--ink); letter-spacing: 0; }
.info-modal-close {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    background: var(--surface);
    border: 1px solid var(--ink-15);
    border-radius: var(--r-sm);
    color: var(--ink-45);
    cursor: pointer;
    transition: all 0.12s ease;
}
.info-modal-close:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.info-modal-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 12px; }
.info-section { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: var(--r-sm); font-size: 14px; line-height: 1.55; border: var(--line); }
.info-section svg { flex-shrink: 0; margin-top: 1px; }
.info-section p { margin: 0; color: var(--ink-60); }
.info-section a { color: var(--lime-text); font-weight: 600; }
.info-section a:hover { text-decoration: underline; }
.info-warning { background: var(--ink-04); border-color: var(--ink-15); }
.info-warning svg { color: var(--ink-75); }
.info-collab { background: var(--lime-dim); border-color: var(--lime-border); }
.info-collab svg { color: var(--lime-text); }
.info-source { background: var(--ink-04); }
.info-source svg { color: var(--ink-35); }

/* ═══════════════════════════════════════════════════════════
   Auth modal
   ═══════════════════════════════════════════════════════════ */
.auth-modal-overlay { position: fixed; inset: 0; background: rgba(22, 23, 21, 0.45); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-modal-overlay.hidden { display: none; }
.auth-modal-box { background: var(--surface); border: var(--line-strong); border-radius: var(--r); width: 100%; max-width: 360px; box-shadow: var(--pop); overflow: hidden; }
.auth-modal-tabs { display: flex; border-bottom: var(--line); }
.auth-tab-btn {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--ink-45); padding: 14px 0 12px; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    cursor: pointer; font-family: inherit; transition: color 0.12s, border-color 0.12s; margin-bottom: -1px;
}
.auth-tab-btn.active { color: var(--ink); border-bottom-color: var(--lime); }
.auth-modal-body { padding: 22px 22px 24px; }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-field { margin-bottom: 12px; }
.auth-field label { display: block; font-size: 11px; font-weight: 700; color: var(--ink-45); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; font-family: inherit; }
.auth-input {
    width: 100%; background: var(--surface); border: 1px solid var(--ink-20, var(--ink-15));
    border-radius: var(--r-sm); padding: 10px 13px; font-size: 14px; color: var(--ink-90);
    font-family: inherit; transition: border-color 0.12s, box-shadow 0.12s; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: var(--lime-strong); box-shadow: 0 0 0 3px var(--lime-dim); }
.auth-submit {
    width: 100%; margin-top: 18px; padding: 13px;
    background: var(--lime); border: 1.5px solid var(--ink-fixed); border-radius: var(--r-sm);
    font-size: 15px; font-weight: 700; color: var(--ink-fixed); cursor: pointer; font-family: inherit;
    letter-spacing: 0; transition: all 0.12s; box-shadow: 3px 3px 0 var(--ink-fixed);
}
.auth-submit:hover:not(:disabled) { background: var(--lime-strong); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink-fixed); }
.auth-submit:active:not(:disabled) { transform: translate(0, 0); box-shadow: 3px 3px 0 var(--ink-fixed); }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-error { margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--ink); text-align: center; min-height: 16px; font-family: inherit; }

.auth-profile-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.auth-profile-avatar {
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--lime); border: 1.5px solid var(--ink-fixed);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800; color: var(--ink-fixed); flex-shrink: 0; font-family: var(--font-display);
}
.auth-profile-name { font-size: 17px; font-weight: 800; color: var(--ink); letter-spacing: 0; font-family: var(--font-display); }
.auth-profile-score { font-size: 12px; color: var(--ink-45); margin-top: 3px; font-family: inherit; }
.auth-profile-score strong { color: var(--lime-text); }
.auth-profile-actions { display: flex; gap: 8px; margin-top: 4px; }
.auth-profile-link {
    flex: 1; display: flex; align-items: center; justify-content: center; padding: 9px;
    background: var(--surface); border: 1px solid var(--ink-15); border-radius: var(--r-sm);
    font-size: 12px; font-weight: 600; color: var(--ink-60); text-decoration: none; cursor: pointer;
    font-family: inherit; transition: all 0.12s;
}
.auth-profile-link:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.auth-logout { color: var(--ink-75); border-color: var(--ink-15); }
.auth-logout:hover { background: var(--ink) !important; border-color: var(--ink) !important; color: var(--bg) !important; }

.auth-user-initial {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--lime); border: 1.5px solid var(--ink-fixed);
    color: var(--ink-fixed); font-size: 11px; font-weight: 800; font-family: var(--font-display);
    display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* ═══════════════════════════════════════════════════════════
   Footer / Ko-fi panel / tutorial panel
   ═══════════════════════════════════════════════════════════ */
footer {
    position: fixed; bottom: 12px; right: 14px;
    background: var(--surface);
    color: var(--ink-60);
    padding: 6px 12px;
    border-radius: var(--r-sm);
    font-size: 11px;
    z-index: 999;
    border: var(--line-strong);
}
footer a { color: var(--ink-75); text-decoration: none; font-weight: 600; }
footer a:hover { color: var(--ink); text-decoration: underline; }

#kofi-panel {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(22, 23, 21, 0.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 3000;
    opacity: 1; visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
#kofi-panel.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#kofi-panel-content { position: relative; border-radius: var(--r); overflow: hidden; border: var(--line-strong); box-shadow: var(--pop); width: min(480px, 92vw); height: min(640px, 88dvh); }
#kofi-iframe { width: 100%; height: 100%; border: none; display: block; }
#kofi-panel-close {
    position: absolute; top: 10px; right: 12px; z-index: 10;
    background: rgba(22, 23, 21, 0.5); border: 1px solid rgba(255,255,255,0.3); color: #fff;
    border-radius: 50%; width: 28px; height: 28px; font-size: 14px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background 0.12s;
}
#kofi-panel-close:hover { background: rgba(0, 0, 0, 0.7); }

.tutorial-panel {
    background: var(--lime-dim);
    border: 1px solid var(--lime-border);
    border-radius: var(--r-sm);
    padding: 10px 14px; margin-bottom: 14px;
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 13px; color: var(--ink-75); line-height: 1.45;
}
.tutorial-panel .tutorial-icon { width: 16px; height: 16px; fill: var(--lime-text); flex-shrink: 0; margin-top: 1px; }
.tutorial-panel h4 { display: none; }
.tutorial-panel p { margin: 0; }
.tutorial-panel p strong { color: var(--ink-90); }
.tutorial-panel.tutorial-warning { background: var(--ink-04); border-color: var(--ink-25); }
.tutorial-panel.tutorial-warning .tutorial-icon { fill: var(--ink-75); }

/* ═══════════════════════════════════════════════════════════
   Mobile
   ═══════════════════════════════════════════════════════════ */
@media screen and (max-width: 768px) {
    #tech-warning-banner { left: 12px; right: 12px; transform: none; max-width: none; top: 10px; font-size: 11px; }
    #add-club-hint { right: 0; left: auto; top: calc(100% + 10px); transform: none; max-width: 210px; white-space: normal; font-size: 11px; padding: 8px 10px; }
    #add-club-hint::before, #add-club-hint::after { display: none; }

    #clubs-sidebar { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: 78dvh; transform: translateY(100%); z-index: 1100; border-radius: 0; }
    #clubs-sidebar.hidden { transform: translateY(100%); }
    #clubs-sidebar:not(.hidden) { transform: translateY(0); }
    .sidebar-content { border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: none; }
    .sidebar-drag-handle { display: block !important; }
    .sidebar-close-btn { display: flex !important; }

    .leaflet-top.leaflet-left { left: 20px; top: 20px; }
    #clubs-sidebar.hidden ~ #map .leaflet-top.leaflet-left { left: 20px; }

    #top-right-buttons { top: 10px; right: 10px; gap: 10px; }
    #submit-button button:not(.add-club-hint-close),
    #kofi-button button, #info-button button, #filter-button button,
    #about-button a, #news-button a, #mapstyle-button button, #theme-toggle-button button,
    #random-button button, #stats-button a, #latest-button a,
    #auth-button button, #current-loc-button button, #nearby-button button { width: 38px; height: 38px; }

    .sidebar-select, .league-filter-search { padding: 6px 10px; font-size: 13px; }
    .league-filter-dropdown { max-height: 160px; }

    .form-content { width: 100%; max-width: 100%; padding: 16px; margin: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .form-row { flex-direction: column; gap: 0; }
    .form-group input, .form-group select, .form-group textarea { padding: 12px; font-size: 16px; }
    .form-actions { flex-direction: column-reverse; gap: 8px; }
    .form-actions button { width: 100%; padding: 13px 20px; }
    #submission-form, #edit-form, #kit-form, #duplicate-form, #invalid-form, #rivals-form { align-items: flex-end; }
    #submission-form.hidden .form-content,
    #edit-form.hidden .form-content,
    #kit-form.hidden .form-content,
    #duplicate-form.hidden .form-content,
    #invalid-form.hidden .form-content,
    #rivals-form.hidden .form-content { transform: translateY(100%); }

    .btn-group-pages, .btn-group-account { display: none; }
    #filter-button { display: none; }
    #add-club-hint { display: none !important; }
    #mobile-bottom-nav { display: flex !important; padding-bottom: env(safe-area-inset-bottom, 0px); }
    #sidebar-overlay { display: none; }
    #sidebar-overlay.active { display: block; }
}

@media screen and (max-width: 480px) {
    #clubs-sidebar { height: 86dvh; }
}

.sidebar-drag-handle { display: none; width: 40px; height: 4px; background: var(--ink-15); border-radius: 2px; margin: 10px auto 6px; flex-shrink: 0; }

#filter-section-toggle {
    display: none; width: 100%; box-sizing: border-box; align-items: center; gap: 7px;
    padding: 8px 12px; background: var(--surface); border: 1px solid var(--ink-15);
    border-radius: var(--r-sm); color: var(--ink-60); font-size: 12px; font-family: inherit;
    cursor: pointer; transition: background 0.12s, color 0.12s;
}
#filter-section-toggle:hover { background: var(--ink-04); color: var(--ink); }
#filter-section-toggle .toggle-chevron { margin-left: auto; transition: transform 0.2s ease; flex-shrink: 0; }
#clubs-sidebar.filters-open #filter-section-toggle .toggle-chevron { transform: rotate(180deg); }
#clubs-sidebar.filters-open #filter-section-toggle { background: var(--ink); color: var(--bg); }

#filter-section-collapsible { display: contents; }
@media screen and (max-width: 768px) {
    #filter-section-toggle { display: flex; }
    #filter-section-collapsible { display: none; flex-direction: column; gap: 10px; }
    #clubs-sidebar.filters-open #filter-section-collapsible { display: flex; }
}

#sidebar-overlay { position: fixed; inset: 0; z-index: 1090; background: rgba(22, 23, 21, 0.4); display: none; }

#mobile-bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1200;
    background: var(--surface);
    border-top: var(--line-strong);
    flex-direction: row; align-items: stretch; height: 60px;
    box-sizing: content-box;
}
.mob-nav-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; background: none; border: none; color: var(--ink-45);
    font-size: 11px; font-weight: 600; cursor: pointer; transition: color 0.12s;
}
.mob-nav-btn:hover, .mob-nav-btn.active { color: var(--ink); }
.mob-nav-btn svg { flex-shrink: 0; }
.mob-nav-initial {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--lime); border: 1.5px solid var(--ink-fixed); color: var(--ink-fixed);
    font-size: 12px; font-weight: 800; font-family: var(--font-display);
    display: flex; align-items: center; justify-content: center; line-height: 1;
}
@media screen and (max-width: 768px) {
    .mob-nav-btn.active { color: var(--ink); }
    .mob-nav-btn:not(.active):active { color: var(--ink-75); }
}

/* ── Club bottom sheet (mobile only) ─────────────────────── */
#club-bottom-sheet { display: none; position: fixed; inset: 0; z-index: 1300; }
#club-bottom-sheet.active { display: block; }
#club-sheet-backdrop { position: absolute; inset: 0; background: rgba(22, 23, 21, 0.35); }
#club-sheet-panel {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: var(--line-strong);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-height: 82dvh;
    display: flex; flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
    touch-action: none;
}
#club-bottom-sheet.active #club-sheet-panel { transform: translateY(0); }
#club-bottom-sheet.sheet-dismissing #club-sheet-panel { transform: translateY(100%); }
.club-sheet-handle { width: 40px; height: 4px; background: var(--ink-15); border-radius: 2px; margin: 12px auto 4px; flex-shrink: 0; cursor: grab; }
#club-sheet-close {
    position: absolute;
    top: 14px; right: 14px;
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    background: var(--surface);
    border: var(--line-strong);
    color: var(--ink-60);
    cursor: pointer;
    z-index: 2;
}
#club-sheet-close:hover { background: var(--ink); color: var(--bg); }
#club-sheet-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom, 12px); }
#club-sheet-content .popup-content { min-width: 0; border-radius: 0; }
/* No room to overlap the panel edge in the sheet's scroll area — sit the badge inline instead */
#club-sheet-content .popup-logo-badge { position: static; transform: none; margin: 0 auto 10px; display: block; }

@media screen and (min-width: 769px) { #club-bottom-sheet { display: none !important; } }

@media screen and (max-width: 768px) {
    #club-sheet-content .popup-content { padding: 22px 22px 6px; }
    #club-sheet-content .popup-logo-badge { width: 88px; height: 88px; }
    #club-sheet-content .popup-logo,
    #club-sheet-content .popup-logo-placeholder { width: 88px; height: 88px; }
    #club-sheet-content .popup-title { font-size: 24px; letter-spacing: 0; margin-bottom: 8px; }
    #club-sheet-content .popup-meta { font-size: 13px; margin-bottom: 8px; }
    #club-sheet-content .popup-meta-tier { font-size: 11px; padding: 2px 8px; border-radius: var(--r-sm); }
    #club-sheet-content .popup-sep { margin: 14px 0; }
    #club-sheet-content .popup-actions { gap: 8px; margin-top: 16px; }
    #club-sheet-content .popup-btn { padding: 11px 14px; border-radius: var(--r-sm); font-size: 13px; }
    #club-sheet-content .popup-btn-sm { padding: 8px 10px !important; font-size: 12px !important; border-radius: var(--r-sm) !important; }
    #club-sheet-content .popup-actions-report { margin-top: 8px !important; }
    #club-sheet-content .popup-rival { padding: 8px 12px; border-radius: var(--r-sm); }
    #club-sheet-content .popup-rival-logo { width: 26px; height: 26px; }
    #club-sheet-content .popup-rival-derby { font-size: 11px; }
    #club-sheet-content .popup-rival-name { font-size: 12px; }
    #club-sheet-content .popup-stadium { font-size: 13px; margin-bottom: 4px; }
    #club-sheet-content .popup-league { font-size: 14px; margin-top: 10px; }
    #club-sheet-content .popup-social-btn { width: 36px; height: 36px; }
}

/* ── Stadium history overlay (map) ─────────────────────────── */
.stadium-history-pin {
    box-sizing: border-box;
    background: var(--surface); color: var(--ink);
    border: 2px solid var(--ink-fixed); box-shadow: 2px 2px 0 var(--ink-fixed);
    font-size: 12px; font-weight: 800;
}
/* leaflet.css forces display:block on marker icons, so centre the number on the span */
.stadium-history-pin span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; line-height: 1; }
.stadium-history-pin.is-current { background: var(--lime); color: var(--ink-fixed); }
/* Corner badge: this stadium has a photo (hover or click the pin to see it) */
.stadium-history-pin.has-photo::after {
    content: ''; position: absolute; top: -6px; right: -6px; width: 10px; height: 10px; box-sizing: border-box;
    background: var(--lime); border: 2px solid var(--ink-fixed);
}
path.stadium-history-line { stroke: var(--lime-strong); stroke-width: 3; stroke-dasharray: 8 6; fill: none; }
.stadium-history-arrow { background: none; border: none; }
.stadium-history-arrow svg { display: block; fill: var(--lime); stroke: var(--ink-fixed); stroke-width: 1.5; stroke-linejoin: round; }
.stadium-history-year { background: none; border: none; }
.stadium-history-year span {
    position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 14px));
    padding: 2px 6px; background: var(--ink-fixed); color: var(--lime);
    font-size: 11px; font-weight: 800; white-space: nowrap;
}
.stadium-history-popup { padding-bottom: 10px; }
.stadium-history-popup img { display: block; width: 100%; height: 120px; object-fit: cover; margin-bottom: 8px; background: var(--ink-06); }
.stadium-history-popup .stadium-history-popup-name { padding: 0 12px; }
.stadium-history-popup-name { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.stadium-history-popup-name span { display: block; font-size: 11px; font-weight: 600; color: var(--ink-45); }
.leaflet-tooltip.stadium-history-tooltip {
    background: var(--surface); color: var(--ink); border: var(--line-strong);
    border-radius: 0; box-shadow: var(--pop-sm); padding: 6px 8px;
}
.leaflet-tooltip.stadium-history-tooltip::before { display: none; }
.stadium-history-tooltip .stadium-history-popup { padding-bottom: 0; }
.stadium-history-tooltip .stadium-history-popup .stadium-history-popup-name { padding: 0; }
.leaflet-tooltip.stadium-history-tooltip.has-photo { width: 200px; padding: 0; white-space: normal; }
.stadium-history-tooltip.has-photo .stadium-history-popup { padding-bottom: 8px; }
.stadium-history-tooltip.has-photo .stadium-history-popup img { height: 110px; }
.stadium-history-tooltip.has-photo .stadium-history-popup .stadium-history-popup-name { padding: 0 10px; }
/* Right-corner panel shown while a club's stadium history is drawn (top set in JS) */
.stadium-history-panel {
    position: fixed; right: 20px; top: 20px; z-index: 1100;
    display: flex; flex-direction: column; gap: 10px;
    width: 220px; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 12px;
    background: var(--surface); color: var(--ink); border: var(--line-strong); box-shadow: var(--pop-sm);
}
.stadium-history-panel-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-45); }
.stadium-history-panel-club { display: flex; align-items: center; gap: 10px; min-width: 0; font-family: var(--font-display); font-size: 16px; font-weight: 800; }
.stadium-history-panel-club img { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.stadium-history-panel-club span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stadium-history-panel-close {
    align-self: flex-start; font: inherit; font-size: 12px; font-weight: 700; padding: 5px 10px; cursor: pointer;
    background: transparent; color: var(--ink); border: 1.5px solid var(--ink);
}
.stadium-history-panel-close:hover { background: var(--lime); color: var(--ink-fixed); }
/* While the history is drawn, hide every other marker on the map (club logos etc.) */
.stadium-history-mode .leaflet-marker-icon:not(.stadium-history-marker),
.stadium-history-mode .leaflet-marker-shadow { display: none; }
