:root {
    --primary: #1e3a6f;
    --primary-light: #2b4c8a;
    --primary-dark: #0f2a4d;
    --primary-soft: #e8edf5;
    --accent: #c42e2e;
    --accent-light: #fce8e8;
    --gold: #d7b75b;
    --gold-soft: #f6efcf;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 6px 16px -8px rgb(15 23 42 / 0.22);
    --shadow-lg: 0 18px 38px -20px rgb(15 23 42 / 0.4);
    --shadow-xl: 0 24px 48px -24px rgb(15 23 42 / 0.5);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --site-page-gutter: 10vw;
    --site-page-width: 80vw;
}

* {
    font-family: 'Inter', sans-serif;
}

#our-referees-page {
    width: var(--site-page-width);
    max-width: none;
    margin: 0 var(--site-page-gutter);
    padding: 2rem 0 4rem;
}

.referees-banner {
    display: flex;
    justify-content: center;
    margin: 50px auto 150px;
}

.referees-banner img {
    width: 75vw;
    height: auto;
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.section-kicker,
.eyebrow {
    margin: 0 0 0.5rem;
    /* color: var(--gold-soft); */
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.section-heading {
    margin-bottom: 1.5rem;
}

.section-heading h2,
.filter-copy h2,
.division-header h2 {
    color: var(--gray-900);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.4rem;
}

.section-heading p,
.filter-copy p,
.card-role,
.results-summary,
.panel-card-copy {
    color: var(--gray-600);
}

.referees-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    padding: 4rem 2rem 2.5rem;
    border-radius: var(--radius-2xl);
    color: white;
    background:
        radial-gradient(circle at top right, rgb(215 183 91 / 0.28), transparent 24%),
        linear-gradient(135deg, #10284a 0%, #1e3a6f 55%, #29578d 100%);
    box-shadow: var(--shadow-xl);
}

.referees-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgb(255 255 255 / 0.05) 20%, transparent 20% 40%, rgb(255 255 255 / 0.04) 40% 60%, transparent 60%),
        radial-gradient(circle at bottom left, rgb(255 255 255 / 0.08), transparent 30%);
    pointer-events: none;
}

.hero-copy,
.referee-stats {
    position: relative;
    z-index: 1;
}

.referees-hero h1 {
    font-size: clamp(2.6rem, 5vw, 4.4rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
    color: white;
}

.hero-intro {
    max-width: 760px;
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.75;
    color: rgb(255 255 255 / 0.88);
}

.referee-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.stat-item {
    min-width: 0;
    padding: 1.1rem 1.25rem;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: var(--radius-xl);
    background: rgb(255 255 255 / 0.08);
    backdrop-filter: blur(12px);
}

.stat-number {
    display: block;
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.stat-label {
    display: block;
    color: rgb(255 255 255 / 0.82);
    font-size: 0.88rem;
    line-height: 1.35;
}

.featured-panels,
.quick-nav,
.filter-bar,
.division-section,
.no-results {
    border: 1px solid rgb(209 213 219 / 0.75);
    border-radius: var(--radius-2xl);
    background: rgb(255 255 255 / 0.92);
    box-shadow: var(--shadow-md);
}

.featured-panels {
    margin-bottom: 2rem;
    padding: 1.75rem;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.panel-card {
    padding: 1.25rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(180deg, rgb(248 250 252 / 1) 0%, rgb(255 255 255 / 1) 100%);
}

.panel-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.panel-card-header h3 {
    margin: 0;
    color: var(--gray-800);
    font-size: 1.05rem;
    font-weight: 700;
}

.panel-card-header span {
    min-width: 2.3rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: var(--gold-soft);
    color: #735a0a;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}

.panel-list {
    margin: 0;
    padding-left: 1rem;
    color: var(--gray-700);
    line-height: 1.7;
}

.quick-nav {
    position: sticky;
    top: 100px;
    z-index: 10;
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.5rem;
    backdrop-filter: blur(14px);
}

.quick-nav h2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.85rem;
    color: var(--gray-800);
    font-size: 1rem;
    font-weight: 700;
}

.quick-nav h2 svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.division-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.division-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.division-chip:hover,
.division-chip:focus-visible {
    background: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    outline: none;
}

.division-chip.active,
.division-chip[aria-current="true"] {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.division-chip .count {
    min-width: 1.8rem;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: rgb(17 24 39 / 0.08);
    font-size: 0.78rem;
    text-align: center;
}

.division-chip.active .count,
.division-chip[aria-current="true"] .count {
    background: rgb(255 255 255 / 0.2);
}

.filter-bar {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
}

.filter-copy .section-kicker,
.division-header .section-kicker,
.modal-header .section-kicker {
    color: var(--accent);
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0 0.75rem;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn,
.secondary-btn,
.view-profile-btn,
.search-box button {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.filter-btn {
    padding: 0.65rem 1rem;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.92rem;
}

.filter-btn:hover,
.filter-btn:focus-visible,
.view-profile-btn:hover,
.view-profile-btn:focus-visible,
.search-box button:hover,
.search-box button:focus-visible,
.secondary-btn:hover,
.secondary-btn:focus-visible {
    transform: translateY(-1px);
    outline: none;
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.search-box {
    display: flex;
    align-items: center;
    min-width: min(100%, 360px);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    overflow: hidden;
}

.search-box input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 0.8rem 0.95rem;
    font-size: 0.95rem;
    color: var(--gray-800);
    outline: none;
}

.search-box button {
    margin: 0.3rem;
    padding: 0.62rem 1rem;
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.results-summary {
    margin: 0;
    font-size: 0.95rem;
}

.division-section {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    scroll-margin-top: 170px;
}

.division-content[hidden] {
    display: none;
}

.division-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.35rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.division-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.division-header h2 span {
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 700;
}

.badge {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.badge span {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.88rem;
    font-weight: 700;
}

.referee-slider {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 280px);
    align-items: start;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.referee-slider::-webkit-scrollbar {
    height: 10px;
}

.referee-slider::-webkit-scrollbar-thumb {
    background: rgb(30 58 111 / 0.22);
    border-radius: 999px;
}

.referee-slider > * {
    scroll-snap-align: start;
}

.referee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.referee-card {
    overflow: hidden;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    background: white;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.referee-card:hover {
    transform: translateY(-4px);
    border-color: rgb(43 76 138 / 0.35);
    box-shadow: var(--shadow-lg);
}

.layout-toggle-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.75rem;
    min-height: 100%;
    padding: 1.4rem;
    border: 1px dashed rgb(30 58 111 / 0.28);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(160deg, rgb(232 237 245 / 0.85) 0%, rgb(255 255 255 / 1) 100%);
    color: var(--gray-800);
    text-align: left;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.layout-toggle-card:hover,
.layout-toggle-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgb(30 58 111 / 0.5);
    box-shadow: var(--shadow-lg);
    outline: none;
}

.layout-toggle-eyebrow {
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.layout-toggle-card strong {
    display: block;
    font-size: 1.2rem;
    line-height: 1.3;
}

.layout-toggle-card span:last-child {
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.5;
}

.close-grid-card {
    border-style: solid;
    background: linear-gradient(160deg, rgb(249 250 251 / 1) 0%, rgb(243 244 246 / 1) 100%);
}

.card-image {
    position: relative;
    height: 220px;
    background: linear-gradient(135deg, #dfe7f3 0%, #eef3f9 100%);
}

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

.image-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ref-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: white;
    color: var(--primary);
    border: 1px solid rgb(255 255 255 / 0.75);
    box-shadow: var(--shadow-sm);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ref-badge.reserve {
    background: #ffedd5;
    color: #9a3412;
    border-color: #fed7aa;
}

.ref-badge.trp {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.card-content {
    padding: 0 1.25rem 1.25rem;
}

.view-profile-btn-compact {
    margin-top: -2.15rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
    background: white;
    box-shadow: var(--shadow-sm);
}

.card-content h3 {
    margin: 0 0 0.45rem;
    color: var(--gray-900);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
}

.card-role {
    margin: 0 0 0.9rem;
    min-height: 2.4em;
    font-size: 0.9rem;
    line-height: 1.45;
}

.ref-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ref-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.36rem 0.72rem;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.82rem;
    line-height: 1.35;
}

.ref-meta svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.view-profile-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.82rem 1rem;
}

.view-profile-btn {
    width: 100%;
    background: var(--gray-50);
    color: var(--gray-700);
}

.view-profile-btn:hover,
.view-profile-btn:focus-visible {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.view-profile-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.ref-modal[hidden] {
    display: none;
}

.ref-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgb(15 23 42 / 0.65);
    backdrop-filter: blur(8px);
}

.modal-card {
    position: relative;
    width: min(100%, 760px);
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-2xl);
    background: white;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.24s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(180deg, rgb(232 237 245 / 0.8) 0%, white 100%);
}

.modal-header h2 {
    margin: 0;
    color: var(--gray-900);
    font-size: 1.5rem;
    font-weight: 800;
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    background: white;
    cursor: pointer;
}

.modal-close svg {
    width: 20px;
    height: 20px;
    stroke: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
}

.modal-profile {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.modal-profile img {
    width: 130px;
    height: 130px;
    object-fit: cover;
    border-radius: var(--radius-xl);
    border: 4px solid var(--primary-soft);
}

.modal-profile h3 {
    margin: 0 0 0.35rem;
    color: var(--gray-900);
    font-size: 1.8rem;
    font-weight: 800;
}

.modal-profile p {
    margin: 0;
    color: var(--gray-600);
    line-height: 1.6;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.info-item {
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    background: var(--gray-50);
}

.info-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--gray-500);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.info-value {
    color: var(--gray-900);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.45;
}

.modal-note {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--primary-soft), white);
    color: var(--gray-700);
    line-height: 1.7;
}

.modal-note p {
    margin: 0;
}

.secondary-btn {
    background: white;
    color: var(--gray-700);
}

.no-results {
    margin-top: 1rem;
    padding: 3rem 1.5rem;
    text-align: center;
}

.no-results svg {
    width: 54px;
    height: 54px;
    margin-bottom: 1rem;
    color: var(--gray-400);
}

.no-results h2 {
    margin: 0 0 0.5rem;
    color: var(--gray-800);
    font-size: 1.4rem;
}

.no-results p {
    margin: 0;
    color: var(--gray-600);
}

.back-to-top {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
    background: var(--primary-dark);
    outline: none;
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    stroke: white;
    stroke-width: 2;
}

@media (max-width: 980px) {
    .referee-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    #our-referees-page {
        padding-inline: 0;
    }

    .referees-hero,
    .featured-panels,
    .filter-bar,
    .division-section {
        padding: 1.25rem;
    }

    .quick-nav {
        top: 70px;
        padding: 1rem;
    }

    .division-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .modal-profile {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 560px) {
    .referee-stats {
        grid-template-columns: 1fr;
    }

    .referee-grid,
    .panel-grid,
    .modal-info-grid {
        grid-template-columns: 1fr;
    }

    .search-box {
        flex-direction: column;
        align-items: stretch;
        padding: 0.35rem;
    }

    .search-box button {
        margin: 0;
    }

    .modal-body,
    .modal-header {
        padding: 1rem;
    }
}
