:root {
    --pico-primary: #ed7d31 !important;
    --pico-primary-background: #595959 !important;
    --pico-primary-hover-background: #e7eaf0 !important;
    --pico-line-height: 1.5;
}

html,
body {
    height: 100%;
    margin: 0;
    text-align: center;
}

body {
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

main {
    flex: 1 0 auto;
}

main.container {
    padding: 0.2rem 0.35rem;
    max-width: 100%;
}

footer {
    font-size: 0.72em;
    padding: 0.2rem 0.1rem 0.4rem;
}

a {
    text-decoration: none;
}

summary:hover {
    color: var(--pico-contrast);
}

header {
    margin-bottom: 0.1rem;
    padding: 0.15rem 0 0;
}

#logo {
    max-height: 100px;
    width: auto;
    object-fit: scale-down;
}

#event-info {
    text-align: center;
    margin: 0.1rem 0 0.35rem;
}

#event-info h1 {
    margin: 0;
    font-size: clamp(0.95rem, 2.8vw, 1.2rem);
    line-height: 1.05;
}

#event-info p {
    margin: 0.05rem 0 0;
    font-size: clamp(0.68rem, 2vw, 0.8rem);
    color: #666;
}

/* Kategorienavigation */
#categories-navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.22rem;
    margin-bottom: 0.4rem;
}

#categories-navigation button,
#categories-navigation a[role="button"] {
    min-width: auto;
    padding: 0.28rem 0.45rem;
    font-size: 0.72rem;
    line-height: 1.1;
    margin: 0;
}

.class-block {
    margin: 0 0 0.25rem;
}

.class-block h2 {
    margin: 0.2rem 0 0.25rem;
    font-size: clamp(0.82rem, 2.4vw, 1rem);
    line-height: 1.05;
}

/* Scrollbarer Tabellencontainer */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Kompakte Tabelle */
table {
    width: 100%;
    min-width: 520px;
    table-layout: fixed;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: clamp(0.66rem, 1.8vw, 0.82rem);
    line-height: 2.0;
    margin: 0;
}

/* Spaltenbreiten */
th:nth-child(1),
td:nth-child(1) {
    width: 10%;
}

th:nth-child(2),
td:nth-child(2) {
    width: 35%;
}

th:nth-child(3),
td:nth-child(3) {
    width: 35%;
}

th:nth-child(4),
td:nth-child(4) {
    width: 10%;
}

th:nth-child(5),
td:nth-child(5) {
    width: 10%;
}

th,
td {
    padding: 0.16rem 0.22rem;
    vertical-align: middle;
    overflow-wrap: break-word;
}

th {
    font-size: 0.68rem;
    line-height: 2.0;
    white-space: nowrap;
}

td:nth-child(1),
td:nth-child(4),
td:nth-child(5),
th:nth-child(1),
th:nth-child(4),
th:nth-child(5) {
    text-align: center;
    white-space: nowrap;
}

td:nth-child(2),
td:nth-child(3) {
    text-align: left;
    word-break: break-word;
}

.results tbody tr:hover td,
tbody tr:hover td {
    background-color: var(--pico-primary-hover-background);
}

/* Zusatztext unter Name */
.subtext {
    font-size: 0.82em;
    color: #666;
    line-height: 2.0;
    margin-top: 1px;
}

/* Statusfarben */
.status-dns {
    color: #999;
}

.status-dnf {
    color: #e67e22;
    font-weight: 600;
}

.status-mp {
    color: #e74c3c;
    font-weight: 600;
}

.status-disq {
    color: #8e44ad;
    font-weight: 600;
}

/* Top 3 */
.rank-1 {
    background-color: #fff8dc;
    font-weight: bold;
}

.rank-2 {
    background-color: #f2f2f2;
    font-weight: bold;
}

.rank-3 {
    background-color: #fbe5d6;
    font-weight: bold;
}

/* Optional alte Kategorienansicht */
.categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 0.35rem;
}

.categories article {
    margin: 0;
    text-align: center;
}

.categories article header {
    font-size: 2em;
    background-color: var(--pico-primary-background);
    color: white;
    padding: 0.35rem 0.5rem;
}

.categories article footer {
    font-size: 0.72em;
}

.categories article:hover {
    cursor: pointer;
}

.categories article:hover header {
    background-color: var(--pico-primary);
}

.categories article:hover p {
    color: var(--pico-primary);
}

@media (max-width: 700px) {
    table {
        min-width: 480px;
        font-size: 0.84rem;
        line-height: 1.5;
    }

    th,
    td {
        padding: 0.45rem 0.16rem;
    }

    .subtext {
        font-size: 0.84em;
        line-height: 1.5;
    }
}

@media (max-width: 420px) {
    #logo {
        max-height: 80px;
    }

    table {
        min-width: 450px;
        font-size: 0.84rem;
        line-height: 1.5;
    }

    th,
    td {
        padding: 0.5rem 0.12rem;
    }

    #categories-navigation button,
    #categories-navigation a[role="button"] {
        font-size: 0.64rem;
        padding: 0.18rem 0.28rem;
    }
}
