:root {
  --bg: #f5f8ff;
  --panel: rgba(255, 255, 255, 0.86);
  --text: #172033;
  --muted: #65738a;
  --line: rgba(33, 92, 186, 0.13);
  --blue: #246bfe;
  --blue-dark: #174ed8;
  --soft-blue: #eaf1ff;
  --shadow: 0 24px 70px rgba(35, 87, 160, 0.14);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 10%, rgba(55, 125, 255, 0.16), transparent 28%),
    radial-gradient(circle at 80% 2%, rgba(99, 179, 255, 0.18), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 48%, #eef5ff 100%);
  min-height: 100vh;
}

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

.hero {
  min-height: 360px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.topbar,
.hero-grid,
.toolbar,
.card-actions {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, #1e63ff, #79b8ff);
  box-shadow: 0 14px 34px rgba(36, 107, 254, 0.28);
}

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

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.engine-tabs,
.tier-pills {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: var(--soft-blue);
}

.engine-tab,
.tier-pill,
.secondary-btn,
.play-btn {
  border: 0;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.engine-tab,
.tier-pill {
  min-width: 78px;
  padding: 10px 16px;
  border-radius: 999px;
  color: #31506f;
  background: transparent;
}

.engine-tab.active,
.tier-pill.active {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 10px 28px rgba(36, 107, 254, 0.26);
}

.engine-tab {
  min-width: 128px;
  font-weight: 800;
}

.hero-grid {
  justify-content: space-between;
  gap: 36px;
  padding: 76px 24px 38px;
}

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

.eyebrow {
  display: inline-flex;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: var(--soft-blue);
  font-weight: 700;
}

h1 {
  margin: 22px 0 16px;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.stats {
  min-width: 280px;
  display: grid;
  gap: 12px;
}

.stats div {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.stats span {
  display: block;
  font-size: 34px;
  font-weight: 800;
  color: var(--blue);
}

.stats small {
  color: var(--muted);
}

.toolbar {
  position: sticky;
  top: 12px;
  z-index: 10;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 44px rgba(37, 87, 150, 0.1);
  backdrop-filter: blur(20px);
}

.tier-pills {
  flex: 0 0 auto;
  border-radius: 16px;
}

.tier-pill {
  min-width: 72px;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0 16px;
  border-radius: 15px;
  background: #f7faff;
  border: 1px solid var(--line);
}

.search-box span {
  color: var(--muted);
}

.search-box input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.secondary-btn {
  height: 48px;
  padding: 0 20px;
  border-radius: 15px;
  color: var(--blue-dark);
  background: var(--soft-blue);
  font-weight: 700;
}

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

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 2px 16px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: 28px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.result-count {
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: var(--soft-blue);
  font-weight: 800;
}

.game-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(38, 89, 154, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 66px rgba(38, 89, 154, 0.16);
}

.cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #dce9ff, #f7fbff);
}

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

.type-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #fff;
  background: rgba(36, 107, 254, 0.92);
  font-size: 13px;
  font-weight: 800;
}

.tier-badge {
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.14);
}

.tier-normal {
  background: rgba(80, 116, 160, 0.9);
}

.tier-premium {
  background: rgba(36, 107, 254, 0.94);
}

.tier-custom {
  background: rgba(20, 165, 120, 0.94);
}

.card-body {
  padding: 18px;
}

.card-body h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.desc {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.tag {
  padding: 6px 9px;
  border-radius: 999px;
  color: #31506f;
  background: #eef5ff;
  font-size: 12px;
}

.card-actions {
  justify-content: space-between;
  gap: 12px;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.play-btn:hover {
  background: var(--blue-dark);
}

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

.empty {
  text-align: center;
  padding: 70px 18px;
  border: 1px dashed rgba(36, 107, 254, 0.28);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.64);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .hero-grid,
  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .tier-pills {
    width: 100%;
    overflow-x: auto;
  }

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

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

  .hero {
    border-radius: 22px;
    padding: 14px;
  }

  .engine-tabs {
    width: 100%;
  }

  .engine-tab {
    flex: 1;
    min-width: 0;
  }

  .tier-pill {
    flex: 1;
    min-width: max-content;
  }

  .hero-grid {
    padding: 42px 8px 20px;
  }

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