:root {
  color-scheme: dark;
  --bg: oklch(0.13 0.008 260);
  --surface: oklch(0.18 0.01 260);
  --surface-raised: oklch(0.22 0.012 260);
  --ink: oklch(0.95 0.005 260);
  --ink-muted: oklch(0.71 0.012 260);
  --line: oklch(0.36 0.012 260);
  --red: oklch(0.52 0.17 28);
  --red-bright: oklch(0.66 0.16 28);
  --green: oklch(0.72 0.16 145);
  --amber: oklch(0.8 0.15 82);
  --gray: oklch(0.68 0.015 260);
  --danger: oklch(0.66 0.18 28);
  --radius: 14px;
  --content-width: 1440px;
  --display-font: "Arial Narrow", "Roboto Condensed", "Helvetica Neue Condensed", Arial, sans-serif;
  --body-font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 79% 4%, oklch(0.3 0.055 28 / 0.22), transparent 27rem),
    linear-gradient(180deg, oklch(0.15 0.01 260), var(--bg) 31rem);
  color: var(--ink);
  font-family: var(--body-font);
  line-height: 1.5;
}

button, a { font: inherit; }
a { color: inherit; }

.site-shell { width: min(100%, calc(var(--content-width) + 4rem)); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 3rem); }

.masthead { padding-block: clamp(1.25rem, 3vw, 2.5rem) clamp(3.5rem, 8vw, 7rem); }

.brand-row, .section-heading, .site-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.wordmark {
  color: var(--ink);
  font-family: var(--display-font);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.wordmark::after { content: "/"; color: var(--red-bright); margin-left: 0.13em; }
.environment-label, .section-label, .refresh-note { margin: 0; color: var(--ink-muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.7fr); gap: clamp(2.5rem, 7vw, 8rem); align-items: end; margin-top: clamp(4rem, 11vw, 10rem); }

.hero-copy { max-width: 47rem; }
.hero-copy .section-label { color: var(--red-bright); }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--display-font); text-wrap: balance; }
h1 { max-width: 11ch; margin-bottom: 1.5rem; font-size: clamp(3rem, 7vw, 5.8rem); font-weight: 800; letter-spacing: -0.035em; line-height: 0.94; }
h2 { margin-bottom: 0.4rem; font-size: clamp(1.8rem, 3vw, 2.8rem); letter-spacing: -0.02em; line-height: 1; }
.tagline { max-width: 33rem; margin-bottom: 0; color: var(--ink-muted); font-size: clamp(1.05rem, 1.8vw, 1.25rem); text-wrap: pretty; }

.overall-state { padding: 1.3rem 0 0; border-top: 2px solid var(--red); }
.state-line { display: flex; align-items: center; gap: 0.65rem; margin-top: 0.75rem; }
.state-indicator { width: 0.8rem; height: 0.8rem; flex: 0 0 auto; border-radius: 50%; background: var(--gray); }
.state-indicator--good { background: var(--green); }
.state-indicator--warning { background: var(--amber); }
.state-indicator--critical { background: var(--danger); }
.state-indicator--pending { background: var(--gray); }
.overall-state__title { margin: 0; font-family: var(--display-font); font-size: clamp(1.45rem, 2.1vw, 2rem); font-weight: 800; letter-spacing: -0.015em; line-height: 1; text-wrap: balance; }
.overall-state__detail { max-width: 32ch; margin: 0.8rem 0 0 1.45rem; color: var(--ink-muted); font-size: 0.92rem; text-wrap: pretty; }

.games-section { padding-bottom: clamp(4rem, 8vw, 7rem); }
.section-heading { align-items: end; padding-bottom: 1.75rem; border-bottom: 1px solid var(--line); }
.section-heading p:not(.refresh-note) { margin: 0; color: var(--ink-muted); }
.refresh-note { padding-bottom: 0.3rem; text-align: right; }

.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(1rem, 2vw, 1.6rem); padding-top: 1.6rem; }

.game-card { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.game-card__art { position: relative; min-height: 13rem; overflow: hidden; background: var(--surface-raised); }
.game-card__art::after { position: absolute; inset: 0; content: ""; background: linear-gradient(180deg, transparent 38%, oklch(0.14 0.008 260 / 0.76)); pointer-events: none; }
.game-card__art img { display: block; width: 100%; height: 100%; min-height: 13rem; object-fit: cover; }
.game-card__fallback { display: grid; width: 100%; min-height: 13rem; place-items: end start; padding: 1.25rem; background: linear-gradient(135deg, oklch(0.27 0.055 28), var(--surface-raised) 65%); color: var(--ink); font-family: var(--display-font); font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em; line-height: 0.9; }

.game-card__body { padding: clamp(1.15rem, 2.5vw, 1.55rem); }
.game-card__topline, .players-row, .freshness-row { display: flex; gap: 0.8rem; justify-content: space-between; align-items: baseline; }
.game-card__topline { align-items: start; }
.game-card h3 { max-width: 15ch; margin: 0; font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -0.025em; line-height: 0.94; overflow-wrap: anywhere; }
.lifecycle { display: inline-flex; align-items: center; gap: 0.35rem; flex: 0 0 auto; margin-top: 0.15rem; color: var(--gray); font-size: 0.73rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap; }
.lifecycle::before { width: 0.5rem; height: 0.5rem; content: ""; border-radius: 50%; background: currentColor; }
.lifecycle--online { color: var(--green); }
.lifecycle--starting, .lifecycle--updating { color: var(--amber); }
.lifecycle--offline { color: var(--danger); }
.lifecycle--unknown { color: var(--gray); }
.game-description { min-height: 3rem; margin: 1rem 0 1.5rem; color: var(--ink-muted); font-size: 0.96rem; text-wrap: pretty; }
.card-label { margin: 0; color: var(--ink-muted); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.095em; text-transform: uppercase; }
.players-row { margin-bottom: 0.55rem; }
.players-count { margin: 0; color: var(--ink); font-family: var(--display-font); font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; }
.capacity { width: 100%; height: 0.46rem; overflow: hidden; background: oklch(0.29 0.008 260); border-radius: 99px; }
.capacity__fill { display: block; width: 0; height: 100%; background: var(--red-bright); border-radius: inherit; transition: width 300ms cubic-bezier(0.16, 1, 0.3, 1); }
.players-unavailable { margin: 0; color: var(--ink-muted); font-size: 0.92rem; }
.card-divider { height: 1px; margin-block: 1.45rem 1.2rem; background: var(--line); }
.join-guidance { margin: 0.35rem 0 0; color: var(--ink); font-size: 0.98rem; text-wrap: pretty; overflow-wrap: anywhere; }
.freshness-row { margin-top: 1.3rem; align-items: start; }
.freshness { margin: 0; color: var(--ink-muted); font-size: 0.78rem; }
.freshness--stale { color: var(--amber); }

.notice { grid-column: 1 / -1; margin: 0; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--surface); text-wrap: pretty; }
.notice--error { border-color: oklch(0.49 0.12 28); }
.notice__title { margin-bottom: 0.35rem; font-family: var(--display-font); font-size: 1.45rem; font-weight: 800; }
.notice__detail { margin: 0; color: var(--ink-muted); }

.site-footer { min-height: 5rem; padding-block: 1.25rem; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: 0.82rem; }
.site-footer p { margin: 0; }

a:focus-visible { outline: 3px solid var(--amber); outline-offset: 4px; }

@media (max-width: 700px) {
  .masthead { padding-bottom: 3.5rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 2.6rem; margin-top: 5rem; }
  .overall-state { max-width: 31rem; }
  .section-heading { display: block; }
  .refresh-note { margin-top: 1rem; text-align: left; }
  .game-card__art, .game-card__art img, .game-card__fallback { min-height: 10.5rem; }
  .site-footer { display: block; }
  .site-footer p + p { margin-top: 0.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
