@font-face {
    font-family: "Sakana";
    src: url("./Sakana.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}
:root {
    --nav-bg: #0a0c12;
    --nav-border: #262b38;
    --nav-muted: #6b7280;
    --nav-text: #e8eaf0;
    --accent: #e8ff3a;
    --bg: #f5f6f8;
    --surface: #ffffff;
    --border: #e2e6ed;
    --text: #111827;
    --muted: #6b7280;
    --muted2: #9ca3af;
    --gold: #c8960c;
    --silver: #6b7a99;
    --bronze: #a0522d;
    --badge-p: #3b82f6;
    --badge-c: #10b981;
    --badge-r: #f59e0b;
    --row-hover: #f0f4ff;
    --indigo: #4f46e5;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 16px rgba(0, 0, 0, 0.05);
}
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    background: var(--bg);
    color: var(--text);
    font-family: "Barlow", sans-serif;
    min-height: 100vh;
}

/* NAV */
nav {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 300;
}
.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 1.5rem;
    text-decoration: none;
}
.logo-text {
    font-family: "Sakana", "Barlow Condensed", sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 0.1em;
    color: var(--accent);
    text-transform: uppercase;
    line-height: 1;
}
.logo-badge {
    font-family: "Sakana", "Barlow Condensed", sans-serif;
    font-weight: 800;
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 6px;
    text-transform: uppercase;
    align-self: flex-end;
    margin-bottom: 3px;
}
.nav-links {
    display: flex;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
}
.nav-links::-webkit-scrollbar {
    display: none;
}
.nav-links li a {
    display: block;
    padding: 0 0.85rem;
    line-height: 56px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--nav-muted);
    text-decoration: none;
    transition: color 0.15s;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}
.nav-links li a:hover {
    color: var(--nav-text);
}
.nav-links li a.active {
    color: var(--nav-text);
    border-bottom-color: var(--accent);
}
.hamburger {
    display: none;
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    flex-direction: column;
    gap: 5px;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--nav-text);
    border-radius: 2px;
    transition: all 0.25s;
}
.mobile-menu {
    display: none;
    flex-direction: column;
    background: #13161f;
    border-top: 1px solid var(--nav-border);
    position: sticky;
    top: 56px;
    z-index: 99;
}
.mobile-menu.open {
    display: flex;
}
.mobile-menu a {
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    color: var(--nav-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
    border-left: 3px solid transparent;
}
.mobile-menu a:hover {
    color: var(--nav-text);
    background: rgba(255, 255, 255, 0.04);
}
.mobile-menu a.active {
    color: var(--nav-text);
    border-left-color: var(--accent);
    background: rgba(255, 255, 255, 0.04);
}

/* MAIN */
main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* SELECTOR ROW */
.selector-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.selector-group {
    flex: 1;
    min-width: 200px;
    max-width: 520px;
}
.selector-label {
    font-size: 0.74rem;
    color: var(--muted);
    margin-bottom: 0.4rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
}

/* CUSTOM DROPDOWN */
.custom-select-wrap {
    position: relative;
}
.custom-select-input-row {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
.custom-select-input-row.focused {
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.custom-select-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: "Barlow", sans-serif;
    font-size: 0.9rem;
    color: var(--text);
    padding: 0.65rem 0.5rem 0.65rem 1rem;
    cursor: pointer;
}
.custom-select-input::placeholder {
    color: var(--muted2);
}
.custom-select-chevron {
    padding: 0 0.9rem;
    color: var(--muted2);
    font-size: 0.8rem;
    pointer-events: none;
    user-select: none;
    flex-shrink: 0;
}
.custom-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    z-index: 200;
    overflow: hidden;
    max-height: 220px;
    overflow-y: auto;
}
.custom-select-dropdown.open {
    display: block;
}
.custom-select-option {
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    /* color: var(--text); */
    color: #fff;
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid var(--border);
}
.custom-select-option:last-child {
    border-bottom: none;
}
.custom-select-option:hover,
.custom-select-option.highlighted {
    background: var(--row-hover);
    color: var(--indigo);
}
.custom-select-option.selected {
    background: #ede9fe;
    color: var(--indigo);
    font-weight: 600;
}
.custom-select-not-found {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--muted2);
    text-align: center;
    font-style: italic;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: "Barlow", sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.63rem 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 0.04em;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
    align-self: flex-end;
}
.share-btn:hover {
    border-color: var(--indigo);
    background: #f5f3ff;
    color: var(--indigo);
}
.share-btn svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* LB HEADER */
.lb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.lb-title {
    font-family: "Sakana", "Barlow Condensed", sans-serif;
    font-weight: 800;
    font-size: 1.65rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1;
}
.lb-title span {
    /* color: var(--indigo); */
    color:red;
}
.lb-meta {
    font-size: 0.78rem;
    color: var(--muted2);
    font-weight: 500;
    letter-spacing: 0.04em;
}

/* TABLE */
.table-wrap {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 460px;
}
thead th {
    background: #f8f9fc;
    padding: 0.7rem 1rem;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    color: black;
}
thead th.center {
    text-align: center;
}
tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.13s;
    animation: fadeIn 0.35s ease both;
}
tbody tr:last-child {
    border-bottom: none;
}
tbody tr:hover {
    background: var(--row-hover);
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
tbody tr:nth-child(1) {
    animation-delay: 0.04s;
}
tbody tr:nth-child(2) {
    animation-delay: 0.07s;
}
tbody tr:nth-child(3) {
    animation-delay: 0.1s;
}
tbody tr:nth-child(4) {
    animation-delay: 0.13s;
}
tbody tr:nth-child(5) {
    animation-delay: 0.16s;
}
tbody tr:nth-child(6) {
    animation-delay: 0.19s;
}
tbody tr:nth-child(7) {
    animation-delay: 0.22s;
}
tbody tr:nth-child(8) {
    animation-delay: 0.25s;
}
tbody tr:nth-child(9) {
    animation-delay: 0.28s;
}
tbody tr:nth-child(10) {
    animation-delay: 0.31s;
}
tbody tr:nth-child(11) {
    animation-delay: 0.34s;
}
td {
    padding: 0.78rem 1rem;
    font-size: 0.87rem;
    vertical-align: middle;
    white-space: nowrap;
}

.td-pos {
    font-weight: 800;
    font-size: 1rem;
    width: 52px;
    color: var(--muted2);
}

.td-driver {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.driver-name {
    font-weight: 600;
    color: var(--text);
}
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    font-size: 0.62rem;
    font-weight: 700;
    flex-shrink: 0;
}
.badge-P {
    background: var(--badge-p);
    color: #fff;
}
.badge-C {
    background: var(--badge-c);
    color: #fff;
}
.badge-R {
    background: var(--badge-r);
    color: #fff;
}
.td-time {
    /* font-family: 'Sakana', 'Barlow Condensed', sans-serif; */
    color: black;
}

.td-chart {
    text-align: center;
}
.chart-btn {
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.28rem 0.42rem;
    cursor: pointer;
    color: var(--muted);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    display: inline-flex;
    align-items: center;
}
.chart-btn:hover {
    background: var(--indigo);
    border-color: var(--indigo);
    color: #fff;
}
.chart-btn svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}
.td-date {
    /* color: black; */
    font-size: 0.82rem;
    font-weight: bold;
}
.td-vehicle {
    /* color: black; */
    font-size: 0.82rem;
    font-weight: bold;
}
.td-venue {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .col-vehicle {
        display: none;
    }
}
@media (max-width: 680px) {
    .col-date {
        display: none;
    }
    td,
    th {
        padding: 0.65rem 0.7rem;
    }
    .lb-title {
        font-size: 1.3rem;
    }
    main {
        padding: 1.25rem 1rem 3rem;
    }
}
@media (max-width: 480px) {
    .col-venue {
        display: none;
    }
    .nav-links {
        display: none;
    }
    .hamburger {
        display: flex;
    }
    td,
    th {
        padding: 0.6rem 0.55rem;
    }
    .td-time {
        font-size: 0.95rem;
    }
    .badge {
        width: 18px;
        height: 18px;
        font-size: 0.58rem;
    }
    .driver-name {
        font-size: 0.83rem;
    }
    .selector-row {
        flex-direction: column;
        align-items: stretch;
    }
    .selector-group {
        max-width: 100%;
    }
    .share-btn {
        align-self: flex-start;
    }
    table {
        min-width: 300px;
    }
    .lb-meta {
        display: none;
    }
}
