:root {
  --bg: #fbf6ec;
  --surface: #ffffff;
  --text: #3d2c1e;
  --muted: #8a7562;
  --line: #eadfcd;
  --brand: #f2a51e;
  --brand-2: #5cbf3a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1814;
    --surface: #2a231d;
    --text: #f3e9dc;
    --muted: #b3a291;
    --line: #3e342b;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}
a { color: inherit; }

.site-header { padding: 18px 20px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 900; text-decoration: none; letter-spacing: .5px; }
.logo-mark { font-size: 26px; }
.logo .dot { color: var(--brand); }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px 40px; flex: 1; }
.hero { padding: 28px 4px 34px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(28px, 5vw, 44px); line-height: 1.15; }
.hero p { margin: 0; color: var(--muted); font-size: 16px; }

.section-title { font-size: 18px; margin: 0 0 14px; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.game-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
a.game-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(60,40,10,.12); }
.game-card.disabled { opacity: .6; }
.card-cover {
  aspect-ratio: 16 / 9; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.55), transparent 60%), var(--accent);
}
.card-cover span { font-size: 64px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.2)); }
.card-body { padding: 14px 16px 16px; }
.card-title { font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--muted); }
.card-tagline { color: var(--brand); font-weight: 700; font-size: 13px; margin-top: 2px; }
.card-desc { margin: 8px 0 10px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }

.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; }

/* ---------- play page ---------- */
body.play { height: 100dvh; overflow: hidden; }
.play-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.bar-btn {
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 10px; padding: 6px 12px; font: inherit; font-weight: 700; font-size: 14px;
  text-decoration: none; cursor: pointer;
}
.play-title { font-weight: 800; }
.frame-wrap { position: relative; flex: 1; min-height: 0; background: #000; }
.frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.frame-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #ccc; }
@media (max-width: 600px) {
  .play-bar { padding: 6px 10px; }
}

/* ---------- 账号 ---------- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acct-slot { position: relative; margin-left: auto; }
.play-bar .acct-slot { margin-left: auto; margin-right: 6px; }
.acct-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 200px; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.acct-chip span:not(.ava):not(.flag) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-chip.login { padding: 7px 16px; background: var(--brand); border-color: var(--brand); color: #fff; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: flex; flex-direction: column; min-width: 120px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.acct-menu button { padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.acct-menu button:hover { background: var(--bg); }
.ava { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: inline-grid; place-items: center; font-size: 18px; line-height: 1; background: var(--bg); object-fit: cover; vertical-align: middle; }
.ava.big { width: 56px; height: 56px; font-size: 36px; }
.flag { font-size: 18px; line-height: 1; }
.btn { display: inline-block; padding: 8px 16px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.btn.ghost { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.acct-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.45); }
.acct-card { position: relative; width: 100%; max-width: 420px; max-height: 90dvh; overflow: auto; padding: 22px 20px 18px; border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.acct-card h2 { margin: 0 0 6px; font-size: 22px; }
.acct-x { position: absolute; right: 10px; top: 8px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 24px; cursor: pointer; }
.acct-muted, .acct-label small { color: var(--muted); font-weight: 400; }
.acct-google { display: flex; justify-content: center; min-height: 44px; margin: 14px 0; }
.acct-dev { padding: 10px; border: 1px dashed var(--line); border-radius: 12px; }
.acct-row { display: flex; gap: 8px; margin-top: 6px; }
.acct-row input { flex: 1; }
.acct-card input, .acct-card select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; }
.acct-label { display: block; margin: 14px 0 6px; font-weight: 800; }
.acct-avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.acct-avatars button { display: grid; place-items: center; height: 44px; border: 2px solid transparent; border-radius: 12px; background: var(--bg); cursor: pointer; }
.acct-avatars button.on { border-color: var(--brand); }
.acct-preview { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; font-size: 18px; }
.acct-hint { min-height: 1.2em; margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.acct-hint.ok { color: var(--brand-2); }
.acct-hint.bad, .acct-err { color: #e04a3a; }
.acct-err { margin: 10px 0 0; }
.acct-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.acct-menu[hidden] { display: none; }
