/* ---- Design tokens ---- */
:root {
  --bg: #0e1020;
  --bg-elev: #171935;
  --card: #1e2144;
  --border: #2c2f5c;
  --text: #e9ecff;
  --muted: #9ba0c9;
  --brand: #7c5cff;
  --brand-2: #22d3ee;
  --accent: #ffcc33;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft Yahei", Roboto, Helvetica, Arial, sans-serif; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 0.5em; font-weight: 700; letter-spacing: 0.2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---- Header ---- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(14,16,32,0.85); backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 24px; padding: 14px 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand-icon { font-size: 22px; }
.site-nav { display: flex; gap: 20px; margin-left: auto; }
.site-nav a { color: var(--muted); padding: 6px 4px; border-bottom: 2px solid transparent; transition: color 0.15s; }
.site-nav a:hover { color: var(--text); }
.site-nav a.active { color: var(--text); border-bottom-color: var(--brand); }
.lang-toggle { padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--muted); }
.lang-toggle:hover { color: var(--text); border-color: var(--brand); }

/* ---- Hero ---- */
.hero { padding: 72px 0 40px; background: radial-gradient(1000px 400px at 15% 0%, rgba(124,92,255,0.35), transparent 60%), radial-gradient(800px 400px at 85% 10%, rgba(34,211,238,0.25), transparent 60%); }
.hero.small { padding: 40px 24px 8px; text-align: center; }
.hero h1 { font-size: 42px; line-height: 1.15; background: linear-gradient(90deg, var(--text), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: var(--muted); font-size: 17px; max-width: 720px; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 10px; background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); font-size: 14px; }
.btn-primary { background: linear-gradient(90deg, var(--brand), var(--brand-2)); border: none; color: #0a0a20; font-weight: 700; }
.btn:hover { transform: translateY(-1px); }

/* ---- Sections ---- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 40px 0 16px; }
.section-head h2 { font-size: 22px; }
.section-head .more { color: var(--muted); font-size: 14px; }
.section-head .more:hover { color: var(--brand-2); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.game-card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform 0.15s, border-color 0.15s; }
.game-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.card-cover { height: 130px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #262b58, #1a1d3f); }
.cover-emoji { font-size: 54px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4)); }
.card-body { padding: 14px 16px 16px; }
.card-title { font-size: 17px; margin-bottom: 4px; }
.card-summary { color: var(--muted); font-size: 13px; min-height: 38px; }
.card-meta { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: rgba(124,92,255,0.15); color: #b7a5ff; font-size: 11px; border: 1px solid rgba(124,92,255,0.35); }
.pill-cat { background: rgba(34,211,238,0.10); color: #7ceaf7; border-color: rgba(34,211,238,0.3); }

.cat-row { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px; font-size: 14px; color: var(--muted); }
.cat-chip:hover { color: var(--text); border-color: var(--brand); }
.cat-icon { font-size: 16px; }

/* ---- Detail ---- */
.detail { padding: 24px; max-width: 1000px; margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.back-link:hover { color: var(--brand-2); }
.detail-head h1 { font-size: 32px; }
.detail-head .lead { color: var(--muted); font-size: 16px; }
.player-shell { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin: 20px 0; }
.player-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.player-toolbar .hint { color: var(--muted); font-size: 13px; flex: 1; }
.player { width: 100%; height: 560px; border: none; border-radius: 10px; background: #000; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; padding: 16px; background: var(--bg-elev); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 24px; }
.meta-grid h4 { font-size: 12px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; letter-spacing: 0.8px; }
.meta-grid a, .meta-grid span { font-size: 14px; word-break: break-all; }
.desc h3 { margin-top: 8px; font-size: 18px; }
.desc p { color: #cfd3f5; font-size: 15px; }
.desc .controls { color: var(--muted); font-size: 14px; padding: 10px 12px; background: rgba(34,211,238,0.05); border-left: 3px solid var(--brand-2); border-radius: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px; }

/* ---- Footer ---- */
.site-footer { margin-top: 60px; padding: 24px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 720px) {
  .hero h1 { font-size: 28px; }
  .header-inner { gap: 12px; padding: 12px 16px; }
  .player { height: 460px; }
}

/* v2 additions: scale features */
.card-cover { position: relative; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zh-pending { position: absolute; top: 8px; right: 8px; background: rgba(255,204,51,0.9); color: #2a1d00; font-size: 10px; padding: 2px 6px; border-radius: 6px; font-weight: 600; }
.cat-count { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: rgba(124,92,255,0.15); color: #b7a5ff; font-size: 11px; }
.cat-line { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.cat-line a { cursor: pointer; }
.cat-line a:hover { border-color: var(--brand-2); color: #7ceaf7; }

/* Status badges on game cards */
.status-badge { position: absolute; bottom: 8px; right: 8px; font-size: 10px; padding: 2px 7px; border-radius: 6px; background: rgba(255,255,255,0.12); color: #e0e0e0; backdrop-filter: blur(4px); font-weight: 500; }
.badge-play { background: rgba(34,211,238,0.15); color: #7ceaf7; }

/* External play panel (non-fetched games) */
.play-external { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 48px 24px; }
.play-external .btn { min-width: 180px; text-align: center; }
.coming-soon { color: var(--muted); font-size: 16px; }

/* Tip box on detail pages */
.tip-box { margin-top: 16px; padding: 14px 16px; background: rgba(255,204,51,0.06); border-left: 3px solid var(--accent); border-radius: 8px; }
.tip-box h4 { margin: 0 0 6px; font-size: 13px; color: var(--accent); }
.tip-box p { color: #cfd3f5; font-size: 14px; margin: 0; }

/* FAQ on detail pages */
.faq-item { margin-top: 14px; }
.faq-item h4 { margin: 0 0 4px; font-size: 14px; color: #fff; }
.faq-item p { margin: 0; color: #cfd3f5; font-size: 14px; }

/* Search box on list pages */
.search-box { margin-bottom: 22px; }
.search-box input {
  width: 100%; max-width: 560px; display: block;
  padding: 12px 16px; font-size: 15px; color: #fff;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,204,51,0.15); }
.search-box input::placeholder { color: var(--muted); }
.search-empty { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
