body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

:root:has(dialog:modal) body {
    overflow: hidden;
}

header {
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
}

header a {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    letter-spacing: .03em;
    transition: opacity .15s;
}

header a:hover {
    opacity: .75;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--brand);
    font-family: 'Pixelify Sans', monospace;
    font-size: 1.1rem;
    letter-spacing: 0;
}

nav {
    display: flex;
    gap: 1.5rem;
}

.mobile-nav {
    display: none;
}

nav a {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color .15s;
}

nav a:hover,
nav a.active {
    color: var(--text);
}

.nav-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #000;
    font-size: .65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    padding: 0 .3rem;
    margin-left: .3rem;
}

main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1rem;
}

.notice a:not([class]),
.empty a:not([class]) {
    color: var(--accent);
    text-decoration: none;
    transition: color .15s;
}

.notice a:not([class]):hover,
.notice a:not([class]):focus-visible,
.empty a:not([class]):hover,
.empty a:not([class]):focus-visible {
    color: var(--text);
}


@media (max-width: 600px) {
    header {
        padding: .75rem 1rem;
        position: static;
        background: var(--bg);
        flex-wrap: wrap;
        gap: .45rem 1rem;
    }

    header nav {
        display: none;
    }

    .mobile-nav {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: .65rem .75rem .75rem;
        gap: .4rem;
    }

    .mobile-nav__link {
        position: relative;
        min-width: 0;
        min-height: 4rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .3rem;
        padding: .55rem .25rem;
        border: 1px solid transparent;
        border-radius: var(--radius);
        color: var(--text-muted);
        font-size: .72rem;
        font-weight: 650;
        line-height: 1.15;
        text-align: center;
    }

    .mobile-nav__link:hover,
    .mobile-nav__link.active {
        color: var(--text);
        background: var(--surface-2);
        border-color: var(--border);
    }

    .mobile-nav__link.active {
        color: var(--accent);
    }

    .mobile-nav__icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: currentColor;
    }

    .mobile-nav__label {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-nav .nav-count {
        position: absolute;
        top: .35rem;
        right: .45rem;
    }
}
