:root {
  --bg: #0b0b0b;
  --text: #f5f5f5;
  --muted: #8d8d8d;
  --dim: #6e6e6e;
  --line: #2a2a2a;
  --chip: #1c1c1c;
  --chip-text: #d8d8d8;
  --border: #3a3a3a;
  --search-bg: #141414;
  --accent: #d4af4a;
  --accent-dim: #9a7d2e;
  --max: 46rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

#app {
  flex: 1 0 auto;
}

.wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
}

.boot,
.empty {
  width: min(var(--max), calc(100% - 2rem));
  margin: 3rem auto;
  color: var(--muted);
  font-size: 1.05rem;
}

.home-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 1.4rem 0 0.85rem;
}

.brand {
  margin: 0;
  font-size: clamp(2.1rem, 8vw, 3.35rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 0.95;
  text-transform: none;
}

.sub {
  margin: 0.45rem 0 0;
  font-size: clamp(1.05rem, 3.4vw, 1.35rem);
  font-weight: 400;
  color: var(--text);
}

.search {
  display: block;
  width: 100%;
  margin-top: 1.35rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--search-bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  outline: none;
}

.search::placeholder {
  color: #7a7a7a;
}

.search:focus {
  border-color: #6a6a6a;
}

.count-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.7rem 0 0;
}

.count {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.text-btn {
  appearance: none;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  padding: 0;
  cursor: pointer;
}

.text-btn:hover:not(:disabled) {
  color: var(--text);
  text-decoration: underline;
}

.text-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.text-btn[aria-pressed="true"] {
  color: var(--accent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.35rem 0 1.4rem;
}

.chip {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--chip);
  color: var(--chip-text);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1;
  padding: 0.48rem 0.78rem;
  cursor: pointer;
}

.chip:hover {
  background: #262626;
}

.chip.is-on {
  background: #ececec;
  color: #111;
}

.list {
  border-top: 1px solid var(--line);
}

.game-row {
  display: block;
  padding: 1.15rem 0 1.05rem;
  border-bottom: 1px solid var(--line);
  content-visibility: auto;
  contain-intrinsic-size: 0 4.6rem;
}

.game-row:hover {
  text-decoration: none;
}

.game-row:hover .game-title {
  text-decoration: underline;
}

.game-title {
  display: block;
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.2;
}

.game-tags {
  display: block;
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.detail {
  padding: 1.25rem 0 3rem;
}

.back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.detail-title {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.1rem);
  font-weight: 800;
  line-height: 1.05;
}

.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0 1.35rem;
}

.detail-chip {
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  padding: 0.28rem 0.62rem;
  font-size: 0.92rem;
  color: #f0f0f0;
}

.category {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
  margin: 0 0 1.35rem;
}

.article .attribution {
  margin: 0 0 1.2rem;
  padding: 0.1rem 0 0.1rem 0.9rem;
  border-left: 4px solid var(--accent);
  color: var(--text);
}

.article .attribution a,
.source-link,
.article a {
  color: var(--accent);
}

.article figure {
  margin: 0 0 1.4rem;
}

.article img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  background: #111;
}

.article p,
.article ul {
  margin: 0 0 1rem;
}

.article ul {
  padding-left: 1.15rem;
}

.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.6rem 0;
}

.role h2 {
  margin: 0 0 1.05rem;
  font-size: 1.35rem;
  letter-spacing: 0.03em;
}

.field {
  margin: 0 0 1rem;
}

.field h3 {
  margin: 0 0 0.2rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.field p {
  margin: 0;
}

.sources-lead {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.sources-lead a {
  color: var(--accent);
}

.sources-list {
  margin-top: 1.6rem;
}

.source-row {
  display: block;
  padding: 1.15rem 0 1.05rem;
  border-bottom: 1px solid var(--line);
}

.source-row:hover {
  text-decoration: none;
}

.source-row:hover .game-title {
  text-decoration: underline;
}

.site-foot {
  border-top: 1px solid var(--line);
  padding: 1.3rem 0 2.4rem;
  color: var(--dim);
  font-size: 0.82rem;
  line-height: 1.5;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
}

.site-foot a {
  color: var(--muted);
}

.foot-nav a[aria-current="page"] {
  color: var(--text);
}

.foot-local {
  margin: 0.85rem 0 0;
}

.foot-local a {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.train-block {
  margin: 2rem 0 0;
}

.train-block h2 {
  margin: 0 0 0.55rem;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}

.train-block a,
.train-cta {
  color: var(--accent);
}

.train-cta {
  font-weight: 700;
}

.train-note {
  color: var(--muted);
}

@media (min-width: 720px) {
  .home-head {
    padding-top: 2rem;
  }

  .game-title {
    font-size: 1.35rem;
  }
}

@media print {
  body {
    display: block;
    background: #fff;
    color: #111;
  }

  .site-foot,
  .game-actions,
  .back,
  .home-head,
  .chips,
  .search,
  .count-row {
    display: none !important;
  }

  .detail-title,
  .game-title,
  .article,
  .field p {
    color: #111;
  }

  .field h3,
  .article a {
    color: #333;
  }

  .article img {
    break-inside: avoid;
  }
}
