/* ================================================================
 * Bao Games — Global Stylesheet
 * Mobile-first, max-width 480px container, PC 端模拟 App 框架
 * ================================================================ */

/* ---- 1. CSS Variables / Design Tokens ---- */
:root {
  --color-primary: #FF6B9D;
  --color-secondary: #6C5CE7;
  --color-accent: #FFD93D;
  --color-cyan: #4ECDC4;
  --color-bg: #FFF5F8;
  --color-card: #FFFFFF;
  --color-text: #2D1B4E;
  --color-text-light: #6B5B8E;
  --color-border: #F0E6F2;
  --color-success: #00C48C;
  --color-danger: #FF4D6D;

  --gradient-primary: linear-gradient(135deg, #FF6B9D 0%, #6C5CE7 100%);
  --gradient-hero: linear-gradient(135deg, #FF6B9D 0%, #FF8FB1 35%, #6C5CE7 100%);
  --gradient-soft: linear-gradient(180deg, #FFF5F8 0%, #F4ECFF 100%);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;

  --shadow-sm: 0 2px 8px rgba(108, 92, 231, 0.08);
  --shadow-md: 0 4px 20px rgba(108, 92, 231, 0.12);
  --shadow-lg: 0 8px 32px rgba(108, 92, 231, 0.18);
  --shadow-press: 0 1px 4px rgba(108, 92, 231, 0.18);

  --font-display: 'Fredoka One', 'Comic Sans MS', system-ui, sans-serif;
  /* Body font MUST include an emoji-capable font near the front of the
     stack. On a zh-CN system the browser's CJK fallback will otherwise
     map 🔍 ✕ ☰ 🏠 to CJK ideographs (e.g. "馃攳", "锟", "辘"), because
     Nunito / Segoe UI have no glyphs for those codepoints. "Segoe UI
     Emoji" (Win) / "Apple Color Emoji" (macOS) / "Noto Color Emoji"
     (Linux) cover all the icons we use. */
  --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
  

  --header-h: 64px;
  --nav-h: 64px;
  --max-w: 480px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- 2. Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ---- 3. App Frame (PC 端模拟手机) ---- */
.app-frame {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  position: relative;
  /* Drawer / search overlay use `position:fixed` and slide in from the
     right edge of the VIEWPORT on both mobile and PC. We do NOT make
     .app-frame a containing block for them — that would force the drawer
     to be relative to the 480px column and the `translateX(100%)` trick
     would no longer hide it (50% of 480 ≠ 50% of 1107). The visual
     tradeoff is that on PC the drawer floats over the dark body outside
     the 480px column, which is the standard mobile-drawer pattern. */
  /* No `overflow:hidden` here: it would break `position:sticky` on the top-nav.
     Decorative elements (particles, etc.) self-clamp via their own containers. */
}
@media (min-width: 768px) {
  body { background: #1A0B2E; }
  .app-frame {
    max-width: var(--max-w);
    margin: 0 auto;
    min-height: 100vh;
    box-shadow: 0 0 60px rgba(255, 107, 157, 0.3);
    border-left: 1px solid rgba(255,255,255,0.05);
    border-right: 1px solid rgba(255,255,255,0.05);
  }
}

/* ---- 4. Loader ---- */
.loader {
  position: fixed;
  inset: 0;
  background: var(--gradient-hero);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .4s, visibility .4s;
}
.loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader__logo {
  font-family: var(--font-display);
  font-size: 48px;
  color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 4px 12px rgba(0,0,0,.2);
  animation: ballPulse 1.2s ease-in-out infinite;
}
.loader__sub { color: rgba(255,255,255,.85); font-size: 14px; margin-top: 12px; }
@keyframes ballPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: .85; }
}

/* ---- 5. Hero ---- */
.hero {
  position: relative;
  background: var(--gradient-hero);
  color: #fff;
  padding: 48px 24px 80px;
  text-align: center;
  overflow: hidden;
}
.hero__title {
  font-family: var(--font-display);
  font-size: 42px;
  line-height: 1.1;
  margin: 0 0 12px;
  letter-spacing: 1px;
  text-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.hero__subtitle {
  font-size: 16px;
  margin: 0 0 24px;
  opacity: .95;
}
.hero__search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: var(--radius-full);
  padding: 12px 20px;
  box-shadow: var(--shadow-md);
  max-width: 360px;
  margin: 0 auto;
}
.hero__search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  color: var(--color-text);
  background: transparent;
}
.hero__search-icon { font-size: 18px; }

/* floating blobs in hero */
.hero::before, .hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  animation: floatY 6s ease-in-out infinite;
}
.hero::before { width: 120px; height: 120px; top: -40px; left: -40px; }
.hero::after { width: 80px; height: 80px; bottom: -20px; right: -20px; animation-delay: 2s; }
@keyframes floatY {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-20px) rotate(45deg); }
}

/* floating particles (decorative dots) */
.particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.particle {
  position: absolute;
  width: 8px; height: 8px;
  background: rgba(255,255,255,.5);
  border-radius: 50%;
  animation: floatParticle 8s linear infinite;
}
@keyframes floatParticle {
  0% { transform: translateY(100vh) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-10vh) translateX(40px); opacity: 0; }
}

/* ---- 6. Sections ---- */
.section { padding: 24px 16px; }
.section__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section__title {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0;
  color: var(--color-text);
}
.section__link {
  font-size: 13px;
  color: var(--color-primary);
  font-weight: 700;
}

/* ---- 7. Category Chips ---- */
.chips {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--color-text-light);
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  transition: all .2s;
  white-space: nowrap;
}
.chip.is-active, .chip:hover {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ---- 8. Game Card Grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.card {
  background: var(--color-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.card:active { transform: scale(.97); box-shadow: var(--shadow-press); }
.card__thumb {
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 64px;
  background: var(--gradient-soft);
  position: relative;
  overflow: hidden;
}
.card__thumb::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.6), transparent 60%);
  pointer-events: none;
}
.card__thumb-img {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
  transition: transform .35s ease;
}
.card:hover .card__thumb-img { transform: scale(1.04); }
.card__thumb-icon { position: relative; z-index: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.1)); }
.card__body { padding: 10px 12px 12px; flex: 1; display: flex; flex-direction: column; }
.card__title {
  font-size: 14px; font-weight: 800; line-height: 1.3;
  margin: 0 0 6px;
  color: var(--color-text);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--color-text-light); }
.card__rating { color: var(--color-accent); font-weight: 800; }
.card__plays { font-size: 11px; }

/* Featured big card (首页精选) */
.card--featured { grid-column: span 2; }
.card--featured .card__thumb { aspect-ratio: 16 / 9; }
.card--featured .card__thumb-icon { font-size: 96px; }
.card--featured .card__title { font-size: 18px; -webkit-line-clamp: 2; }
.card--featured .card__meta { font-size: 13px; }

/* ---- 9. Stars ---- */
.stars { display: inline-flex; gap: 1px; color: var(--color-accent); font-size: 14px; line-height: 1; }
.stars--sm { font-size: 12px; }
.stars--lg { font-size: 20px; }

/* ---- 10. Top Nav (固定顶部) + Drawer + Search Overlay ---- */
:root { --topnav-h: 56px; }

.top-nav {
  position: sticky;
  top: 0; left: 0; right: 0;
  height: var(--topnav-h);
  background: rgba(255, 245, 248, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  z-index: 80;
}
.top-nav__logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--color-text);
  text-decoration: none;
  flex: 0 0 auto;
}
.top-nav__logo-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--gradient-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.top-nav__title {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top-nav__actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.top-nav__btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--color-text);
  transition: background .2s, transform .2s;
  cursor: pointer;
}
.top-nav__btn:hover { background: rgba(255, 107, 157, 0.1); }
.top-nav__btn:active { transform: scale(0.92); }
.top-nav__btn[aria-expanded="true"] { background: rgba(255, 107, 157, 0.12); color: var(--color-primary); }

/* Inline SVG icon (replaces emoji for cross-platform consistency).
   Inherits `color` from parent so it follows text color / hover state. */
.icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  pointer-events: none;
}

@media (min-width: 768px) {
  /* Center the top-nav inside the viewport at 480px width.
     We use `margin: 0 auto` instead of `left:50% + transform:translateX(-50%)`
     because the latter interacts badly with `position:sticky` on some browsers
     (the sticky offset is calculated from the transformed position, not the
     natural flow position, causing the nav to render ~240px off-center). */
  .top-nav {
    width: var(--max-w);
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
  }
}

/* ---- Drawer (汉堡菜单抽屉) ---- */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(45, 27, 78, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
  z-index: 90;
}
.drawer-backdrop.is-open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: var(--color-bg);
  box-shadow: -8px 0 32px rgba(45, 27, 78, 0.18);
  /* `translateX(100%)` alone leaves ~15px of the drawer visible at the
     right edge when a vertical scrollbar is present (the scrollbar
     narrows the viewport so `right: 0` lands at content-area edge,
     not viewport edge). Add a 30px buffer to guarantee full hide. */
  transform: translateX(calc(100% + 30px));
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  z-index: 95;
  display: flex; flex-direction: column;
  padding-top: var(--safe-bottom);
}
.drawer.is-open { transform: translateX(0); }

@media (min-width: 768px) {
  /* Drawer stays at viewport right edge on PC (standard mobile-drawer
     pattern). It floats over the dark body area outside the 480px
     .app-frame, which is intentional — constraining it inside the
     480px column would break the `translateX(100%)` hide trick. */
}

.drawer__head {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer__brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--color-text);
}
.drawer__brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--gradient-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
}
.drawer__close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: var(--color-text);
  cursor: pointer;
  padding: 0;
}
.drawer__close:hover { background: rgba(255, 107, 157, 0.1); }

.drawer__nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.drawer__item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  transition: background .2s, color .2s;
  cursor: pointer;
  background: none; border: none; width: 100%; text-align: left;
  font-family: inherit;
}
.drawer__item:hover { background: rgba(255, 107, 157, 0.08); }
.drawer__item.is-active { background: var(--gradient-primary); color: #fff; }
.drawer__item.is-active .drawer__item-icon { transform: scale(1.1); }
.drawer__item-icon { font-size: 22px; width: 28px; text-align: center; transition: transform .2s; }
.drawer__sep { height: 1px; background: var(--color-border); margin: 12px 16px; }
.drawer__section-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-light);
  padding: 12px 16px 6px;
}
.drawer__foot {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-text-light);
  text-align: center;
}

/* ---- Search Overlay (顶部搜索按钮弹出的全屏搜索) ---- */
.search-overlay {
  position: fixed; inset: 0;
  background: rgba(45, 27, 78, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
  z-index: 96;
  padding-top: var(--topnav-h);
  display: flex; flex-direction: column;
  align-items: center;
}
.search-overlay.is-open { opacity: 1; visibility: visible; }
.search-overlay__sheet {
  width: 100%;
  max-width: 480px;
  background: var(--color-bg);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  transform: translateY(-20px);
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}
.search-overlay.is-open .search-overlay__sheet { transform: translateY(0); }
.search-overlay__form {
  display: flex; align-items: center; gap: 8px;
  background: #fff;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-full);
  padding: 4px 4px 4px 16px;
  box-shadow: var(--shadow-md);
}
.search-overlay__form input {
  flex: 1;
  border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 16px;
  color: var(--color-text);
  padding: 10px 0;
}
.search-overlay__form input::placeholder { color: var(--color-text-light); }
.search-overlay__form button[type="submit"] {
  background: var(--gradient-primary);
  color: #fff;
  border-radius: var(--radius-full);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  flex: 0 0 auto;
}
.search-overlay__hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--color-text-light);
  text-align: center;
  opacity: 0.85;
}
.search-overlay__quicklinks {
  margin-top: 20px;
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
}
.search-overlay__quicklinks a {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px;
  background: #fff;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.search-overlay__quicklinks a:hover { background: var(--gradient-primary); color: #fff; }

/* ---- 11. Detail Page ---- */
.detail-hero {
  position: relative;
  background: var(--gradient-hero);
  color: #fff;
  padding: 32px 20px 40px;
  text-align: center;
}
.detail-hero__icon {
  width: 120px; height: 120px;
  margin: 0 auto 16px;
  background: rgba(255,255,255,.2);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 72px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
}
.detail-hero__title { font-family: var(--font-display); font-size: 28px; margin: 0 0 6px; }
.detail-hero__sub { font-size: 14px; opacity: .9; margin: 0 0 16px; }
.detail-hero__stats {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  font-size: 13px;
}
.detail-hero__stat { display: flex; align-items: center; gap: 4px; background: rgba(255,255,255,.15); padding: 6px 12px; border-radius: var(--radius-full); }

.play-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--gradient-primary);
  color: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  padding: 16px 24px;
  border-radius: var(--radius-full);
  margin: 24px 16px 0;
  box-shadow: var(--shadow-lg);
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: transform .2s;
}
.play-cta:active { transform: scale(.97); }

.info-block {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px;
  box-shadow: var(--shadow-sm);
}
.info-block__title {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0 0 10px;
  color: var(--color-text);
  display: flex; align-items: center; gap: 6px;
}
.info-block__body { font-size: 14px; color: var(--color-text-light); line-height: 1.6; }
.info-block__list { display: flex; flex-direction: column; gap: 8px; }
.info-block__list li { display: flex; gap: 8px; font-size: 14px; color: var(--color-text-light); }
.info-block__list li::before { content: '🎮'; flex: 0 0 auto; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px; font-weight: 700;
  background: var(--gradient-soft);
  color: var(--color-primary);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.comments { display: flex; flex-direction: column; gap: 12px; }
.comment { display: flex; gap: 10px; }
.comment__avatar {
  flex: 0 0 36px; width: 36px; height: 36px;
  background: var(--gradient-soft);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.comment__body { flex: 1; }
.comment__head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.comment__name { font-weight: 800; }
.comment__date { color: var(--color-text-light); font-size: 12px; margin-left: auto; }
.comment__text { font-size: 13px; color: var(--color-text-light); margin: 4px 0 0; line-height: 1.5; }

/* ---- 12. Play Page ---- */
.play-shell {
  position: relative;
  width: 100%;
  height: 100vh; height: 100dvh;
  background: #000;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.play-top {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  color: #fff;
  background: rgba(0,0,0,.4);
  position: relative; z-index: 2;
}
.play-top__back {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
}
.play-top__title { font-family: var(--font-display); font-size: 16px; flex: 1; }
.play-frame-wrap { flex: 1; position: relative; }
.play-frame {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  background: #000;
}
.play-loader {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff;
  background: var(--gradient-hero);
  z-index: 3;
  transition: opacity .4s;
}
.play-loader.is-hidden { opacity: 0; pointer-events: none; }
.play-loader__ball {
  width: 48px; height: 48px;
  background: #fff;
  border-radius: 50%;
  animation: ballPulse 1.2s ease-in-out infinite;
  margin-bottom: 16px;
}
.play-loader__text { font-size: 14px; opacity: .9; }

/* ---- 13. List / Search ---- */
.list-toolbar {
  position: sticky; top: 0;
  background: var(--color-bg);
  padding: 12px 16px;
  z-index: 10;
  border-bottom: 1px solid var(--color-border);
}
.list-search {
  display: flex; align-items: center; gap: 8px;
  background: #fff;
  border-radius: var(--radius-full);
  padding: 10px 16px;
  box-shadow: var(--shadow-sm);
}
.list-search input { flex: 1; border: none; outline: none; font-family: inherit; font-size: 14px; background: transparent; }
.list-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--color-text-light);
}
.list-empty__icon { font-size: 64px; margin-bottom: 12px; }

/* ---- 14. Static / Legal Pages ---- */
.legal {
  padding: 24px 16px 32px;
}
.legal h1 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 8px;
  color: var(--color-text);
}
.legal h2 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 28px 0 8px;
  color: var(--color-text);
}
.legal p, .legal li {
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.7;
  margin: 0 0 10px;
}
.legal ul { padding-left: 20px; list-style: disc; }
.legal .updated { font-size: 12px; color: var(--color-text-light); opacity: .8; margin-top: 32px; }

/* ---- 15. Contact ---- */
.contact-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 16px;
  box-shadow: var(--shadow-sm);
}
.contact-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}
.contact-row:last-child { border-bottom: 0; }
.contact-row__icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gradient-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.contact-row__label { font-size: 12px; color: var(--color-text-light); }
.contact-row__value { font-size: 14px; font-weight: 700; color: var(--color-text); word-break: break-all; }

.contact-form { display: flex; flex-direction: column; gap: 12px; }
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  outline: none;
  transition: border-color .2s;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--color-primary); }
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-form button {
  background: var(--gradient-primary);
  color: #fff;
  padding: 12px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 15px;
}

/* ---- 16. 404 ---- */
.notfound {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 70vh;
  padding: 32px 24px;
  text-align: center;
}
.notfound__code { font-family: var(--font-display); font-size: 96px; background: var(--gradient-primary); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.notfound__title { font-family: var(--font-display); font-size: 22px; margin: 16px 0 8px; }
.notfound__text { color: var(--color-text-light); margin: 0 0 24px; }
.notfound__home {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gradient-primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* ---- 17. Footer (page bottom above nav) ---- */
.footer {
  text-align: center;
  padding: 20px 16px;
  font-size: 12px;
  color: var(--color-text-light);
}
.footer a { color: var(--color-text-light); }
.footer__links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.footer__sep { color: var(--color-border); }

/* ---- 18. Utilities ---- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

/* ---- 9.5 Detail page Game Head (替代原 detail-hero) ---- */
.game-head {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #FFE5EE 0%, #ECE4FF 100%);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px;
  box-shadow: var(--shadow-sm);
}
.game-head__icon {
  width: 72px; height: 72px;
  background: #fff;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
  box-shadow: var(--shadow-sm);
  flex: 0 0 auto;
  overflow: hidden;
  position: relative;
}
.game-head__icon-img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
.game-head__icon-emoji {
  font-size: 40px; line-height: 1;
}
.game-head__body { flex: 1; min-width: 0; }
.game-head__title {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 2px;
  color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.game-head__sub {
  font-size: 12px; color: var(--color-text-light);
  margin: 0 0 8px;
}
.game-head__stats {
  display: flex; gap: 6px; flex-wrap: wrap;
  font-size: 11px;
}
.game-head__stats span {
  background: rgba(255,255,255,.85);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  color: var(--color-text);
}

/* ---- 10.2 Drawer Categories Grid ---- */
.drawer__cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 8px;
}
.drawer__cat {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 107, 157, 0.08);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  transition: background .2s, color .2s, transform .2s;
  cursor: pointer;
}
.drawer__cat:hover { background: var(--gradient-primary); color: #fff; transform: translateX(2px); }
.drawer__cat.is-active { background: var(--gradient-primary); color: #fff; box-shadow: var(--shadow-sm); }
.drawer__cat-icon { font-size: 16px; line-height: 1; }

/* ---- 19. Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- 20. CMP Cookie Consent Banner ---- */
.consent-banner {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  max-width: 456px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  padding: 16px 18px;
  z-index: 200;
  display: none;
  animation: consentSlideUp .35s ease-out;
}
.consent-banner.is-visible { display: block; }
@keyframes consentSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.consent-banner__title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--color-text);
  margin: 0 0 6px;
  display: flex; align-items: center; gap: 6px;
}
.consent-banner__text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text-light);
  margin: 0 0 12px;
}
.consent-banner__text a {
  color: var(--color-primary);
  text-decoration: underline;
  font-weight: 700;
}
.consent-banner__actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.consent-banner__btn {
  flex: 1 1 auto;
  min-width: 100px;
  padding: 10px 14px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  border: none;
}
.consent-banner__btn:active { transform: scale(0.97); }
.consent-banner__btn--accept {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.consent-banner__btn--accept:hover { box-shadow: var(--shadow-md); }
.consent-banner__btn--reject {
  background: transparent;
  color: var(--color-text-light);
  border: 1px solid var(--color-border);
}
.consent-banner__btn--reject:hover { color: var(--color-text); border-color: var(--color-text-light); }
.consent-banner__btn--settings {
  flex: 0 0 auto;
  background: transparent;
  color: var(--color-text-light);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  padding: 10px 8px;
  min-width: 0;
}
