/* SnapArcade 站点样式。
   墨黑街机机台：珊瑚红闪电标、阳光黄操作键、硬边偏移投影。
   不用外部字体与图片，不用毛玻璃，动效只在悬停与按压时出现。 */

:root {
  --bg: #0b0c11;
  --bg-2: #101219;
  --surface: #161924;
  --surface-2: #1e2231;
  --line: #262b3b;
  --line-2: #3a4159;
  --text: #f6f3ea;
  --muted: #aab0c0;
  --dim: #7f879b;
  --hot: #ff4f5e;
  --hot-ink: #1a0b0e;
  --sun: #ffcc3d;
  --sun-hi: #ffd966;
  --sun-ink: #1a1406;
  --sun-shade: #a87a08;
  --mint: #43e3b8;
  --ink: #06070a;
  --r: 12px;
  --r-lg: 18px;
  --wrap: 1240px;
  --gutter: clamp(14px, 3.6vw, 32px);
  --top: 60px;
  --stripe: linear-gradient(100deg, var(--hot) 0 64%, var(--sun) 64% 100%);
  --font: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scroll-padding-top: calc(var(--top) + 12px);
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 16px/1.6 var(--font);
  background: radial-gradient(1100px 480px at 86% -12%, rgba(255, 79, 94, .13), transparent 62%), var(--bg);
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
svg { flex: none; }
code { font-family: var(--mono); font-size: .92em; padding: .1em .35em; border-radius: 5px; background: rgba(255, 255, 255, .07); }

:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -80px; z-index: 200;
  padding: 10px 16px; border-radius: 10px; background: var(--sun); color: var(--sun-ink);
  font-weight: 800; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.muted { color: var(--muted); }
.eyebrow {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: var(--sun); font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
.lead { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 46em; }

/* Section headings carry the brand's skewed sun bar. */
.section-title { display: flex; align-items: center; gap: 12px; font-size: clamp(22px, 2.6vw, 30px); font-weight: 900; letter-spacing: -.025em; }
.section-title::before {
  content: ""; flex: none; width: 9px; height: .85em; border-radius: 2px;
  background: var(--sun); box-shadow: 4px 0 0 var(--hot); transform: skewX(-14deg);
}

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(11, 12, 17, .97); border-bottom: 1px solid var(--line); }
.topbar::before { content: ""; display: block; height: 3px; background: var(--stripe); }
.topbar__inner { display: flex; align-items: center; gap: 8px; min-height: 56px; }

.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-right: auto; color: var(--text); text-decoration: none; }
.logo { flex: none; }
.brand .logo { width: 34px; height: 34px; transform: rotate(-7deg); transition: transform .18s ease; }
.brand:hover .logo { transform: rotate(0deg); }
.brand__name { font-size: 21px; font-weight: 900; font-style: italic; letter-spacing: -.04em; line-height: 1; padding-right: .1em; }
.brand__name span, .footer__brand strong span { color: var(--hot); }

.topnav { display: flex; gap: 2px; }
.topnav a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  border-radius: 10px; color: var(--muted); font-size: 15px; font-weight: 700; text-decoration: none;
}
.topnav a:hover { color: var(--text); background: var(--surface-2); }
.topnav a svg { color: var(--sun); }

.language-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); }
.language-switch a {
  display: inline-flex; align-items: center; justify-content: center; min-width: 38px; min-height: 38px; padding: 0 9px;
  border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 800; text-decoration: none; white-space: nowrap;
}
.language-switch a:hover { color: var(--text); }
.language-switch a[aria-current="true"] { background: var(--sun); color: var(--sun-ink); }

/* ---------- 按钮 ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 20px; }
.actions--center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: 0 20px; border-radius: 12px;
  border: 2px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 800; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .12s ease, box-shadow .12s ease;
}
.btn:hover { border-color: #58627f; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--sun); border-color: var(--sun); color: var(--sun-ink); box-shadow: 0 4px 0 var(--sun-shade); }
.btn--primary:hover { background: var(--sun-hi); border-color: var(--sun-hi); }
.btn--primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--sun-shade); }
.btn--ghost { background: rgba(11, 12, 17, .6); }
.btn--lg { min-height: 54px; padding: 0 26px; font-size: 18px; }
.btn .icon-play { width: 1em; height: 1em; }

/* ---------- 首页 ---------- */
.home { padding-top: clamp(14px, 2.4vw, 26px); }
.home-intro { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; margin-bottom: clamp(12px, 1.8vw, 18px); }
.home-intro h1 { font-size: clamp(23px, 3.2vw, 34px); font-weight: 900; letter-spacing: -.035em; }
.home-intro p { color: var(--muted); font-size: clamp(14px, 1.5vw, 16px); line-height: 1.45; }

/* Featured: the real cover, uncropped on phones, with one obvious Play action. */
.showcase { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.feature {
  position: relative; isolation: isolate; display: block; overflow: hidden;
  width: 100%; aspect-ratio: 3 / 2; min-width: 0; min-height: 216px; border-radius: var(--r-lg);
  background: var(--surface); color: #fff; text-decoration: none;
  box-shadow: 0 0 0 1px var(--line), 0 20px 50px rgba(0, 0, 0, .4);
}
.feature__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.feature::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 8, 12, 0) 34%, rgba(7, 8, 12, .6) 62%, rgba(7, 8, 12, .94) 100%),
    linear-gradient(90deg, rgba(7, 8, 12, .45), rgba(7, 8, 12, 0) 62%);
}
.feature__copy { position: absolute; left: 0; right: 0; bottom: 0; display: grid; justify-items: start; gap: 8px; padding: clamp(14px, 3vw, 32px); }
.feature__tag {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  color: var(--sun); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
}
.feature__flag {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 8px; border-radius: 4px;
  background: var(--hot); color: var(--hot-ink); text-shadow: none; transform: skewX(-10deg);
  box-shadow: 3px 3px 0 var(--ink);
}
.feature__title {
  max-width: 16ch; font-size: clamp(27px, 4.6vw, 54px); font-weight: 900; line-height: 1.02; letter-spacing: -.04em;
  text-wrap: balance; overflow-wrap: break-word; text-shadow: 0 2px 14px rgba(0, 0, 0, .55);
}
.feature__summary { max-width: 46ch; color: #e7e4dc; font-size: 16px; line-height: 1.5; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.feature__cta { margin-top: 6px; }
.feature:focus-visible { outline-offset: 4px; border-radius: var(--r-lg); }

.picks { display: none; }
.picks__label { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.picks__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pick {
  position: relative; display: grid; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); align-items: center; gap: 14px;
  height: 100%; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); text-decoration: none; transition: border-color .15s ease, background-color .15s ease;
}
.pick__art { display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 9px; background: var(--bg-2); }
.pick__art img { width: 100%; height: 100%; object-fit: cover; }
.pick__text { display: grid; gap: 2px; min-width: 0; padding-right: 36px; }
.pick__title {
  font-size: 16px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.pick__meta { color: var(--muted); font-size: 13px; line-height: 1.35; }
.pick__go {
  position: absolute; right: 12px; top: 50%; display: grid; place-items: center; width: 32px; height: 32px; margin-top: -16px;
  border-radius: 9px; background: var(--surface-2); color: var(--sun);
}
.pick__go svg { width: 13px; height: 13px; }
.picks__all {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 0 16px;
  border-radius: 14px; border: 2px dashed var(--line-2); color: var(--sun); font-weight: 800; text-decoration: none;
}
.picks__all:hover { border-color: var(--sun); }

/* Library */
.catalogue { margin-top: clamp(26px, 4.4vw, 52px); }
.catalogue__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 12px; }
.library-search {
  display: flex; align-items: center; gap: 10px; flex: 1 1 100%; min-height: 50px; padding: 0 14px;
  border-radius: 12px; border: 2px solid var(--line-2); background: var(--surface); color: var(--sun);
}
.library-search:focus-within { border-color: var(--sun); background: var(--surface-2); }
.library-search input {
  flex: 1; min-width: 0; height: 46px; padding: 0; border: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 16px; scroll-margin-top: 64px;
}
.library-search input::placeholder { color: var(--dim); opacity: 1; }
.library-search input:focus-visible { outline: none; }

/* Phones: one swipeable row of filters bleeding to the screen edges. */
.filters {
  display: flex; gap: 8px; margin: 0 calc(var(--gutter) * -1) 14px; padding: 4px var(--gutter) 8px;
  overflow-x: auto; scrollbar-width: none; scroll-padding-inline: var(--gutter); overscroll-behavior-x: contain;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 15px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 700; white-space: nowrap; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.chip span { color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: #58627f; }
.chip:focus-visible { outline-offset: 2px; }
.chip[aria-pressed="true"] { background: var(--sun); border-color: var(--sun); color: var(--sun-ink); box-shadow: 0 3px 0 var(--sun-shade); }
.chip[aria-pressed="true"] span { color: rgba(26, 20, 6, .62); }

.grid {
  list-style: none; padding: 0; margin: 0; display: grid; gap: 18px 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.card { min-width: 0; }
.card__link { display: flex; flex-direction: column; gap: 8px; height: 100%; color: var(--text); text-decoration: none; border-radius: var(--r); }
.card__link:focus-visible { outline-offset: 4px; }
.card__art {
  position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--r);
  background: var(--surface); box-shadow: 0 0 0 1px var(--line);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card__art img { width: 100%; height: 100%; object-fit: cover; }
.card__arrow {
  position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; background: var(--sun); color: var(--sun-ink); box-shadow: 0 3px 0 var(--sun-shade);
  opacity: 0; transition: opacity .15s ease;
}
.card__arrow svg { width: 14px; height: 14px; }
.card__body { display: grid; gap: 1px; padding: 0 2px; }
.card__title {
  font-size: 15px; font-weight: 800; line-height: 1.28; letter-spacing: -.01em; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.card__meta { color: var(--muted); font-size: 13px; line-height: 1.35; }

.catalogue__empty {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 20px;
  border: 2px dashed var(--line-2); border-radius: var(--r-lg); color: var(--muted);
}

.about { display: grid; gap: 18px 36px; margin-top: clamp(44px, 6vw, 76px); padding-top: clamp(22px, 3vw, 32px); border-top: 1px solid var(--line); }
.about h2 { font-size: 20px; font-weight: 900; letter-spacing: -.02em; margin-bottom: 8px; }
.about h3 { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.about p { color: var(--muted); font-size: 14.5px; }
.about__link { margin-top: 12px; }
.inline-link { display: inline-flex; align-items: center; gap: 6px; color: var(--sun); font-weight: 800; text-decoration: none; }
.inline-link:hover { text-decoration: underline; }

/* ---------- 页脚 ---------- */
.footer { margin-top: clamp(48px, 7vw, 88px); background: var(--bg-2); color: var(--muted); font-size: 14px; }
.footer::before { content: ""; display: block; height: 3px; background: var(--stripe); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding-block: 28px 36px; }
.footer__about { display: grid; gap: 8px; max-width: 46ch; }
.footer__brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.footer__brand .logo { width: 28px; height: 28px; transform: rotate(-7deg); }
.footer__brand strong { font-size: 18px; font-weight: 900; font-style: italic; letter-spacing: -.04em; }
.footer nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: -12px; }
.footer nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px;
  color: var(--text); font-weight: 700; text-decoration: none;
}
.footer nav a:hover { background: var(--surface-2); color: var(--sun); }

/* ---------- 游戏详情 ---------- */
.detail { padding-top: clamp(10px, 2vw, 20px); }
.detail__top { display: grid; gap: 8px; margin-bottom: 14px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0 6px; list-style: none; padding: 0; margin: 0; font-size: 13.5px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: #5d6479; }
.crumbs a { display: inline-block; padding-block: 4px; color: var(--text); text-decoration: none; }
.crumbs a:hover { color: var(--sun); text-decoration: underline; }
.detail__head { display: grid; gap: 6px; min-width: 0; }
.detail__kicker { color: var(--mint); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.detail__kicker span { color: var(--dim); margin-inline: 2px; }
.detail__head h1 {
  font-size: clamp(28px, 4.8vw, 52px); font-weight: 900; line-height: 1.04; letter-spacing: -.04em;
  text-wrap: balance; overflow-wrap: break-word;
}
.detail__lead { max-width: 62ch; color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); line-height: 1.5; }

/* Phones: devices on the left, Embed on the right; the open panel drops in before the stage. */
.playbar { display: flow-root; margin-top: 4px; }
.devices { float: left; display: flex; flex-wrap: wrap; align-items: center; min-height: 46px; margin: 0 12px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.devices li + li::before { content: "·"; margin: 0 7px; color: var(--dim); }
.embed-box > summary { float: right; min-height: 46px; padding: 0 14px; font-size: 15px; list-style: none; }
.embed-box > summary::-webkit-details-marker { display: none; }
.embed-box > summary svg { color: var(--sun); }
.embed-box[open] > summary { margin-bottom: 10px; border-color: var(--sun); color: var(--sun); }
.embed-box__body {
  clear: both; padding: 16px;
  border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface);
}
.embed-box__body p { color: var(--muted); font-size: 14px; }
.embed-box .actions { margin-top: 12px; }
.code {
  display: block; width: 100%; margin-top: 10px; padding: 10px 12px; resize: vertical;
  font: 13px/1.5 var(--mono); color: #e9e6dd; background: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
}
.copy-status { color: var(--mint); font-weight: 700; min-height: 1.6em; }

.detail__info { display: grid; gap: 14px; margin-top: clamp(22px, 3.4vw, 36px); }
.panel { padding: clamp(18px, 2.6vw, 26px); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.panel h2 { font-size: 19px; font-weight: 900; letter-spacing: -.015em; margin-bottom: 10px; }
.panel p { color: #d8dae1; }
.panel p + p { margin-top: 10px; }
.note, .panel .note { margin-top: 12px; color: var(--muted); font-size: 14px; }
.panel .muted { color: var(--muted); }

.controls { margin: 0; display: grid; }
.controls__row { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.controls__row:first-child { border-top: 0; padding-top: 0; }
.controls dt { color: var(--sun); font-size: 14.5px; font-weight: 800; }
.controls dd { margin: 0; color: var(--muted); font-size: 14.5px; }

.guide { margin: 0; display: grid; gap: 16px; }
.guide__item { display: grid; gap: 6px; align-content: start; padding-top: 14px; border-top: 1px solid var(--line); }
.guide__item:first-child { padding-top: 0; border-top: 0; }
.guide dt { color: var(--sun); font-size: 15px; font-weight: 800; line-height: 1.35; }
.guide dd { margin: 0; color: #d8dae1; font-size: 14.5px; }

.collection__guide, .collection__games, .collection__note { margin-top: clamp(22px, 3.4vw, 36px); }
.collection__styles { display: grid; gap: 14px; margin-top: 14px; }
.collection__style h3 { font-size: 16px; font-weight: 800; color: var(--sun); margin-bottom: 8px; }
.collection__style p { font-size: 14.5px; }

.more { margin-top: clamp(36px, 5vw, 60px); }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; margin-bottom: 14px; }
.section-head a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--sun); font-weight: 800; text-decoration: none; }
.section-head a:hover { text-decoration: underline; }

.empty { padding-block: clamp(48px, 10vw, 110px) 24px; display: grid; justify-items: start; gap: 12px; }
.empty h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 900; letter-spacing: -.04em; }

/* ---------- 播放器 ---------- */
.player { margin: 0; }
.player__stage {
  position: relative; isolation: isolate; overflow: hidden;
  width: 100%; aspect-ratio: 4 / 3; max-height: 80vh; min-height: 270px;
  border-radius: 16px; background: #05060a;
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgba(0, 0, 0, .45);
}
.player__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.player__panel {
  position: absolute; inset: 0; z-index: 1; overflow: auto;
  display: grid; place-items: center; padding: clamp(14px, 3.5vw, 32px); text-align: center;
  background: linear-gradient(180deg, rgba(7, 8, 12, .4), rgba(7, 8, 12, .86));
}
/* Detail idle: show the cover at full strength and anchor Play to the bottom edge. */
.player--detail[data-state="idle"] .player__poster { opacity: 1; }
.player--detail[data-state="idle"] .player__panel {
  place-items: end center;
  background: linear-gradient(180deg, rgba(7, 8, 12, 0) 28%, rgba(7, 8, 12, .62) 60%, rgba(7, 8, 12, .95) 100%);
}
.player--detail [data-view="idle"] .player__title { display: none; }

.player__view { width: min(100%, 540px); display: grid; gap: 8px; justify-items: center; }
.player__view .actions { width: 100%; margin-top: 8px; }
.player__title { font-size: clamp(22px, 4vw, 34px); font-weight: 900; line-height: 1.15; letter-spacing: -.02em; text-shadow: 0 2px 0 #000; overflow-wrap: break-word; }
.player__title:focus { outline: none; }
.player__hint { color: #dfe1e8; font-size: 14.5px; line-height: 1.5; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.player__language { color: var(--sun); font-size: 13px; font-weight: 700; }
.player__brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 900; font-style: italic; letter-spacing: -.03em; }
.player__brand .logo { width: 26px; height: 26px; transform: rotate(-7deg); }
.player__credit a { color: var(--muted); font-size: 14px; }
.player__credit a:hover { color: var(--text); }
.player__details { width: 100%; text-align: left; font-size: 13px; color: var(--muted); }
.player__details pre { white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; font-family: var(--mono); }
.player__noscript { margin-top: 10px; color: var(--hot); }
.meter {
  width: 100%; height: 12px; border: 0; border-radius: 999px; overflow: hidden;
  background: #262c3b; accent-color: var(--sun); appearance: none; -webkit-appearance: none;
}
.meter::-webkit-progress-bar { background: #262c3b; border-radius: 999px; }
.meter::-webkit-progress-value { background: linear-gradient(90deg, var(--hot), var(--sun)); border-radius: 999px; }
.meter::-moz-progress-bar { background: linear-gradient(90deg, var(--hot), var(--sun)); border-radius: 999px; }

/* 画布尺寸由 Godot 按 canvasResizePolicy 设置，这里不改宽高。 */
.player__canvas { position: absolute; top: 0; left: 0; display: block; visibility: hidden; outline: none; touch-action: none; }
.player[data-state="running"] .player__canvas,
.player[data-state="ended"] .player__canvas { visibility: visible; }
.player[data-state="running"] .player__poster,
.player[data-state="running"] .player__panel,
.player[data-state="ended"] .player__poster { display: none; }
.player[data-state="error"] .player__canvas { display: none; }

.player__bar {
  position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; gap: 6px;
  opacity: .55; transition: opacity .2s ease;
}
.player__bar:hover, .player__bar:focus-within { opacity: 1; }
.player__bar button {
  min-height: 38px; padding: 0 13px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .26); background: rgba(7, 8, 12, .86); color: #fff;
  font: 700 13px/1 var(--font);
}
.player__bar button:hover { background: rgba(7, 8, 12, .96); border-color: var(--sun); }

/* 详情页开始游戏后：舞台铺满窗口，与原导出的整窗画布一致。 */
body.is-playing { overflow: hidden; overscroll-behavior: none; }
body.is-playing .player__stage {
  position: fixed; inset: 0; z-index: 100; max-height: none; min-height: 0; aspect-ratio: auto;
  border: 0; border-radius: 0; box-shadow: none;
}
.player__stage:fullscreen { max-height: none; min-height: 0; aspect-ratio: auto; width: 100%; height: 100%; border: 0; border-radius: 0; }
.player__stage:-webkit-full-screen { max-height: none; min-height: 0; aspect-ratio: auto; width: 100%; height: 100%; border: 0; border-radius: 0; }

/* 嵌入玩家页：整个 iframe 就是舞台。 */
html:has(body.embed-page) { height: 100%; }
body.embed-page { min-height: 0; height: 100%; overflow: hidden; background: #05060a; }
.embed-page .player { margin: 0; }
.embed-page .player__stage {
  position: fixed; inset: 0; max-height: none; min-height: 0; aspect-ratio: auto;
  border: 0; border-radius: 0; box-shadow: none;
}
.embed-page .player__view { gap: 8px; }
@media (max-height: 360px) {
  .embed-page .player__hint, .embed-page .player__credit { font-size: 13px; }
  .embed-page .btn--lg { min-height: 44px; font-size: 16px; }
}

/* ---------- 断点 ---------- */
@media (max-width: 639px) {
  .topnav a { width: 44px; padding: 0; justify-content: center; }
  .language-switch a { min-height: 44px; }
  .topnav__label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .feature__summary { display: none; }
  .feature__cta { min-height: 48px; padding-inline: 20px; font-size: 16px; }
  .player .actions .btn { flex: 1 1 auto; }
  .embed-box .actions .btn { flex: 1 1 auto; }
}
@media (max-width: 369px) {
  .topnav__browse { display: none !important; }
  .brand { gap: 8px; }
  .brand .logo { width: 30px; height: 30px; }
  .brand__name { font-size: 19px; }
  .language-switch a { min-width: 34px; padding-inline: 7px; }
  .devices { margin-right: 8px; font-size: 13px; }
  .devices li + li::before { margin-inline: 5px; }
  .card__title { font-size: 14.5px; }
}
@media (pointer: coarse) {
  .code { font-size: 16px; }
}

@media (min-width: 600px) {
  .feature { aspect-ratio: 16 / 9; }
  .picks { display: grid; gap: 10px; align-content: start; }
  .picks__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pick { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px; }
  .pick__text { padding: 0 4px 4px; }
  .pick__go { display: none; }
  .library-search { flex: 0 1 380px; }
  .filters { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 22px 14px; }
  .card__title { font-size: 16px; }
  .controls__row { grid-template-columns: minmax(9em, 42%) minmax(0, 1fr); gap: 4px 16px; }
}

@media (min-width: 760px) {
  .detail__top {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "crumbs crumbs" "head bar";
    align-items: end; gap: 10px 32px; margin-bottom: 18px;
  }
  .collection__top { grid-template-columns: minmax(0, 1fr); grid-template-areas: "crumbs" "head"; }
  .guide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
  .guide__item { padding-top: 0; border-top: 0; }
  .crumbs { grid-area: crumbs; }
  .detail__head { grid-area: head; }
  .playbar { grid-area: bar; display: flex; align-items: center; gap: 16px; margin: 0; }
  .devices { float: none; margin: 0; }
  .embed-box { position: relative; }
  .embed-box > summary, .embed-box[open] > summary { float: none; margin-bottom: 0; }
  /* Desktop: the embed panel opens as a popover over the top of the stage, keeping Play in view. */
  .embed-box__body {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 15; width: min(460px, calc(100vw - 2 * var(--gutter)));
    margin: 0; box-shadow: 0 22px 60px rgba(0, 0, 0, .6), 5px 5px 0 var(--hot);
  }
  .player__stage { aspect-ratio: 16 / 9; max-height: min(72vh, 700px); min-height: 320px; border-radius: var(--r-lg); }
}

@media (min-width: 820px) {
  .about { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr); }
  .collection__styles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

@media (min-width: 900px) {
  .grid--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail__info {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-areas: "about controls" "notes controls" "guide guide";
    grid-template-rows: auto 1fr auto; gap: 16px;
  }
  .panel--about { grid-area: about; }
  .panel--guide { grid-area: guide; }
  .panel--controls { grid-area: controls; }
  .panel--notes { grid-area: notes; align-self: start; }
}

@media (min-width: 960px) {
  :root { --top: 64px; }
  .topbar__inner { min-height: 60px; gap: 14px; }
  .showcase { grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr); gap: 16px; }
  /* Grid items with an aspect ratio don't stretch; let the row (set by the picks rail) size the hero. */
  .feature { aspect-ratio: auto; align-self: stretch; min-height: clamp(360px, 31vw, 500px); }
  .picks { grid-template-rows: auto 1fr auto; }
  .picks__list { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 1fr; }
  .pick { grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); align-content: center; gap: 14px; }
  .pick__text { padding: 0 40px 0 0; }
  .pick__go { display: grid; }
}

@media (hover: hover) {
  .feature:hover .feature__img { transform: scale(1.03); }
  .feature:hover .feature__cta { background: var(--sun-hi); border-color: var(--sun-hi); }
  .pick:hover { border-color: var(--sun); background: var(--surface-2); }
  .pick:hover .pick__go { background: var(--sun); color: var(--sun-ink); }
  .card__link:hover .card__art { transform: translate(-2px, -2px); box-shadow: 0 0 0 2px var(--sun), 5px 5px 0 var(--hot); }
  .card__link:hover .card__arrow { opacity: 1; }
  .card__link:hover .card__title { color: var(--sun); }
}
.card__link:focus-visible .card__arrow { opacity: 1; }

/* Chinese: no negative tracking on CJK headings, and calmer letter-spacing on kickers. */
:lang(zh) .home-intro h1, :lang(zh) .feature__title, :lang(zh) .detail__head h1,
:lang(zh) .section-title, :lang(zh) .empty h1, :lang(zh) .player__title, :lang(zh) .card__title { letter-spacing: 0; }
:lang(zh) .detail__kicker, :lang(zh) .picks__label, :lang(zh) .feature__tag { letter-spacing: .06em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .feature:hover .feature__img, .card__link:hover .card__art { transform: none; }
}
@media (forced-colors: active) {
  .btn, .chip, .player__bar button, .language-switch a { border: 1px solid ButtonText; }
  .section-title::before, .topbar::before, .footer::before { forced-color-adjust: none; }
}
