:root {
    --ink:        #0b0b0b;
    --ink-secondary: #52514e;
    --ink-muted:  #898781;
    --surface:    #ffffff;
    --surface-alt: #d9d9d9;
    --border:     rgba(11,11,11,0.10);
}

* { box-sizing: border-box; }

body {
    font-family: Arial, sans-serif;
    background-color: #ffffff;
    color: var(--ink);
    margin: 0;
    padding: 0;
}
.bg-logo {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 90vmin;
    height: 90vmin;
    transform: translate(-50%, -50%);
    object-fit: contain;
    opacity: 0.08;
    z-index: -1;
    pointer-events: none;
    user-select: none;
}

#content {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

.lang-switch {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 10px;
}
.lang-switch button {
    appearance: none;
    font: inherit;
    font-weight: bold;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--ink-secondary);
    padding: 4px 9px;
    border-radius: 999px;
    cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
    background: #000;
    color: #fff;
    border-color: #000;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.header img {
    width: 80px;
    height: 80px;
    flex: 0 0 auto;
}
h1 {
    font-size: 1.3rem;
    text-align: center;
    margin: 0;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin: 20px 0 16px;
    border-bottom: 2px solid var(--surface-alt);
}
.tab-btn {
    appearance: none;
    border: none;
    background: none;
    font: inherit;
    font-weight: bold;
    font-size: 1rem;
    padding: 10px 16px;
    cursor: pointer;
    color: var(--ink-secondary);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}
.tab-btn[aria-selected="true"] {
    color: var(--ink);
    border-bottom-color: var(--ink);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Schedule blocks */
.info-block {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    background: var(--surface-alt);
    border-radius: 6px;
    padding: 10px 14px;
    margin: 10px 0;
    font-weight: bold;
}
.info-block .info-time {
    font-weight: normal;
    color: var(--ink-secondary);
    font-variant-numeric: tabular-nums;
}
.info-results { background: #000; color: #fff; }
.info-results .info-time { color: #d9d9d9; }

.race-block {
    margin: 22px 0;
}
.race-block h2 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 1.05rem;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--surface-alt);
}
.race-block h2 .info-time {
    font-weight: normal;
    font-size: 0.85rem;
    color: var(--ink-secondary);
    font-variant-numeric: tabular-nums;
}

.heats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.heat-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.heat-label {
    display: flex;
    justify-content: space-between;
    background: #000;
    color: #fff;
    font-size: 0.8rem;
    padding: 6px 10px;
}
.heat-label .heat-time {
    color: #d9d9d9;
    font-variant-numeric: tabular-nums;
}
.lane {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
}
.lane:nth-child(odd) { background: #f5f5f4; }
.lane-number {
    flex: 0 0 auto;
    width: 3.5em;
    font-size: 0.8rem;
    color: var(--ink-muted);
}
.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex: 0 0 auto;
    border: 1px solid var(--border);
}
.lane-team {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lane-team .abbr { font-weight: bold; }
.lane-team .full-name { color: var(--ink-secondary); }
.lane-team .tbd { color: var(--ink-muted); font-style: italic; }
.lane-time {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    font-weight: bold;
}
.lane-time.empty { color: var(--ink-muted); font-weight: normal; }

/* Teams tab */
table.teams {
    width: 100%;
    border-collapse: collapse;
}
table.teams th {
    background: #000;
    color: #fff;
    text-align: left;
    padding: 8px 10px;
}
table.teams td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--surface-alt);
}
table.teams tr:nth-child(odd) td { background: #f5f5f4; }
table.teams td.col-name {
    display: flex;
    align-items: center;
    gap: 8px;
}
td.col-total { font-variant-numeric: tabular-nums; text-align: right; }
td.col-total.empty { color: var(--ink-muted); }

@media (max-width: 520px) {
    table.teams thead { display: none; }
    table.teams, table.teams tbody, table.teams tr, table.teams td {
        display: block;
        width: 100%;
    }
    table.teams tr {
        border: 1px solid var(--border);
        border-radius: 8px;
        margin-bottom: 10px;
        overflow: hidden;
    }
    table.teams td {
        border-bottom: none;
        padding: 6px 10px;
    }
    table.teams td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--ink-muted);
    }
    table.teams td.col-total { text-align: left; }
}
