:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --ink: #19263c;
  --navy: #1b2940;
  --muted: #4b5565;
  --rule: #a7acb3;
  --surface: #fffcf6;
  --lime: #d6ef55;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid #5548a1; outline-offset: 4px; }

.page {
  width: min(1440px, calc(100% - clamp(32px, 6.12vw, 96px)));
  min-height: 100vh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: clamp(68px, 7.1vw, 108px);
}

.brand, .library-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: clamp(8px, 1.15vw, 18px);
  font-weight: 750;
  text-decoration: none;
}

.brand { font-size: clamp(17px, 2.15vw, 33px); }
.brand img { width: clamp(32px, 3.13vw, 48px); height: auto; }
.library-link { font-size: clamp(14px, 1.55vw, 23px); }
.library-link span { font-size: 1.04em; }
.library-link:hover { text-decoration: underline; text-underline-offset: .3em; }

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(325px, 30.6vw, 470px);
  overflow: hidden;
  border-radius: clamp(16px, 1.6vw, 24px);
  background: linear-gradient(132deg, #19273c, var(--navy) 62%, #1c2a42);
  color: #fffaf0;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 59%;
  padding: clamp(30px, 5.3vw, 80px) 0 clamp(30px, 3.4vw, 52px) clamp(28px, 4.8vw, 74px);
}

.hero h1 {
  font-size: clamp(47px, 5.45vw, 84px);
  font-weight: 850;
  line-height: 1.16;
  letter-spacing: .02em;
  text-wrap: balance;
}

.hero p {
  margin-top: clamp(11px, 1.25vw, 19px);
  color: #e3e7ed;
  font-size: clamp(17px, 2.12vw, 32px);
  line-height: 1.55;
}

.browse-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: clamp(46px, 4.38vw, 67px);
  margin-top: clamp(22px, 2.35vw, 36px);
  padding: .5em clamp(18px, 2.37vw, 36px);
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
  font-size: clamp(16px, 1.76vw, 27px);
  font-weight: 800;
  text-decoration: none;
  transition: background-color .18s ease;
}

.browse-link:hover { background: #e4fa76; }
.hero :focus-visible { outline-color: #fffaf0; }

.hero-art {
  position: absolute;
  inset: 0 0 0 auto;
  width: 57%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  mask-image: linear-gradient(to right, transparent, #000 19%);
  pointer-events: none;
}

.game-library {
  margin-block: clamp(34px, 3.6vw, 55px) clamp(38px, 4.4vw, 66px);
  border-radius: 12px;
  scroll-margin-top: 16px;
}

.game-library > h2 {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
  margin-bottom: clamp(16px, 1.8vw, 27px);
  font-size: clamp(27px, 2.72vw, 41px);
  font-weight: 850;
  line-height: 1.25;
}

.game-library > h2::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.game-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: clamp(15px, 1.65vw, 25px);
}

.game-card {
  display: block;
  height: 100%;
  overflow: hidden;
  border: 1px solid #e1ddd2;
  border-radius: 16px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.game-cover { aspect-ratio: 1.66; overflow: hidden; background: #fba68f; }
.game-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .18s ease; }
.game-copy { position: relative; padding: 15px 48px 17px 16px; }
.game-genre { color: var(--muted); font-size: 13px; font-weight: 650; }
.game-copy h3 { margin-top: 4px; font-size: 20px; font-weight: 800; line-height: 1.3; }
.game-description { margin-top: 7px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.card-action {
  position: absolute;
  top: 16px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #e9eddc;
  font-size: 17px;
  transition: background-color .18s ease;
}

.game-card:hover { border-color: #a3a990; box-shadow: 0 7px 17px #19263c13; }
.game-card:hover .game-cover img { transform: scale(1.035); }
.game-card:hover .card-action, .game-card:focus-visible .card-action { background: var(--lime); }

.site-footer {
  margin-top: auto;
  padding-block: 16px 24px;
  border-top: 1px solid #dad7cf;
  color: var(--muted);
  font-size: 13px;
}

@media (min-width: 761px) and (max-width: 1050px) {
  .hero { min-height: clamp(300px, 34vw, 359px); }
  .hero h1 { font-size: clamp(39px, 5.1vw, 54px); }
  .hero-art { object-fit: contain; object-position: right bottom; }
}

@media (max-width: 760px) {
  .hero { display: block; min-height: 0; }
  .hero-copy { max-width: none; padding: 29px clamp(19px, 6vw, 40px) 4px; }
  .hero h1 { font-size: clamp(32px, 7.8vw, 55px); }
  .hero p { font-size: clamp(16px, 4vw, 22px); }
  .hero-art {
    position: relative;
    width: 100%;
    height: auto;
    mask-image: linear-gradient(to bottom, transparent, #000 16%);
  }
  .game-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 242px), 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .browse-link, .game-card, .game-cover img, .card-action { transition: none; }
}
