:root {
  color-scheme: light;
  --paper: #f7f4ed;
  --paper-deep: #eee9dd;
  --ink: #172033;
  --muted: #697184;
  --coral: #ff6b57;
  --coral-dark: #e94f3b;
  --yellow: #ffc857;
  --mint: #4fd1a1;
  --blue: #5b7cfa;
  --white: #fffdfa;
  --line: rgba(23, 32, 51, 0.12);
  --shadow: 0 18px 50px rgba(50, 42, 30, 0.09);
  --radius-lg: 30px;
  --radius-md: 22px;
  --page-width: 1320px;
  font-family:
    Inter, ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 5%, rgba(255, 200, 87, 0.16), transparent 28rem),
    radial-gradient(circle at 92% 18%, rgba(79, 209, 161, 0.13), transparent 24rem), var(--paper);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.3;
  background-image: radial-gradient(rgba(23, 32, 51, 0.12) 0.65px, transparent 0.65px);
  background-size: 16px 16px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  color: white;
  background: var(--ink);
  transform: translateY(-150%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(23, 32, 51, 0.08);
  background: rgba(247, 244, 237, 0.88);
  backdrop-filter: blur(18px) saturate(130%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 48px), var(--page-width));
  min-height: 76px;
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--coral);
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-4deg);
}

.brand-mark::after {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  content: "";
}

.brand-mark span {
  color: white;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.brand-text {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: #4f586c;
  font-size: 14px;
  font-weight: 700;
}

.header-nav a {
  padding: 10px 2px;
  color: var(--ink);
  text-decoration: none;
}

.header-nav a:hover {
  color: var(--coral-dark);
}

.game-total {
  padding-right: 24px;
  border-right: 1px solid var(--line);
}

.game-total strong {
  color: var(--coral-dark);
  font-size: 18px;
}

main,
.site-footer {
  width: min(calc(100% - 48px), var(--page-width));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(440px, 1.08fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
  min-height: 610px;
  padding: 72px 0 76px;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 8px 14px;
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.75);
  color: #525b6d;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.eyebrow span {
  color: var(--coral-dark);
}

.hero h1 {
  margin: 0;
  font-size: clamp(43px, 5vw, 72px);
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: -0.07em;
}

.hero h1 span {
  position: relative;
  color: var(--coral-dark);
  white-space: nowrap;
}

.hero h1 span::after {
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  content: "";
  opacity: 0.8;
  transform: rotate(-1.3deg);
}

.hero-copy > p {
  max-width: 580px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 24px;
  align-items: center;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  border: 2px solid var(--ink);
  color: white;
  background: var(--coral);
  box-shadow: 4px 4px 0 var(--ink);
}

.button-primary:hover {
  background: var(--coral-dark);
  box-shadow: 2px 2px 0 var(--ink);
}

.button-dark {
  align-self: flex-start;
  margin-top: 2px;
  color: white;
  background: var(--ink);
}

.button-dark:hover {
  box-shadow: 0 9px 18px rgba(23, 32, 51, 0.2);
}

.button-secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: white;
}

.hero-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #626b7c;
  font-size: 14px;
  font-weight: 650;
}

.hero-note i {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(79, 209, 161, 0.16);
}

.featured {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: 34px;
  background: var(--white);
  box-shadow: var(--shadow);
  transform: rotate(1deg);
}

.featured::before,
.featured::after {
  position: absolute;
  z-index: 2;
  width: 70px;
  height: 22px;
  background: rgba(255, 200, 87, 0.8);
  content: "";
}

.featured::before {
  top: 11px;
  left: -18px;
  transform: rotate(-40deg);
}

.featured::after {
  right: -18px;
  bottom: 10px;
  transform: rotate(-40deg);
}

.featured-cover {
  aspect-ratio: 16 / 9.8;
  border-radius: 0;
}

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

.featured-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 0 5px 16px rgba(23, 32, 51, 0.16);
  font-size: 12px;
  font-weight: 900;
}

.featured-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 24px;
  align-items: center;
  padding: 24px 26px 26px;
}

.featured-meta {
  grid-column: 1;
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.featured-content h2 {
  grid-column: 1;
  margin: 1px 0 0;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.featured-content p {
  grid-column: 1;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.featured-content .button {
  grid-column: 2;
  grid-row: 1 / 4;
}

.games-section {
  padding: 84px 0 40px;
  border-top: 1px solid rgba(23, 32, 51, 0.1);
}

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

.section-kicker {
  display: block;
  margin-bottom: 10px;
  color: var(--coral-dark);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.18em;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 950;
  letter-spacing: -0.055em;
}

.section-heading > p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 32px 0 30px;
}

.category-tabs {
  display: flex;
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.72);
}

.filter-button {
  min-height: 42px;
  padding: 9px 16px;
  border: 0;
  border-radius: 11px;
  color: #687084;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.filter-button:hover {
  color: var(--ink);
}

.filter-button.is-active {
  color: white;
  background: var(--ink);
  box-shadow: 0 5px 12px rgba(23, 32, 51, 0.16);
}

.search-box {
  display: flex;
  width: min(100%, 350px);
  min-height: 52px;
  align-items: center;
  gap: 11px;
  padding: 0 13px 0 17px;
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 8px 25px rgba(50, 42, 30, 0.05);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.search-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(91, 124, 250, 0.14);
}

.search-icon {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid #7d8494;
  border-radius: 50%;
}

.search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 2px;
  border-radius: 3px;
  background: #7d8494;
  content: "";
  transform: rotate(45deg);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.search-box input::placeholder {
  color: #9a9fab;
}

.search-box kbd {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: #8a909d;
  background: #f7f5f0;
  font-family: inherit;
  font-size: 10px;
}

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

.game-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 51, 0.11);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: 0 10px 30px rgba(50, 42, 30, 0.055);
  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    border-color 200ms ease;
}

.game-card:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  box-shadow: 0 20px 42px rgba(50, 42, 30, 0.11);
  transform: translateY(-5px);
}

.card-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.cover-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: color-mix(in srgb, var(--accent) 15%, #f0ece4);
}

.cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.game-card:hover .cover-frame img {
  transform: scale(1.035);
}

.image-fallback {
  display: grid;
  place-items: center;
  padding: 24px;
}

.image-fallback::before {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 20px;
  color: white;
  background: var(--accent);
  content: "玩";
  font-size: 26px;
  font-weight: 950;
  box-shadow: 5px 5px 0 rgba(23, 32, 51, 0.16);
}

.image-fallback::after {
  position: absolute;
  right: 18px;
  bottom: 16px;
  left: 18px;
  overflow: hidden;
  color: rgba(23, 32, 51, 0.7);
  content: attr(data-fallback-label);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cover-badges {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.category-badge,
.new-badge {
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

.category-badge {
  color: var(--ink);
  background: rgba(255, 253, 250, 0.88);
}

.new-badge {
  margin-left: auto;
  color: white;
  background: var(--coral);
}

.card-body {
  display: flex;
  min-height: 198px;
  flex-direction: column;
  padding: 20px 20px 18px;
}

.card-body h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.card-body > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 9px 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(23, 32, 51, 0.08);
}

.card-tags {
  display: flex;
  min-width: 0;
  gap: 5px;
}

.tag {
  overflow: hidden;
  padding: 4px 7px;
  border-radius: 7px;
  color: #757c8b;
  background: #f2f0eb;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-link {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.empty-state {
  padding: 70px 24px;
  border: 1px dashed rgba(23, 32, 51, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 250, 0.6);
  text-align: center;
}

.empty-state > span {
  display: block;
  margin-bottom: 16px;
  font-size: 42px;
}

.empty-state h3 {
  margin: 0;
  font-size: 23px;
}

.empty-state p {
  margin: 10px 0 22px;
  color: var(--muted);
}

.more-banner {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(260px, 0.7fr);
  gap: 22px;
  align-items: center;
  overflow: hidden;
  margin: 80px 0;
  padding: 30px 34px;
  border: 2px solid var(--ink);
  border-radius: 24px;
  background: var(--yellow);
  box-shadow: 6px 6px 0 var(--ink);
}

.more-banner::after {
  position: absolute;
  top: -50px;
  right: 27%;
  width: 130px;
  height: 130px;
  border: 24px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  content: "";
}

.more-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 18px;
  color: white;
  background: var(--coral);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 35px;
  font-weight: 400;
}

.more-banner span {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.more-banner h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: -0.045em;
}

.more-banner p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(23, 32, 51, 0.72);
  font-size: 14px;
  line-height: 1.75;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  min-height: 130px;
  border-top: 1px solid rgba(23, 32, 51, 0.11);
  color: var(--muted);
  font-size: 12px;
}

.site-footer > span {
  justify-self: end;
}

.site-footer p {
  margin: 0;
  text-align: center;
}

.footer-brand .brand-mark {
  width: 33px;
  height: 33px;
  border-radius: 11px;
  box-shadow: 2px 2px 0 var(--ink);
}

.footer-brand .brand-mark span {
  font-size: 15px;
}

.footer-brand .brand-text {
  color: var(--ink);
  font-size: 15px;
}

.noscript-message {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 80;
  padding: 15px;
  border-radius: 12px;
  color: white;
  background: var(--ink);
  text-align: center;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.card-link:focus-visible {
  border-radius: var(--radius-md);
  outline-offset: -4px;
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: minmax(0, 0.9fr) minmax(390px, 1.1fr);
    gap: 38px;
  }

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

@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 56px;
  }

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

  .featured {
    width: min(100%, 700px);
    margin-inline: auto;
    transform: none;
  }

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

  .more-banner {
    grid-template-columns: auto 1fr;
  }

  .more-banner p {
    grid-column: 2;
  }
}

@media (max-width: 640px) {
  .header-inner,
  main,
  .site-footer {
    width: min(calc(100% - 30px), var(--page-width));
  }

  .header-inner {
    min-height: 66px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .brand-mark span {
    font-size: 17px;
  }

  .brand-text {
    font-size: 17px;
  }

  .header-nav {
    gap: 0;
  }

  .game-total {
    display: none;
  }

  .hero {
    gap: 42px;
    padding: 44px 0 58px;
  }

  .hero h1 {
    font-size: clamp(40px, 12vw, 56px);
  }

  .hero-copy > p {
    font-size: 16px;
    line-height: 1.75;
  }

  .featured-content {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .featured-content .button {
    grid-column: 1;
    grid-row: auto;
    margin-top: 10px;
  }

  .games-section {
    padding-top: 62px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading > p {
    padding-top: 10px;
    white-space: nowrap;
  }

  .controls {
    align-items: stretch;
    flex-direction: column;
    margin-top: 25px;
  }

  .category-tabs {
    align-self: flex-start;
  }

  .search-box {
    width: 100%;
  }

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

  .card-body {
    min-height: 178px;
  }

  .more-banner {
    grid-template-columns: 1fr;
    margin: 60px 0;
    padding: 27px 24px;
  }

  .more-banner p {
    grid-column: 1;
  }

  .site-footer {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 34px 0;
    text-align: center;
  }

  .site-footer > span {
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .game-card:hover,
  .button:hover {
    transform: none;
  }
}
