@charset "UTF-8";

:root {
  color-scheme: dark;
  --bg: #130e23;
  --deep: #100b1e;
  --panel: #211830;
  --panel-bright: #2d2041;
  --line: #483856;
  --line-soft: #382c47;
  --text: #fbf6ff;
  --muted: #c8bdd9;
  --quiet: #ad9abd;
  --accent: #ffc085;
  --bright: #ffa86a;
  --ink: #281126;
  --width: 1240px;
  --radius: 18px;
  --header-height: 74px;
  font-family: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

:lang(zh-Hant) {
  font-family: "Aptos", "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 96px; }
body { margin: 0; min-width: 0; background: var(--bg); color: var(--text); line-height: 1.58; }
body, button, input, select { font-size: 1rem; }
img { display: block; max-width: 100%; }
button, input, select { font-family: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.15; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.75rem, 3.35vw, 2.95rem); letter-spacing: -.035em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--ink); }

.container { width: min(var(--width), calc(100% - 80px)); margin-inline: auto; }
.site-header {
  position: sticky;
  z-index: 3;
  top: 0;
  background: rgba(19, 14, 35, .94);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(12px);
}
.header-inner { display: flex; align-items: center; gap: 32px; min-height: var(--header-height); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.08rem; }
.brand-mark { width: 44px; height: 44px; flex: 0 0 44px; }
.site-nav { display: flex; justify-content: center; align-items: center; gap: clamp(18px, 3vw, 48px); margin-inline: auto; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-weight: 650; white-space: nowrap; }
.site-nav a:hover, .site-footer a:hover { color: var(--accent); }
.language { display: inline-flex; padding: 3px; gap: 1px; border: 1px solid var(--line); border-radius: 12px; background: var(--deep); }
.language button {
  min-width: 46px;
  min-height: 44px;
  padding: 0 6px;
  color: var(--muted);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-weight: 700;
  font-size: .875rem;
  white-space: nowrap;
}
.language button:hover { color: var(--text); }
.language button[aria-pressed="true"] { color: var(--accent); background: var(--panel-bright); }
.skip-link { position: fixed; z-index: 5; top: 8px; left: 8px; transform: translateY(-160%); padding: 10px; color: var(--ink); background: var(--accent); }
.skip-link:focus { transform: none; }

.hero { position: relative; isolation: isolate; padding: clamp(48px, 6.7vw, 104px) 0 clamp(42px, 5vw, 74px); overflow: clip; }
.hero::before, .hero::after { position: absolute; inset: 0; content: ""; z-index: -1; pointer-events: none; }
.hero::before {
  background:
    radial-gradient(ellipse at 79% 45%, #522f88 0%, transparent 58%),
    radial-gradient(ellipse at 26% 0%, #3e2054 0%, transparent 59%),
    linear-gradient(180deg, #1c122e 0%, transparent 95%);
}
.hero::after {
  background-image: linear-gradient(#d2b3fc10 1px, transparent 1px), linear-gradient(90deg, #d2b3fc10 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at 66% 27%, #000 0%, transparent 77%);
}
.hero-inner { display: grid; grid-template-columns: minmax(0, .81fr) minmax(0, 1.19fr); align-items: center; gap: clamp(32px, 5vw, 72px); }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  font-size: .88rem;
  font-weight: 800;
  letter-spacing: .16em;
}
.eyebrow::before { display: block; width: 23px; height: 2px; flex: 0 0 auto; background: var(--bright); content: ""; }
.hero h1 { margin-top: 18px; font-size: clamp(2.9rem, 6vw, 5.8rem); font-weight: 900; letter-spacing: -.065em; line-height: 1.07; }
.hero h1 span { display: block; }
.hero-accent { color: var(--accent); }
.hero-copy { max-width: 34ch; margin-top: 22px; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.24rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 27px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 9px 18px;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 750;
  transition: background-color .18s, border-color .18s, color .18s;
}
.button-primary { color: var(--ink); background: var(--accent); border-color: var(--accent); }
.button-primary:hover { background: #ffe0bc; border-color: #ffe0bc; }
.button-secondary { color: var(--text); background: #261c37; border-color: #604b71; }
.button-secondary:hover { color: var(--accent); border-color: var(--accent); }

.hero-visual { position: relative; isolation: isolate; }
.hero-visual::before {
  position: absolute;
  z-index: -1;
  inset: -12px 18px 10px -12px;
  content: "";
  border-radius: 24px;
  background: linear-gradient(125deg, #e6b9ff 0%, #603c93 27%, #301b49 55%, #aa71cb 100%);
  opacity: .7;
}
.hero-visual::after {
  position: absolute;
  z-index: -1;
  width: 18px;
  height: 18px;
  right: -18px;
  bottom: 25px;
  content: "";
  background: var(--accent);
  clip-path: polygon(50% 0, 63% 37%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0 50%, 37% 37%);
}
.feature-card { position: relative; display: block; isolation: isolate; overflow: hidden; border: 1px solid #8467ae; border-radius: var(--radius); background: #110e23; }
.feature-card img { width: 100%; height: auto; aspect-ratio: 2.55; object-fit: cover; object-position: center 23%; transition: transform .28s ease; }
.feature-main img { aspect-ratio: 16 / 9; }
.feature-card:hover img { transform: scale(1.035); }
.feature-main { box-shadow: 0 25px 55px #090516ba; }
.feature-caption {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 23px 19px 12px;
  color: #fff;
  background: linear-gradient(transparent, #130d24ed);
  font-size: clamp(1.04rem, 1.7vw, 1.4rem);
  font-weight: 800;
  text-shadow: 0 1px 7px #000;
}
.feature-open {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid #e7cbff77;
  border-radius: 50%;
  color: #fff;
  background: #181126b8;
  line-height: 1;
}
.feature-card:hover .feature-open { color: var(--ink); background: var(--accent); text-shadow: none; }
.featured { padding: 4px 0 54px; }
.featured h2 { margin-bottom: 16px; color: var(--muted); font-size: 1.26rem; letter-spacing: 0; }
.featured-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.section { padding: clamp(50px, 6vw, 82px) 0; }
.catalog-section { border-block: 1px solid var(--line-soft); background: linear-gradient(180deg, #1d152a 0, var(--bg) 260px); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px 32px; margin-bottom: 25px; }
.section-heading p { color: var(--muted); }
.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(165px, .44fr) auto;
  align-items: end;
  gap: 14px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.filters label { display: block; margin-bottom: 5px; color: var(--muted); font-size: .88rem; font-weight: 700; }
.filters input, .filters select {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid #5d4b6c;
  border-radius: 9px;
  background: var(--deep);
  color: var(--text);
}
.filters input::placeholder { color: var(--quiet); opacity: 1; }
.filters select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 17px center, right 12px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.result-count { color: var(--muted); margin-bottom: 15px; font-size: .9rem; }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.game-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  scroll-margin-top: 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color .18s ease, background-color .18s ease;
}
.game-card:hover, .game-card:focus-within { border-color: #916dab; background: #271d39; }
.game-card:target { border-color: var(--accent); }
.card-link { display: block; }
.card-link::after { content: ""; position: absolute; z-index: 1; inset: 0; border-radius: var(--radius); }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 3px solid var(--accent); outline-offset: -4px; }
.card-preview { overflow: hidden; background: var(--deep); }
.card-preview img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .25s ease; }
.card-link:hover .card-preview img { transform: scale(1.035); }
.card-heading { display: flex; align-items: center; gap: 13px; }
.game-card .card-heading { padding: 15px 16px 0; }
.card-heading img { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 12px; object-fit: cover; }
.card-heading h3 { font-size: 1.19rem; }
.card-body { display: flex; flex: 1; flex-direction: column; gap: 11px; padding: 12px 16px 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags:empty { display: none; }
.tags span { padding: 2px 8px; border: 1px solid #4b395f; border-radius: 99px; color: #e1cef1; background: #302341; font-size: .81rem; line-height: 1.5; }
.summary { color: var(--muted); }
.card-stores { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 7px; }
.card-stores .store-link { position: relative; z-index: 2; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 700; }
.back-link:hover { text-decoration: underline; text-underline-offset: .25em; }
.empty-state { padding: 34px 20px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
.empty-state p { margin: 10px 0 16px; color: var(--muted); }

.store-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid #615071;
  border-radius: 8px;
  background: #181126;
  color: #fff;
  font-size: .875rem;
  font-weight: 750;
  transition: border-color .18s, background-color .18s;
  white-space: nowrap;
}
.store-link:hover { border-color: var(--accent); background: var(--panel-bright); }
.store-icon { display: grid; place-items: center; width: 13px; flex: 0 0 13px; }
.store-google .store-icon { height: 14px; background: conic-gradient(from 134deg, #ff6876, #ffd889, #70dab3, #75b8ff, #ff6876); clip-path: polygon(4% 0, 100% 50%, 4% 100%); }
.store-apple .store-icon { height: 15px; border: 1px solid #e8d6f4; border-radius: 3px; }
.store-apple .store-icon::after { content: ""; align-self: end; margin-bottom: 2px; width: 4px; height: 1px; border-radius: 1px; background: #e8d6f4; }
.store-tap .store-icon { color: #80f0ec; }
.store-tap .store-icon::after { content: "T"; }

.site-footer { background: var(--deep); border-top: 1px solid var(--line-soft); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 24px; padding-block: 24px; color: var(--muted); font-size: .88rem; }
.footer-brand { color: var(--text); font-size: 1rem; font-weight: 800; }

.detail-page { padding-top: 14px; padding-bottom: 44px; }
.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
  align-items: stretch;
  min-width: 0;
  border: 1px solid #594368;
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(ellipse at right top, #3d2955, transparent 75%), var(--panel);
}
.detail-banner { min-width: 0; background: var(--deep); }
.detail-banner img { width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.detail-intro { display: grid; align-content: center; gap: 16px; min-width: 0; padding: clamp(20px, 3.15vw, 42px); }
.detail-intro .card-heading { align-items: center; }
.detail-intro .card-heading img { width: 54px; height: 54px; flex-basis: 54px; }
.detail-intro h1 { font-size: clamp(1.55rem, 3.2vw, 2.9rem); letter-spacing: -.035em; }
.detail-lead, .store-note { color: var(--muted); }
.store-note { font-size: .87rem; }
.detail-stores { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-stores .store-link { min-height: 46px; padding-inline: 12px; font-size: .98rem; }
.detail-content { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(25px, 4vw, 56px); margin: 32px 0 22px; }
.detail-content h2 { margin-bottom: 16px; font-size: clamp(1.5rem, 2.4vw, 2.15rem); }
.long-summary { color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; line-height: 1.78; }
.story-source { margin-top: 20px; color: var(--quiet); font-size: .88rem; }
.story-source a { color: var(--accent); }
.story-source a:hover { text-decoration: underline; }
.screenshot-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: start; gap: 12px; }
.screenshot-item { grid-column: span 3; }
.screenshot-portrait { grid-column: span 2; }
.screenshot-item:only-child { grid-column: 1 / -1; }
.screenshot-portrait:only-child { grid-column: span 3; }
.screenshot-item a { display: block; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: var(--deep); }
.screenshot-item a:hover { border-color: var(--accent); }
.screenshot-item img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; }
.screenshot-portrait img { aspect-ratio: 9 / 16; }
.gallery-dialog {
  width: min(990px, calc(100% - 26px));
  max-height: calc(100dvh - 26px);
  padding: 12px;
  border: 1px solid #796391;
  border-radius: 16px;
  color: var(--text);
  background: var(--deep);
}
.gallery-dialog::backdrop { background: #080511d9; }
body:has(.gallery-dialog[open]) { overflow: hidden; }
.gallery-image { width: 100%; max-height: calc(100dvh - 166px); object-fit: contain; margin-inline: auto; }
.gallery-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.gallery-controls { justify-content: center; margin: 8px 0 0; }
.gallery-bar button { padding: 6px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--panel); }
.gallery-bar button:disabled { cursor: default; opacity: .5; }

.error-page { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 65vh; padding-block: 40px; text-align: center; }
.error-code { color: var(--accent); font-size: clamp(6rem, 23vw, 13rem); font-weight: 900; line-height: 1; }
.error-page h1 { margin: 12px 0; }
.error-page p { margin-bottom: 24px; color: var(--muted); }

@media (max-width: 920px) {
  .container { width: calc(100% - 48px); }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

@media (max-width: 850px) {
  .hero-inner, .detail-hero { grid-template-columns: 1fr; }
  .hero-visual { margin: 6px 13px 0 10px; }
  .hero h1 { font-size: clamp(3.35rem, 9vw, 5.25rem); }
  .hero-copy { max-width: 48ch; }
  .detail-banner img { height: auto; }
}

@media (max-width: 620px) {
  :root { --header-height: 58px; }
  html { scroll-padding-top: 114px; }
  .container { width: calc(100% - 32px); }
  .header-inner { position: relative; justify-content: space-between; flex-wrap: wrap; gap: 0 8px; padding-top: 5px; }
  .brand { gap: 7px; font-size: .92rem; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .site-nav { order: 1; justify-content: start; gap: 26px; width: 100%; }
  .site-nav a { font-size: .88rem; }
  .language button { min-width: 43px; }
  .hero { padding: 40px 0 32px; }
  .hero-inner { gap: 26px; }
  .hero h1 { margin-top: 13px; }
  .hero-copy { margin-top: 14px; }
  .hero-actions { margin-top: 18px; }
  .hero-visual::before { inset: -7px 15px 10px -7px; border-radius: 19px; }
  .hero-visual::after { display: none; }
  .feature-card { border-radius: 12px; }
  .feature-caption { padding-inline: 12px; min-height: 53px; }
  .feature-open { width: 28px; height: 28px; flex-basis: 28px; }
  .featured { padding-bottom: 36px; }
  .featured-grid { gap: 10px; }
  .featured-grid .feature-card img { aspect-ratio: 1.45; }
  .featured-grid .feature-caption { font-size: .88rem; gap: 4px; }
  .featured-grid .feature-open { display: none; }
  .section-heading { display: block; margin-bottom: 18px; }
  .section-heading h2 { margin-bottom: 8px; }
  .filters { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px; }
  .search-field { grid-column: 1 / -1; }
  .game-grid, .detail-content { grid-template-columns: 1fr; }
  .detail-content { gap: 28px; }
  .detail-intro { gap: 12px; }
}

@media (max-width: 365px) {
  .header-inner { width: calc(100% - 20px); }
  .brand { font-size: .83rem; }
  .language button { min-width: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
