:root {
    --gutter: 16px;
    --bg: #fff;
    --fg: #1a1a1a;
    --rule: #d0d0d0;
    --table-head: #f0f0f0;
    --link: #0b57d0;
    --today: #fff3c4;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #161616;
        --fg: #e8e8e8;
        --rule: #444;
        --table-head: #262626;
        --link: #8ab4f8;
        --today: #3d3517;
    }
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0 var(--gutter);
    background: var(--bg);
    color: var(--fg);
    font: 16px/1.5 system-ui, sans-serif;
    overflow-wrap: anywhere;
}

main {
    max-width: 40rem;
    margin: 0 auto;
}

a {
    color: var(--link);
}

footer {
    max-width: 40rem;
    margin: 2rem auto 0;
    padding: 0.75rem 0 1.5rem;
    border-top: 1px solid var(--rule);
    font-size: 0.875rem;
}

/* Nav links wrap onto a second row rather than widening the page; the current page is underlined. */
nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    max-width: 40rem;
    margin: 0 auto;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--rule);
}

nav a {
    color: var(--fg);
    text-decoration: none;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
}

nav a[aria-current=page] {
    font-weight: 600;
    color: var(--link);
    border-bottom-color: var(--link);
}

ul {
    padding-left: 1.25rem;
}

/* Task lists: the checkbox is the bullet, nested lists indent under their parent. */
ul:has(> li > input[type=checkbox]) {
    list-style: none;
    padding-left: 0;
}

li ul:has(> li > input[type=checkbox]) {
    padding-left: 1.5rem;
}

input[type=checkbox] {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0 0.4rem 0 0;
    vertical-align: -0.15rem;
}

/* Wide tables scroll inside themselves so the page never scrolls sideways. */
table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

th, td {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--rule);
    text-align: left;
    overflow-wrap: normal;
}

th {
    background: var(--table-head);
}

td {
    vertical-align: top;
}

/* Games page: games to buy stand out, skipped games fade. */
tr.status-buy td.status {
    font-weight: 600;
}

tr.status-skip {
    opacity: 0.6;
}

img {
    max-width: 100%;
}

pre {
    max-width: 100%;
    overflow-x: auto;
}

.notice {
    max-width: 40rem;
    margin: 1rem auto 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--rule);
}

.passphrase label {
    display: block;
    margin-bottom: 0.5rem;
}

.passphrase input[type=password],
.passphrase button {
    font: inherit;
    padding: 0.4rem 0.6rem;
}

.passphrase input[type=password] {
    width: 100%;
    margin-bottom: 0.5rem;
}

.passphrase .wrong {
    margin-top: 0;
    font-weight: bold;
}

.present-today {
    margin: 1rem 0 0;
    padding: 0.5rem 0.75rem;
    border-left: 4px solid var(--link);
    background: var(--today);
}

tr.today td {
    background: var(--today);
    font-weight: 600;
}
