:root {
  --ink: #07100b;
  --shell: #0b1510;
  --panel: #122119;
  --panel-raised: #1c3123;
  --line: #385038;
  --screen: #d7e7c5;
  --screen-mid: #8fae72;
  --screen-dark: #385b38;
  --screen-ink: #102d1b;
  --text: #edf5df;
  --muted: #91a58d;
  --signal: #b8d95f;
  --gutter: clamp(1rem, 4vw, 4rem);
  --mono: "DejaVu Sans Mono", "Liberation Mono", monospace;
  font-family: var(--mono);
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background:
    linear-gradient(rgb(184 217 95 / 3%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(184 217 95 / 3%) 1px, transparent 1px),
    var(--ink);
  background-size: 24px 24px;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 70% 25%, rgb(143 174 114 / 8%), transparent 38%);
}

a, button { font: inherit; }

a:focus-visible, button:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }

.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: rgb(7 16 11 / 86%);
}

.brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  color: var(--text);
  text-decoration: none;
}

.brand img { image-rendering: pixelated; }
.brand span { display: grid; gap: .18rem; }
.brand strong { font-size: 1rem; letter-spacing: .12em; }
.brand small { color: var(--muted); font-size: .57rem; letter-spacing: .08em; }

.site-status, .runtime-status {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--muted);
  font-size: .65rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.site-status i, .runtime-status i {
  width: 8px;
  height: 8px;
  background: var(--screen-mid);
  box-shadow: 0 0 12px rgb(184 217 95 / 45%);
}

.catalog-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  width: min(1500px, calc(100% - var(--gutter) * 2));
  height: calc(100vh - 64px - var(--gutter) * 1.5);
  min-height: 520px;
  margin: calc(var(--gutter) * .75) auto;
  border: 1px solid var(--line);
  background: var(--shell);
  box-shadow: 18px 18px 0 rgb(0 0 0 / 24%);
}

.game-index {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #0d1912;
}

.game-index > header { padding: 2rem; border-bottom: 1px solid var(--line); }
.game-index > header p, .eyebrow { margin: 0 0 .45rem; color: var(--signal); font-size: .62rem; letter-spacing: .16em; }
.game-index h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); line-height: .85; letter-spacing: -.08em; }
.game-list { min-height: 14rem; }
.game-list { overflow-y: auto; }

.game-row {
  display: grid;
  width: 100%;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.35rem;
  color: var(--muted);
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.game-row:hover { color: var(--text); background: var(--panel); }
.game-row[aria-selected="true"] { color: var(--screen-ink); background: var(--screen-mid); }
.game-row__number { font-size: .65rem; opacity: .7; }
.game-row__text { display: grid; gap: .32rem; }
.game-row__text strong { color: inherit; font-size: .9rem; text-transform: uppercase; }
.game-row__text small { font-size: .56rem; line-height: 1.4; text-transform: uppercase; }
.game-row__arrow { font-size: 1.7rem; line-height: 1; }

.game-index > footer {
  display: grid;
  gap: .7rem;
  padding: 1.25rem 1.35rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: .6rem;
  line-height: 1.5;
}

.game-index > footer a { color: var(--text); text-underline-offset: .25rem; }

.game-detail {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(360px, 58%) minmax(300px, 1fr);
}

.game-detail__media {
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #07100b;
}

.game-detail__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.game-detail__body {
  display: flex;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.4rem, 2.4vw, 2.6rem);
}
.game-detail h2 { margin: 0; font-size: clamp(2.4rem, 4.5vw, 5rem); line-height: .86; letter-spacing: -.09em; text-transform: uppercase; }
.description { max-width: 46rem; margin: 1rem 0; color: #c4d0bd; font-family: sans-serif; font-size: clamp(.84rem, 1.1vw, 1rem); line-height: 1.55; }

.feature-list {
  display: grid;
  gap: .55rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: .7rem;
}

.feature-list li::before { content: "■"; margin-right: .75rem; color: var(--screen-mid); }
.runtime-status { margin: 1rem 0; }
.runtime-status--ready { color: var(--signal); }

.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.button {
  display: inline-grid;
  min-height: 46px;
  padding: 0 1.15rem;
  place-items: center;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
}

.button:hover { border-color: var(--screen-mid); background: var(--panel-raised); }
.button--primary { color: var(--screen-ink); border-color: var(--screen); background: var(--screen); }
.button--primary:hover { color: var(--screen); background: var(--screen-dark); }

.loading-panel { display: grid; min-height: 50vh; place-items: center; color: var(--muted); }
.loading-panel--error { color: #e9ae8e; }
.loading-panel small { color: var(--muted); }

@media (max-width: 760px) {
  body { height: auto; min-height: 100%; overflow: auto; }
  .site-header { height: 66px; }
  .brand small { display: none; }
  .catalog-shell { grid-template-columns: 1fr; width: calc(100% - 1.25rem); height: auto; min-height: 0; margin: .6rem auto; }
  .game-index { border-right: 0; border-bottom: 1px solid var(--line); }
  .game-index > header { padding: 1.25rem; }
  .game-index h1 { font-size: 2rem; }
  .game-list { min-height: auto; }
  .game-index > footer { display: none; }
  .game-detail { grid-template-columns: 1fr; grid-template-rows: minmax(220px, 40vh) auto; }
  .game-detail__media { border-right: 0; border-bottom: 1px solid var(--line); }
  .game-detail__body { padding: 1.4rem; }
}
