:root {
  --bg: #0a0c14;
  --panel: rgba(16, 20, 32, 0.92);
  --panel-strong: rgba(20, 24, 38, 0.98);
  --line: #84f4b1;
  --line-soft: rgba(132, 244, 177, 0.35);
  --text: #f3f6ff;
  --muted: #9eb0c9;
  --danger: #ff5f7d;
  --warning: #ffb347;
  --lime: #b8ff72;
  --green: #53ff8f;
  --ghost: #90a0b8;
  --accent: #7dd3fc;
  --shadow: 0 0 0 2px rgba(6, 10, 20, 0.95), 0 0 0 6px rgba(68, 98, 140, 0.28), 0 18px 36px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top, rgba(67, 84, 140, 0.28), transparent 32%),
    linear-gradient(180deg, #101524 0%, #090b12 56%, #06070b 100%);
  color: var(--text);
  font-family: "VT323", monospace;
  letter-spacing: 0.02em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 50%, rgba(0, 0, 0, 0.08) 50%);
  background-size: 100% 6px;
  opacity: 0.12;
  mix-blend-mode: screen;
}

.page-shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 40px;
}

.page-shell__noise {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.06) 0.8px, transparent 0.8px);
  background-size: 12px 12px;
  opacity: 0.09;
  pointer-events: none;
}

.hero {
  position: relative;
  margin-bottom: 28px;
  padding: 28px;
  border: 4px solid rgba(132, 244, 177, 0.52);
  background: linear-gradient(180deg, rgba(17, 22, 36, 0.96), rgba(9, 12, 20, 0.96));
  box-shadow: var(--shadow);
}

.hero__title,
.catalog-switch__button,
.catalog-section-title,
.stat-card__value,
.game-card__title,
.game-card__rating-value,
.chip,
.site-footer {
  font-family: "Press Start 2P", monospace;
}

.hero__updated {
  position: absolute;
  top: 20px;
  right: 24px;
  color: rgba(243, 246, 255, 0.78);
  font-size: 18px;
  line-height: 1;
  text-align: right;
}

.hero__title {
  margin: 0 0 14px;
  font-size: clamp(26px, 5vw, 46px);
  line-height: 1.2;
  color: #f4fffa;
  text-shadow: 0 0 18px rgba(124, 255, 180, 0.24);
}

.hero__lede {
  max-width: 900px;
  margin: 0;
  font-size: 28px;
  color: var(--muted);
  line-height: 1.12;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.stat-card {
  padding: 14px 16px;
  border: 3px solid rgba(132, 244, 177, 0.3);
  background: rgba(8, 11, 20, 0.84);
}

.stat-card__value {
  display: block;
  margin-bottom: 8px;
  color: var(--line);
  font-size: 19px;
}

.stat-card__label {
  display: block;
  color: var(--muted);
  font-size: 22px;
}

.catalog-toolbar {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.catalog-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  width: fit-content;
  padding: 12px;
  border: 3px solid rgba(132, 244, 177, 0.24);
  background: rgba(9, 12, 20, 0.8);
  box-shadow: var(--shadow);
  align-self: auto;
  order: 1;
}

.catalog-switch__button {
  min-width: 150px;
  padding: 12px 16px;
  border: 3px solid rgba(132, 244, 177, 0.28);
  background: rgba(7, 9, 16, 0.86);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.catalog-switch__button:hover:not(:disabled),
.catalog-switch__button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(132, 244, 177, 0.5);
  color: #f4fffa;
  outline: none;
}

.catalog-switch__button.is-active {
  border-color: rgba(132, 244, 177, 0.84);
  color: #081017;
  background: linear-gradient(180deg, #8cf8bb, #52d9a5);
  box-shadow: 0 0 0 2px rgba(9, 16, 27, 0.8);
}

.catalog-switch__button:disabled {
  opacity: 0.42;
  cursor: default;
}

.catalog-section-title {
  margin: 0;
  width: auto;
  max-width: min(100%, 520px);
  color: #f4fffa;
  font-size: 14px;
  line-height: 1.45;
  text-transform: uppercase;
  text-align: right;
  align-self: auto;
  margin-left: auto;
  order: 2;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.catalog-empty {
  grid-column: 1 / -1;
  padding: 28px 24px;
  border: 4px solid rgba(132, 244, 177, 0.22);
  background: rgba(8, 11, 20, 0.84);
  color: var(--muted);
  font-size: 28px;
  line-height: 1.1;
  box-shadow: var(--shadow);
}

.game-card {
  display: grid;
  grid-template-columns: 144px 1fr;
  gap: 18px;
  min-height: 196px;
  padding: 18px;
  border: 4px solid rgba(132, 244, 177, 0.28);
  background: linear-gradient(180deg, rgba(15, 19, 31, 0.95), rgba(8, 10, 18, 0.98));
  box-shadow: var(--shadow);
}

.game-card__media {
  display: flex;
  align-items: stretch;
}

.game-card__image {
  width: 100%;
  height: 160px;
  border: 3px solid rgba(132, 244, 177, 0.3);
  object-fit: cover;
  image-rendering: pixelated;
  background: #07090f;
}

.game-card__image--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, hsl(var(--hue-a) 70% 58%), hsl(var(--hue-b) 70% 54%)),
    linear-gradient(0deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.22));
  color: rgba(255, 255, 255, 0.94);
  font-family: "Press Start 2P", monospace;
  font-size: 24px;
  letter-spacing: 0.08em;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.28);
}

.game-card__body {
  display: flex;
  flex-direction: column;
}

.game-card__header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-card__title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  color: #fbfffe;
}

.game-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  font-size: 9px;
  line-height: 1.35;
  text-transform: uppercase;
  border: 2px solid currentColor;
}

.chip--success { color: var(--green); }
.chip--danger { color: var(--danger); }
.chip--warning { color: var(--warning); }
.chip--ghost { color: var(--ghost); }
.chip--accent { color: var(--accent); }
.chip--info { color: #ffd36d; }

.game-card__comment {
  margin: 12px 0 0;
  color: #cfdaef;
  font-size: 26px;
  line-height: 1.08;
  flex: 1 1 auto;
}

.game-card__rating {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 3px solid currentColor;
  background: rgba(4, 6, 12, 0.74);
}

.game-card__rating-label {
  color: var(--muted);
  font-size: 21px;
}

.game-card__rating-value {
  font-size: 14px;
}

.game-card__rating--muted { color: #7a8297; }
.game-card__rating--orange { color: var(--warning); }
.game-card__rating--lime { color: var(--lime); }
.game-card__rating--green { color: var(--green); }

.site-footer {
  margin-top: 40px;
  color: rgba(243, 246, 255, 0.2);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
}

@media (max-width: 920px) {
  .hero__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .hero {
    padding: 52px 20px 20px;
  }

  .hero__updated {
    top: 18px;
    right: 20px;
    font-size: 14px;
  }

  .hero__title {
    font-size: 28px;
  }

  .hero__lede {
    font-size: 23px;
  }

  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .catalog-switch {
    order: 1;
    width: 100%;
    align-self: flex-start;
  }

  .catalog-switch__button {
    flex: 1 1 140px;
    min-width: 0;
  }

  .catalog-section-title {
    order: 2;
    font-size: 12px;
    width: 100%;
    max-width: 100%;
    align-self: flex-end;
  }

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

  .game-card__media {
    max-width: 180px;
  }
}
