:root {
  color-scheme: dark;
  --bg: #111318;
  --panel: #1b1f27;
  --panel-soft: #242936;
  --text: #f4f0e8;
  --muted: #b6bac4;
  --line: rgba(255, 255, 255, 0.12);
  --green: #59d98e;
  --amber: #f0b64b;
  --red: #ed6a5e;
  --cyan: #58c7d8;
  --violet: #a17cf2;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

img {
  display: block;
  width: 100%;
}

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

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px max(20px, calc((100vw - 1180px) / 2));
  background: rgba(17, 19, 24, 0.78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: linear-gradient(135deg, #58c7d8, #59d98e 48%, #f0b64b);
  color: #111318;
  font-weight: 900;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.1;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a {
  padding: 9px 12px;
  border-radius: 8px;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  align-content: center;
  overflow: hidden;
  padding: 120px max(20px, calc((100vw - 1180px) / 2)) 86px;
  border-bottom: 1px solid var(--line);
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(17, 19, 24, 0.94) 0%, rgba(17, 19, 24, 0.76) 46%, rgba(17, 19, 24, 0.36) 100%),
    linear-gradient(0deg, rgba(17, 19, 24, 0.92), rgba(17, 19, 24, 0.1) 40%, rgba(17, 19, 24, 0.58)),
    url("https://images.unsplash.com/photo-1542751371-adc38448a05e?auto=format&fit=crop&w=1800&q=82") center / cover;
  transform: scale(1.02);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(54px, 10vw, 112px);
  line-height: 0.94;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 660px;
  margin: 26px 0 28px;
  color: #ded9cf;
  font-size: clamp(18px, 2.5vw, 24px);
}

.search-panel {
  max-width: 680px;
}

.search-panel label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.search-row input {
  min-width: 0;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  padding: 0 16px;
  outline: none;
  font: inherit;
}

.search-row input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(89, 217, 142, 0.14);
}

.search-row button,
.submit-button {
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #101419;
  padding: 0 22px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.search-row button:hover,
.submit-button:hover {
  filter: brightness(1.07);
}

.hero-strip {
  position: absolute;
  z-index: 2;
  left: max(20px, calc((100vw - 1180px) / 2));
  right: max(20px, calc((100vw - 1180px) / 2));
  bottom: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.hero-strip a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8f5ee;
  backdrop-filter: blur(12px);
  font-weight: 700;
}

.hero-strip a:hover {
  background: rgba(255, 255, 255, 0.15);
}

.quick-stats {
  width: min(1180px, calc(100% - 40px));
  margin: -34px auto 0;
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.quick-stats div {
  min-height: 98px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 31, 39, 0.96);
  box-shadow: var(--shadow);
  padding: 20px;
}

.quick-stats strong,
.quick-stats span {
  display: block;
}

.quick-stats strong {
  color: var(--amber);
  font-size: 26px;
  line-height: 1;
}

.quick-stats span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.section {
  padding: 82px 0;
}

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
}

.section-heading > p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.filter {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  padding: 0 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.filter:hover,
.filter.active {
  border-color: rgba(89, 217, 142, 0.58);
  background: rgba(89, 217, 142, 0.12);
  color: var(--text);
}

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

.resource-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.resource-card[hidden] {
  display: none;
}

.resource-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #101419;
  font-weight: 900;
}

.steam { background: var(--cyan); }
.epic { background: #f7f2e8; }
.gog { background: var(--violet); }
.itch { background: var(--red); }
.deal { background: var(--amber); }
.db { background: #7ed957; }
.wiki { background: #9fd3ff; }
.mod { background: #ff8f70; }
.data { background: #c3f2a6; }
.time { background: #f8d36d; }
.community { background: #ff9f5f; }

.resource-card h3 {
  margin: 18px 0 8px;
  font-size: 20px;
  line-height: 1.2;
}

.resource-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.resource-card a {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  min-height: 36px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 800;
}

.resource-card a:hover {
  background: var(--green);
  color: #101419;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 20px;
  color: var(--muted);
}

.collections {
  background: #171a21;
  border-block: 1px solid var(--line);
}

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

.collection-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.collection-card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.collection-card div {
  padding: 18px;
}

.collection-card span {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.collection-card h3 {
  margin: 8px 0;
  font-size: 21px;
  line-height: 1.25;
}

.collection-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

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

.tool-list div {
  border-left: 4px solid var(--amber);
  background: var(--panel);
  padding: 18px;
  border-radius: 0 8px 8px 0;
}

.tool-list div:nth-child(2) {
  border-color: var(--cyan);
}

.tool-list div:nth-child(3) {
  border-color: var(--red);
}

.tool-list div:nth-child(4) {
  border-color: var(--green);
}

.tool-list strong,
.tool-list span {
  display: block;
}

.tool-list strong {
  font-size: 18px;
}

.tool-list span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
}

.submit-band {
  padding: 74px 0;
  background:
    linear-gradient(135deg, rgba(89, 217, 142, 0.16), rgba(240, 182, 75, 0.1)),
    #1c211e;
}

.submit-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.submit-inner h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
}

.submit-inner p:not(.eyebrow) {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
}

.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  flex: 0 0 auto;
}

.site-footer {
  padding: 26px 0;
  border-top: 1px solid var(--line);
  background: #0d0f13;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a:hover {
  color: var(--text);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.sitemap-page {
  padding-top: 120px;
}

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

.sitemap-list a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.sitemap-list a:hover {
  border-color: rgba(89, 217, 142, 0.58);
  background: rgba(89, 217, 142, 0.1);
}

.sitemap-list strong,
.sitemap-list span {
  display: block;
}

.sitemap-list span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 980px) {
  .resource-grid,
  .collection-grid,
  .tool-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .hero-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .site-header {
    position: sticky;
    flex-wrap: wrap;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .nav-links a {
    padding-inline: 8px;
  }

  .hero {
    min-height: 94vh;
    padding-top: 62px;
    padding-bottom: 172px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .hero-strip {
    bottom: 18px;
  }

  .section-heading,
  .submit-inner,
  .footer-inner {
    display: block;
  }

  .section-heading > p,
  .submit-button {
    margin-top: 16px;
  }

  .resource-grid,
  .collection-grid,
  .tool-list,
  .sitemap-list,
  .quick-stats {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .resource-card {
    min-height: 220px;
  }
}
