:root {
    --bg: #f3ede4;
    --card: rgba(255, 251, 245, 0.84);
    --muted: #667489;
    --text: #16202b;
    --accent: #d96536;
    --accent-strong: #b44b1f;
    --secondary: #1c6b68;
    --border: rgba(74, 70, 64, 0.14);
    --shadow-lg: 0 28px 80px rgba(35, 30, 22, 0.14);
    --shadow-md: 0 14px 40px rgba(35, 30, 22, 0.1);
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: rgba(255, 255, 255, 0.94);
    --table-head: linear-gradient(180deg, #233243, #17222e);
    --table-head-text: rgba(255, 249, 244, 0.94);
    --table-row-odd: #ffffff;
    --table-row-even: #ffffff;
    --table-row-hover: #ffffff;
    --table-border: rgba(119, 120, 116, 0.08);
    --modal-backdrop: rgba(20, 20, 24, 0.42);
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    background-image:
        radial-gradient(circle at 12% 18%, rgba(28, 107, 104, 0.16), transparent 24%),
        radial-gradient(circle at 88% 12%, rgba(217, 101, 54, 0.18), transparent 22%),
        linear-gradient(180deg, #f7f2ea 0%, #f1e9df 46%, #ece4d7 100%);
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

body::before,
body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: 0;
    border-radius: 999px;
    filter: blur(10px);
}

body::before {
    top: 84px;
    right: -80px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(217, 101, 54, 0.24) 0%, rgba(217, 101, 54, 0) 70%);
}

body::after {
    left: -120px;
    bottom: 70px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(28, 107, 104, 0.2) 0%, rgba(28, 107, 104, 0) 74%);
}

body.modal-open {
    overflow: hidden;
}

.page {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 42px 28px 64px;
}

.card {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 1700px;
    background: var(--card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 30px;
    padding: 28px 28px 34px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--secondary), var(--accent), #efb458);
}

.card::after {
    content: "";
    position: absolute;
    top: -90px;
    right: -40px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 72%);
    pointer-events: none;
}

.title {
    margin: 6px 0 10px;
    font-family: "Sora", "Segoe UI", sans-serif;
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    text-align: center;
    color: #122031;
    text-wrap: balance;
}

.sponsor-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    width: 100%;
    margin: 0 0 20px;
    min-height: 108px;
    padding: 20px 28px;
    border: 1px dashed rgba(28, 107, 104, 0.32);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(248, 242, 234, 0.92)),
        repeating-linear-gradient(135deg, rgba(28, 107, 104, 0.04) 0 10px, rgba(217, 101, 54, 0.05) 10px 20px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    text-align: center;
    box-sizing: border-box;
    text-decoration: none;
    color: inherit;
}

.sponsor-banner.is-link {
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.sponsor-banner.is-link:hover {
    transform: translateY(-1px);
    border-color: rgba(28, 107, 104, 0.48);
    box-shadow: 0 14px 28px rgba(24, 42, 56, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}
/*kai yra rėmėjas naudoti 158-160, kai nėra paslėpti kodą*/
.sponsor-banner.has-image .sponsor-banner-label {
    display: none;
}
.sponsor-banner-image {
    
    width: 80%;
    max-width: 80%;
    max-height: none;
    object-fit: contain;
    flex: 1 1 auto;
}
/* kai yra įdėtas logo, šitą disablinti
.sponsor-banner-image {
    width: clamp(120px, 18vw, 220px);
    max-height: 72px;
    object-fit: contain;
    flex: 0 0 auto;
}
*/
.sponsor-banner-image[hidden] {
    display: none;
}

.sponsor-banner-label {
    font-family: "Sora", "Segoe UI", sans-serif;
    flex: 1 1 auto;
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1c4f5a;
}

.subtitle {
    margin: 0 auto 24px;
    max-width: 760px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
    text-align: center;
}

.controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid rgba(72, 73, 70, 0.08);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.58));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.age-group-buttons,
#ageGroupButtons {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 6px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.age-group-buttons .btn,
#ageGroupButtons .btn {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(79, 79, 79, 0.12);
    color: #16202b;
}

input#filter {
    flex: 1 1 280px;
    min-width: 260px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(78, 86, 95, 0.16);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    font-size: 14px;
}

input#filter::placeholder {
    color: #8a95a5;
}

input#filter:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 5px rgba(217, 101, 54, 0.14);
}

.btn {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(79, 79, 79, 0.12);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: rgba(217, 101, 54, 0.24);
    box-shadow: 0 10px 20px rgba(36, 31, 26, 0.08);
}

.btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(180, 75, 31, 0.22);
}

.participant-record-button {
    min-width: 72px;
    background: linear-gradient(135deg, rgba(126, 136, 149, 0.4), rgba(162, 170, 181, 0.28));
    border-color: rgba(92, 103, 117, 0.28);
}

.table-wrap {
    overflow: auto;
    border: 1px solid rgba(72, 69, 61, 0.12);
    border-radius: 28px;
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), var(--shadow-md);
}

.status {
    min-height: 1.25rem;
    margin: 10px 12px 0;
    padding: 10px 14px;
    border-radius: 14px;
    color: #8f2e19;
    background: rgba(217, 101, 54, 0.08);
}

.status:empty {
    display: none;
}

.data-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
    font-size: 14px;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 14px 12px;
    background: var(--table-head);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--table-head-text);
    text-align: left;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.data-table tbody td {
    background: var(--table-row-odd);
    padding: 12px;
    border-bottom: 1px solid var(--table-border);
}

.data-table tbody tr:hover td {
    background: var(--table-row-hover);
}

.data-table tbody tr:nth-child(even) td {
    background: var(--table-row-even);
}

.data-table tbody tr {
    transition: background 150ms ease;
}

.table-head-cell.no-sort {
    cursor: default;
}

.cell-center {
    text-align: center;
}

.cell-left {
    text-align: left;
}

.cell-wrap {
    white-space: normal;
}

.cell-nowrap {
    white-space: nowrap;
}

.cell-clip {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

th.sort-asc::after,
th.sort-desc::after {
    font-size: 12px;
    margin-left: 6px;
    color: rgba(255, 250, 246, 0.72);
}

.pager {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-inline: 8px;
}

.pager button {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(79, 79, 79, 0.12);
    background: rgba(255, 255, 255, 0.82);
}

.pager button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pager select {
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid rgba(79, 79, 79, 0.12);
    background: rgba(255, 255, 255, 0.82);
}

.pager-info {
    color: var(--muted);
    font-weight: 700;
}

.record-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--modal-backdrop);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.record-modal[hidden] {
    display: none;
}

.record-panel {
    width: min(1120px, 100%);
    max-height: calc(100vh - 180px);
    overflow: auto;
    position: relative;
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
    border: 1px solid rgba(72, 69, 61, 0.12);
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    padding: 22px;
}

.record-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--accent), #efb458);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.record-kicker {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.record-title {
    margin: 0;
    font-family: "Sora", "Segoe UI", sans-serif;
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.record-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.record-chip {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 244, 249, 0.84));
    border: 1px solid rgba(82, 93, 110, 0.12);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.record-section+.record-section {
    margin-top: 20px;
}

.record-section-title {
    margin: 0 0 10px;
    font-size: 18px;
}

.record-chart-shell,
.record-table-wrap {
    border: 1px solid rgba(72, 69, 61, 0.1);
    border-radius: 20px;
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
}

.record-chart-shell {
    padding: 10px 12px 8px;
    background:
        radial-gradient(circle at top left, rgba(11, 99, 214, 0.08), transparent 34%),
        linear-gradient(180deg, var(--panel-strong), var(--panel));
}

.record-chart {
    width: 100%;
    height: auto;
    display: block;
}

.record-chart-grid {
    stroke: #dfe7f1;
    stroke-dasharray: 3 6;
    stroke-width: 0.8;
}

.record-chart-axis {
    stroke: #b4c0d1;
    stroke-width: 0.8;
}

.record-chart-guide {
    stroke: rgba(129, 148, 170, 0.18);
    stroke-width: 0.8;
}

.record-chart-rank-tick {
    stroke: rgba(82, 106, 135, 0.34);
    stroke-width: 0.9;
    stroke-linecap: round;
}

.record-chart-line {
    fill: none;
    stroke: #184f95;
    stroke-width: 1.1;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.record-chart-point {
    stroke: #fff;
    stroke-width: 1.2;
}

.record-chart-point.started {
    fill: #184f95;
}

.record-chart-point.skipped {
    fill: #8da1ba;
}

.record-chart-label {
    fill: #627286;
    font-size: 9px;
    letter-spacing: 0.01em;
}

.record-chart-count-label {
    fill: #30465f;
    font-size: 10px;
    font-weight: 700;
}

.record-chart-place-label {
    fill: #17324a;
    font-size: 10px;
    font-weight: 700;
}

.record-chart-y-label {
    fill: #7d8ea3;
}

.record-empty {
    color: var(--muted);
    padding: 16px;
    font-style: italic;
}

.record-table-wrap {
    overflow: auto;
}

.record-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

.record-table th,
.record-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #edf2f8;
}

.record-table th {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(237, 233, 226, 0.74));
    font-weight: 600;
}

.record-table tbody tr:nth-child(even) td {
    background: rgba(245, 248, 250, 0.68);
}

.record-table td.record-medal-gold {
    background: linear-gradient(90deg, #ffe38a, #ffc94d);
    color: #553600;
    font-weight: 700;
}

.record-table td.record-medal-silver {
    background: linear-gradient(90deg, #edf1f6, #d6dde6);
    color: #33404f;
    font-weight: 700;
}

.record-table td.record-medal-bronze {
    background: linear-gradient(90deg, #f7d0b2, #e79a65);
    color: #5a3419;
    font-weight: 700;
}

.record-race-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.data-table tbody tr.podium1 td {
    background: linear-gradient(90deg, #fff4d9, #ffe7a8);
    color: #5b3b00;
}

.data-table tbody tr.podium2 td {
    background: linear-gradient(90deg, #e9eef6, #d7dfe9);
    color: #24303a;
}

.data-table tbody tr.podium3 td {
    background: linear-gradient(90deg, #fde8d9, #ffd1a8);
    color: #5a3620;
}

.data-table tbody td.race-gold,
.data-table tbody tr.podium1 td.race-gold,
.data-table tbody tr.podium2 td.race-gold,
.data-table tbody tr.podium3 td.race-gold {
    background: linear-gradient(90deg, #ffd94d, #ffbf00);
    color: #3b2a00;
}

.data-table tbody td.race-silver,
.data-table tbody tr.podium1 td.race-silver,
.data-table tbody tr.podium2 td.race-silver,
.data-table tbody tr.podium3 td.race-silver {
    background: linear-gradient(90deg, #dfe6ee, #c6cfd9);
    color: #1f2933;
}

.data-table tbody td.race-bronze,
.data-table tbody tr.podium1 td.race-bronze,
.data-table tbody tr.podium2 td.race-bronze,
.data-table tbody tr.podium3 td.race-bronze {
    background: linear-gradient(90deg, #f6c49a, #e5935b);
    color: #4b2e1a;
}

.gold {
    background: #ffffff;
    color: #16202b;
}

.silver {
    background: #ffffff;
    color: #16202b;
}

.bronze {
    background: #ffffff;
    color: #16202b;
}

.btn.toggle {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1;
}

.toggle-button {
    margin-right: 8px;
}

.details-row[hidden] {
    display: none;
}

.details-row td {
    background: linear-gradient(180deg, rgba(250, 250, 252, 0.9), rgba(245, 247, 250, 0.95));
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
}

.detail-grid {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
}

.detail-summary {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(82, 93, 110, 0.08);
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 13px;
}

.detail-item strong {
    font-weight: 600;
    margin-right: 6px;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.details-th {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid #eef2f7;
}

.details-td {
    padding: 6px 8px;
}

.details-title-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.up {
    color: #0f9d58;
    font-weight: 600;
}

.down {
    color: #d93025;
    font-weight: 600;
}

.muted {
    color: #6f7d8e;
    font-style: italic;
}

.podium1 td.gold,
.podium2 td.gold,
.podium3 td.gold {
    background: #ffffff;
    color: #16202b;
}

.podium1 td.silver,
.podium2 td.silver,
.podium3 td.silver {
    background: #ffffff;
    color: #16202b;
}

.podium1 td.bronze,
.podium2 td.bronze,
.podium3 td.bronze {
    background: #ffffff;
    color: #16202b;
}

@media (max-width: 700px) {
    .page {
        padding: 18px 14px 32px;
    }

    .card {
        border-radius: 22px;
        padding: 18px 16px 22px;
    }

    .sponsor-banner {
        flex-direction: column;
        min-height: 0;
        padding: 18px;
    }

    .sponsor-banner-image {
        width: min(100%, 220px);
        max-height: 64px;
    }

    .controls {
        padding: 12px;
        border-radius: 18px;
    }

    input#filter {
        width: 100%;
        min-width: 0;
    }

    .data-table thead th,
    .data-table tbody td {
        padding: 8px;
    }

    .pager-info {
        width: 100%;
    }

    .details-title-cell {
        max-width: 180px;
    }

    .record-modal {
        padding: 12px;
    }

    .record-panel {
        max-height: calc(100vh - 24px);
        padding: 16px;
        border-radius: 20px;
    }

    .record-header {
        flex-direction: column;
        align-items: stretch;
    }

    .record-title {
        font-size: 22px;
    }
}