:root {
    --color-background: white;
    --color-on-background: black;
    --color-background-hover: #eee;
    --color-on-background-hover: black;
    --color-primary: #01ffbb;
    --color-on-primary: white;
    --color-error: #de0000;
    --color-on-error: white;
}

main.dark,
header.dark {
    color-scheme: dark;
    --color-background: #1c1b1f;
    --color-on-background: white;
    --color-background-hover: #27262c;
    --color-on-background-hover: white;
    --color-primary: #008f6b;
    --color-primary-disabled: #1f213c;
    --color-on-primary: white;
    --color-error: #de0000;
    --color-on-error: white;
}

html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;
}

header,
main {
    background-color: var(--color-background);
    color: var(--color-on-background);
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) minmax(16rem, 2fr) minmax(
            16em,
            1fr
        );
    column-gap: 2rem;
}

header {
    display: flex;
    padding-inline: calc(25vw - 10rem);
    height: 4rem;
    background-color: var(--color-primary);
    color: var(--color-on-primary);
}
@media screen and (min-width: 1366px) {
    header {
        display: grid;
        padding-inline: 0;
    }
}
header .logo {
    justify-self: end;
    align-self: center;
    display: flex;
    align-items: flex-end;
    gap: 1rem;
}
header .nav {
    flex: 1;
}

main {
    height: 0;
    flex: 1;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    column-gap: 2rem;
}
main > div {
    overflow-y: auto;
}

.spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: span 3;
}

input[type="checkbox"] {
    height: 1.25rem;
    width: 1.25rem;
    cursor: pointer;
    margin: 0;
}
/* Light-mode header */
header,
header .nav {
    background-color: #01ffbb;
    color: white;
}

/* Dark-mode header */
header.dark,
header.dark .nav {
    background-color: #008f6b;
    color: white;
}

.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.popup {
    position: relative;
    background: var(--color-background);
    color: var(--color-on-background);
    padding: 24px;
    border: 1px solid var(--color-background-hover);
    border-radius: 12px;
    width: min(420px, 90%);
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.popup-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 26px;
    cursor: pointer;
    color: inherit;
    background: transparent;
    border: none;
}

.popup h2 {
    margin-bottom: 16px;
}

.popup p {
    margin: 8px 0;
}

/* Clickable level ID */
.stats a {
    color: var(--color-on-background);
    cursor: pointer;
    text-decoration: none;
}

/* Underline on hover */
.stats a:hover {
    text-decoration: underline;
    opacity: 1;
}

/* Clickable level ID — dark mode */
main.dark .stats a {
    color: white;
}

.popup-close:hover {
    opacity: 0.7;
}
