/* ===================================================================
   Sportly theme tokens — Light / Dark / Modern
   data-theme="light" (default) / "dark" / "modern"
   =================================================================== */

:root,
[data-theme="light"] {
    --bg: #faf6ee;
    --surface: #fffdf7;
    --surface-elev: #fffefa;
    --card-bg: #fffdf7;
    --input-bg: #fbf7ec;
    --border: #ebe3d1;
    --border-soft: #d9cfb8;
    --text: #2b2418;
    --text-muted: #6b6353;
    --text-faint: #a39b8a;
    --primary: #0f1d3a;
    --primary-2: #1b2c5e;
    --primary-soft: rgba(15, 29, 58, 0.08);
    --on-primary: #ffffff;
    --accent: #ff6b35;
    --accent-2: #ff8554;
    --accent-soft: rgba(255, 107, 53, 0.12);
    --on-accent: #ffffff;
    --hero-grad: linear-gradient(135deg, #0f1d3a 0%, #1b2c5e 60%, #2a3f7e 100%);
    --hero-deco-1: rgba(255, 107, 53, 0.25);
    --hero-deco-2: rgba(99, 145, 255, 0.20);
    --topnav-grad: linear-gradient(180deg, #0f1d3a 0%, #15265a 100%);
    --topnav-text: #ffffff;
    --topnav-text-muted: rgba(255, 255, 255, 0.78);
    --topnav-hover: rgba(255, 255, 255, 0.10);
    --topnav-active: rgba(255, 255, 255, 0.18);
    --bottomnav-bg: #fffdf7;
    --bottomnav-text: #6b6353;
    --bottomnav-active: #0f1d3a;
    --bottomnav-active-icon: #ff6b35;
    --shadow-sm: 0 2px 8px rgba(95, 70, 30, 0.06);
    --shadow: 0 8px 24px rgba(95, 70, 30, 0.10);
    --warn-bg: #fff7ed;
    --warn-border: #fed7aa;
    --warn-text: #9a3412;
    --tap-highlight: rgba(95, 70, 30, 0.10);
    /* Compatibility w/ legacy variable names */
    --sportly-navy: var(--primary);
    --sportly-navy-2: var(--primary-2);
    --sportly-accent: var(--accent);
    --sportly-bg: var(--bg);
}

[data-theme="dark"] {
    --bg: #0a0e1a;
    --surface: #131823;
    --surface-elev: #1c2230;
    --card-bg: #131823;
    --input-bg: #1c2230;
    --border: #232a3a;
    --border-soft: #2d364a;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --text-faint: #6b7280;
    --primary: #4d7cff;
    --primary-2: #6b91ff;
    --primary-soft: rgba(77, 124, 255, 0.15);
    --on-primary: #ffffff;
    --accent: #ff7849;
    --accent-2: #ff8e62;
    --accent-soft: rgba(255, 120, 73, 0.15);
    --on-accent: #ffffff;
    --hero-grad: linear-gradient(135deg, #0a0e1a 0%, #131823 50%, #1f2940 100%);
    --hero-deco-1: rgba(255, 120, 73, 0.18);
    --hero-deco-2: rgba(77, 124, 255, 0.15);
    --topnav-grad: linear-gradient(180deg, #06090f 0%, #0d1320 100%);
    --topnav-text: #e5e7eb;
    --topnav-text-muted: rgba(229, 231, 235, 0.70);
    --topnav-hover: rgba(255, 255, 255, 0.06);
    --topnav-active: rgba(255, 255, 255, 0.12);
    --bottomnav-bg: #0d1320;
    --bottomnav-text: #9ca3af;
    --bottomnav-active: #e5e7eb;
    --bottomnav-active-icon: #ff7849;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    --warn-bg: #2a1a0a;
    --warn-border: #5c3a18;
    --warn-text: #fcd9b6;
    --tap-highlight: rgba(255, 255, 255, 0.12);
}

[data-theme="modern"] {
    --bg: #0d0717;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-elev: rgba(255, 255, 255, 0.07);
    --card-bg: rgba(255, 255, 255, 0.04);
    --input-bg: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.10);
    --border-soft: rgba(255, 255, 255, 0.18);
    --text: #f1edf6;
    --text-muted: #b5acca;
    --text-faint: #7a7088;
    --primary: #00d4ff;
    --primary-2: #2af0e0;
    --primary-soft: rgba(0, 212, 255, 0.15);
    --on-primary: #0d0717;
    --accent: #ff3d9a;
    --accent-2: #ff5dad;
    --accent-soft: rgba(255, 61, 154, 0.18);
    --on-accent: #ffffff;
    --hero-grad: linear-gradient(135deg, #1a0a2e 0%, #2a1452 40%, #6b21a8 100%);
    --hero-deco-1: rgba(255, 61, 154, 0.35);
    --hero-deco-2: rgba(0, 212, 255, 0.30);
    --topnav-grad: linear-gradient(180deg, rgba(26, 10, 46, 0.85) 0%, rgba(42, 20, 82, 0.85) 100%);
    --topnav-text: #f1edf6;
    --topnav-text-muted: rgba(241, 237, 246, 0.70);
    --topnav-hover: rgba(255, 255, 255, 0.08);
    --topnav-active: rgba(0, 212, 255, 0.20);
    --bottomnav-bg: rgba(13, 7, 23, 0.92);
    --bottomnav-text: #b5acca;
    --bottomnav-active: #f1edf6;
    --bottomnav-active-icon: #00d4ff;
    --shadow-sm: 0 4px 14px rgba(255, 61, 154, 0.12);
    --shadow: 0 8px 32px rgba(255, 61, 154, 0.20), 0 4px 16px rgba(0, 212, 255, 0.12);
    --warn-bg: rgba(255, 200, 0, 0.08);
    --warn-border: rgba(255, 200, 0, 0.30);
    --warn-text: #ffd86b;
    --tap-highlight: rgba(255, 61, 154, 0.20);
}

/* Modern background ornament */
[data-theme="modern"] body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(255, 61, 154, 0.18), transparent 40%),
        radial-gradient(ellipse at 100% 100%, rgba(0, 212, 255, 0.15), transparent 40%);
    pointer-events: none;
    z-index: -1;
}

/* ===================================================================
   Base
   =================================================================== */

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

html, body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

* {
    -webkit-tap-highlight-color: var(--tap-highlight);
}

.btn,
.nav-link,
.nav-auth-btn {
    min-height: 44px;
}

a, .btn-link {
    color: var(--primary);
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-2);
    --bs-btn-hover-border-color: var(--primary-2);
    --bs-btn-active-bg: var(--primary-2);
    --bs-btn-color: var(--on-primary);
    --bs-btn-hover-color: var(--on-primary);
    --bs-btn-active-color: var(--on-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary);
    --bs-btn-hover-border-color: var(--primary);
    --bs-btn-hover-color: var(--on-primary);
}

.btn:focus, .btn:active:focus {
    box-shadow: 0 0 0 0.1rem var(--bg), 0 0 0 0.25rem var(--primary);
}

h1:focus { outline: none; }

/* ===================================================================
   Hero
   =================================================================== */

.hero {
    position: relative;
    margin: -1.5rem -1.25rem 2rem -1.25rem;
    padding: 4rem 2rem;
    background: var(--hero-grad);
    color: #fff;
    overflow: hidden;
    border-radius: 0 0 16px 16px;
}

@media (max-width: 720px) {
    .hero {
        margin: -1rem -1rem 1.5rem -1rem;
        border-radius: 0;
        padding: 2.75rem 1.25rem;
    }
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 80% 20%, var(--hero-deco-1), transparent 40%),
        radial-gradient(circle at 10% 80%, var(--hero-deco-2), transparent 50%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    max-width: 720px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.20);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
    max-width: 580px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-actions .btn {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.hero .btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-2);
    --bs-btn-hover-border-color: var(--accent-2);
    --bs-btn-active-bg: var(--accent-2);
    --bs-btn-color: var(--on-accent);
    --bs-btn-hover-color: var(--on-accent);
}

/* ===================================================================
   Section title
   =================================================================== */

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 1.25rem 0;
}

/* ===================================================================
   Feature cards
   =================================================================== */

.features { margin-bottom: 2.5rem; }

.feature-card {
    display: block;
    height: 100%;
    padding: 1.75rem;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--border-soft);
    color: var(--text);
}

[data-theme="modern"] .feature-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    word-break: break-word;
    color: var(--text);
}

.feature-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.feature-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===================================================================
   Stats
   =================================================================== */

.quick-actions { margin-bottom: 1.5rem; }
.stats { margin-top: 1.5rem; margin-bottom: 2rem; }

.stat-card {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1.25rem 0.5rem;
}

[data-theme="modern"] .stat-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.35rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===================================================================
   Page header
   =================================================================== */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.35rem 0;
    color: var(--text);
}

.page-subtitle {
    color: var(--text-muted);
    margin: 0;
}

/* ===================================================================
   Form card
   =================================================================== */

.form-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    max-width: 720px;
}

.form-card .form-label {
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.form-card .form-control,
.form-card .form-select {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

.form-card .form-control:focus,
.form-card .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15);
}

/* Gender pill radio group */
.gender-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gender-pill {
    flex: 1 1 0;
    min-width: 90px;
    cursor: pointer;
    margin: 0;
    position: relative;
}

.gender-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gender-pill > span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-weight: 500;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    user-select: none;
    min-height: 42px;
}

.gender-pill:hover > span {
    border-color: var(--accent);
}

.gender-pill input[type="radio"]:checked + span {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.gender-pill input[type="radio"]:focus-visible + span {
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.2);
}

/* Range slider value/ticks */
.range-value {
    font-weight: 600;
    color: var(--accent);
}

.range-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: -0.25rem;
}

/* Skill star rating */
.skill-stars {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    justify-content: center;
}

.skill-star {
    background: transparent;
    border: 0;
    padding: 0.2rem 0.25rem;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.skill-star i {
    font-size: 2rem;
    color: var(--border);
    transition: color 0.15s ease, text-shadow 0.15s ease, transform 0.15s ease;
    display: block;
}

.skill-star:hover {
    transform: scale(1.08);
}

.skill-star.is-filled i {
    color: #f59e0b;
    text-shadow: 0 0 14px rgba(245, 158, 11, 0.55);
}

.skill-star:focus-visible i {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 4px;
}

.skill-label-current {
    font-weight: 600;
    color: #f59e0b;
}

.skill-hint {
    letter-spacing: 0.02em;
    text-align: center;
}

/* Volleyball position pills (compact, single row) */
.position-pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.position-pill {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    padding: 0.5rem 0.4rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    user-select: none;
}

.position-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* Compact role pills (ProfileEdit) — horizontal chips */
/* Back link — page header */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border: none;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    width: fit-content;
}

.back-link:hover {
    background: var(--accent);
    color: var(--on-accent);
    text-decoration: none;
}

.back-link:active { transform: translateY(1px); }

.back-link i { font-size: 1rem; }

.role-pills {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.role-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    background: var(--input-bg);
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    user-select: none;
}

.role-pill input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.role-pill i { font-size: 0.95rem; }

.role-pill:hover {
    border-color: var(--p-color, var(--accent));
    color: var(--p-color, var(--accent));
}

.role-pill.role-athlete   { --p-color: #10b981; }
.role-pill.role-coach     { --p-color: #3b82f6; }
.role-pill.role-organizer { --p-color: #f59e0b; }
.role-pill.role-referee   { --p-color: #ef4444; }

.role-pill:has(input:checked) {
    background: var(--p-color);
    border-color: var(--p-color);
    color: #fff;
}

.position-pill:focus-within {
    outline: 2px solid var(--p-color, var(--accent));
    outline-offset: 2px;
}

.position-pill:hover {
    border-color: var(--p-color, var(--accent));
}

/* Per-position accent colors */
.pos-s   { --p-color: #f59e0b; }
.pos-oh  { --p-color: #ef4444; }
.pos-opp { --p-color: #8b5cf6; }
.pos-mb  { --p-color: #3b82f6; }
.pos-l   { --p-color: #10b981; }

.position-pill.is-active {
    background: var(--p-color);
    border-color: var(--p-color);
    color: #fff;
}

.position-name-display {
    margin-top: 0.5rem;
    text-align: center;
    font-weight: 600;
    color: var(--accent);
    min-height: 1.4em;
}

.position-name-display.is-empty {
    color: var(--text-faint);
    font-weight: 500;
    font-style: italic;
    opacity: 0.6;
}

[data-theme="dark"] .position-name-display.is-empty,
[data-theme="modern"] .position-name-display.is-empty {
    color: rgba(255, 255, 255, 0.55);
    opacity: 1;
}

/* Input placeholder — null state text */
.form-control::placeholder,
.form-control::-webkit-input-placeholder {
    color: var(--text-faint);
    opacity: 0.85;
}

[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .form-control::-webkit-input-placeholder,
[data-theme="modern"] .form-control::placeholder,
[data-theme="modern"] .form-control::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.10);
    opacity: 1;
}

/* Hero slider */
.hero-slider {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: -1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 720px) {
    .hero-slider { margin-top: -1rem; margin-bottom: 1.5rem; }
}

.hero-track {
    display: flex;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.hero-track::-webkit-scrollbar { display: none; }

.hero-slide {
    flex: 0 0 100%;
    min-width: 100%;
    scroll-snap-align: start;
    margin: 0;
    border-radius: 0;
}

/* Variant gradients */
.hero-alt-1 {
    --hero-grad: linear-gradient(135deg, #1a3a4d 0%, #0f5c4d 60%, #0d8b65 100%);
    --hero-deco-1: rgba(255, 200, 100, 0.25);
    --hero-deco-2: rgba(100, 240, 200, 0.20);
}

.hero-alt-2 {
    --hero-grad: linear-gradient(135deg, #4a1a3a 0%, #6b1f5a 50%, #b3318f 100%);
    --hero-deco-1: rgba(255, 140, 200, 0.30);
    --hero-deco-2: rgba(160, 100, 255, 0.25);
}

.hero-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.4rem;
    z-index: 5;
}

.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: width 0.2s ease, background-color 0.2s ease;
}

.hero-dot.is-active {
    background: #fff;
    width: 22px;
    border-radius: 6px;
}

/* Participant role checklist */
.role-checks {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.role-check {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--input-bg);
    cursor: pointer;
    margin: 0;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.role-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--p-color, var(--accent));
    flex-shrink: 0;
    margin: 0;
}

.role-check .role-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--p-color, var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.role-check .role-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.role-check .role-name {
    font-weight: 700;
    color: var(--text);
    font-size: 1rem;
}

.role-check .role-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.role-check:hover {
    border-color: var(--p-color, var(--accent));
    box-shadow: var(--shadow-sm);
}

.role-check:has(input:checked) {
    border-color: var(--p-color, var(--accent));
    background: color-mix(in srgb, var(--p-color, var(--accent)) 10%, var(--input-bg));
}

.role-athlete   { --p-color: #10b981; }
.role-coach     { --p-color: #3b82f6; }
.role-organizer { --p-color: #f59e0b; }
.role-referee   { --p-color: #ef4444; }

/* My profile card on home */
.profile-card {
    text-decoration: none;
}

.profile-card-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.profile-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.profile-card-avatar-fallback {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--input-bg);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.6rem;
}

.profile-card-meta {
    flex: 1;
    min-width: 0;
}

.profile-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-card-pos {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-card-pos .pos-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 22px;
    padding: 0 0.4rem;
    border-radius: 6px;
    background: var(--p-color, var(--accent));
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.profile-card-pos .pos-name {
    color: var(--text);
    font-weight: 500;
}

.profile-card-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.profile-card { position: relative; }

.champion-badge {
    position: absolute;
    bottom: 0.65rem;
    right: 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.32rem 0.6rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #5a2c00;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 215, 130, 0.85);
    z-index: 2;
}

.champion-badge-inline {
    position: static;
    margin-left: 0.4rem;
    padding: 0.1rem 0.45rem;
    font-size: 0.7rem;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
    vertical-align: middle;
}

.champion-badge-inline i {
    font-size: 0.75rem;
}

.champion-badge-inline .champion-count {
    font-size: 0.62rem;
    padding: 0 0.28rem;
}

.athlete-card-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.champion-badge i {
    font-size: 0.95rem;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.champion-count {
    background: rgba(90, 44, 0, 0.18);
    border-radius: 999px;
    padding: 0 0.4rem;
    font-size: 0.75rem;
    line-height: 1.4;
}

[data-theme="modern"] .champion-badge {
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.55), 0 0 24px rgba(255, 200, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}


.role-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.2;
}

.role-pill i {
    font-size: 0.85rem;
}

.profile-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.85rem;
}

.profile-card-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Success state */
.success-card {
    background: var(--card-bg, var(--surface));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    box-shadow: var(--shadow-sm);
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    color: #10b981;
    line-height: 1;
    margin-bottom: 0.5rem;
    animation: success-pop 0.4s ease;
}

.success-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.success-text {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

@keyframes success-pop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

/* ===================================================================
   Empty state
   =================================================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface);
    border-radius: 12px;
    border: 1px dashed var(--border-soft);
}

.empty-state i {
    font-size: 3.5rem;
    color: var(--text-faint);
    margin-bottom: 1rem;
    display: block;
}

.empty-state h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.empty-state p {
    color: var(--text-muted);
    margin: 0;
}

/* ===================================================================
   Login page
   =================================================================== */

.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 5rem);
    padding: 2rem 1rem;
}

.login-card {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
}

[data-theme="modern"] .login-card {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.login-brand i {
    color: var(--accent);
    font-size: 1.6rem;
}

.login-logo {
    width: 100%;
    max-width: 280px;
    height: auto;
    display: block;
    object-fit: contain;
}

.login-title {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

.login-fineprint {
    margin-top: 1.25rem;
    font-size: 0.8rem;
    color: var(--text-faint);
    text-align: center;
}

.login-fineprint a {
    color: var(--text-muted);
    text-decoration: underline;
}

.login-avatar,
.login-avatar-fallback {
    width: 80px;
    height: 80px;
    border-radius: 999px;
    margin: 0 auto 1rem auto;
    display: block;
    object-fit: cover;
}

.login-avatar-fallback {
    background: var(--border);
    color: var(--text-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
}

.btn-fb {
    --bs-btn-bg: #1877f2;
    --bs-btn-border-color: #1877f2;
    --bs-btn-hover-bg: #166fe5;
    --bs-btn-hover-border-color: #166fe5;
    --bs-btn-active-bg: #1565d8;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-disabled-bg: #1877f2;
    --bs-btn-disabled-border-color: #1877f2;
    --bs-btn-disabled-color: #fff;
    font-weight: 600;
}

.btn-google {
    --bs-btn-bg: #ffffff;
    --bs-btn-border-color: #dadce0;
    --bs-btn-hover-bg: #f8f9fa;
    --bs-btn-hover-border-color: #c1c7cd;
    --bs-btn-active-bg: #f1f3f4;
    --bs-btn-color: #3c4043;
    --bs-btn-hover-color: #3c4043;
    --bs-btn-disabled-bg: #ffffff;
    --bs-btn-disabled-border-color: #dadce0;
    --bs-btn-disabled-color: #80868b;
    font-weight: 600;
}

.login-warning {
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    color: var(--warn-text);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.login-warning code {
    background: var(--surface);
    border: 1px solid var(--warn-border);
    border-radius: 4px;
    padding: 0.05rem 0.3rem;
    color: var(--warn-text);
    font-size: 0.85rem;
}

/* ===================================================================
   Match list
   =================================================================== */

.match-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.match-row {
    display: grid;
    grid-template-columns: 90px 1fr 100px 1fr 110px;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    color: var(--text);
}

.match-meta { line-height: 1.2; color: var(--text-muted); }

.match-team {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-team-home { text-align: right; }
.match-team-away { text-align: left; }

.match-score { text-align: center; font-weight: 700; }
.match-score .score { font-size: 1.1rem; color: var(--primary); }
.match-score .vs { color: var(--text-faint); font-weight: 500; font-size: 0.85rem; }
.match-status { text-align: right; }

@media (max-width: 720px) {
    .match-row {
        grid-template-columns: 1fr 80px 1fr;
        grid-template-areas:
            "meta meta status"
            "home score away";
        gap: 0.4rem;
    }
    .match-meta   { grid-area: meta; }
    .match-status { grid-area: status; }
    .match-team-home { grid-area: home; }
    .match-score     { grid-area: score; }
    .match-team-away { grid-area: away; }
}

/* ===================================================================
   Mobile overrides
   =================================================================== */

@media (max-width: 720px) {
    .hero-title { margin-bottom: 0.75rem; }
    .hero-subtitle { font-size: 1rem; margin-bottom: 1.5rem; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; justify-content: center; }
    .feature-card { padding: 1.25rem; }
    .stat-card { padding: 0.85rem 0.5rem; }
    .stat-value { font-size: 1.5rem; }
    .stat-label { font-size: 0.75rem; }
    .page-title { font-size: 1.4rem; }
    .page-header { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .page-header .btn { width: 100%; justify-content: center; }
    .login-card { padding: 1.75rem 1.25rem; }
    .login-title { font-size: 1.2rem; }
}

/* ===================================================================
   Sport picker (анхны хуудас — спорт сонгох)
   =================================================================== */

.picker-hero {
    text-align: center;
    margin: 2.5rem auto 2.5rem auto;
    max-width: 640px;
}

.picker-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.picker-title {
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.6rem 0;
    color: var(--text);
}

.picker-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin: 0;
}

.picker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    max-width: 820px;
    margin: 0 auto 3rem auto;
}

/* Pill list (alternative picker style) */
.pill-list {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    max-width: 460px;
    margin: 0 auto 3rem auto;
}

.sport-pill {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 76px;
    padding: 0 1.75rem 0 0.5rem;
    border-radius: 999px;
    background: transparent;
    border: 1.5px solid var(--border-soft);
    text-decoration: none;
    position: relative;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.sport-pill:hover {
    transform: translateY(-2px);
    border-color: var(--text-muted);
    background: var(--surface);
}

.pill-orb {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--surface);
    border: 1.5px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    flex-grow: 0;
}

.pill-orb svg {
    width: 70%;
    height: 70%;
}

.pill-name {
    color: var(--text-muted);
    font-weight: 500;
    font-size: clamp(1.1rem, 3vw, 1.35rem);
    letter-spacing: 0;
    flex: 1;
    line-height: 1;
}

.sport-pill:hover .pill-name {
    color: var(--text);
}

/* Disabled — coming soon */
.sport-pill.is-disabled {
    cursor: not-allowed;
    opacity: 0.55;
    pointer-events: none;
}

.sport-pill.is-disabled:hover {
    transform: none;
    border-color: var(--border-soft);
    background: transparent;
}

.pill-soon {
    margin-left: auto;
    padding: 0.25rem 0.65rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-faint);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .sport-pill {
        height: 68px;
        padding: 0 1.25rem 0 0.4rem;
    }
    .pill-orb {
        width: 50px;
        height: 50px;
    }
    .pill-name {
        font-size: 1.05rem;
    }
}

.picker-card {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 24px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    isolation: isolate;
}

.picker-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.06), transparent 55%);
    pointer-events: none;
    z-index: 1;
}

.picker-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.22);
    color: #fff;
    filter: brightness(1.05);
}

.picker-art {
    width: clamp(110px, 22vw, 160px);
    height: clamp(110px, 22vw, 160px);
    z-index: 2;
    position: relative;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
    transition: transform 0.25s ease;
}

.picker-art svg,
.picker-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.picker-card:hover .picker-art {
    transform: rotate(-3deg) scale(1.05);
}

.picker-name {
    font-size: clamp(1.05rem, 2.5vw, 1.5rem);
    font-weight: 700;
    z-index: 2;
    position: relative;
    letter-spacing: -0.01em;
}

.picker-arrow {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: transform 0.2s ease, background 0.2s ease;
}

.picker-card:hover .picker-arrow {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.32);
}

/* Solid dark sport-themed backgrounds */
.picker-volleyball  { background: #78350f; }  /* deep amber */
.picker-basketball  { background: #7c2d12; }  /* deep orange-brown */
.picker-football    { background: #14532d; }  /* deep forest */
.picker-tabletennis { background: #1e3a8a; }  /* deep navy */

@media (max-width: 720px) {
    .picker-hero { margin: 1.25rem auto 1.5rem auto; }
    .picker-grid {
        gap: 0.75rem;
    }
    .picker-card {
        padding: 1.1rem;
        border-radius: 18px;
    }
    .picker-card::after {
        width: 120px;
        height: 120px;
        bottom: -20px;
        right: -20px;
    }
    .picker-arrow {
        width: 28px;
        height: 28px;
        top: 0.85rem;
        right: 0.85rem;
        font-size: 0.85rem;
    }

    .picker-art {
        width: clamp(80px, 26vw, 110px);
        height: clamp(80px, 26vw, 110px);
    }
}

/* ===================================================================
   Sport tabs
   =================================================================== */

.sport-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25rem 0 0.75rem 0;
    margin: 0 0 1.5rem 0;
    scrollbar-width: thin;
    -ms-overflow-style: none;
}

.sport-tabs::-webkit-scrollbar { height: 6px; }
.sport-tabs::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 3px; }

.sport-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.95rem 0.5rem 0.45rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
    flex-shrink: 0;
    min-height: 44px;
}

.sport-tab:hover {
    color: var(--text);
    border-color: var(--border-soft);
    transform: translateY(-1px);
}

.sport-tab-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px solid var(--border);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.2s ease;
    flex-shrink: 0;
    overflow: hidden;
    padding: 3px;
}

.sport-tab-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.sport-tab:hover .sport-tab-icon {
    transform: scale(1.05);
}

.sport-tab.is-active {
    color: #fff;
    border-color: transparent;
}

.sport-tab.is-active .sport-tab-icon {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

/* Sport-specific gradients on active state */
.sport-tab[data-sport="volleyball"].is-active {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.sport-tab[data-sport="basketball"].is-active {
    background: linear-gradient(135deg, #ff8c4a 0%, #ff6b35 100%);
    box-shadow: 0 6px 18px rgba(255, 107, 53, 0.35);
}

.sport-tab[data-sport="football"].is-active {
    background: linear-gradient(135deg, #34d399 0%, #16a34a 100%);
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.35);
}

.sport-tab[data-sport="tabletennis"].is-active {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
}

@media (max-width: 720px) {
    .sport-tabs {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .sport-tab {
        font-size: 0.85rem;
        padding: 0.4rem 0.85rem 0.4rem 0.4rem;
    }

    .sport-tab-icon {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
}

/* ===================================================================
   ThemeSwitcher active state (server-rendered via [data-theme] on <html>)
   =================================================================== */

[data-theme="light"]  .theme-switcher .theme-btn[data-theme-set="light"],
[data-theme="dark"]   .theme-switcher .theme-btn[data-theme-set="dark"],
[data-theme="modern"] .theme-switcher .theme-btn[data-theme-set="modern"] {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

[data-theme="modern"] .theme-switcher .theme-btn[data-theme-set="modern"] {
    background: rgba(0, 212, 255, 0.28);
    color: #fff;
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.45);
}

/* ===================================================================
   Validation / error boundary
   =================================================================== */

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

.blazor-error-boundary {
    background: #b32121;
    color: white;
    padding: 1rem;
}

.blazor-error-boundary::after {
    content: "Алдаа гарлаа.";
}

/* ===================================================================
   Athletes — alphabet filter bar + card grid
   =================================================================== */

.alpha-bar {
    display: grid;
    grid-template-columns: repeat(28, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 10;
    margin-bottom: 1.75rem;
}

.alpha-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.2rem;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1;
    transition: background 0.12s ease, color 0.12s ease;
}

.alpha-link:hover {
    background: var(--primary);
    color: var(--on-primary);
}

.alpha-link-disabled {
    color: var(--text-faint);
    background: var(--surface);
    pointer-events: none;
    opacity: 0.5;
}

.alpha-link-active {
    background: var(--accent);
    color: var(--on-accent);
}

.alpha-link-active:hover {
    background: var(--accent-2);
    color: var(--on-accent);
}

.alpha-link-all {
    font-size: 1.05rem;
    line-height: 1;
}

/* Athletes dashboard — top stats strip */
.athlete-dash {
    margin-bottom: 1.5rem;
}

.dash-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
}

.dash-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.dash-col {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dash-col-grow { flex: 1; min-width: 0; }

.dash-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}

.dash-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.dash-value-trophy {
    color: #f59e0b;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.dash-gender {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.dash-gender-male   { color: #3b82f6; }
.dash-gender-female { color: #ec4899; }
.dash-gender i      { font-size: 1.1rem; }
.dash-divider {
    width: 1px;
    height: 1rem;
    background: var(--border);
}

.dash-bar {
    display: flex;
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--input-bg);
}

.dash-bar-male   { background: #3b82f6; }
.dash-bar-female { background: #ec4899; }

.dash-positions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

/* Collapsible filter panel */
.filter-panel {
    margin-bottom: 1.5rem;
}

.filter-panel summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.filter-panel summary::-webkit-details-marker { display: none; }

.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--text);
    font-weight: 600;
    font-size: 0.88rem;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.filter-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-chevron {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    margin-left: 0.15rem;
}

.filter-panel[open] .filter-chevron {
    transform: rotate(180deg);
}

.filter-badge {
    color: var(--accent);
    font-size: 0.7rem;
    line-height: 1;
}

.filter-body {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--border);
}

.dash-pos {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    background: color-mix(in oklab, var(--p-color, var(--accent)) 14%, transparent);
    color: var(--p-color, var(--accent));
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.dash-pos:hover {
    background: color-mix(in oklab, var(--p-color, var(--accent)) 22%, transparent);
    color: var(--p-color, var(--accent));
}

.dash-pos-active {
    background: var(--p-color, var(--accent));
    color: #fff;
    border-color: var(--p-color, var(--accent));
    box-shadow: 0 4px 12px color-mix(in oklab, var(--p-color, var(--accent)) 35%, transparent);
}

.dash-pos-active:hover {
    background: var(--p-color, var(--accent));
    color: #fff;
}

.dash-pos-active .dash-pos-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.dash-pos-all {
    --p-color: #6b7280;
    background: color-mix(in oklab, #6b7280 14%, transparent);
    color: #6b7280;
    border-color: transparent;
}

.dash-pos-all.dash-pos-active {
    background: #6b7280;
    color: #fff;
    border-color: #6b7280;
    box-shadow: none;
}

.dash-pos-trophy {
    --p-color: #f59e0b;
    background: color-mix(in oklab, #f59e0b 14%, transparent);
    color: #f59e0b;
    border-color: transparent;
}

.dash-pos-trophy.dash-pos-active {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.dash-pos-trophy i { font-size: 0.95rem; }


.dash-pos.pos-s   { --p-color: #f59e0b; }
.dash-pos.pos-oh  { --p-color: #ef4444; }
.dash-pos.pos-opp { --p-color: #8b5cf6; }
.dash-pos.pos-mb  { --p-color: #3b82f6; }
.dash-pos.pos-l   { --p-color: #10b981; }

.dash-pos-code {
    font-weight: 800;
    letter-spacing: 0.04em;
}

.dash-pos-count {
    background: color-mix(in oklab, var(--p-color) 22%, transparent);
    border-radius: 999px;
    padding: 0 0.4rem;
    font-size: 0.78rem;
    line-height: 1.3;
}

/* Gender filter bar — Эр / Эм / ∗ */
.gender-bar {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.gender-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.gender-link i { font-size: 1rem; }

.gender-link-count {
    background: var(--input-bg);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.4;
    min-width: 1.5rem;
    text-align: center;
}

.gender-link-active .gender-link-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.gender-link:hover {
    border-color: var(--p-color, var(--accent));
    color: var(--p-color, var(--accent));
}

.gender-link-male   { --p-color: #3b82f6; }
.gender-link-female { --p-color: #ec4899; }
.gender-link-all    { --p-color: var(--text-muted); }

.gender-link-active {
    background: var(--p-color);
    border-color: var(--p-color);
    color: #fff;
    box-shadow: 0 4px 14px color-mix(in oklab, var(--p-color) 40%, transparent);
}

.gender-link-active:hover {
    color: #fff;
    border-color: var(--p-color);
}

.letter-section {
    margin-bottom: 2rem;
    scroll-margin-top: 64px;
}

.letter-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.4rem;
    margin: 0 0 1rem 0;
    display: inline-block;
    min-width: 2.5rem;
}

.athlete-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.athlete-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    overflow: hidden;
    min-height: 110px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.athlete-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.athlete-card-body {
    flex: 1;
    min-width: 0;
}

.athlete-card-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.athlete-card-realname {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.55rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.athlete-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-faint);
    align-items: center;
}

.athlete-card-meta i {
    margin-right: 0.2rem;
}

.skill-stars {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    color: var(--accent);
    font-size: 0.95rem;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.skill-stars .bi-star {
    color: var(--text-faint);
}

.skill-stars-idle {
    opacity: 0.55;
}

.athlete-card-photo {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--border);
    box-shadow: 0 0 0 1px var(--border-soft);
}

.athlete-card-photo.gender-male {
    border-color: #3b82f6;
    box-shadow:
        0 0 0 2px rgba(59, 130, 246, 0.55),
        0 0 16px rgba(59, 130, 246, 0.55),
        0 0 32px rgba(59, 130, 246, 0.30),
        inset 0 0 8px rgba(59, 130, 246, 0.20);
}

.athlete-card-photo.gender-female {
    border-color: #ec4899;
    box-shadow:
        0 0 0 2px rgba(236, 72, 153, 0.55),
        0 0 16px rgba(236, 72, 153, 0.55),
        0 0 32px rgba(236, 72, 153, 0.30),
        inset 0 0 8px rgba(236, 72, 153, 0.20);
}

[data-theme="modern"] .athlete-card-photo.gender-male {
    box-shadow:
        0 0 0 2px rgba(99, 165, 255, 0.7),
        0 0 22px rgba(59, 130, 246, 0.7),
        0 0 44px rgba(99, 165, 255, 0.45);
}

[data-theme="modern"] .athlete-card-photo.gender-female {
    box-shadow:
        0 0 0 2px rgba(255, 105, 180, 0.7),
        0 0 22px rgba(236, 72, 153, 0.7),
        0 0 44px rgba(255, 105, 180, 0.45);
}

.athlete-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.athlete-card-photo i {
    font-size: 2.5rem;
    color: var(--text-faint);
}

@media (max-width: 768px) {
    .alpha-bar {
        font-size: 0.7rem;
        border-radius: 6px;
    }
    .alpha-link {
        padding: 0.45rem 0.1rem;
        font-size: 0.75rem;
    }
    .athlete-card-name { font-size: 1.1rem; }
    .athlete-card-photo { width: 70px; height: 70px; }
    .athlete-card-photo i { font-size: 2rem; }
}

@media (max-width: 480px) {
    .alpha-bar {
        grid-template-columns: repeat(14, minmax(0, 1fr));
    }
}
