/* ==========================================================================
   桌游游戏大全 · 全局样式
   ========================================================================== */

:root {
  --bg: #080b16;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-2: rgba(255, 255, 255, 0.095);
  --border: rgba(255, 255, 255, 0.12);
  --border-soft: rgba(255, 255, 255, 0.07);
  --text: #eaf0ff;
  --text-dim: #9aa6c9;
  --text-mute: #6c78a1;
  --x: #38bdf8;
  --o: #fb7185;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --success: #34d399;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 26px;
  --shadow-lg: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 600px at 12% -10%, rgba(139, 92, 246, 0.28), transparent 60%),
    radial-gradient(820px 520px at 92% 0%, rgba(34, 211, 238, 0.18), transparent 62%),
    radial-gradient(760px 700px at 50% 118%, rgba(251, 113, 133, 0.14), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

/* ------------------------------- Layout --------------------------------- */

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px;
}

.app-view { flex: 1 1 auto; padding-bottom: 40px; }

/* ------------------------------- Header --------------------------------- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 22px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.9), rgba(34, 211, 238, 0.75));
  box-shadow: 0 12px 26px -12px rgba(139, 92, 246, 0.9);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 17px; letter-spacing: 0.02em; }
.brand-text small { font-size: 11px; color: var(--text-mute); letter-spacing: 0.14em; text-transform: uppercase; }

.app-nav { display: flex; align-items: center; gap: 10px; }

.nav-chip {
  padding: 7px 15px;
  font-size: 13px;
  border-radius: 999px;
  color: var(--text-dim);
  border: 1px solid var(--border-soft);
  background: var(--surface);
}

.nav-chip.is-active { color: var(--text); border-color: rgba(139, 92, 246, 0.5); background: rgba(139, 92, 246, 0.16); }

.nav-link {
  padding: 7px 15px;
  font-size: 13px;
  border-radius: 999px;
  color: var(--text-dim);
  border: 1px solid var(--border-soft);
  background: var(--surface);
  transition: color .2s, border-color .2s, background .2s;
}
.nav-link:hover { color: var(--text); border-color: var(--border); background: var(--surface-2); }

/* -------------------------------- Hero ---------------------------------- */

.hero {
  position: relative;
  margin-top: 8px;
  padding: 46px 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    linear-gradient(150deg, rgba(139, 92, 246, 0.22), rgba(34, 211, 238, 0.08) 55%, rgba(255, 255, 255, 0.02)),
    rgba(10, 14, 28, 0.6);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35), transparent 65%);
  pointer-events: none;
}

.hero-inner { position: relative; max-width: 620px; }

.hero-eyebrow {
  display: inline-block;
  padding: 5px 13px;
  margin-bottom: 16px;
  font-size: 12px;
  letter-spacing: 0.08em;
  border-radius: 999px;
  color: #d9c9ff;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  background: linear-gradient(100deg, #ffffff, #c9d6ff 55%, #a5f3fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--text-dim); }

.hero-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--text-dim);
}
.hero-stats b { font-size: 18px; color: var(--text); margin-right: 2px; }
.hero-stats .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-mute); }

/* ------------------------------ Sections -------------------------------- */

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 44px 0 20px;
}
.section-head h2 { margin: 0; font-size: 19px; letter-spacing: 0.01em; }
.section-head p { margin: 0; font-size: 13px; color: var(--text-mute); }

/* ---------------------------- Game cards -------------------------------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 20px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.95);
  overflow: hidden;
  transition: transform .28s cubic-bezier(.2, .8, .3, 1), border-color .28s, box-shadow .28s;
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 34px 60px -28px rgba(139, 92, 246, 0.55);
}

.card-glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(360px 180px at 85% 0%, rgba(139, 92, 246, 0.28), transparent 68%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.game-card:hover .card-glow { opacity: 1; }

.card-art {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 18px;
  font-size: 30px;
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(139, 92, 246, 0.28), rgba(34, 211, 238, 0.16));
  border: 1px solid var(--border);
}

.card-title-row { display: flex; align-items: center; gap: 10px; }
.card-title-row h3 { margin: 0; font-size: 18px; letter-spacing: 0.01em; }

.badge {
  padding: 3px 9px;
  font-size: 11px;
  border-radius: 999px;
  color: #0a0e1a;
  font-weight: 700;
  background: linear-gradient(120deg, #a78bfa, #22d3ee);
}

.card-desc {
  margin: 10px 0 16px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-dim);
  flex: 1 1 auto;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  padding: 4px 10px;
  font-size: 11.5px;
  border-radius: 999px;
  color: #b9c4e6;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-soft);
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.card-players { font-size: 12px; color: var(--text-mute); }

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #c4b5fd;
  transition: color .2s;
}
.card-cta .arrow { transition: transform .25s; }
.game-card:hover .card-cta { color: #e9d5ff; }
.game-card:hover .card-cta .arrow { transform: translateX(4px); }
.card-cta.muted { color: var(--text-mute); font-weight: 500; }

.game-card.is-upcoming { cursor: default; opacity: 0.72; }
.game-card.is-upcoming:hover { transform: none; border-color: var(--border-soft); box-shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.95); }

/* ----------------------------- Game page -------------------------------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 22px;
  font-size: 13px;
  color: var(--text-dim);
  transition: color .2s, transform .2s;
}
.back-link:hover { color: var(--text); transform: translateX(-3px); }

.game-page-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.game-page-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  font-size: 30px;
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(139, 92, 246, 0.3), rgba(34, 211, 238, 0.16));
  border: 1px solid var(--border);
  flex: 0 0 auto;
}

.game-page-title h1 { margin: 0 0 6px; font-size: clamp(22px, 3.6vw, 30px); }
.game-page-title p { margin: 0; font-size: 13.5px; color: var(--text-dim); }

/* ------------------------------- Footer --------------------------------- */

.app-footer {
  padding: 30px 0 34px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-mute);
  border-top: 1px solid var(--border-soft);
}
.app-footer p { margin: 0; }

/* ------------------------------ Buttons --------------------------------- */

.btn {
  padding: 11px 20px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  color: var(--text);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: transform .18s, background .2s, border-color .2s, box-shadow .2s, opacity .2s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: rgba(139, 92, 246, 0.45); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }

.btn-primary {
  border-color: transparent;
  color: #0a0e1a;
  background: linear-gradient(120deg, #a78bfa, #22d3ee);
  box-shadow: 0 14px 30px -16px rgba(139, 92, 246, 0.95);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); background: linear-gradient(120deg, #a78bfa, #22d3ee); }

/* ------------------------------ Switch ---------------------------------- */

.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--border);
  transition: background .22s, border-color .22s;
  flex: 0 0 auto;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e8edff;
  transition: transform .22s cubic-bezier(.2, .8, .3, 1);
}
.switch input:checked + .switch-track { background: rgba(139, 92, 246, 0.75); border-color: rgba(167, 139, 250, 0.8); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }
.switch input:disabled + .switch-track { opacity: 0.45; }
.switch.is-disabled { cursor: not-allowed; opacity: 0.6; }

/* ------------------------------ Details --------------------------------- */

details.panel {
  margin-top: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: var(--surface);
  overflow: hidden;
}
details.panel > summary {
  padding: 15px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .2s;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "＋"; font-size: 15px; color: var(--text-mute); transition: transform .25s; }
details.panel[open] > summary::after { content: "－"; }
details.panel > summary:hover { background: var(--surface-2); }
.panel-body { padding: 4px 20px 20px; font-size: 13.5px; line-height: 1.75; color: var(--text-dim); }
.panel-body h4 { margin: 16px 0 6px; font-size: 13.5px; color: var(--text); }
.panel-body h4:first-child { margin-top: 6px; }
.panel-body p, .panel-body ol, .panel-body ul { margin: 0 0 10px; padding-left: 20px; }
.panel-body p { padding-left: 0; }
.panel-body li { margin-bottom: 5px; }
.panel-body strong { color: #c4b5fd; }

/* ------------------------------ Responsive ------------------------------ */

@media (max-width: 640px) {
  #app { padding: 0 15px; }
  .hero { padding: 32px 22px; }
  .brand-text small { display: none; }
  .game-grid { grid-template-columns: 1fr; gap: 16px; }
}
