* {
  box-sizing: border-box;
}

:root {
  --bg: #080d17;
  --surface: #101827;
  --surface-2: #151f31;
  --border: #22304a;
  --text: #edf3fb;
  --muted: #91a0b8;
  --accent: #6d8cff;
  --green: #2bd576;
  --max: 1180px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

button,
input,
select {
  font: inherit;
}

.container {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8, 13, 23, .88);
  border-bottom: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(14px);
}

.nav-wrap {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #7b94ff, #405fd8);
  font-weight: 900;
  font-size: 21px;
}

.brand strong {
  display: block;
  letter-spacing: .08em;
  font-size: 15px;
}

.brand-logo { background: none; border-radius: 0; object-fit: contain; flex-shrink: 0; }

.catalog-filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin: 24px 0 0; }
.catalog-filters label { display: grid; gap: 8px; flex: 1 1 170px; color: var(--muted); font-size: 13px; }
.catalog-filters select, .catalog-filters button { min-height: 46px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); max-width: 100%; }
.catalog-filters button { cursor: pointer; }
.catalog-filters button:hover { border-color: var(--accent); }
.catalog-filters select:focus-visible, .catalog-filters button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.filter-panel { padding: 26px; margin: 24px 0; border: 1px solid #2b3854; border-radius: 22px; background: linear-gradient(145deg, #131e32, #0d1422 75%); box-shadow: 0 16px 50px rgba(0,0,0,.15); }
.filter-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.filter-source { border: 1px solid #32486a; border-radius: 999px; padding: 7px 12px; color: #b6c9ed; font-size: 11px; letter-spacing: .03em; }
.footer-discover { display: flex; flex-wrap: wrap; gap: 14px 24px; margin-bottom: 24px; color: var(--muted); font-size: 13px; }
.footer-discover a:hover { color: var(--text); }
.filter-panel .browse-filters { gap: 9px; }
.filter-panel .category-chip, .filter-panel .filter-chip { border-radius: 999px; padding: 10px 16px; background: rgba(8,13,23,.45); transition: background .2s, border-color .2s; }
.filter-panel .category-chip.active, .filter-panel .filter-chip.active { background: #334773; border-color: #829bff; color: #fff; }
.filter-panel .catalog-filters select { appearance: none; width: 100%; padding: 14px 38px 14px 16px; background: #111d31; border-color: #34445f; border-radius: 12px; cursor: pointer; }
.filter-panel .catalog-filters label { position: relative; color: #b5c4dd; letter-spacing: .015em; }
.filter-panel .catalog-filters label::after { content: "⌄"; position: absolute; right: 16px; bottom: 14px; color: #a4baff; pointer-events: none; }
.filter-panel #resetFilters { background: transparent; color: #b6c5df; border-color: transparent; font-size: 13px; padding-inline: 10px; }
.filter-panel #resetFilters:hover { color: #fff; background: #1c2c46; }
@media (max-width: 600px) {
  .filter-panel { padding: 18px; border-radius: 18px; }
  .catalog-filters label { flex-basis: 100%; }
  .filter-panel .category-chip, .filter-panel .filter-chip { font-size: 12px; padding: 9px 12px; }
  .filter-source { font-size: 10px; }
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: .12em;
  margin-top: 2px;
}

.nav {
  display: flex;
  gap: 28px;
  color: #aebbd0;
  font-size: 14px;
}

.nav a:hover {
  color: white;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 96px 0 52px;
  background:
    radial-gradient(circle at 50% 0%, rgba(88, 116, 255, .17), transparent 38%),
    var(--bg);
  text-align: center;
}

.hero-spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(320px, 50vw, 440px);
  height: auto;
  transform: translate(-50%, -50%);
  opacity: .16;
  pointer-events: none;
  user-select: none;
  z-index: -1;
}

.spark-piece {
  transform-box: fill-box;
  transform-origin: center;
  animation: spark-assemble 1.1s cubic-bezier(.16, 1, .3, 1) both;
}

.spark-core { --spark-x: 0px; --spark-y: -55px; animation-delay: .08s; }
.spark-diamond { --spark-x: -55px; --spark-y: 60px; animation-delay: .18s; }
.spark-right { --spark-x: 65px; --spark-y: 30px; animation-delay: .32s; }
.spark-left { --spark-x: -65px; --spark-y: -20px; animation-delay: .42s; }
.spark-top { --spark-x: 45px; --spark-y: -60px; animation-delay: .52s; }

@keyframes spark-assemble {
  from {
    opacity: 0;
    transform: translate(var(--spark-x), var(--spark-y)) rotate(-12deg) scale(.6);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spark-piece { animation: none; }
}

.hero-inner {
  max-width: 850px;
}

.eyebrow {
  color: #8299ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}

h1 {
  margin: 15px 0 18px;
  font-size: clamp(38px, 6vw, 66px);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.hero p {
  max-width: 670px;
  margin: 0 auto 34px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 16px;
}

.search-box {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  height: 60px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
}

.search-box span {
  color: #8091ad;
  font-size: 27px;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: white;
  font-size: 16px;
}

.quick-filters {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
}

.filter-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: #aebbd0;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: #6077e9;
  color: white;
  background: #17213a;
}

.content {
  padding: 45px 0 80px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 24px;
}

h2 {
  margin: 7px 0 0;
  font-size: 28px;
  letter-spacing: -.025em;
}

.sort-label {
  color: var(--muted);
  font-size: 13px;
}

.sort-label select {
  margin-left: 8px;
  padding: 9px 12px;
  background: var(--surface);
  color: white;
  border: 1px solid var(--border);
  border-radius: 9px;
}

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

.game-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: transform .2s ease, border-color .2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: #4b62b5;
}

.game-image {
  width: 100%;
  aspect-ratio: 460 / 215;
  object-fit: cover;
  display: block;
  background: #182236;
}

.game-info {
  padding: 15px;
}

.game-title {
  margin: 0 0 7px;
  font-size: 16px;
}

.meta {
  color: var(--muted);
  font-size: 12px;
}

.price-row {
  margin-top: 15px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.price {
  font-size: 21px;
  font-weight: 800;
}

.old-price {
  color: #6d7b91;
  text-decoration: line-through;
  font-size: 12px;
  margin-left: 5px;
}

.discount {
  color: #08150e;
  background: var(--green);
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
}

.rating {
  margin-top: 10px;
  color: #80dca8;
  font-size: 12px;
}

.merchant {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  color: #aab8cc;
  font-size: 12px;
}

.deal-button {
  display: block;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.deal-button:hover {
  background: #5977eb;
}

.deal-button:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}

.releases { padding: 24px 0 46px; scroll-margin-top: 100px; }
.releases .section-head { margin-bottom: 12px; }
.section-description { color: var(--muted); line-height: 1.65; max-width: 800px; }
.section-link { color: #a6b8ff; font-size: 14px; }
.hero p.data-status { margin: 22px auto 0; font-size: 12px; }
.browse-filters { display: flex; flex-wrap: wrap; gap: 9px; margin: 20px 0; }
.category-chip, .highlight-tab, .pagination button { border: 1px solid var(--border); background: var(--surface); color: #aebbd0; padding: 10px 15px; border-radius: 9px; cursor: pointer; font: inherit; }
.category-chip.active, .highlight-tab.active { background: #243457; color: white; border-color: var(--accent); }
.highlight-tab { border-radius: 999px; }
.discount-filters { margin-top: 0; }
.release-grid .game-card { border-color: #364467; background: linear-gradient(160deg, #17233a, var(--surface)); }
.game-info { display: flex; flex-direction: column; height: auto; }
.game-card { display: flex; flex-direction: column; }
.game-card .game-info { flex: 1; }
.game-card .deal-button { margin-top: auto; }
.game-card .merchant { margin-bottom: 14px; }
.release-badge { align-self: flex-start; color: #a9efc4; background: #16352a; padding: 4px 8px; border-radius: 5px; font-size: 11px; font-weight: 700; margin-bottom: 10px; }
.release-badge.upcoming { color: #dbd2ff; background: #30254c; }
.regular-price { color: var(--muted); font-size: 10px; text-align: right; }
.price-row .price { font-size: 19px; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 18px; margin-top: 28px; color: var(--muted); font-size: 14px; }
.pagination button:disabled { opacity: .4; cursor: default; }
.browse-filters button:focus-visible, .pagination button:focus-visible { outline: 2px solid white; outline-offset: 3px; }
#deals { scroll-margin-top: 100px; }

.empty-state {
  padding: 50px;
  text-align: center;
  color: var(--muted);
}

.how {
  padding: 35px 0 90px;
  max-width: 760px;
}

.how p {
  color: var(--muted);
  line-height: 1.7;
}

.footer {
  border-top: 1px solid rgba(255,255,255,.06);
  color: #718096;
  font-size: 12px;
}

.genre-section { padding-top: 36px; padding-bottom: 28px; }
.genre-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 18px; margin-top: 24px; }
.genre-cards a { display: flex; flex-direction: column; gap: 12px; padding: 26px; border: 1px solid #344353; border-radius: 16px; background: #151e29; color: #f1f6fb; text-decoration: none; }
.genre-cards a:hover, .genre-cards a:focus-visible { border-color: #9ee7b3; }
.genre-cards span { color: #b4c2d1; font-size: 14px; line-height: 1.6; }
.landing-hero { padding: 48px 0; }
.landing-hero h1 { max-width: 900px; }
.landing-intro { max-width: 860px; line-height: 1.8; }
.breadcrumbs { margin-bottom: 30px; color: #b4c2d1; font-size: 14px; }
.breadcrumbs a, .genre-links a { color: #9ee7b3; }
.genre-links { display: flex; flex-wrap: wrap; gap: 16px 24px; margin: 24px 0; }
.how p { line-height: 1.8; }

.steam-review { margin: 12px 0; color: #9ee7b3; font-size: 13px; line-height: 1.5; }
.steam-review small { display: block; color: var(--muted); }
.steam-review.unavailable { color: var(--muted); }

.footer-inner {
  min-height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

@media (max-width: 720px) {
  .container {
    width: min(100% - 24px, var(--max));
  }

  .nav {
    display: none;
  }

  .hero {
    padding-top: 68px;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

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

  .footer-inner {
    flex-direction: column;
    justify-content: center;
    gap: 5px;
  }
}

@media (max-width: 470px) {
  .game-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 40px;
  }

  .sort-label select {
    margin-left: 0;
    margin-top: 7px;
    display: block;
  }
}
