:root {
  --bar-h: 52px;
  --bg: #090a0c;
  --panel: #121418;
  --panel-2: #191c21;
  --text: #f5f6f8;
  --muted: #8f959f;
  --line: rgba(255, 255, 255, .1);
  --brand: #0026ff;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f4f1;
  --panel: #fff;
  --panel-2: #ecece8;
  --text: #111318;
  --muted: #6d737b;
  --line: rgba(17, 19, 24, .11);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(880px 430px at 0 -190px, rgba(0, 38, 255, .2), transparent 68%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }

.catalogue {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: calc(var(--bar-h) + 31px) 0 54px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 22px;
  margin: 0 0 25px;
}

.eyebrow {
  margin: 0 0 7px;
  color: #6f89ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  font-weight: 790;
  letter-spacing: -.06em;
  line-height: .98;
}

.intro-copy {
  max-width: 525px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.count b { color: var(--text); }

.tools {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 17px;
}

.search {
  position: relative;
  flex: 1;
}

.search svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 16px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 43px;
  padding: 0 15px 0 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
}

.search input:focus { border-color: rgba(0, 38, 255, .72); box-shadow: 0 0 0 3px rgba(0, 38, 255, .12); }

.filters { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }

.filter {
  height: 39px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  cursor: pointer;
  white-space: nowrap;
}

.filter:hover { color: var(--text); background: var(--panel); }
.filter.active { color: var(--text); background: var(--panel-2); }

.games {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.game-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 78px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  color: var(--text);
  text-decoration: none;
  transition: border-color .18s, background .18s, transform .18s;
}

.game-card:hover {
  z-index: 1;
  transform: translateY(-2px);
  border-color: rgba(65, 92, 255, .54);
  background: var(--panel-2);
}

.game-card img {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  object-fit: cover;
}

.game-card strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 740;
  letter-spacing: -.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-card small {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.game-card svg {
  width: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
}

.empty {
  grid-column: 1 / -1;
  padding: 50px 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 980px) { .games { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@media (max-width: 720px) {
  .catalogue { width: min(100% - 22px, 600px); padding-top: calc(var(--bar-h) + 24px); }
  .intro { grid-template-columns: 1fr; gap: 9px; }
  .count { display: none; }
  .tools { align-items: stretch; flex-direction: column; }
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-card { grid-template-columns: 38px minmax(0, 1fr); min-height: 72px; }
  .game-card img { width: 38px; height: 38px; }
  .game-card > svg { display: none; }
}

@media (max-width: 420px) {
  .games { grid-template-columns: 1fr; }
  .game-card { min-height: 66px; }
  .intro-copy { font-size: 12px; }
}
