:root {
  --bg: #e8eef2;
  --ink: #14212b;
  --muted: #5a6b78;
  --line: #c5d0d8;
  --panel: #f7fafc;
  --good: #0f6a4b;
  --good-bg: #ddf3ea;
  --bad: #a33b2d;
  --bad-bg: #f7e6e2;
  --accent: #155e8a;
  --shadow: 0 8px 24px rgba(20, 33, 43, 0.06);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(21, 94, 138, 0.07), transparent 40%),
    linear-gradient(180deg, #dfe7ed 0%, var(--bg) 45%, #d7e1e8 100%);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.top {
  padding: 1.4rem 1.5rem 0.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.top-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.brand {
  font-family: "IBM Plex Mono", "SF Mono", ui-monospace, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}
.tag { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.92rem; }

.devs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
  align-items: center;
}
.dev-item {
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.dev-chip {
  display: inline-block;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.86rem;
  text-decoration: none;
  border-radius: 2px;
}
.dev-chip small {
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  margin-left: 0.2rem;
}
.dev-chip:hover { border-color: #9eb0bd; text-decoration: none; }
.dev-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #f4f8fb;
}
.dev-chip.is-active small { color: #c5d0d8; }
.dev-del { display: inline; margin: 0; }
.dev-del button {
  border: 1px solid var(--line);
  border-left: 0;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  padding: 0.28rem 0.45rem;
  font-size: 0.95rem;
  line-height: 1;
  border-radius: 0 2px 2px 0;
}
.dev-del button:hover { color: var(--bad); border-color: #d9a8a0; }
.dev-item .dev-chip { border-radius: 2px 0 0 2px; }

.dev-add {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.65rem;
  max-width: 720px;
}
.dev-add input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 0.9rem;
}
.dev-add button {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.dev-add button:disabled { opacity: 0.65; cursor: wait; }

.flash {
  margin: 0.55rem 0 0;
  font-size: 0.9rem;
}
.flash.ok { color: var(--good); }
.flash.err { color: var(--bad); }

.dev-tag {
  color: var(--accent);
  font-weight: 600;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 3rem;
}

.hero h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1.1;
  margin: 0.4rem 0 0.5rem;
  letter-spacing: -0.02em;
}
.lead { font-size: 1.05rem; margin: 0; }
.sync-stat {
  margin: 0.55rem 0 0;
  font-size: 0.95rem;
  color: var(--ink);
}
.sync-stat strong {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.note, .meta, .back { color: var(--muted); font-size: 0.9rem; }
.back { margin: 1rem 0 0; }

.controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.1rem;
  margin-top: 0.65rem;
}
.control-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.control-label {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}
.control-select,
.filter-select {
  padding: 0.22rem 0.45rem;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 0.82rem;
  border-radius: 2px;
  max-width: 100%;
}
.control-select { min-width: 8.5rem; }

.game-list { margin-top: 1.5rem; display: grid; gap: 0.65rem; }
.game-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.95rem 1.05rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease;
}
.game-row:hover {
  transform: translateY(-1px);
  border-color: #9eb0bd;
  text-decoration: none;
}
.game-row h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}
.game-side { text-align: right; display: grid; gap: 0.35rem; justify-items: end; }
.pill {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.82rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.signal { font-size: 0.86rem; font-weight: 650; }
.signal.good { color: var(--good); }
.signal.bad { color: var(--bad); }
.fresh {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.fresh-n {
  font-weight: 700;
}

.charts { margin-top: 1.1rem; }
.chart-note { margin: 0 0 0.75rem; font-size: 0.82rem; }
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.chart-box h3 {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.chart {
  width: 100%;
  height: 72px;
  background: rgba(20, 33, 43, 0.03);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.history-table { margin-top: 0.85rem; font-size: 0.88rem; }
.history-table summary { cursor: pointer; color: var(--muted); }
.history-table table {
  width: 100%;
  margin-top: 0.5rem;
  border-collapse: collapse;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
}
.history-table th,
.history-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
@media (max-width: 800px) {
  .chart-grid { grid-template-columns: 1fr; }
}

.panel {
  margin-top: 1.1rem;
  padding: 1.05rem 1.15rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 0.7rem; font-size: 1.15rem; }
.panel h3 {
  margin: 1rem 0 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.panel.good { background: linear-gradient(180deg, var(--good-bg), var(--panel) 52%); }
.panel.bad { background: linear-gradient(180deg, var(--bad-bg), var(--panel) 52%); }
.overview p { font-size: 1.02rem; line-height: 1.5; margin: 0; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 800px) {
  .grid-2 { grid-template-columns: 1fr; }
  .game-row { flex-direction: column; align-items: start; }
  .game-side { justify-items: start; text-align: left; }
}

.theme-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; }
.theme-list.compact { gap: 0.55rem; }
.theme-title { font-weight: 700; }
.count {
  display: inline-block;
  margin-left: 0.25rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.theme-list p { margin: 0.25rem 0 0; color: var(--muted); }
blockquote {
  margin: 0.4rem 0 0;
  padding: 0.45rem 0.7rem;
  border-left: 3px solid var(--line);
  color: var(--ink);
  background: rgba(255,255,255,0.65);
  font-size: 0.9rem;
}

.reviews { display: grid; gap: 0.7rem; }
.review {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 2px;
}
.review header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.stars { letter-spacing: 0.04em; color: #8a6a12; }
.review.rating-1, .review.rating-2 { border-left: 4px solid var(--bad); }
.review.rating-4, .review.rating-5 { border-left: 4px solid var(--good); }
.review.rating-3 { border-left: 4px solid #b0892c; }
.empty { color: var(--muted); }
code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  background: rgba(20, 33, 43, 0.06);
  padding: 0.1rem 0.35rem;
}
