* { margin: 0; padding: 0; box-sizing: border-box; }
@font-face { font-family: 'Press Start 2P'; src: url('/assets/PressStart2P.ttf') format('truetype'); font-display: block; }
:root {
    /* Site header is position: fixed, so we reserve its height in body
       padding-top to keep content from sliding under it. The mobile
       header wraps to two rows below 768px, so the value bumps up. Other
       fixed bars (like the /guide TOC) reuse this var. */
    --header-h: 52px;
}
@media (max-width: 767px) {
    :root { --header-h: 84px; }
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1f2328;
    background: #fff;
    margin: 0;
    padding: var(--header-h) 0 0;
}
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #ffffff;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.site-header-inner {
    height: 52px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    position: relative;
}
.site-title {
    font-weight: 600;
    font-size: 20px;
    letter-spacing: -0.02em;
    color: #1f2328;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.site-icon {
    border-radius: 4px;
}
.site-title:hover { color: #1e6e2e; }
.site-nav {
    display: flex;
    gap: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    align-items: stretch;
}
.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: #1f2328;
    opacity: 0.45;
    text-decoration: none;
    padding: 0 14px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid transparent;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.nav-link:hover { opacity: 0.7; text-decoration: none; }
.nav-link.active { font-weight: 600; opacity: 1; border-bottom-color: #288135; }
.game-btn {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #288135;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    white-space: nowrap;
    margin-left: auto;
}
.game-btn:hover { background: #166024; }
.container {
    max-width: 1272px;
    margin: 0 auto;
    padding: 32px 32px 64px;
}

.site-footer {
    border-top: 1px solid rgba(0,0,0,0.08);
    padding: 32px 32px 40px;
    max-width: 1272px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    font-size: 13px;
    color: #656d76;
}
.footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.footer-icon { border-radius: 4px; }
.footer-title { font-weight: 600; color: #1f2328; font-size: 14px; }
.footer-sub { margin-top: 2px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; line-height: 24px; }
.footer-links a { color: #656d76; text-decoration: none; }
.footer-links a:hover { color: #1e6e2e; }

@media (prefers-color-scheme: dark) {
    body { background: #0d1117; color: #e6edf3; }
    .site-header { background: #0d1117; border-bottom-color: rgba(255,255,255,0.08); }
    .site-title { color: #e6edf3; }
    .site-title:hover { color: #4aba5a; }
    .nav-link { color: #e6edf3; }
    .nav-link.active { opacity: 1; border-bottom-color: #4aba5a; }
    .site-footer { border-top-color: rgba(255,255,255,0.08); }
    .footer-title { color: #e6edf3; }
    .footer-links a { color: #8b949e; }
    .footer-links a:hover { color: #4aba5a; }
}
@media (max-width: 767px) {
    .site-header-inner {
        padding: 0 16px;
        height: auto;
        flex-wrap: wrap;
    }
    .site-title { font-size: 17px; height: 44px; display: flex; align-items: center; }
    .site-nav {
        position: static;
        transform: none;
        gap: 0;
        order: 5;
        width: 100%;
        padding: 0;
        height: auto;
        margin: 0 -16px;
        width: calc(100% + 32px);
    }
    .nav-link { font-size: 13px; padding: 13px 0; flex: 1; text-align: center; display: block; border-bottom: 1px solid transparent; }
    .game-btn { margin-left: auto; }
    .container { padding: 32px 16px 48px; }
    .site-footer { padding: 24px 16px 32px; flex-direction: column; gap: 16px; }
}
