/* ==========================================================
   MGame — Starfield Mobile H5 Games Portal
   Domain: mgame.northfivefun.com
   Style: Starfield / Night sky / Mobile-first
   ========================================================== */

/* ---------- 1. Design Tokens ---------- */
:root {
  /* Cosmic palette */
  --bg-0:        #05060f;   /* deepest space */
  --bg-1:        #0b0f24;
  --bg-2:        #131a3a;
  --nebula-1:    #2a1a6b;
  --nebula-2:    #4a2bbf;
  --nebula-3:    #1e3a8a;
  --cosmos-pink: #ec4899;
  --cosmos-blue: #38bdf8;
  --cosmos-cyan: #22d3ee;
  --cosmos-purple: #a855f7;
  --cosmos-violet: #6366f1;

  /* Surfaces */
  --surface-1:   rgba(20, 25, 60, 0.55);
  --surface-2:   rgba(30, 38, 85, 0.72);
  --surface-3:   rgba(255, 255, 255, 0.06);
  --surface-4:   rgba(255, 255, 255, 0.10);
  --border-1:    rgba(255, 255, 255, 0.10);
  --border-2:    rgba(255, 255, 255, 0.18);
  --border-3:    rgba(168, 85, 247, 0.35);

  /* Text */
  --text-1:      #f1f5ff;
  --text-2:      #cbd5ff;
  --text-3:      #8a93c4;
  --text-mute:   #5a6390;

  /* Accent gradients */
  --grad-1:      linear-gradient(135deg, #38bdf8 0%, #a855f7 100%);
  --grad-2:      linear-gradient(135deg, #ec4899 0%, #6366f1 100%);
  --grad-3:      linear-gradient(180deg, rgba(11,15,36,0.0) 0%, rgba(5,6,15,0.95) 100%);
  --grad-card:   linear-gradient(165deg, rgba(74,43,191,0.18) 0%, rgba(30,58,138,0.12) 100%);

  /* Glow shadows */
  --glow-1:      0 0 0 1px rgba(168, 85, 247, 0.30), 0 8px 32px rgba(99, 102, 241, 0.25);
  --glow-2:      0 0 24px rgba(56, 189, 248, 0.45);
  --glow-3:      0 0 32px rgba(236, 72, 153, 0.35);

  /* Radii */
  --r-xs:  6px;
  --r-sm:  10px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-pill: 999px;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;

  /* Typography */
  --font-sans: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Sora", "Space Grotesk", var(--font-sans);

  /* Layout */
  --container-max: 960px;
  --header-h: 56px;

  /* Motion */
  --ease-1: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-2: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 180ms;
  --dur-2: 320ms;
  --dur-3: 520ms;
}

/* ---------- 2. Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-1);
  background: var(--bg-0);
  min-height: 100vh;
  line-height: 1.55;
  font-size: 15px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, picture, video, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: transparent; padding: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; margin: 0; }
h1, h2, h3, h4, h5 { margin: 0; font-family: var(--font-display); letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0; }

/* ---------- 3. Starfield background ---------- */
body::before,
body::after {
  content: "";
  position: fixed; inset: 0;
  z-index: -2;
  pointer-events: none;
}
body::before {
  background:
    radial-gradient(ellipse 80% 60% at 18% -10%, rgba(99, 102, 241, 0.35), transparent 60%),
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(236, 72, 153, 0.20), transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(56, 189, 248, 0.18), transparent 60%),
    linear-gradient(180deg, #05060f 0%, #0b0f24 60%, #131a3a 100%);
}
body::after {
  background-image:
    radial-gradient(1px 1px at 14% 22%, rgba(255,255,255,0.85), transparent 60%),
    radial-gradient(1px 1px at 82% 18%, rgba(255,255,255,0.65), transparent 60%),
    radial-gradient(1px 1px at 36% 64%, rgba(199, 210, 254, 0.85), transparent 60%),
    radial-gradient(1px 1px at 71% 71%, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(1.4px 1.4px at 8% 80%, rgba(255,255,255,0.9), transparent 60%),
    radial-gradient(1.4px 1.4px at 92% 48%, rgba(186, 230, 253, 0.9), transparent 60%),
    radial-gradient(1px 1px at 25% 38%, rgba(255,255,255,0.65), transparent 60%),
    radial-gradient(1px 1px at 60% 30%, rgba(255,255,255,0.65), transparent 60%),
    radial-gradient(1px 1px at 45% 85%, rgba(199, 210, 254, 0.75), transparent 60%);
  background-size: 100% 100%;
  opacity: 0.85;
  animation: twinkle 6.5s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.95; }
}

/* ---------- 4. Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--s-4);
}
.section { padding: var(--s-6) 0; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.center { text-align: center; }
.mb-2 { margin-bottom: var(--s-2); }
.mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); }
.mb-5 { margin-bottom: var(--s-5); }
.mb-6 { margin-bottom: var(--s-6); }
.mb-8 { margin-bottom: var(--s-8); }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }

/* ---------- 5. Header / Top bar ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  background: rgba(5, 6, 15, 0.55);
  border-bottom: 1px solid var(--border-1);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.04em;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--grad-1);
  display: grid; place-items: center;
  box-shadow: var(--glow-2);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute; inset: -3px;
  border-radius: 11px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  filter: blur(2px);
  opacity: 0.7;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-name b { color: var(--cosmos-cyan); }
.menu-trigger {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  background: var(--surface-3);
  transition: background var(--dur-1) var(--ease-1), transform var(--dur-1) var(--ease-1);
}
.menu-trigger:hover, .menu-trigger:active { background: var(--surface-4); transform: scale(1.04); }
.menu-trigger svg { width: 18px; height: 18px; }

/* ---------- 6. Drawer (off-canvas menu) ---------- */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 12, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-2) var(--ease-1), visibility 0s linear var(--dur-2);
}
.drawer-mask.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(82vw, 320px);
  z-index: 100;
  background:
    linear-gradient(180deg, rgba(11, 15, 36, 0.96) 0%, rgba(5, 6, 15, 0.98) 100%);
  border-left: 1px solid var(--border-2);
  box-shadow: -10px 0 50px rgba(0, 0, 0, 0.5);
  transform: translateX(105%);
  transition: transform var(--dur-3) var(--ease-1);
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-5) var(--s-5) var(--s-3);
  border-bottom: 1px solid var(--border-1);
}
.drawer-head .title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.06em;
}
.drawer-close {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
}
.drawer-body { padding: var(--s-4) var(--s-5); overflow-y: auto; flex: 1 1 auto; }
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-nav a {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: 12px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background var(--dur-1) var(--ease-1), color var(--dur-1) var(--ease-1), border-color var(--dur-1) var(--ease-1);
}
.drawer-nav a:hover, .drawer-nav a.is-active {
  color: var(--text-1);
  background: var(--surface-4);
  border-color: var(--border-2);
}
.drawer-nav .ico {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--cosmos-cyan);
}
.drawer-nav .ico svg { width: 18px; height: 18px; }
.drawer-divider {
  height: 1px;
  background: var(--border-1);
  margin: var(--s-4) 0;
}
.drawer-foot {
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--border-1);
  color: var(--text-mute);
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}
.drawer-foot a { color: var(--cosmos-cyan); }

/* ---------- 7. Hero / Search ---------- */
.hero {
  padding: var(--s-10) 0 var(--s-6);
  position: relative;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  background: linear-gradient(120deg, #f1f5ff 0%, #38bdf8 40%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: var(--s-3);
}
.hero-sub {
  color: var(--text-2);
  font-size: 15px;
  margin-bottom: var(--s-6);
  max-width: 38ch;
}
.hero-search {
  display: flex;
  gap: var(--s-2);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-pill);
  padding: 6px;
  align-items: center;
  box-shadow: var(--glow-1);
}
.hero-search .ico { width: 22px; height: 22px; display: grid; place-items: center; color: var(--text-3); padding-left: 8px; }
.hero-search input {
  flex: 1 1 auto;
  border: 0; outline: 0;
  background: transparent;
  padding: 10px 8px;
  font-size: 15px;
  color: var(--text-1);
}
.hero-search input::placeholder { color: var(--text-mute); }
.hero-search button {
  background: var(--grad-1);
  color: #04132a;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: 14px;
  box-shadow: var(--glow-2);
  transition: transform var(--dur-1) var(--ease-1);
}
.hero-search button:hover { transform: translateY(-1px); }

/* ---------- 8. Ad slots ---------- */
.ad-slot {
  margin: var(--s-6) 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(99, 102, 241, 0.10), rgba(236, 72, 153, 0.08)),
    rgba(11, 15, 36, 0.45);
  border: 1px dashed var(--border-3);
  min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  color: var(--text-3);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.ad-slot::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(168, 85, 247, 0.20), transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(56, 189, 248, 0.20), transparent 60%);
  pointer-events: none;
}
.ad-slot[data-size="leaderboard"] { min-height: 110px; }
.ad-slot[data-size="rectangle"]  { min-height: 280px; }
.ad-slot[data-size="sticky"] { margin: 0; border-radius: 0; min-height: 70px; }
.ad-slot .label { position: relative; opacity: 0.7; }

/* MGID ad placement (placeholder; replace with MGID script tag) */
.ad-mgid {
  display: block;
  width: 100%;
  min-height: inherit;
}

/* ---------- 9. Section title ---------- */
.sec-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 0 var(--s-4);
}
.sec-title h2 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sec-title h2 .bar {
  display: inline-block; width: 6px; height: 18px;
  border-radius: 3px;
  background: var(--grad-1);
  margin-right: 8px;
  vertical-align: -3px;
  box-shadow: var(--glow-2);
}
.sec-title a { color: var(--cosmos-cyan); font-size: 13px; }

/* ---------- 10. Game cards ---------- */
.game-list { display: grid; gap: var(--s-4); }
.game-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--s-4);
  padding: var(--s-3);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-1) var(--ease-1), border-color var(--dur-1) var(--ease-1), background var(--dur-1) var(--ease-1);
  position: relative;
  overflow: hidden;
}
.game-card::before {
  content: ""; position: absolute; inset: 0;
  background: var(--grad-card);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-2) var(--ease-1);
}
.game-card:hover, .game-card:active { transform: translateY(-2px); border-color: var(--border-3); }
.game-card:hover::before, .game-card:active::before { opacity: 1; }
.game-card .thumb {
  position: relative;
  width: 110px; aspect-ratio: 1 / 1;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg-2);
}
.game-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 600ms var(--ease-2); }
.game-card:hover .thumb img { transform: scale(1.06); }
.game-card .thumb .badge {
  position: absolute; top: 6px; left: 6px;
  background: rgba(5, 6, 15, 0.7);
  backdrop-filter: blur(4px);
  font-size: 11px;
  padding: 3px 7px;
  border-radius: var(--r-pill);
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--cosmos-cyan);
  font-weight: 600;
}
.game-card .body { position: relative; }
.game-card .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.game-card .name .visit {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  font-family: var(--font-sans);
  white-space: nowrap;
}
.game-card .excerpt {
  font-size: 12.5px;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--s-2);
  line-height: 1.4;
}
.game-card .meta {
  display: flex; align-items: center; gap: var(--s-3);
  font-size: 11.5px;
  color: var(--text-3);
}
.game-card .meta .rating { color: #facc15; font-weight: 700; }
.game-card .meta .rating .star { margin-right: 3px; }
.game-card .meta .likes { color: var(--cosmos-pink); }

/* Grid variant (for list page) */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
}
.game-grid .game-card {
  grid-template-columns: 1fr;
  padding: var(--s-2);
}
.game-grid .game-card .thumb { width: 100%; aspect-ratio: 4 / 3; }
.game-grid .game-card .name { font-size: 14px; }
.game-grid .game-card .excerpt { display: none; }
.game-grid .game-card .meta { font-size: 11px; gap: var(--s-2); }

@media (min-width: 720px) {
  .game-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 11. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: transform var(--dur-1) var(--ease-1), box-shadow var(--dur-1) var(--ease-1);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grad-1); color: #04132a; box-shadow: var(--glow-2); }
.btn-ghost   { border: 1px solid var(--border-2); color: var(--text-1); background: var(--surface-3); }
.btn-block   { width: 100%; }

/* ---------- 12. Footer ---------- */
.site-foot {
  margin-top: var(--s-12);
  padding: var(--s-8) 0 var(--s-6);
  background: linear-gradient(180deg, transparent 0%, rgba(5, 6, 15, 0.7) 100%);
  border-top: 1px solid var(--border-1);
}
.foot-row { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; justify-content: space-between; }
.foot-brand { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.foot-nav { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.foot-nav a { color: var(--text-3); font-size: 13px; transition: color var(--dur-1) var(--ease-1); }
.foot-nav a:hover { color: var(--cosmos-cyan); }
.foot-copy { color: var(--text-mute); font-size: 12px; line-height: 1.6; }
.foot-copy a { color: var(--cosmos-cyan); }

/* ---------- 13. Detail page ---------- */
.detail-hero {
  padding: var(--s-6) 0 var(--s-5);
  position: relative;
}
.breadcrumb {
  display: flex; gap: 6px; align-items: center;
  color: var(--text-3); font-size: 13px;
  margin-bottom: var(--s-4);
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--cosmos-cyan); }
.breadcrumb .sep { opacity: 0.5; }
.detail-head {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--s-4);
  align-items: center;
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: var(--s-3);
}
.detail-head .cover {
  width: 96px; aspect-ratio: 1/1;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: var(--glow-2);
}
.detail-head .cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-head h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: var(--s-2);
}
.detail-head .slogan { font-size: 13px; color: var(--text-3); margin-bottom: var(--s-2); }
.detail-head .stats { display: flex; align-items: center; gap: var(--s-4); font-size: 12.5px; color: var(--text-3); flex-wrap: wrap; }
.detail-head .stats .v { color: var(--text-1); font-weight: 700; }

@media (min-width: 720px) {
  .detail-head { grid-template-columns: 160px 1fr; padding: var(--s-5); }
  .detail-head .cover { width: 160px; }
  .detail-head h1 { font-size: 28px; }
  .detail-head .slogan { font-size: 15px; }
}

.cta-play {
  margin: var(--s-5) 0;
  display: flex; gap: var(--s-3); align-items: center;
}
.cta-play .btn-primary {
  flex: 1;
  font-size: 16px;
  padding: 14px 20px;
  box-shadow: var(--glow-2), var(--glow-3);
}

.detail-body {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  margin-top: var(--s-3);
}
.detail-body h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin: var(--s-5) 0 var(--s-2);
}
.detail-body h2:first-child { margin-top: 0; }
.detail-body p { color: var(--text-2); font-size: 14.5px; line-height: 1.7; }
.feature-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.feature-chips .chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  font-size: 12.5px;
  color: var(--text-2);
}
.feature-chips .chip::before { content: "✦"; color: var(--cosmos-cyan); }

.review-list { display: grid; gap: var(--s-3); margin-top: var(--s-3); }
.review-card {
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: var(--s-4);
}
.review-card .who {
  display: flex; align-items: center; gap: var(--s-2);
  margin-bottom: var(--s-2);
  font-size: 13px;
}
.review-card .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--grad-1);
  display: grid; place-items: center;
  color: #04132a;
  font-weight: 800;
  font-size: 12px;
}
.review-card .nickname { font-weight: 700; color: var(--text-1); }
.review-card .stars { color: #facc15; letter-spacing: 1px; }
.review-card .body-text {
  color: var(--text-2); font-size: 14px; line-height: 1.6;
}

/* ---------- 14. Play page ---------- */
.play-shell {
  padding: var(--s-4) 0 var(--s-6);
}
.play-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #000;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border-2);
  box-shadow: var(--glow-1);
}
.play-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.play-loading {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--text-2); font-size: 13px;
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.20), transparent 60%), #04050d;
}
.play-loading .spinner {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
  border-top-color: var(--cosmos-cyan);
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--s-3);
}
@keyframes spin { to { transform: rotate(360deg); } }
.play-meta {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  margin-top: var(--s-4);
  color: var(--text-3); font-size: 13px;
}
.play-meta .v { color: var(--text-1); font-weight: 700; }

/* ---------- 15. List page filters ---------- */
.filter-bar {
  display: flex; gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-pill);
  margin-bottom: var(--s-4);
  align-items: center;
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.filter-bar .input {
  flex: 1;
  background: transparent;
  border: 0; outline: 0;
  color: var(--text-1);
  font-size: 14px;
}
.filter-bar .input::placeholder { color: var(--text-mute); }
.filter-bar .count {
  color: var(--text-mute);
  font-size: 12px;
  white-space: nowrap;
}
.filter-bar select {
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  color: var(--text-1);
  border-radius: var(--r-pill);
  padding: 6px 10px;
  font-size: 13px;
  outline: 0;
}

.empty-state {
  padding: var(--s-12) var(--s-4);
  text-align: center;
  color: var(--text-3);
}
.empty-state .ico { font-size: 32px; margin-bottom: var(--s-3); }

/* ---------- 16. Static legal / contact pages ---------- */
.legal-shell {
  padding: var(--s-8) 0 var(--s-10);
}
.legal-card {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.legal-card h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin: var(--s-5) 0 var(--s-2);
}
.legal-card h2:first-child { margin-top: 0; }
.legal-card p, .legal-card li {
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: var(--s-3);
}
.legal-card ul {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: var(--s-3);
}
.legal-card ul li { margin-bottom: 6px; }
.legal-card .meta { color: var(--text-mute); font-size: 12.5px; margin-bottom: var(--s-4); }
.legal-card .kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px var(--s-3); }
.legal-card .kv dt { color: var(--text-3); font-size: 13px; }
.legal-card .kv dd { margin: 0; color: var(--text-1); font-size: 14px; word-break: break-word; }
.legal-card a { color: var(--cosmos-cyan); }

/* ---------- 17. Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(11, 15, 36, 0.95);
  border: 1px solid var(--border-2);
  color: var(--text-1);
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: 13px;
  box-shadow: var(--glow-1);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-1) var(--ease-1), transform var(--dur-1) var(--ease-1);
  z-index: 200;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 18. Loading skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

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

/* ---------- 19.5. Hot picks (horizontal trending strip) ---------- */
.hot-picks { padding-top: var(--s-6); }
.hot-picks .hot-flame {
  display: inline-block;
  margin-left: 4px;
  font-size: 16px;
  filter: drop-shadow(0 0 6px rgba(252, 165, 165, 0.55));
  animation: pulseFlame 2.2s ease-in-out infinite;
}
@keyframes pulseFlame {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 6px rgba(252, 165, 165, 0.45)); }
  50%      { transform: scale(1.18); filter: drop-shadow(0 0 12px rgba(252, 165, 165, 0.85)); }
}
.hot-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: var(--s-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 6px;
  margin: 0 calc(var(--s-4) * -1);
  padding-left: var(--s-4);
  padding-right: var(--s-4);
}
.hot-strip::-webkit-scrollbar { display: none; }

.hot-card {
  position: relative;
  display: block;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  scroll-snap-align: start;
  box-shadow: var(--glow-1);
  isolation: isolate;
  text-decoration: none;
  color: inherit;
  aspect-ratio: 2 / 3;
  min-height: 220px;
}
.hot-card .bg {
  position: absolute; inset: 0;
  z-index: -2;
}
.hot-card .bg img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 700ms var(--ease-2);
}
.hot-card:hover .bg img { transform: scale(1.07); }
.hot-card::after {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background:
    linear-gradient(0deg, rgba(5, 6, 15, 0.92) 0%, rgba(5, 6, 15, 0.55) 45%, rgba(5, 6, 15, 0.10) 100%),
    linear-gradient(135deg, rgba(99, 102, 241, 0.18), transparent 65%);
  pointer-events: none;
}
.hot-card .badge-rank {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: #04132a;
  background: var(--grad-1);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.55);
  z-index: 2;
}
.hot-card .badge-hot {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 9px;
  border-radius: var(--r-pill);
  background: rgba(11, 15, 36, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fef3c7;
  display: inline-flex; align-items: center; gap: 4px;
  z-index: 2;
}
.hot-card .badge-hot::before {
  content: "🔥";
  filter: drop-shadow(0 0 4px rgba(252, 165, 165, 0.6));
}
.hot-card .body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 16px 14px;
  z-index: 1;
}
.hot-card .name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.15;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.hot-card .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
}
.hot-card .meta .rating { color: #facc15; font-weight: 700; }
.hot-card .meta .rating .star { margin-right: 3px; }
.hot-card .meta .plays   { color: var(--cosmos-cyan); font-weight: 600; }
.hot-card .meta .arrow   { margin-left: auto; opacity: 0.85; }
@media (min-width: 720px) {
  .hot-strip { grid-auto-columns: 44%; }
}
@media (min-width: 960px) {
  .hot-strip { grid-auto-columns: 32%; }
}

/* ---------- 20. Small-screen tweaks ---------- */
@media (max-width: 380px) {
  .game-card { grid-template-columns: 84px 1fr; gap: var(--s-3); padding: var(--s-2); }
  .game-card .thumb { width: 84px; }
  .game-card .name { font-size: 14.5px; }
  .detail-head { grid-template-columns: 72px 1fr; }
  .detail-head .cover { width: 72px; }
  .detail-head h1 { font-size: 19px; }
}
