:root {
  --bg: #0b0f14;
  --bg2: #121821;
  --card: #161e29;
  --line: #24303f;
  --txt: #e8eef6;
  --muted: #8fa3b8;
  --accent: #7cf29c;
  --accent2: #4dd0e1;
  --danger: #ff6b6b;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

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

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(11, 15, 20, 0.86);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 12px;
}

.brand {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.4px;
}

.brand span { color: var(--accent); }

.nav-links { display: flex; gap: 6px; }

.nav-links a {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
}

.nav-links a:hover { color: var(--txt); background: var(--bg2); }

/* ---------- hero ---------- */
.hero {
  padding: 40px 0 24px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(28px, 7vw, 46px);
  line-height: 1.05;
  margin: 0 0 12px;
  letter-spacing: -1.2px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--muted);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto 22px;
}

/* ---------- search ---------- */
.search {
  display: flex;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
}

.search input {
  flex: 1;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--txt);
  padding: 0 16px;
  font-size: 16px;
  outline: none;
}

.search input:focus { border-color: var(--accent); }

/* ---------- chips ---------- */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 18px 0 8px;
}

.chip {
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--muted);
  cursor: pointer;
}

.chip.active {
  color: #06210f;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

/* ---------- section ---------- */
.section { padding: 28px 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: 20px;
  margin: 0;
  letter-spacing: -0.4px;
}

.section-head a { font-size: 13px; color: var(--muted); }

/* ---------- grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

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

.card:hover { transform: translateY(-3px); border-color: #35506b; }

.cover {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: -1px;
}

.cover img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: 10px 12px 12px; }

.card-body h3 {
  font-size: 15px;
  margin: 0 0 4px;
  line-height: 1.2;
}

.card-body p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.35;
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(124, 242, 156, .12);
  color: var(--accent);
  margin-top: 8px;
}

.badge-warn {
  background: rgba(255, 200, 90, .13);
  color: #ffc85a;
}

.note-box {
  margin: 18px 0;
  padding: 12px 14px;
  border-left: 3px solid #ffc85a;
  background: rgba(255, 200, 90, .07);
  border-radius: 0 10px 10px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #d9c9a6;
}

.note-box strong { color: #ffc85a; }

/* ---------- game page ---------- */
.game-head {
  display: flex;
  gap: 16px;
  padding: 28px 0 8px;
  align-items: flex-start;
}

.game-cover {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 800;
}

.game-head h1 {
  font-size: clamp(22px, 5vw, 32px);
  margin: 0 0 4px;
  letter-spacing: -0.8px;
  line-height: 1.1;
}

.game-head .dev { color: var(--muted); font-size: 14px; margin: 0 0 8px; }

.meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.meta span {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--muted);
}

.cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: 16px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 17px;
  color: #06210f;
  background: linear-gradient(90deg, var(--accent), #59e0a0);
  margin: 18px 0 8px;
  box-shadow: 0 8px 24px rgba(124, 242, 156, .18);
}

.cta:active { transform: scale(.99); }

.cta.waiting {
  background: #1b2735;
  color: #7f93a8;
  box-shadow: none;
  border: 1px solid var(--line);
  cursor: progress;
}

.note { font-size: 12px; color: var(--muted); text-align: center; margin: 0 0 18px; }

.prose {
  color: #c6d4e3;
  font-size: 15.5px;
  line-height: 1.65;
}

.prose h2 { font-size: 18px; color: var(--txt); margin: 26px 0 8px; }

/* ---------- top list ---------- */
.top-item {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}

.top-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  width: 34px;
  flex: 0 0 34px;
  text-align: center;
}

.top-item .thumb {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.top-item h3 { margin: 0 0 2px; font-size: 16px; }
.top-item p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------- ads ---------- */
.ad {
  margin: 18px 0;
  min-height: 100px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
}

.ad-placeholder {
  border: 1px dashed #2d3d50;
  color: #4a6076;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: repeating-linear-gradient(45deg, #101720, #101720 10px, #121a24 10px, #121a24 20px);
}

.anchor-ad {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--bg2);
  border-top: 1px solid var(--line);
  padding: 6px 8px;
  min-height: 54px;
  display: grid;
  place-items: center;
}

body.has-anchor { padding-bottom: 64px; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 40px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

footer a { color: var(--txt); text-decoration: underline; text-underline-offset: 3px; }

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

@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
  .hero { padding: 64px 0 32px; }
}
