:root {
    --bg: #0b0d12;
    --panel: #151a22;
    --panel-soft: #1d2430;
    --panel-strong: #10161f;
    --ink: #f8f4ec;
    --muted: #b9b4a7;
    --line: rgba(173, 190, 216, 0.16);
    --accent: #e2b84b;
    --accent-2: #59c8ae;
    --accent-3: #7da6ff;
    --accent-4: #e8866c;
    --max: 1180px;
}

html,
body {
    background:
        radial-gradient(circle at top left, rgba(125, 166, 255, 0.16) 0%, transparent 32%),
        radial-gradient(circle at top right, rgba(89, 200, 174, 0.12) 0%, transparent 28%),
        linear-gradient(180deg, #10151d 0%, #0c1118 34%, #0b0d12 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
}

.boot-loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 20% 20%, rgba(125, 166, 255, 0.12) 0%, transparent 28%),
        linear-gradient(180deg, rgba(11, 13, 18, 0.94) 0%, rgba(11, 13, 18, 0.9) 100%);
    backdrop-filter: blur(10px);
}

.boot-loader__panel {
    width: min(460px, 100%);
    padding: 1.25rem 1.25rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(28, 36, 49, 0.98) 0%, rgba(19, 26, 36, 0.98) 100%);
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.28);
}

.boot-loader__panel strong {
    display: block;
    margin: 0.8rem 0 0.9rem;
    font-size: 1.05rem;
}

.boot-loader__panel span {
    display: block;
    margin-top: 0.7rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.boot-loader__track {
    overflow: hidden;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.boot-loader__bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
    box-shadow: 0 0 22px rgba(89, 200, 174, 0.25);
    transition: width 180ms ease;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.page-section {
    background:
        radial-gradient(circle at 10% 10%, rgba(226, 184, 75, 0.07) 0%, transparent 24%),
        radial-gradient(circle at 90% 0%, rgba(125, 166, 255, 0.08) 0%, transparent 26%),
        linear-gradient(180deg, rgba(20, 27, 37, 0.94) 0%, rgba(15, 21, 30, 0.94) 100%);
    padding: 5rem 5vw;
    position: relative;
}

.section-inner {
    margin: 0 auto;
    max-width: var(--max);
}

.wide-table-page {
    padding-left: clamp(1rem, 2vw, 2rem);
    padding-right: clamp(1rem, 2vw, 2rem);
}

.wide-table-page .section-inner {
    max-width: min(1800px, 100%);
}

.eyebrow {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero {
    background:
        linear-gradient(90deg, rgba(8, 9, 12, 0.92) 0%, rgba(8, 9, 12, 0.72) 44%, rgba(8, 9, 12, 0.26) 100%),
        url("https://images.unsplash.com/photo-1502904550040-7534597429ae?auto=format&fit=crop&w=2200&q=80") center/cover;
    min-height: calc(100vh - 72px);
    padding: 6rem 5vw 4rem;
}

.hero-grid {
    align-items: end;
    display: grid;
    gap: 2rem;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    margin: 0 auto;
    max-width: var(--max);
}

.hero h3,
.page-hero h3 {
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 900;
    line-height: 0.96;
    margin: 1rem 0;
    max-width: 900px;
}

.hero p,
.page-hero p {
    color: #ddd4c5;
    font-size: clamp(1.05rem, 2vw, 1.28rem);
    line-height: 1.7;
    max-width: 680px;
}

.hero-actions,
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.toolbar input.auto-grow-input {
    max-width: min(100%, 42ch);
    width: min(100%, 32ch);
    min-width: 20rem;
}

.btn-strong,
.btn-soft {
    border-radius: 8px;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-height: 44px;
    padding: 0.78rem 1rem;
    text-decoration: none;
}

.btn-strong {
    background: var(--accent);
    color: #111111;
    border: 0;
    box-shadow: 0 10px 24px rgba(226, 184, 75, 0.22);
}

.btn-soft {
    background: rgba(125, 166, 255, 0.12);
    color: var(--ink);
    border: 1px solid rgba(125, 166, 255, 0.2);
}

.metric-grid,
.member-summary,
.world-grid {
    display: grid;
    gap: 1rem;
}

.metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.member-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.world-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric,
.world-card {
    background:
        linear-gradient(180deg, rgba(28, 36, 49, 0.96) 0%, rgba(19, 26, 36, 0.96) 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.metric,
.world-card {
    padding: 1.1rem;
}

.metric strong {
    display: block;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1;
}

.metric span,
.world-card p,
.table-tools,
.text-muted,
.subtle {
    color: var(--muted);
}

.page-hero {
    background:
        radial-gradient(circle at 85% 20%, rgba(89, 200, 174, 0.08) 0%, transparent 24%),
        radial-gradient(circle at 15% 0%, rgba(125, 166, 255, 0.12) 0%, transparent 28%),
        linear-gradient(180deg, #18202c 0%, #121a24 100%);
    border-bottom: 1px solid var(--line);
    padding: 5rem 5vw 3rem;
}

input:not([type="checkbox"]),
select,
textarea {
    background: #131a24;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    min-height: 44px;
    padding: 0.7rem 0.85rem;
}

.table-wrap {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow-x: auto;
    background:
        linear-gradient(180deg, rgba(24, 31, 43, 0.94) 0%, rgba(16, 23, 32, 0.94) 100%);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
}

.table {
    width: 100%;
    border-collapse: collapse;
    color: var(--ink);
}

.table th {
    color: #c8d5f3;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
    background: rgba(30, 39, 54, 0.98);
}

.table-sort {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    letter-spacing: inherit;
    padding: 0;
    text-align: left;
    text-transform: inherit;
}

.table-sort.active {
    color: #ffffff;
}

.table-sort:hover {
    color: #ffffff;
}

.table td,
.table th {
    border-bottom: 1px solid var(--line);
    padding: 0.95rem;
    vertical-align: top;
}

.table tbody tr:nth-child(odd) td {
    background: rgba(255, 255, 255, 0.015);
}

.table tbody tr:nth-child(even) td {
    background: rgba(125, 166, 255, 0.035);
}

.status-message {
    background: rgba(103, 208, 179, 0.12);
    border: 1px solid rgba(103, 208, 179, 0.28);
    border-radius: 8px;
    color: #d5fff3;
    padding: 1rem;
    white-space: pre-wrap;
}

.site-nav {
    align-items: center;
    backdrop-filter: blur(18px);
    background: rgba(10, 13, 18, 0.88);
    border-bottom: 1px solid rgba(125, 166, 255, 0.14);
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
    min-height: 72px;
    padding: 0 5vw;
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-footer {
    border-top: 1px solid rgba(125, 166, 255, 0.14);
    color: var(--muted);
    padding: 2rem 5vw 3rem;
}

.site-footer p {
    line-height: 1.75;
    margin: 0;
}

.site-footer a {
    color: var(--accent-2);
    text-decoration: none;
}

.site-footer a:hover {
    color: #8ce3d0;
}

.brand {
    align-items: center;
    color: #f8f4ec;
    display: inline-flex;
    gap: 0.8rem;
    text-decoration: none;
}

.brand-mark {
    align-items: center;
    background: linear-gradient(135deg, var(--accent) 0%, #f3d788 100%);
    border-radius: 8px;
    color: #111111;
    display: inline-flex;
    font-weight: 900;
    height: 42px;
    justify-content: center;
    width: 48px;
}

.brand strong,
.brand small {
    display: block;
    line-height: 1.1;
}

.brand small {
    color: #b8b0a1;
    font-size: 0.72rem;
    margin-top: 0.2rem;
}

.nav-toggle {
    appearance: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    display: none;
    height: 42px;
    position: relative;
    width: 46px;
}

.nav-toggle::before {
    color: #f8f4ec;
    content: "Menu";
    font-size: 0.72rem;
    left: 8px;
    position: absolute;
    top: 12px;
}

.nav-links {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
}

.nav-links a {
    background: transparent;
    border-radius: 8px;
    color: #d8d2c8;
    padding: 0.65rem 0.8rem;
    text-decoration: none;
}

.nav-links a.active,
.nav-links a:hover {
    background: rgba(125, 166, 255, 0.16);
    color: #ffffff;
}

.table-tools {
    display: flex;
    flex-wrap: wrap;
    font-size: 0.9rem;
    gap: 0.8rem;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.rank-cell,
.number-cell {
    color: var(--accent);
    font-weight: 900;
}

.table a {
    color: var(--accent-2);
}

.table a:hover {
    color: #8ce3d0;
}

.status-pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    justify-content: center;
    min-width: 68px;
    padding: 0.32rem 0.6rem;
}

.status-active {
    background: rgba(103, 208, 179, 0.16);
    color: #9ff2dc;
    border: 1px solid rgba(89, 200, 174, 0.24);
}

.status-quiet {
    background: rgba(232, 134, 108, 0.12);
    color: var(--muted);
    border: 1px solid rgba(232, 134, 108, 0.18);
}

.row-actions,
.club-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.45rem;
    white-space: nowrap;
}

.row-actions .btn-soft,
.club-actions .btn-soft,
.btn-disabled {
    border-radius: 8px;
    font-size: 0.82rem;
    min-height: 36px;
    padding: 0.45rem 0.7rem;
    text-decoration: none;
}

.row-actions .btn-table-action {
    background: rgba(14, 19, 27, 0.94);
    border: 1px solid rgba(125, 166, 255, 0.18);
    color: #f8f4ec;
}

.btn-disabled {
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(248, 244, 236, 0.38);
    display: inline-flex;
    font-weight: 800;
}

.detail-row td {
    background: rgba(89, 200, 174, 0.08) !important;
}

.detail-panel {
    background: linear-gradient(180deg, rgba(16, 23, 32, 0.92) 0%, rgba(21, 29, 40, 0.92) 100%);
    border: 1px solid rgba(125, 166, 255, 0.12);
    border-radius: 10px;
    padding: 1rem;
}

.menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.col-menu {
    position: fixed;
    z-index: 41;
    min-width: 220px;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(24, 31, 43, 0.98) 0%, rgba(16, 23, 32, 0.98) 100%);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.col-menu-title {
    font-weight: 900;
    margin-bottom: 0.7rem;
}

.col-menu label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.2rem 0;
}

.history-grid {
    display: grid;
    gap: 0.45rem 1rem;
    grid-template-columns: repeat(6, max-content);
}

.member-history-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(80px, auto));
    gap: 0;
    overflow-x: auto;
}

.member-history-grid > span,
.member-history-grid > strong {
    border-bottom: 1px solid var(--line);
    padding: 0.4rem 0.6rem;
    white-space: nowrap;
    color: var(--accent);
}

.member-history-grid > .member-history-grid-header {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.marathons-grid {
    display: grid;
    gap: 0.45rem 1rem;
    grid-template-columns: repeat(6, max-content);
}

.history-grid strong,
.history-grid span,
.marathons-grid span {
    color: var(--accent);
}

.member-history-title,
.member-marathon-title {
    background: linear-gradient(135deg, var(--accent) 0%, #f0d277 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    border-left: 6px solid var(--accent-2) !important;
    border-radius: 8px;
    color: #08090c !important;
    display: block;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.3;
    margin: 0 0 0.9rem;
    padding: 0.7rem 0.9rem;
}

.rules-document {
    background: linear-gradient(180deg, rgba(250, 246, 239, 0.98) 0%, rgba(242, 236, 225, 0.98) 100%);
    border: 1px solid rgba(226, 184, 75, 0.28);
    border-radius: 12px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
    color: #1d1a16;
    padding: clamp(1.25rem, 3vw, 2.5rem);
}

.rules-document__header {
    border-bottom: 2px solid rgba(111, 87, 33, 0.18);
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    text-align: center;
}

.rules-document__kicker {
    color: #7e6223;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.rules-document__header h1 {
    color: #1d1a16;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    margin: 0.85rem 0 0.6rem;
}

.rules-document__header p,
.rules-section,
.rules-section li {
    color: #312a22;
}

.rules-section + .rules-section {
    margin-top: 2rem;
}

.rules-section h2 {
    border-left: 6px solid #e2b84b;
    color: #1d1a16;
    font-size: 1.45rem;
    margin: 0 0 1rem;
    padding-left: 0.85rem;
}

.rules-section ol,
.rules-section ul {
    margin: 0;
    padding-left: 1.35rem;
}

.rules-section li + li {
    margin-top: 0.65rem;
}

.rules-section ul {
    margin-top: 0.65rem;
}

.rules-numbered {
    list-style: none;
    padding-left: 0;
}

.rules-numbered > li {
    border-top: 1px solid rgba(111, 87, 33, 0.12);
    padding-top: 0.9rem;
}

.rules-numbered > li:first-child {
    border-top: 0;
    padding-top: 0;
}

.stickycol {
    position: sticky;
    left: 0;
    background-color: #1b2431;
    z-index: 2;
}

.trend-toolbar {
    flex-direction: column;
    align-items: stretch;
}

.trend-filter-row,
.trend-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.trend-search {
    min-width: 22rem;
}

.trend-year-filter {
    align-items: center;
    display: inline-flex;
    gap: 0.5rem;
}

.trend-option {
    align-items: center;
    display: inline-flex;
    gap: 0.45rem;
}

.predict-col {
    color: var(--accent-3);
}

.predict-active {
    color: var(--accent-2);
}

.predict-stopped {
    color: var(--accent-4);
}

.tab-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 700;
    padding: 0.75rem 0.25rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--accent-3);
    border-bottom-color: var(--accent-3);
}

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.p-4 {
    padding: 1.5rem;
}

.w-100 {
    width: 100%;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.align-items-start {
    align-items: flex-start;
}

@media (max-width: 920px) {
    .site-nav {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 0.9rem 1rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-basis: 100%;
        justify-content: flex-start;
        padding-top: 0.75rem;
    }

    .nav-toggle:checked ~ .nav-links {
        display: flex;
    }

    .hero {
        min-height: auto;
        padding-top: 4rem;
    }

    .hero-grid,
    .metric-grid,
    .member-summary,
    .world-grid {
        grid-template-columns: 1fr;
    }

    .page-section {
        padding: 3rem 1rem;
    }

    .trend-filter-row,
    .trend-options {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar input.auto-grow-input,
    .trend-search {
        min-width: 0;
        width: 100%;
    }

    .rules-document {
        padding: 1rem;
    }

    .rules-section h2 {
        font-size: 1.2rem;
    }
}
