:root {
  color-scheme: light;
  --ink: #17211c;
  --muted: #64706a;
  --paper: #f7f5ef;
  --panel: #fffdf7;
  --line: #ded8ca;
  --green: #2f7b57;
  --green-dark: #21573e;
  --red: #c94d3f;
  --yellow: #f0b84b;
  --cyan: #3b8798;
  --shadow: 0 18px 50px rgba(42, 44, 38, .14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(23, 33, 28, .12);
  background: rgba(247, 245, 239, .86);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-size: 18px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(14px, 3vw, 34px);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.topnav a:hover {
  color: var(--ink);
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(320px, .97fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  min-height: calc(100svh - 68px);
  max-height: 860px;
  padding: clamp(34px, 7vw, 92px) clamp(18px, 4vw, 56px) clamp(30px, 5vw, 56px);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(47, 123, 87, .10), transparent 36%),
    linear-gradient(315deg, rgba(201, 77, 63, .13), transparent 38%),
    var(--paper);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 126px;
  background:
    linear-gradient(90deg, rgba(23, 33, 28, .12) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(0deg, rgba(23, 33, 28, .10) 1px, transparent 1px) 0 0 / 34px 34px;
  mask-image: linear-gradient(to top, #000, transparent);
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(64px, 12vw, 146px);
  line-height: .86;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 650px;
  margin: 24px 0 0;
  color: #39443e;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-weight: 900;
}

.primary-action {
  background: var(--green);
  color: #fff;
  box-shadow: 5px 5px 0 var(--ink);
}

.secondary-action {
  background: var(--panel);
}

.hero-art {
  width: min(100%, 680px);
  justify-self: end;
  filter: drop-shadow(0 28px 28px rgba(42, 44, 38, .18));
}

.hero-panel {
  position: absolute;
  right: clamp(18px, 5vw, 80px);
  bottom: clamp(20px, 5vw, 62px);
  width: min(330px, calc(100% - 36px));
  padding: 18px 20px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 8px 8px 0 var(--ink);
}

.hero-panel p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.hero-panel strong {
  display: block;
  font-size: 18px;
  line-height: 1.35;
}

.live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(201, 77, 63, .14);
}

.search-band {
  display: grid;
  grid-template-columns: minmax(260px, 430px) 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px clamp(18px, 4vw, 56px);
  border-block: 1px solid var(--line);
  background: var(--panel);
}

.search-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
}

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

#site-search {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.filter-tab {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
}

.filter-tab:hover,
.filter-tab.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.section-shell,
.category-band,
.split-section,
.tools-band {
  padding: clamp(44px, 7vw, 90px) clamp(18px, 4vw, 56px);
}

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

.section-heading h2,
.split-section h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

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

.game-card {
  position: relative;
  display: grid;
  min-height: 226px;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 6px 6px 0 rgba(23, 33, 28, .92);
  transition: transform .18s ease, box-shadow .18s ease;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 9px 9px 0 rgba(23, 33, 28, .92);
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 86px;
  background: var(--card-bg);
}

.game-card header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.game-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  font-size: 26px;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--ink);
}

.tag {
  padding: 6px 9px;
  border: 1px solid rgba(23, 33, 28, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: #22302a;
  font-size: 12px;
  font-weight: 900;
}

.game-card h3 {
  position: relative;
  z-index: 1;
  align-self: end;
  margin: 66px 0 8px;
  font-size: 22px;
  line-height: 1.15;
}

.game-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.keywords {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: end;
  margin-top: 18px;
}

.keywords span {
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(23, 33, 28, .08);
  color: #405048;
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  margin: 26px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.category-band {
  background: #e7efe9;
}

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

.category-tile {
  min-height: 168px;
  padding: 20px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
}

.category-tile:hover {
  background: #fff8df;
}

.tile-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 24px;
}

.category-tile strong,
.category-tile small {
  display: block;
}

.category-tile strong {
  font-size: 19px;
}

.category-tile small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(300px, 1.25fr);
  gap: clamp(26px, 5vw, 70px);
  align-items: start;
  border-block: 1px solid var(--line);
  background: var(--panel);
}

.ranking-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranking-list li {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ranking-list span {
  color: var(--red);
  font-weight: 1000;
}

.ranking-list a {
  font-size: 18px;
  font-weight: 900;
}

.ranking-list em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.tools-band {
  background: #f4eadc;
}

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

.tool-link {
  display: grid;
  gap: 9px;
  min-height: 118px;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
}

.tool-link:hover {
  background: #edf8ff;
}

.tool-link span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tool-link strong {
  align-self: end;
  font-size: 22px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 82px;
  padding: 20px clamp(18px, 4vw, 56px);
  background: var(--ink);
  color: #fff;
}

.footer p {
  margin: 0;
  font-weight: 800;
}

.footer a {
  color: #f6d779;
  font-weight: 900;
}

@media (max-width: 1120px) {
  .site-grid,
  .category-grid,
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-art {
    width: min(86%, 560px);
    justify-self: center;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    align-items: flex-start;
  }

  .topnav {
    display: none;
  }

  .hero {
    padding-top: 38px;
  }

  .hero h1 {
    font-size: clamp(58px, 21vw, 92px);
  }

  .hero-panel {
    position: relative;
    right: auto;
    bottom: auto;
    margin-top: 4px;
  }

  .search-band,
  .split-section {
    grid-template-columns: 1fr;
  }

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

  .site-grid,
  .category-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: block;
  }

  .ranking-list li {
    grid-template-columns: 42px 1fr;
  }

  .ranking-list em {
    grid-column: 2;
  }

  .footer {
    display: grid;
  }
}
