:root {
  color-scheme: dark;
  --bg: #07080d;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f5f7ff;
  --muted: #a6adbf;
  --cyan: #54d7ff;
  --lime: #9dff7a;
  --pink: #ff6ac8;
  --gold: #ffd66e;
  --shadow: rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(84, 215, 255, 0.18), transparent 34rem),
    radial-gradient(circle at 82% 6%, rgba(255, 106, 200, 0.14), transparent 28rem),
    linear-gradient(145deg, #05060a 0%, #10131d 52%, #080a10 100%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
}

button,
input,
code {
  font: inherit;
}

#pixel-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.2;
}

.screen-lines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 5px
  );
}

.site-header,
main,
footer {
  position: relative;
  z-index: 2;
}

.site-header {
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1rem, 4vw, 3rem) 1.5rem;
  border-bottom: 1px solid var(--line);
}

.header-inner,
.stats,
main,
footer {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-block {
  max-width: 760px;
}

.kicker,
.search-box span,
.stats dt,
.group-date,
.genre,
.status,
.launch,
footer,
.empty-code {
  font-family: Consolas, "Courier New", monospace;
}

.kicker {
  display: block;
  margin-bottom: 0.65rem;
  color: var(--lime);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 6.4rem);
  line-height: 0.9;
}

.brand-block p {
  max-width: 38rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.back-link,
.chip,
.game-card {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  color: var(--text);
  text-decoration: none;
  background: var(--panel);
  white-space: nowrap;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
}

.stats div {
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stats dt {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}

.stats dd {
  margin: 0.3rem 0 0;
  color: var(--cyan);
  font-size: 2rem;
  font-weight: 800;
}

main {
  padding: 1.5rem 0 3rem;
}

.controls {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 2.25rem;
}

.search-box {
  display: grid;
  gap: 0.5rem;
}

.search-box span {
  color: var(--cyan);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
}

.search-box input {
  width: 100%;
  min-height: 3.2rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.32);
}

.search-box input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(84, 215, 255, 0.14);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.chip {
  min-height: 2.5rem;
  padding: 0 0.8rem;
  color: var(--muted);
  background: var(--panel);
  cursor: pointer;
}

.chip.is-active,
.chip:hover {
  color: #081014;
  border-color: transparent;
  background: var(--lime);
}

.shelf {
  display: grid;
  gap: 2rem;
}

.game-group.is-hidden,
.game-card.is-hidden,
.empty-state {
  display: none;
}

.group-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.group-date {
  color: var(--gold);
  letter-spacing: 0.18em;
}

.group-line {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--line), transparent);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 0.9rem;
}

.game-card {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: 1rem;
  min-height: 9.5rem;
  padding: 0.85rem;
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
  box-shadow: 0 1rem 2.5rem var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--cyan);
  background: linear-gradient(145deg, rgba(84, 215, 255, 0.14), rgba(255, 255, 255, 0.05));
}

.cover {
  display: grid;
  place-items: center;
  min-height: 7.8rem;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(84, 215, 255, 0.52), rgba(255, 106, 200, 0.2)),
    linear-gradient(45deg, transparent 46%, rgba(255, 255, 255, 0.28) 47%, rgba(255, 255, 255, 0.28) 53%, transparent 54%);
}

.cover-icon {
  width: 2.7rem;
  aspect-ratio: 1;
  border: 0.45rem solid rgba(8, 16, 20, 0.78);
  border-radius: 50%;
  box-shadow:
    1.15rem 0 0 -0.2rem rgba(8, 16, 20, 0.72),
    -1.15rem 0 0 -0.2rem rgba(8, 16, 20, 0.72);
}

.card-body {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  min-width: 0;
}

.card-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.genre,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
}

.genre {
  color: #061014;
  background: var(--cyan);
}

.status {
  color: var(--lime);
  border: 1px solid rgba(157, 255, 122, 0.4);
}

.title {
  font-size: 1.28rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.description,
.meta {
  color: var(--muted);
}

.description {
  line-height: 1.5;
}

.meta {
  font-size: 0.9rem;
}

.launch {
  align-self: end;
  color: var(--pink);
  letter-spacing: 0.14em;
  writing-mode: vertical-rl;
}

.empty-state.is-visible {
  display: block;
  padding: 2rem;
  margin: 1rem 0 2rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
}

.empty-code {
  margin: 0 0 0.5rem;
  color: var(--pink);
}

code {
  padding: 0.1rem 0.28rem;
  border-radius: 4px;
  color: var(--lime);
  background: rgba(157, 255, 122, 0.09);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

@media (max-width: 760px) {
  .header-inner,
  .controls,
  footer {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .header-inner {
    display: grid;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .filter-row {
    justify-content: flex-start;
  }

  .game-card {
    grid-template-columns: 4.75rem 1fr;
  }

  .launch {
    grid-column: 1 / -1;
    justify-self: end;
    writing-mode: horizontal-tb;
  }
}
