/* Popup league info (logo + nome) */
.popup-league {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0 0;
    font-size: 13px;
    color: #fff;
    font-weight: 500;
}
.popup-league-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    margin-right: 2px;
    flex-shrink: 0;
}
.popup-league-country {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    margin-left: 2px;
}
/* Create League modal (igual aos outros forms) */
#create-league-form {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

#create-league-form.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#create-league-form.hidden .form-content {
    transform: translateY(-50px) scale(0.9);
}
html, body {
    height: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

#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: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.35);
    color: rgba(255, 235, 205, 0.95);
    font-size: 12px;
    line-height: 1.35;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
}

#tech-warning-banner.hidden {
    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.8;
}

#tech-warning-close:hover {
    opacity: 1;
}

/* Position Leaflet zoom controls to avoid sidebar overlap */
.leaflet-top.leaflet-left {
    left: 440px;
    top: 20px;
    transition: left 0.3s ease;
}

/* When sidebar is hidden, move zoom controls to the left */
#clubs-sidebar.hidden ~ #map .leaflet-top.leaflet-left {
    left: 20px;
}

/* Ensure zoom controls are above sidebar when sidebar is hidden */
.leaflet-control-zoom {
    transition: left 0.3s ease;
}

/* Popup wrapper — Apple-grade dark glass */
.leaflet-popup-content-wrapper {
    background: rgba(18, 18, 20, 0.94) !important;
    backdrop-filter: saturate(180%) blur(28px);
    -webkit-backdrop-filter: saturate(180%) blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.11) !important;
    border-radius: 18px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    overflow: hidden;
    padding: 0 !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    font-size: 13px;
}

.leaflet-container a.leaflet-popup-close-button {
    color: rgba(255, 255, 255, 0.45) !important;
    top: 6px !important;
    right: 8px !important;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: #fff !important;
}

.leaflet-popup-tip-container {
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
}

.leaflet-popup-tip {
    background: rgba(15, 20, 30, 0.88) !important;
    box-shadow: none !important;
    border: none;
}

@keyframes popupSlideIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.93); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.leaflet-popup-content-wrapper {
    animation: popupSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Club icon styling */
.club-icon {
    transition: transform 0.3s ease;
}

.club-icon:hover {
    transform: scale(1.1);
}

/* Placeholder icon styling */
.placeholder-icon {
    background: rgba(52, 152, 219, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.placeholder-club-icon {
    font-size: 16px;
    color: white;
    text-align: center;
    line-height: 1;
}

/* ── Popup — Apple Maps-style ────────────────────────────── */
.popup-content {
    padding: 14px 14px 10px;
    min-width: 230px;
    text-align: left;
}

/* Header row: logo left + title/meta right */
.popup-header {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 10px;
}

.popup-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    object-position: center;
    flex-shrink: 0;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px;
    box-sizing: border-box;
}

.popup-logo-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.popup-header-info {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.popup-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
    line-height: 1.2;
    margin-bottom: 5px;
}

.popup-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.popup-meta-sep {
    color: rgba(255, 255, 255, 0.2);
}

.popup-meta-tier {
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    /* fallback — overridden by data-tier selectors below */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
}

.popup-meta-tier[data-tier="tier1"] {
    background: rgba(255, 195, 0, 0.15);
    border-color: rgba(255, 195, 0, 0.35);
    color: #ffc300;
}
.popup-meta-tier[data-tier="tier2"] {
    background: rgba(180, 195, 210, 0.15);
    border-color: rgba(180, 195, 210, 0.35);
    color: #b4c3d2;
}
.popup-meta-tier[data-tier="tier3"] {
    background: rgba(205, 127, 50, 0.15);
    border-color: rgba(205, 127, 50, 0.35);
    color: #d4915a;
}
.popup-meta-tier[data-tier="tier4"] {
    background: rgba(80, 185, 120, 0.15);
    border-color: rgba(80, 185, 120, 0.3);
    color: #50b978;
}
.popup-meta-tier[data-tier="tier5"] {
    background: rgba(60, 170, 200, 0.15);
    border-color: rgba(60, 170, 200, 0.3);
    color: #3caac8;
}
.popup-meta-tier[data-tier="tier6plus"] {
    background: rgba(150, 150, 170, 0.12);
    border-color: rgba(150, 150, 170, 0.25);
    color: rgba(180, 180, 200, 0.7);
}
.popup-meta-tier[data-tier="college"] {
    background: rgba(130, 100, 210, 0.15);
    border-color: rgba(130, 100, 210, 0.35);
    color: #9b7de0;
}
.popup-meta-tier[data-tier="extinct"] {
    background: rgba(200, 70, 70, 0.15);
    border-color: rgba(200, 70, 70, 0.3);
    color: #e06060;
}
.popup-meta-tier[data-tier="nationalteam"] {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.4);
    color: #93c5fd;
}
.popup-meta-tier[data-tier="nocompetition"] {
    background: rgba(150, 150, 150, 0.12);
    border-color: rgba(150, 150, 150, 0.25);
    color: rgba(180, 180, 180, 0.65);
}

/* Details section (stadium, league) */
.popup-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 9px 11px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-bottom: 10px;
}

.popup-detail-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
}

.popup-detail-row svg { color: rgba(255, 255, 255, 0.3); flex-shrink: 0; }
.popup-detail-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Keep backward compat for old popup-stadium still used in bottom sheet overrides */
.popup-stadium {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 2px;
}

.popup-sep {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 8px 0;
}

.popup-rivals {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.popup-rival {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 8px;
    padding: 5px 8px;
    text-align: left;
}

.popup-rival-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
}

.popup-rival-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.popup-rival-derby {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.popup-rival-name {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

.popup-actions-report {
    margin-top: 5px !important;
}

.popup-btn-sm {
    padding: 5px 8px !important;
    font-size: 11px !important;
    border-radius: 7px !important;
    opacity: 0.8;
}

.popup-btn-sm:hover {
    opacity: 1;
}

.popup-loading {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    padding: 8px 0;
}

.popup-kits-error {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 6px;
}

/* Actions container */
.popup-actions-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

/* Full-width primary button */
.popup-btn-fullwidth {
    width: 100%;
    justify-content: center;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

.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 {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.popup-btn.popup-btn-primary {
    background: #0a84ff;
    border-color: #0a84ff;
    color: #fff;
    font-weight: 600;
    letter-spacing: -0.1px;
    box-shadow: 0 2px 10px rgba(10, 132, 255, 0.4);
}

.popup-btn.popup-btn-primary:hover {
    background: #0077ed;
    border-color: #0077ed;
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.5);
    transform: translateY(-1px);
    color: #fff;
}

.popup-btn-secondary {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.6);
}

.popup-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.9);
}

.popup-btn-report-duplicate {
    background: rgba(255, 152, 0, 0.14);
    border-color: rgba(255, 152, 0, 0.35);
    color: rgba(255, 193, 90, 0.95);
}

.popup-btn-report-duplicate:hover {
    background: rgba(255, 152, 0, 0.24);
    border-color: rgba(255, 152, 0, 0.5);
    color: rgba(255, 215, 140, 1);
}

.popup-btn-report-invalid {
    background: rgba(244, 67, 54, 0.14);
    border-color: rgba(244, 67, 54, 0.35);
    color: rgba(255, 138, 128, 0.95);
}

.popup-btn-report-invalid:hover {
    background: rgba(244, 67, 54, 0.24);
    border-color: rgba(244, 67, 54, 0.5);
    color: rgba(255, 180, 170, 1);
}

.popup-btn-pending {
    background: rgba(100, 149, 237, 0.14);
    border-color: rgba(100, 149, 237, 0.35);
    color: rgba(160, 195, 255, 0.95);
}

.popup-btn-pending:hover {
    background: rgba(100, 149, 237, 0.24);
    border-color: rgba(100, 149, 237, 0.5);
    color: rgba(190, 215, 255, 1);
}

.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: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
}

.equipment-type {
    font-size: 10px;
    margin-top: 3px;
    color: #7f8c8d;
    text-transform: capitalize;
}

/* Top-right button group */
#top-right-buttons {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 5px;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Shared button container style */
#submit-button,
#kofi-button,
#discord-button,
#info-button,
#filter-button,
#about-button,
#news-button,
#mapstyle-button,
#random-button,
#stats-button,
#latest-button,
#auth-button {
    position: static;
}

/* Shared button/link style */
#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,
#random-button button,
#stats-button a,
#latest-button a,
#auth-button button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 11px;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: all 0.18s ease;
}

#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,
#random-button button:hover,
#stats-button a:hover,
#latest-button a:hover,
#auth-button button:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

/* Sidebar brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-brand-icon {
    color: rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
}

.sidebar-brand-title {
    font-size: 17px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: -0.4px;
}

/* Left Sidebar */
#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: rgba(22, 22, 24, 0.88);
    backdrop-filter: saturate(180%) blur(40px);
    -webkit-backdrop-filter: saturate(180%) blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.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: 15px;
}

.sidebar-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 500;
}

.sidebar-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

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

/* Level filter header */
.level-filter-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0;
}

.level-filter-info {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.3);
    cursor: help;
    position: relative;
}

.level-filter-info:hover {
    color: rgba(255, 255, 255, 0.6);
}

.level-filter-info::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e2530;
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.5;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 220px;
    white-space: normal;
    text-transform: none;
    letter-spacing: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.level-filter-info:hover::after {
    opacity: 1;
}

body.map-light .level-filter-label {
    color: rgba(0, 0, 0, 0.35);
}

body.map-light .level-filter-info {
    color: rgba(0, 0, 0, 0.3);
}

body.map-light .level-filter-info:hover {
    color: rgba(0, 0, 0, 0.6);
}

body.map-light .level-filter-info::after {
    background: #ffffff;
    color: rgba(0, 0, 0, 0.8);
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Level multi-select pills */
.level-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.level-btn {
    padding: 4px 9px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.level-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.85);
}

.level-btn.active {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}

.level-btn.active[data-value="Tier 1"] {
    background: rgba(255, 195, 0, 0.18);
    border-color: rgba(255, 195, 0, 0.5);
    color: #ffc300;
}
.level-btn.active[data-value="Tier 2"] {
    background: rgba(180, 195, 210, 0.18);
    border-color: rgba(180, 195, 210, 0.5);
    color: #b4c3d2;
}
.level-btn.active[data-value="Tier 3"] {
    background: rgba(205, 127, 50, 0.18);
    border-color: rgba(205, 127, 50, 0.5);
    color: #d4915a;
}
.level-btn.active[data-value="Tier 4"] {
    background: rgba(80, 185, 120, 0.18);
    border-color: rgba(80, 185, 120, 0.45);
    color: #50b978;
}
.level-btn.active[data-value="Tier 5"] {
    background: rgba(60, 170, 200, 0.18);
    border-color: rgba(60, 170, 200, 0.45);
    color: #3caac8;
}
.level-btn.active[data-value="Tier 6+"] {
    background: rgba(150, 150, 170, 0.18);
    border-color: rgba(150, 150, 170, 0.4);
    color: rgba(200, 200, 215, 0.85);
}
.level-btn.active[data-value="College"] {
    background: rgba(130, 100, 210, 0.18);
    border-color: rgba(130, 100, 210, 0.5);
    color: #9b7de0;
}
.level-btn.active[data-value="Extinct"] {
    background: rgba(200, 70, 70, 0.18);
    border-color: rgba(200, 70, 70, 0.45);
    color: #e06060;
}
.level-btn.active[data-value="No Competition"] {
    background: rgba(150, 150, 150, 0.18);
    border-color: rgba(150, 150, 150, 0.4);
    color: rgba(190, 190, 190, 0.8);
}
.level-btn.active[data-value="National Team"] {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(37, 99, 235, 0.5);
    color: #93c5fd;
}

body.map-light .level-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.5);
}

body.map-light .level-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.75);
}

body.map-light .level-btn.active {
    background: rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.3);
    color: rgba(0, 0, 0, 0.85);
}
body.map-light .level-btn.active[data-value="Tier 1"] {
    background: rgba(180, 130, 0, 0.12);
    border-color: rgba(180, 130, 0, 0.4);
    color: #9a6f00;
}
body.map-light .level-btn.active[data-value="Tier 2"] {
    background: rgba(90, 110, 130, 0.12);
    border-color: rgba(90, 110, 130, 0.35);
    color: #5a6e82;
}
body.map-light .level-btn.active[data-value="Tier 3"] {
    background: rgba(160, 90, 30, 0.12);
    border-color: rgba(160, 90, 30, 0.35);
    color: #a05a1e;
}
body.map-light .level-btn.active[data-value="Tier 4"] {
    background: rgba(30, 140, 70, 0.12);
    border-color: rgba(30, 140, 70, 0.35);
    color: #1e8c46;
}
body.map-light .level-btn.active[data-value="Tier 5"] {
    background: rgba(20, 130, 160, 0.12);
    border-color: rgba(20, 130, 160, 0.35);
    color: #1482a0;
}
body.map-light .level-btn.active[data-value="Tier 6+"] {
    background: rgba(0, 0, 0, 0.07);
    border-color: rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.5);
}
body.map-light .level-btn.active[data-value="College"] {
    background: rgba(90, 60, 170, 0.12);
    border-color: rgba(90, 60, 170, 0.35);
    color: #5a3caa;
}
body.map-light .level-btn.active[data-value="Extinct"] {
    background: rgba(180, 40, 40, 0.12);
    border-color: rgba(180, 40, 40, 0.35);
    color: #b42828;
}
body.map-light .level-btn.active[data-value="No Competition"] {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.18);
    color: rgba(0, 0, 0, 0.45);
}

/* User filter toggle (visited / watched) */
.user-filter-toggle {
    display: flex;
    gap: 8px;
}

.user-filter-btn {
    flex: 1;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.user-filter-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.85);
}

.user-filter-btn.active {
    background: rgba(10, 132, 255, 0.2);
    border-color: rgba(10, 132, 255, 0.45);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body.map-light .user-filter-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.14);
    color: rgba(0, 0, 0, 0.5);
}

body.map-light .user-filter-btn:hover {
    background: rgba(0, 0, 0, 0.09);
    color: rgba(0, 0, 0, 0.75);
}

body.map-light .user-filter-btn.active {
    background: rgba(10, 100, 210, 0.12);
    border-color: rgba(10, 100, 210, 0.35);
    color: #1565c0;
}

/* Region toggle */
.region-toggle {
    display: flex;
    gap: 8px;
}

.region-btn {
    flex: 1;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.region-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.85);
}

.region-btn.active {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#club-search {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    font-size: 13px;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.9);
    box-sizing: border-box;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#club-search:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#club-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.sidebar-select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s 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(255,255,255,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: rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.13);
}

.sidebar-select option {
    background: #1a2235;
    color: rgba(255, 255, 255, 0.9);
}


/* League filter custom dropdown */
.league-filter-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.9);
}
.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: #1a2235;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 10px;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    overflow: hidden;
}
.league-filter-dropdown.hidden {
    display: none;
}
.league-filter-dropdown-search {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.06);
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.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: rgba(255,255,255,0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}
.league-dropdown-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* Light theme */
body.map-light .country-search-input {
    background-color: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.7);
    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(0,0,0,0.4)'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

.country-select-wrapper {
    position: relative;
}

.country-search-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s 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(255,255,255,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: rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.13);
}

.form-group .country-search-input {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-family: inherit;
}

.country-dropdown.hidden {
    display: none;
}

.country-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1a2235;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.country-dropdown-search {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    box-sizing: border-box;
    font-family: inherit;
}

.country-dropdown-search:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
}

.country-dropdown-search::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.country-dropdown-list {
    max-height: 200px;
    overflow-y: auto;
}

.country-dropdown-item {
    padding: 9px 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background 0.15s;
}

.country-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.map-light .country-dropdown {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body.map-light .country-dropdown-search {
    background: rgba(0, 0, 0, 0.03);
    border-bottom-color: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.85);
}

body.map-light .country-dropdown-search::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

body.map-light .country-dropdown-item {
    color: rgba(0, 0, 0, 0.75);
}

body.map-light .country-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.9);
}

body.map-light .form-group .country-search-input {
    background-color: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.85);
}

.sidebar-login-notice {
    margin: 0 20px 10px 20px;
    align-items: center;
}

#sidebar-login-notice.hidden {
    display: none;
}

.login-notice-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.45;
}

.sidebar-login-notice a {
    color: #0a84ff;
    text-decoration: none;
    font-weight: 500;
}

.sidebar-login-notice a:hover {
    text-decoration: underline;
}

.login-notice-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 0 6px;
    align-self: flex-start;
}

.login-notice-close:hover {
    color: rgba(255, 255, 255, 0.8);
}

body.map-light .sidebar-login-notice {
    background: rgba(33, 150, 243, 0.07);
    border-color: rgba(33, 150, 243, 0.2);
    color: rgba(0, 0, 0, 0.55);
}

body.map-light .login-notice-close {
    color: rgba(0, 0, 0, 0.3);
}

body.map-light .login-notice-close:hover {
    color: rgba(0, 0, 0, 0.6);
}

.clubs-list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 20px 20px 20px;
    overflow: hidden;
}

.clubs-list-section h3 {
    margin: 0 0 15px 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* ── Club list — iOS grouped table view ──────────────────── */
.clubs-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    flex: 1;
    /* Grouped container */
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    overflow: hidden;
    overflow-y: auto;
    scrollbar-width: none;
}

.clubs-list::-webkit-scrollbar {
    display: none;
}

.club-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-shrink: 0;
    position: relative;
}

.club-item:last-child {
    border-bottom: none;
}

.club-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.club-item:active {
    background: rgba(255, 255, 255, 0.11);
}

/* Disclosure chevron */
.club-item::after {
    content: '›';
    font-size: 18px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.2);
    margin-left: auto;
    flex-shrink: 0;
    line-height: 1;
}

.club-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    margin-right: 11px;
    object-fit: contain;
    object-position: center;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.club-icon-img {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    object-position: center;
}

.club-icon-frame {
    width: 50px;
    height: 50px;
    padding: 6px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.club-info {
    flex: 1;
    min-width: 0;
}

.club-name {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 1px;
    min-width: 0;
    letter-spacing: -0.15px;
}

.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: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
}

.club-tier-dot[data-tier="tier1"] {
    background: rgba(255, 195, 0, 0.15);
    border-color: rgba(255, 195, 0, 0.35);
    color: #ffc300;
}
.club-tier-dot[data-tier="tier2"] {
    background: rgba(180, 195, 210, 0.15);
    border-color: rgba(180, 195, 210, 0.35);
    color: #b4c3d2;
}
.club-tier-dot[data-tier="tier3"] {
    background: rgba(205, 127, 50, 0.15);
    border-color: rgba(205, 127, 50, 0.35);
    color: #d4915a;
}
.club-tier-dot[data-tier="tier4"] {
    background: rgba(80, 185, 120, 0.15);
    border-color: rgba(80, 185, 120, 0.3);
    color: #50b978;
}
.club-tier-dot[data-tier="tier5"] {
    background: rgba(60, 170, 200, 0.15);
    border-color: rgba(60, 170, 200, 0.3);
    color: #3caac8;
}
.club-tier-dot[data-tier="tier6plus"] {
    background: rgba(150, 150, 170, 0.12);
    border-color: rgba(150, 150, 170, 0.25);
    color: rgba(180, 180, 200, 0.7);
}
.club-tier-dot[data-tier="college"] {
    background: rgba(130, 100, 210, 0.15);
    border-color: rgba(130, 100, 210, 0.35);
    color: #9b7de0;
}
.club-tier-dot[data-tier="extinct"] {
    background: rgba(200, 70, 70, 0.15);
    border-color: rgba(200, 70, 70, 0.3);
    color: #e06060;
}
.club-tier-dot[data-tier="nationalteam"] {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.4);
    color: #93c5fd;
}
.club-tier-dot[data-tier="nocompetition"] {
    background: rgba(150, 150, 150, 0.12);
    border-color: rgba(150, 150, 150, 0.25);
    color: rgba(180, 180, 180, 0.65);
}

.club-stadium {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.1px;
}

/* Info modal */
#info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 1;
    visibility: visible;
    transition: all 0.25s ease;
}

#info-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.info-modal-content {
    background: rgba(22, 22, 24, 0.96);
    backdrop-filter: saturate(180%) blur(40px);
    -webkit-backdrop-filter: saturate(180%) blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0;
    max-width: 460px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(0) scale(1);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

#info-modal.hidden .info-modal-content {
    transform: translateY(-20px) scale(0.95);
}

.info-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.info-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: -0.4px;
}

.info-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.info-modal-close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.info-modal-body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-section {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.55;
}

.info-section svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.info-section p {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
}

.info-section a {
    color: #0a84ff;
    text-decoration: none;
    font-weight: 500;
}

.info-section a:hover {
    opacity: 0.75;
    text-decoration: underline;
}

.info-warning {
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid rgba(255, 69, 58, 0.25);
}

.info-warning svg { color: #ff453a; }

.info-collab {
    background: rgba(10, 132, 255, 0.1);
    border: 1px solid rgba(10, 132, 255, 0.25);
}

.info-collab svg { color: #0a84ff; }

.info-source {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.info-source svg { color: rgba(255, 255, 255, 0.35); }

/* Info modal — light map mode override */
body.map-light .info-modal-content {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 1);
}
body.map-light .info-modal-header { border-bottom-color: rgba(0, 0, 0, 0.07); }
body.map-light .info-modal-header h2 { color: #1a2332; }
body.map-light .info-modal-close { background: rgba(0, 0, 0, 0.06); color: #5a6a7a; }
body.map-light .info-modal-close:hover { background: rgba(0, 0, 0, 0.1); color: #2c3e50; }
body.map-light .info-section p { color: #3d4a5c; }
body.map-light .info-section a { color: #0a64cc; }
body.map-light .info-warning { background: rgba(231, 76, 60, 0.07); border-color: rgba(231, 76, 60, 0.2); }
body.map-light .info-warning svg { color: #e74c3c; }
body.map-light .info-collab { background: rgba(52, 152, 219, 0.07); border-color: rgba(52, 152, 219, 0.2); }
body.map-light .info-collab svg { color: #2980b9; }
body.map-light .info-source { background: rgba(0, 0, 0, 0.03); border-color: rgba(0, 0, 0, 0.08); }
body.map-light .info-source svg { color: #7f8c8d; }

/* Competition filter panel - now hidden since moved to sidebar */
#competition-filter {
    display: none;
}

.filter-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-content h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    text-align: center;
}

/* Hide old filter elements */
.filter-options,
.filter-btn {
    display: none;
}

/* Submission form */
#submission-form {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

#submission-form.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#submission-form.hidden .form-content {
    transform: translateY(-50px) scale(0.9);
}

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

#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 {
    transform: translateY(-50px) scale(0.9);
}

/* Edit & kit forms */
#edit-form,
#kit-form,
#duplicate-form,
#invalid-form,
#pending-edits-form {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.form-content {
    background: rgba(15, 20, 30, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    max-height: 90dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(0) scale(1);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

.form-content h2 {
    margin: 0 0 18px 0;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* Pending edits panel */
#pending-edits-form .form-content {
    max-width: 560px;
}

.pending-edits-empty {
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    padding: 24px 0;
    font-size: 14px;
}

.pending-edits-loading {
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    padding: 24px 0;
    font-size: 14px;
}

.pending-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255, 255, 255, 0.4);
    margin: 14px 0 8px 0;
}

.pending-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    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: rgba(255, 255, 255, 0.35);
    font-size: 11px;
}

.pending-item-score {
    background: rgba(10, 132, 255, 0.18);
    color: rgba(100, 180, 255, 0.95);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
}

.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: rgba(255, 255, 255, 0.4);
    font-weight: 500;
    padding-top: 2px;
}

.pending-diff-old {
    color: rgba(255, 120, 100, 0.85);
    word-break: break-all;
}

.pending-diff-new {
    color: rgba(120, 220, 130, 0.9);
    word-break: break-all;
}

.pending-kit-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pending-kit-type {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
    min-width: 60px;
}

.pending-kit-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
}

.pending-kit-url {
    color: rgba(160, 195, 255, 0.8);
    font-size: 11px;
    word-break: break-all;
    flex: 1;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-group label .required {
    color: #ff6b6b;
    font-style: normal;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group select option {
    background: #1a2235;
    color: rgba(255, 255, 255, 0.9);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.14);
}

.form-group textarea {
    resize: vertical;
    min-height: 92px;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
}

.form-group small a {
    color: rgba(100, 180, 255, 0.8);
    text-decoration: none;
}

.form-group small a:hover {
    color: rgba(100, 180, 255, 1);
    text-decoration: underline;
}

/* Highlight style for missing coordinates */
.form-group.highlight-missing {
    animation: highlightMissing 2s ease-in-out;
}

.form-group.highlight-missing input {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

.form-group.highlight-missing label {
    color: #e74c3c;
    font-weight: 700;
}

@keyframes highlightMissing {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

.form-actions button {
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
}

.form-actions button[type="button"] {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.6);
}

.form-actions button[type="button"]:hover {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.9);
}

.form-actions button[type="submit"] {
    background: #0a84ff;
    border: 1px solid #0a84ff;
    color: #fff;
    font-weight: 600;
    letter-spacing: -0.1px;
    box-shadow: 0 2px 10px rgba(10, 132, 255, 0.35);
}

.form-actions button[type="submit"]:hover {
    background: #0077ed;
    border-color: #0077ed;
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.5);
    transform: translateY(-1px);
}

.form-actions button[type="submit"]:active {
    transform: translateY(0);
}

/* Mark as Duplicate button (in edit form actions) */
.btn-duplicate {
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
    background: rgba(255, 80, 80, 0.1);
    border: 1px solid rgba(255, 80, 80, 0.3);
    color: rgba(255, 120, 120, 0.9);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.btn-duplicate:hover {
    background: rgba(255, 80, 80, 0.2);
    border-color: rgba(255, 80, 80, 0.5);
    color: rgba(255, 150, 150, 1);
}
.btn-duplicate:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Optional fields details/summary */
.form-optional {
    margin-top: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}
.form-optional summary {
    padding: 10px 14px;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: color 0.2s;
}
.form-optional summary::-webkit-details-marker { display: none; }
.form-optional summary::before {
    content: '+ ';
    font-weight: 700;
    color: rgba(255,255,255,0.3);
}
.form-optional[open] summary::before { content: '− '; }
.form-optional summary:hover { color: rgba(255,255,255,0.8); }
.form-optional-body .form-group {
    margin: 0 14px 14px;
}
.form-optional-body .form-row {
    padding: 0 14px;
}
.form-optional-body .form-row .form-group {
    margin: 0 0 14px;
    padding: 0;
}

/* Two-column layout when optional fields are expanded in edit form */
#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: 600;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.4px;
    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 image */
.logo-preview-img {
    display: block;
    max-width: 64px;
    max-height: 64px;
    margin-top: 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    object-fit: contain;
    padding: 4px;
}

/* Mobile: bottom sheet */
@media (max-width: 600px) {
    #submission-form,
    #edit-form,
    #kit-form,
    #duplicate-form,
    #invalid-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 {
        transform: translateY(60px) scale(1);
    }

    .form-content {
        width: 100%;
        max-width: 100%;
        max-height: 92dvh;
        border-radius: 20px 20px 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: rgba(255, 255, 255, 0.2);
        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;
    }
}

/* Add-club hint bubble */
#add-club-hint {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(15, 20, 30, 0.96), rgba(22, 30, 45, 0.92));
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 12px;
    padding: 9px 10px 9px 12px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: rgba(255,255,255,0.88);
    white-space: nowrap;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.06);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    pointer-events: all;
    z-index: 1500;
    animation: hint-fadein 0.32s ease-out;
}

.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: rgba(255,255,255,0.16);
}
#add-club-hint::after {
    content: '';
    position: absolute;
    left: calc(100% - 1px);
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: rgba(18, 25, 38, 0.95);
}
.add-club-hint-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.48);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
    cursor: pointer;
    padding: 1px 4px;
    border-radius: 6px;
    transition: color 0.14s ease, background 0.14s ease;
    flex-shrink: 0;
}
.add-club-hint-close:hover {
    color: rgba(255,255,255,0.92);
    background: rgba(255,255,255,0.09);
}
@keyframes hint-fadein {
    from { opacity: 0; transform: translateY(-50%) translateX(6px); }
    to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}

/* Popup socials */
.popup-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 2px;
}
.popup-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    transition: color 0.15s, background 0.15s;
}
.popup-social-btn:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.14);
}

/* =============================================
   Light map mode overrides
   ============================================= */

/* Popup */
body.map-light .leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.92) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 1) !important;
    color: rgba(0, 0, 0, 0.85) !important;
}

body.map-light .leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.92) !important;
}

body.map-light .leaflet-container a.leaflet-popup-close-button {
    color: rgba(0, 0, 0, 0.3) !important;
}

body.map-light .leaflet-container a.leaflet-popup-close-button:hover {
    color: rgba(0, 0, 0, 0.8) !important;
}

body.map-light .popup-title {
    color: rgba(0, 0, 0, 0.85);
}

body.map-light .popup-meta {
    color: rgba(0, 0, 0, 0.45);
}

body.map-light .popup-meta-sep {
    color: rgba(0, 0, 0, 0.2);
}

body.map-light .popup-meta-tier[data-tier="tier1"] {
    background: rgba(180, 130, 0, 0.1);
    border-color: rgba(180, 130, 0, 0.3);
    color: #9a6f00;
}
body.map-light .popup-meta-tier[data-tier="tier2"] {
    background: rgba(90, 110, 130, 0.1);
    border-color: rgba(90, 110, 130, 0.25);
    color: #5a6e82;
}
body.map-light .popup-meta-tier[data-tier="tier3"] {
    background: rgba(160, 90, 30, 0.1);
    border-color: rgba(160, 90, 30, 0.25);
    color: #a05a1e;
}
body.map-light .popup-meta-tier[data-tier="tier4"] {
    background: rgba(30, 140, 70, 0.1);
    border-color: rgba(30, 140, 70, 0.25);
    color: #1e8c46;
}
body.map-light .popup-meta-tier[data-tier="tier5"] {
    background: rgba(20, 130, 160, 0.1);
    border-color: rgba(20, 130, 160, 0.25);
    color: #1482a0;
}
body.map-light .popup-meta-tier[data-tier="tier6plus"] {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.4);
}
body.map-light .popup-meta-tier[data-tier="college"] {
    background: rgba(90, 60, 170, 0.1);
    border-color: rgba(90, 60, 170, 0.25);
    color: #5a3caa;
}
body.map-light .popup-meta-tier[data-tier="extinct"] {
    background: rgba(180, 40, 40, 0.1);
    border-color: rgba(180, 40, 40, 0.25);
    color: #b42828;
}
body.map-light .popup-meta-tier[data-tier="nocompetition"] {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.38);
}

body.map-light .popup-stadium {
    color: rgba(0, 0, 0, 0.4);
}

body.map-light .popup-sep {
    background: rgba(0,0,0,0.08);
}

body.map-light .popup-rival {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.08);
}

body.map-light .popup-rival-derby {
    color: rgba(0,0,0,0.75);
}

body.map-light .popup-rival-name {
    color: rgba(0,0,0,0.45);
}

body.map-light .popup-loading {
    color: rgba(0, 0, 0, 0.35);
}

body.map-light .popup-btn.popup-btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #1d4ed8;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

body.map-light .popup-btn.popup-btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    border-color: #1e40af;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
    color: #fff;
}

body.map-light .popup-btn-secondary {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.5);
}

body.map-light .popup-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.09);
    color: rgba(0, 0, 0, 0.75);
}

body.map-light .equipment-img {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.04);
}

body.map-light .equipment-type {
    color: rgba(0, 0, 0, 0.45);
}

/* Forms */
body.map-light .form-content {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 1);
}

body.map-light .form-content h2 {
    color: rgba(0, 0, 0, 0.85);
}

body.map-light .form-group label {
    color: rgba(0, 0, 0, 0.5);
}

body.map-light .form-group input,
body.map-light .form-group select {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.85);
}

body.map-light .form-group input::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

body.map-light .form-group input:focus,
body.map-light .form-group select:focus {
    border-color: rgba(0, 0, 0, 0.35);
    background: rgba(0, 0, 0, 0.06);
}

body.map-light .form-group select option {
    background: #fff;
    color: rgba(0, 0, 0, 0.85);
}

body.map-light .form-group small {
    color: rgba(0, 0, 0, 0.4);
}

body.map-light .form-group small a {
    color: rgba(0, 100, 200, 0.8);
}

body.map-light .form-actions button[type="button"] {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.5);
}

body.map-light .form-actions button[type="button"]:hover {
    background: rgba(0, 0, 0, 0.09);
    color: rgba(0, 0, 0, 0.75);
}

body.map-light .form-actions button[type="submit"] {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.8);
    box-shadow: none;
}

body.map-light .form-actions button[type="submit"]:hover {
    background: rgba(0, 0, 0, 0.14);
    border-color: rgba(0, 0, 0, 0.3);
}

body.map-light .tutorial-panel {
    background: rgba(33, 150, 243, 0.07);
    border-color: rgba(33, 150, 243, 0.2);
    color: rgba(0, 0, 0, 0.55);
}

body.map-light .tutorial-panel p strong {
    color: rgba(0, 0, 0, 0.75);
}

body.map-light .tutorial-panel.tutorial-warning {
    background: rgba(255, 152, 0, 0.07);
    border-color: rgba(255, 152, 0, 0.25);
}

/* Sidebar & list */
body.map-light .sidebar-content {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.map-light .sidebar-brand-icon,
body.map-light .sidebar-brand-title {
    color: rgba(0, 0, 0, 0.75);
}

body.map-light .sidebar-close-btn {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.5);
}

body.map-light #club-search {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.85);
    box-shadow: none;
}

body.map-light #club-search::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

body.map-light .sidebar-select {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.7);
    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(0,0,0,0.4)'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

body.map-light .sidebar-select option {
    background: #ffffff;
    color: rgba(0, 0, 0, 0.85);
}

body.map-light .region-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.45);
}

body.map-light .region-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.7);
}

body.map-light .region-btn.active {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.85);
    box-shadow: none;
}

body.map-light .clubs-list-section h3 {
    color: rgba(0, 0, 0, 0.35);
}

body.map-light .clubs-list {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

body.map-light .club-item {
    border-bottom-color: rgba(0, 0, 0, 0.07);
    background: transparent;
}

body.map-light .club-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.map-light .club-item::after {
    color: rgba(0, 0, 0, 0.15);
}

body.map-light .club-name {
    color: rgba(0, 0, 0, 0.85);
}

body.map-light .club-stadium {
    color: rgba(0, 0, 0, 0.4);
}

/* Footer */
body.map-light footer {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

body.map-light footer a {
    color: rgba(0, 0, 0, 0.4);
}

body.map-light footer a:hover {
    color: rgba(0, 0, 0, 0.75);
    text-decoration: underline;
}

/* Button groups — invert button group to dark-on-light */
body.map-light .btn-group {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.map-light #submit-button button:not(.add-club-hint-close),
body.map-light #kofi-button button,
body.map-light #discord-button a,
body.map-light #info-button button,
body.map-light #filter-button button,
body.map-light #about-button a,
body.map-light #news-button a,
body.map-light #mapstyle-button button,
body.map-light #random-button button,
body.map-light #stats-button a,
body.map-light #latest-button a {
    color: rgba(0, 0, 0, 0.5);
}

body.map-light #submit-button button:not(.add-club-hint-close):hover,
body.map-light #kofi-button button:hover,
body.map-light #discord-button a:hover,
body.map-light #info-button button:hover,
body.map-light #filter-button button:hover,
body.map-light #about-button a:hover,
body.map-light #news-button a:hover,
body.map-light #mapstyle-button button:hover,
body.map-light #random-button button:hover,
body.map-light #stats-button a:hover,
body.map-light #latest-button a:hover {
    background: rgba(0, 0, 0, 0.07);
    color: rgba(0, 0, 0, 0.85);
}

body.map-light #add-club-hint {
    background: rgba(255, 255, 255, 0.93);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.74);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255,255,255,0.8);
}

body.map-light #add-club-hint::before {
    border-left-color: rgba(0, 0, 0, 0.12);
}

body.map-light #add-club-hint::after {
    border-left-color: rgba(255, 255, 255, 0.93);
}

body.map-light .add-club-hint-close {
    color: rgba(0, 0, 0, 0.42);
}

body.map-light .add-club-hint-close:hover {
    color: rgba(0, 0, 0, 0.7);
    background: rgba(0, 0, 0, 0.07);
}

/* Mobile responsiveness */
@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;
    }

    /* Sidebar → bottom sheet on mobile */
    #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);
    }

    /* Round top corners for bottom sheet */
    .sidebar-content {
        border-radius: 24px 24px 0 0;
    }

    /* Drag handle */
    .sidebar-drag-handle {
        display: block;
    }

    /* Show close button on mobile */
    .sidebar-close-btn {
        display: flex !important;
    }
    
    /* Adjust zoom controls for mobile */
    .leaflet-top.leaflet-left {
        left: 20px;
        top: 20px;
    }
    
    #clubs-sidebar.hidden ~ #map .leaflet-top.leaflet-left {
        left: 20px;
    }
    
    /* Adjust button group for mobile */
    #top-right-buttons {
        top: 10px;
        right: 10px;
        gap: 6px;
    }

    #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,
    #random-button button,
    #stats-button a,
    #latest-button a {
        width: 36px;
        height: 36px;
    }
    
    /* Form adjustments for mobile */
    .form-content {
        width: 100%;
        max-width: 100%;
        padding: 16px;
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Stack lat/lon side-by-side fields on mobile */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Larger touch targets for inputs */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 12px;
        font-size: 16px; /* prevents iOS zoom on focus */
    }

    /* Full-width action buttons on mobile */
    .form-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }
    .form-actions button {
        width: 100%;
        padding: 13px 20px;
    }

    /* Slide forms up from bottom on mobile */
    #submission-form,
    #edit-form,
    #kit-form,
    #duplicate-form,
    #invalid-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 {
        transform: translateY(100%);
    }

    /* Hide secondary top-right button group on mobile */
    .btn-group:last-child {
        display: none;
    }

    /* Hide top-right filter button (replaced by bottom nav) */
    #filter-button {
        display: none;
    }

    /* Hide add-club hint bubble on mobile */
    #add-club-hint {
        display: none !important;
    }

    /* Mobile bottom nav */
    #mobile-bottom-nav {
        display: flex;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    /* Mobile sidebar overlay */
    #sidebar-overlay {
        display: none;
    }
    #sidebar-overlay.active {
        display: block;
    }
}

@media screen and (max-width: 480px) {
    /* Extra small screens — sidebar stays as bottom sheet */
    #clubs-sidebar {
        height: 86dvh;
    }
}

/* ── Drag handle (mobile bottom sheet) ───────────────────── */
.sidebar-drag-handle {
    display: none;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 2px;
    margin: 10px auto 6px;
    flex-shrink: 0;
}

/* ── Filter section toggle (mobile only) ─────────────────── */
#filter-section-toggle {
    display: none;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

#filter-section-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

#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: rgba(255, 255, 255, 0.11);
    color: rgba(255, 255, 255, 0.85);
}

/* ── Filter section collapsible ──────────────────────────── */
/* Desktop: always shown inline */
#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 (mobile) ────────────────────────────── */
#sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: none;
}

/* ── Mobile bottom nav ───────────────────────────────────── */
#mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    background: rgba(28, 28, 30, 0.88);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    flex-direction: row;
    align-items: stretch;
    height: 60px;
    box-sizing: content-box; /* padding-bottom (safe area) is additive */
}

.mob-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 10px;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.15s;
    padding: 6px 0;
    -webkit-tap-highlight-color: transparent;
}

.mob-nav-btn:hover,
.mob-nav-btn.active {
    color: rgba(255, 255, 255, 0.95);
}

.mob-nav-btn svg {
    flex-shrink: 0;
}

.mob-nav-initial {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(10, 132, 255, 0.22);
    border: 1.5px solid rgba(10, 132, 255, 0.5);
    color: #60aaff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── Light map mode overrides ────────────────────────────── */
body.map-light #filter-section-toggle {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.5);
}

body.map-light #filter-section-toggle:hover,
body.map-light #clubs-sidebar.filters-open #filter-section-toggle {
    background: rgba(0, 0, 0, 0.09);
    color: rgba(0, 0, 0, 0.8);
}

body.map-light .sidebar-drag-handle {
    background: rgba(0, 0, 0, 0.15);
}

body.map-light #mobile-bottom-nav {
    background: rgba(242, 242, 247, 0.92);
    border-top-color: rgba(0, 0, 0, 0.1);
}

body.map-light .mob-nav-btn {
    color: rgba(0, 0, 0, 0.4);
}

body.map-light .mob-nav-btn:hover,
body.map-light .mob-nav-btn.active {
    color: rgba(0, 0, 0, 0.85);
}

/* Tutorial panel */
.tutorial-panel {
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.45;
}

.tutorial-panel .tutorial-icon {
    width: 16px;
    height: 16px;
    fill: rgba(33, 150, 243, 0.8);
    flex-shrink: 0;
    margin-top: 1px;
}

.tutorial-panel h4 {
    display: none;
}

.tutorial-panel p {
    margin: 0;
}

.tutorial-panel p strong {
    color: rgba(255, 255, 255, 0.85);
}

.tutorial-panel.tutorial-warning {
    background: rgba(255, 152, 0, 0.1);
    border-color: rgba(255, 152, 0, 0.3);
}

.tutorial-panel.tutorial-warning .tutorial-icon {
    fill: rgba(255, 152, 0, 0.85);
}

/* Footer styles */
footer {
    position: fixed;
    bottom: 12px;
    right: 14px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    color: rgba(255, 255, 255, 0.85);
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 11px;
    z-index: 999;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

footer a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
}

footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Ko-fi popup panel */
#kofi-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(5px);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

#kofi-panel.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#kofi-panel-content {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    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(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.85);
    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.15s;
}

#kofi-panel-close:hover {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
}

/* Rival club search */
.rival-results {
    position: absolute;
    z-index: 50;
    background: #1a2234;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    max-height: 180px;
    overflow-y: auto;
    width: 100%;
    margin-top: 4px;
}
.rival-results.hidden { display: none; }
.rival-result-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.8);
}
.rival-result-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.rival-result-img { width: 22px; height: 22px; object-fit: contain; border-radius: 3px; flex-shrink: 0; }
.rival-selected {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(10,132,255,0.1);
    border: 1px solid rgba(10,132,255,0.3);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
}
.rival-selected.hidden { display: none; }
.rival-selected-img { width: 22px; height: 22px; object-fit: contain; border-radius: 3px; }
.rival-selected-name { flex: 1; color: rgba(255,255,255,0.9); }
.rival-clear-btn { background: none; border: none; color: rgba(255,255,255,0.4); cursor: pointer; font-size: 16px; padding: 0 2px; line-height: 1; }
.rival-clear-btn:hover { color: rgba(255,255,255,0.8); }
.league-results {
    position: absolute;
    z-index: 50;
    background: #1a2234;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    margin-top: 4px;
}
.league-results.hidden { display: none; }
.league-result-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.8);
}
.league-result-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.league-result-create { color: rgba(10,132,255,0.9); font-style: italic; }
.league-result-create:hover { background: rgba(10,132,255,0.1); color: rgba(10,132,255,1); }
.league-selected { margin-top: 6px; display: flex; align-items: center; gap: 8px; background: rgba(10,132,255,0.1); border: 1px solid rgba(10,132,255,0.3); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.league-selected.hidden { display: none; }
.form-group { position: relative; }

@media screen and (max-width: 768px) {
    .sidebar-header {
        padding: 12px 14px 10px;
        /* Allow header to scroll when filter section is expanded */
        overflow-y: auto;
        max-height: 68dvh;
        overscroll-behavior: contain;
        scrollbar-width: none;
    }
    .sidebar-header::-webkit-scrollbar { display: none; }

    .sidebar-title-row {
        margin-bottom: 10px;
    }

    .filter-controls {
        gap: 8px;
    }

    .level-filter-label {
        margin-bottom: 0;
    }

    .level-btn {
        padding: 3px 8px;
        font-size: 11px;
        gap: 4px;
    }

    .level-btn svg {
        width: 11px;
        height: 11px;
    }

    .level-filter-group {
        gap: 4px;
    }

    .region-btn {
        padding: 4px 8px;
        font-size: 11px;
        gap: 4px;
    }

    .region-btn svg {
        width: 12px;
        height: 12px;
    }

    .region-toggle {
        gap: 6px;
    }

    #club-search {
        padding: 6px 10px;
        font-size: 13px;
    }

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

    .league-filter-dropdown {
        max-height: 160px;
    }

    /* Give clubs list bottom padding so items aren't hidden behind bottom nav */
    .clubs-list-section {
        padding-bottom: 0;
    }

    .clubs-list {
        padding-bottom: 8px;
    }

    /* Clubs list section title compact */
    .clubs-list-section h3 {
        margin-bottom: 10px;
    }
}

/* ── Auth button & modal ───────────────────────────────── */
#auth-button button {
    position: relative;
}

.auth-user-initial {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(10, 132, 255, 0.25);
    border: 1.5px solid rgba(10, 132, 255, 0.55);
    color: #60aaff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.auth-modal-overlay.hidden { display: none; }

.auth-modal-box {
    background: rgba(18, 18, 20, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
    backdrop-filter: saturate(180%) blur(40px);
    -webkit-backdrop-filter: saturate(180%) blur(40px);
}

.auth-modal-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tab-btn {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255, 255, 255, 0.4);
    padding: 14px 0 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}

.auth-tab-btn.active {
    color: #0a84ff;
    border-bottom-color: #0a84ff;
}

.auth-modal-body { padding: 20px 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: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 5px;
    font-family: inherit;
}

.auth-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    border-color: rgba(10, 132, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

.auth-submit {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: #0a84ff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: -0.1px;
    transition: all 0.15s;
    box-shadow: 0 2px 10px rgba(10, 132, 255, 0.4);
}

.auth-submit:hover:not(:disabled) {
    background: #0077ed;
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.5);
    transform: translateY(-1px);
}

.auth-submit:active:not(:disabled) {
    transform: translateY(0);
}

.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-error {
    margin-top: 10px;
    font-size: 12px;
    color: #ff453a;
    text-align: center;
    min-height: 16px;
    font-family: inherit;
}

/* Profile panel */
.auth-profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.auth-profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(10, 132, 255, 0.2);
    border: 2px solid rgba(10, 132, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #60aaff;
    flex-shrink: 0;
    font-family: inherit;
}

.auth-profile-name {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
    font-family: inherit;
}

.auth-profile-score {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 3px;
    font-family: inherit;
}

.auth-profile-score strong {
    color: #ffd60a;
}

.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: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.auth-profile-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.auth-logout {
    color: #ff453a;
    border-color: rgba(255, 69, 58, 0.25);
}

.auth-logout:hover {
    background: rgba(255, 69, 58, 0.1) !important;
    border-color: rgba(255, 69, 58, 0.4) !important;
    color: #ff6b62 !important;
}

/* ── 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(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

#club-sheet-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(13, 18, 28, 0.97);
    backdrop-filter: saturate(180%) blur(28px);
    -webkit-backdrop-filter: saturate(180%) blur(28px);
    border-top: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -6px 40px rgba(0, 0, 0, 0.55);
    max-height: 82dvh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.38s 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: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 12px auto 4px;
    flex-shrink: 0;
    cursor: grab;
}

#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;
}

body.map-light #club-sheet-panel {
    background: rgba(245, 247, 250, 0.97);
    border-top-color: rgba(0, 0, 0, 0.1);
}

body.map-light #club-sheet-backdrop {
    background: rgba(0, 0, 0, 0.3);
}

/* Only show on mobile */
@media screen and (min-width: 769px) {
    #club-bottom-sheet {
        display: none !important;
    }
}

/* ── Bottom sheet content: Apple-like enlarged presentation ── */
@media screen and (max-width: 768px) {
    #club-sheet-content .popup-content {
        padding: 8px 22px 6px;
    }

    #club-sheet-content .popup-logo {
        width: 88px;
        height: 88px;
        margin-bottom: 14px;
    }

    #club-sheet-content .popup-title {
        font-size: 22px;
        font-weight: 700;
        letter-spacing: -0.4px;
        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: 6px;
    }

    #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: 14px;
        font-size: 13px;
    }

    #club-sheet-content .popup-btn-sm {
        padding: 8px 10px !important;
        font-size: 12px !important;
        border-radius: 10px !important;
    }

    #club-sheet-content .popup-actions-report {
        margin-top: 8px !important;
    }

    #club-sheet-content .popup-rival {
        padding: 8px 12px;
        border-radius: 12px;
    }

    #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;
    }

    /* Active bottom nav indicator */
    .mob-nav-btn.active {
        color: #0a84ff;
    }

    .mob-nav-btn:not(.active):active {
        color: rgba(255, 255, 255, 0.7);
    }
}
