*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #111;
  --border: #222;
  --text: #ddd;
  --muted: #555;
  --dim: #333;
  --blue: #58a6ff;
}

body {
  font-family: 'Courier New', monospace;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  padding: 2rem;
  max-width: 720px;
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}
header span { color: var(--text); font-weight: bold; }
nav { display: flex; gap: 1.4rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--text); }

main { display: flex; flex-direction: column; gap: 2rem; }

.sub { color: var(--muted); }

section h2 {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .8rem;
}

.routes { list-style: none; display: flex; flex-direction: column; gap: .3rem; }
.routes li code { color: var(--blue); }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
td {
  padding: .4rem 0;
  border-bottom: 1px solid var(--dim);
  color: var(--text);
}
td:last-child { color: var(--muted); }

/* ── Search ───────────────────────────────────────────────────────────────────────── */
.search-box {
  display: flex;
  gap: .5rem;
}
.search-box input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: .45rem .7rem;
  outline: none;
  transition: border-color .15s;
}
.search-box input:focus { border-color: var(--muted); }
.search-box button {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  padding: .45rem 1rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.search-box button:hover { color: var(--text); border-color: var(--muted); }

.result-box {
  margin-top: 1rem;
  font-size: 13px;
}
.result-box.loading { color: var(--muted); }
.result-box.not-found { color: var(--muted); }
.result-box.found table { width: 100%; border-collapse: collapse; }
.result-box.found th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .35rem .6rem .35rem 0;
  width: 110px;
  border-bottom: none;
}
.result-box.found td {
  padding: .35rem 0;
  border-bottom: 1px solid var(--dim);
  color: var(--text);
}

body {
  font-family: 'Courier New', monospace;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  padding: 2rem;
  max-width: 1040px;
  margin: 0 auto;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}
header span:first-child { font-weight: bold; color: var(--text); }
.header-sub { color: var(--muted); font-size: 12px; }

/* ── Search bar ──────────────────────────────────────────────────────────── */
main { display: flex; flex-direction: column; gap: 1.4rem; }

.search-bar {
  display: flex;
  gap: .5rem;
}
.search-bar input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: .55rem .8rem;
  outline: none;
  transition: border-color .15s;
}
.search-bar input:focus { border-color: var(--muted); }
.search-bar button {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  padding: .55rem 1.2rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.search-bar button:hover:not(:disabled) { color: var(--text); border-color: var(--muted); }
.search-bar button:disabled { opacity: .4; cursor: default; }

/* ── Filter notice ───────────────────────────────────────────────────────── */
.filter-notice {
  font-size: 12px;
  color: var(--red);
  letter-spacing: .03em;
}

/* ── Game grid ───────────────────────────────────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 720px) { .game-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .game-grid { grid-template-columns: 1fr; } }

/* ── Game card ───────────────────────────────────────────────────────────── */
.game-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s;
  overflow: hidden;
}
.game-card:hover { border-color: var(--muted); }

.game-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--dim);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.game-thumb.no-thumb {
  font-size: 2rem;
  color: var(--muted);
}

.game-info {
  padding: .6rem .75rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.game-name {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: bold;
}
.game-meta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Load more ───────────────────────────────────────────────────────────── */
.more-wrap { display: flex; }
.more-wrap button {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  padding: .5rem 1.4rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.more-wrap button:hover:not(:disabled) { color: var(--text); border-color: var(--muted); }
.more-wrap button:disabled { opacity: .4; cursor: default; }

/* ── Status line ─────────────────────────────────────────────────────────── */
.status-line { font-size: 12px; color: var(--muted); min-height: 1.4em; }
