:root {
    color-scheme: light;
    --paper: #f2f0ea;
    --ink: #181b20;
    --muted: #626872;
    --line: #c9c7c0;
    --card: #faf9f5;
    --blue: #164ca2;
    --red: #c72735;
    --green: #167447;
    --yellow: #9b6710;
    --off: #8b3440;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--paper);
}

body {
    min-width: 280px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--paper);
}

a {
    color: inherit;
}

.flag-header nav {
    display: grid;
    grid-template-rows: repeat(3, minmax(58px, 1fr));
}

.flag-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 0.85rem 1.25rem;
    font-size: clamp(0.95rem, 2vw, 1.08rem);
    font-weight: 650;
    letter-spacing: 0.035em;
    text-align: center;
    text-decoration: none;
    text-underline-offset: 0.24em;
}

.flag-link:hover {
    text-decoration: underline;
}

.flag-link:focus-visible,
footer a:focus-visible {
    outline: 3px solid #111;
    outline-offset: -5px;
}

.flag-link[aria-current="page"] {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.flag-link--white {
    color: #15171a;
    background: #fff;
}

.flag-link--blue {
    color: #fff;
    background: var(--blue);
}

.flag-link--red {
    color: #fff;
    background: var(--red);
}

.home-main,
.status-main {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.home-main {
    padding: clamp(4rem, 9vw, 8rem) 0 5rem;
}

.intro {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
    align-items: end;
    gap: 2rem;
    padding-bottom: clamp(3rem, 7vw, 6rem);
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    margin: 0 0 0.75rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
}

.intro h1,
.page-heading h1 {
    margin-bottom: 0;
    font-size: clamp(3.6rem, 11vw, 8.5rem);
    line-height: 0.82;
    letter-spacing: -0.065em;
}

.intro-copy {
    max-width: 32rem;
    margin-bottom: 0;
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.55;
}

.video-section {
    padding-top: clamp(2.5rem, 6vw, 5rem);
}

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.section-heading span,
.updated-at {
    color: var(--muted);
    font-size: 0.85rem;
}

.video-frame {
    display: grid;
    min-height: clamp(240px, 48vw, 590px);
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #dedcd5;
}

.video-frame video {
    display: block;
    width: 100%;
    max-width: 1050px;
    height: auto;
    max-height: 70vh;
    background: #0c0d0f;
}

.muted-message {
    margin: 0;
    padding: 2rem;
    color: var(--muted);
    text-align: center;
}

.status-main {
    padding: clamp(3.5rem, 8vw, 7rem) 0 5rem;
}

.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: clamp(3rem, 7vw, 5rem);
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--line);
}

.page-heading h1 {
    font-size: clamp(3rem, 8vw, 6.5rem);
}

.updated-at {
    max-width: 22rem;
    margin: 0;
    text-align: right;
}

.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
    gap: 1rem;
}

.server-card {
    display: flex;
    flex-direction: column;
    min-height: 290px;
    padding: clamp(1.4rem, 3vw, 2rem);
    border: 1px solid var(--line);
    background: var(--card);
}

.server-card--wow {
    border-top: 4px solid var(--blue);
}

.server-card--link {
    color: inherit;
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.server-card--link:hover,
.server-card--link:focus-visible {
    color: #fff;
    border-color: var(--red);
    background: var(--red);
    transform: translateY(-3px);
}

.server-card--link:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
}

.server-card--link:hover .eyebrow,
.server-card--link:hover .game-name,
.server-card--link:hover .metric dt,
.server-card--link:focus-visible .eyebrow,
.server-card--link:focus-visible .game-name,
.server-card--link:focus-visible .metric dt {
    color: rgba(255, 255, 255, 0.78);
}

.server-card--link:hover .state-line,
.server-card--link:focus-visible .state-line {
    color: #fff;
}

.server-card--link:hover .metrics,
.server-card--link:focus-visible .metrics {
    border-color: rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.38);
}

.server-card--link:hover .metric,
.server-card--link:focus-visible .metric {
    background: rgba(86, 8, 18, 0.2);
}

.server-card h3 {
    margin-bottom: 0.35rem;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.game-name {
    margin-bottom: 2rem;
    color: var(--muted);
}

.state-line {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 2rem;
    font-weight: 700;
}

.state-dot {
    width: 0.72rem;
    height: 0.72rem;
    flex: 0 0 auto;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: currentColor;
}

.state--online { color: var(--green); }
.state--offline,
.state--unavailable { color: var(--off); }
.state--starting,
.state--stopping { color: var(--yellow); }
.state--unknown { color: var(--muted); }

.metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    margin: 0;
    border: 1px solid var(--line);
    background: var(--line);
}

.metric {
    padding: 1rem;
    background: var(--card);
}

.metric dt {
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.metric dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.server-card--loading {
    color: var(--muted);
}

.error-notice {
    grid-column: 1 / -1;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--off);
    background: #f5e8e9;
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem max(20px, calc((100% - 1120px) / 2));
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.83rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 700px) {
    .home-main,
    .status-main {
        width: min(100% - 28px, 1120px);
    }

    .intro {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .intro h1,
    .page-heading h1 {
        line-height: 0.9;
    }

    .page-heading {
        display: block;
    }

    .updated-at {
        margin-top: 1.5rem;
        text-align: left;
    }

    .video-frame {
        min-height: 220px;
    }

    footer {
        display: grid;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }
}
