/* ============================================================
   Game Box · Game Portal Global Styles v2
   Bright & Clean Theme with Neon Accents
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  --bg-base: #F7F8FC;
  --bg-elevated: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-soft: #F0F2F9;
  --bg-muted: #E8EBF4;

  --border: #E0E4EF;
  --border-strong: #C9CFE0;
  --border-glow: rgba(99, 102, 241, 0.3);

  --text-primary: #1A1D2E;
  --text-secondary: #5B6180;
  --text-muted: #9097B2;

  --accent-indigo: #6366F1;
  --accent-violet: #8B5CF6;
  --accent-pink: #EC4899;
  --accent-cyan: #06B6D4;
  --accent-amber: #F59E0B;
  --accent-emerald: #10B981;

  --accent-primary: var(--accent-indigo);
  --accent-primary-light: #EEF2FF;
  --accent-gradient: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #EC4899 100%);
  --accent-gradient-soft: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(236,72,153,0.1));

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 0 4px rgba(99, 102, 241, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;

  --font-display: "Bricolage Grotesque", "Space Grotesk", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  --max-width: 1280px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle background decoration */
body::before {
  content: "";
  position: fixed;
  top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
  border-radius: 50%;
}
body::after {
  content: "";
  position: fixed;
  bottom: -200px; right: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(236,72,153,0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
  border-radius: 50%;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
p { color: var(--text-secondary); }

/* ---------- Layout Container ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.navbar-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 68px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}
.logo-text { color: var(--text-primary); }
.logo-text span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-secondary);
  transition: color .2s, background .2s;
  position: relative;
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg-soft); }
.nav-links a.active { color: var(--accent-primary); background: var(--accent-primary-light); }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* Search Box */
.search-box {
  position: relative;
  width: 260px;
}
.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 44px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
  background: #fff;
}
.search-box .search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-box .search-clear {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
  display: none;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 6px;
}
.search-box .search-clear:hover { background: var(--bg-soft); color: var(--text-primary); }
.search-box.has-value .search-clear { display: block; }

/* Search Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-height: 480px;
  overflow-y: auto;
  display: none;
  z-index: 200;
}
.search-dropdown.open { display: block; }
.search-dropdown .sd-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  align-items: center;
  cursor: pointer;
  transition: background .15s;
  border-radius: 8px;
  margin: 4px;
}
.search-dropdown .sd-item:hover { background: var(--bg-soft); }
.search-dropdown .sd-thumb {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.search-dropdown .sd-info { min-width: 0; flex: 1; }
.search-dropdown .sd-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-dropdown .sd-cat {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}
.search-dropdown .sd-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* Hamburger Button */
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  width: 18px; height: 2px;
  background: var(--text-primary);
  position: relative;
}
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0;
  width: 18px; height: 2px; background: var(--text-primary);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* Mobile Search Toggle Button */
.nav-search-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}
.nav-search-toggle:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99,102,241,0.35);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent-primary); color: var(--accent-primary); background: var(--accent-primary-light); }

.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-sm); }

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  margin-top: 28px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #EEF2FF 0%, #FDF2F8 50%, #ECFEFF 100%);
  box-shadow: var(--shadow-lg);
}
.hero-slide {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 380px;
}
.hero-content {
  padding: 52px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  position: relative;
  z-index: 2;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-primary);
  width: fit-content;
  padding: 6px 14px;
  background: var(--accent-primary-light);
  border-radius: 999px;
  font-weight: 700;
}
.hero-title {
  font-size: clamp(34px, 4.5vw, 56px);
  font-weight: 800;
  line-height: 1.05;
  color: var(--text-primary);
}
.hero-title em {
  font-style: normal;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-desc {
  font-size: 16px;
  max-width: 480px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 12px; margin-top: 8px; }
.hero-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.hero-visual img {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  object-fit: cover;
}
.hero-dots {
  position: absolute;
  bottom: 24px; left: 48px;
  display: flex;
  gap: 8px;
  z-index: 3;
}
.hero-dots button {
  width: 24px; height: 6px;
  border-radius: 3px;
  background: rgba(99,102,241,0.2);
  transition: all .25s;
}
.hero-dots button.active {
  background: var(--accent-gradient);
  width: 40px;
  box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}

/* ---------- Section Title ---------- */
.section { padding: 48px 0 8px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.section-title {
  font-size: 26px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title .tag-emoji { font-size: 24px; }
.section-title .accent-bar {
  width: 6px; height: 28px;
  border-radius: 4px;
  background: var(--accent-gradient);
}
.section-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color .2s, gap .2s;
}
.section-link:hover { color: var(--accent-primary); gap: 8px; }

/* ---------- Game Card Grid ---------- */
.grid {
  display: grid;
  gap: 20px;
}
.grid-6 { grid-template-columns: repeat(6, 1fr); gap: 16px; }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.game-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s;
  display: block;
  opacity: 0;
  transform: translateY(16px);
}
.game-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s;
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: transparent;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(99,102,241,0.15);
}
.game-cover {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.game-card:hover .game-cover img { transform: scale(1.06); }
.game-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,29,46,0.55) 0%, rgba(26,29,46,0) 50%);
  opacity: 0;
  transition: opacity .3s;
}
.game-card:hover .game-cover::after { opacity: 1; }

.badge {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 8px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.badge-hot {
  background: rgba(236, 72, 153, 0.9);
  color: #fff;
  box-shadow: 0 2px 8px rgba(236,72,153,0.3);
}
.badge-new {
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}
.badge-play {
  position: absolute;
  bottom: 12px; right: 12px;
  top: auto; left: auto;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--accent-primary);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transition: all .3s cubic-bezier(.2,.8,.2,1);
  box-shadow: var(--shadow-lg);
  z-index: 3;
}
.game-card:hover .badge-play {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.game-info {
  padding: 14px 14px 18px;
}
.game-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.cat-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-soft);
}

/* Large card (with description) */
.game-card.lg .game-info { padding: 16px 16px 20px; }
.game-card.lg .game-title { font-size: 16px; font-weight: 700; }
.game-card.lg .game-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Category Cards ---------- */
.cat-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s;
  display: block;
  opacity: 0;
  transform: translateY(16px);
}
.cat-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s;
}
.cat-card:hover {
  transform: translateY(-6px);
  border-color: transparent;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(99,102,241,0.15);
}
.cat-card-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-soft);
}
.cat-card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.cat-card:hover .cat-card-cover img { transform: scale(1.08); }
.cat-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.7) 0%, rgba(236,72,153,0.6) 100%);
  opacity: 0.85;
  transition: opacity .3s;
}
.cat-card:hover .cat-card-overlay { opacity: 0.95; }
.cat-card-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 52px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.cat-card:hover .cat-card-icon { transform: translate(-50%, -50%) scale(1.15); }
.cat-card-info {
  padding: 14px 16px 18px;
}
.cat-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
}
.cat-card-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* ---------- Category Pills ---------- */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all .2s;
}
.cat-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-soft);
}
.cat-chip.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(99,102,241,0.3);
}

/* ---------- Sort Bar ---------- */
.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.sort-bar .count {
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.sort-options {
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.sort-options button {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all .2s;
}
.sort-options button:hover { color: var(--text-primary); }
.sort-options button.active {
  background: var(--bg-elevated);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

/* ---------- Page Header (non-home) ---------- */
.page-header {
  padding: 56px 0 36px;
  text-align: center;
}
.page-header h1 {
  font-size: clamp(36px, 5vw, 56px);
  margin-bottom: 14px;
  line-height: 1.05;
}
.page-header h1 em {
  font-style: normal;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-header p {
  font-size: 16px;
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ---------- Detail Page ---------- */
.detail-wrap {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 48px;
  padding: 36px 0;
  align-items: start;
}
.detail-cover {
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  box-shadow: var(--shadow-xl);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-cover .hot-flag {
  position: absolute;
  top: 16px; left: 16px;
  background: rgba(236,72,153,0.95);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.detail-info h1 {
  font-size: 40px;
  margin-bottom: 18px;
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.detail-tags .cat-pill {
  font-size: 12px;
  padding: 6px 12px;
  font-weight: 600;
  background: var(--bg-soft);
}
.detail-desc {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 32px;
}
.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
.stat-box {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s;
}
.stat-box:hover { border-color: var(--accent-primary); box-shadow: var(--shadow-glow); }
.stat-box .label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.stat-box .value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin-top: 6px;
  color: var(--accent-primary);
}

/* ---------- Play Page ---------- */
.play-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: var(--shadow-xl);
}
.play-frame iframe { width: 100%; height: 100%; border: 0; }
.play-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 20px;
}
.play-topbar h1 { font-size: 26px; }
.play-topbar p {
  font-size: 14px;
  margin-top: 4px;
  color: var(--text-secondary);
}

/* Play page placeholder */
.play-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 20px; text-align: center; padding: 32px;
  background:
    radial-gradient(600px circle at 50% 30%, rgba(99,102,241,0.18), transparent 60%),
    radial-gradient(500px circle at 50% 80%, rgba(236,72,153,0.18), transparent 60%),
    linear-gradient(135deg, #0F172A 0%, #1E1B4B 50%, #312E81 100%);
}
.play-placeholder .ph-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: clamp(28px, 4vw, 44px);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.play-placeholder .ph-desc { color: rgba(255,255,255,0.7); max-width: 520px; font-size: 15px; line-height: 1.7; }
.play-placeholder .ph-badge {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.15em;
  text-transform: uppercase; color: #A5B4FC;
  border: 1px solid rgba(165,180,252,0.4); padding: 8px 16px; border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 22px; color: var(--text-primary); margin-bottom: 8px; }

/* Fade-up animation */
.fade-up {
  animation: fadeUp 0.5s ease forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}
.footer p { font-size: 14px; color: var(--text-muted); }
.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 40px;
  padding-top: 40px;
  padding-bottom: 24px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-brand .logo { font-size: 20px; }
.footer-tag {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.footer-col a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color .2s;
}
.footer-col a:hover { color: var(--accent-primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}
.footer-bottom p { font-size: 12px; color: var(--text-muted); text-align: center; }

/* ---------- Static / Legal Pages ---------- */
.legal-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 0 40px;
}
.legal-content h2 {
  font-size: 24px;
  margin: 32px 0 12px;
  color: var(--text-primary);
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 {
  font-size: 18px;
  margin: 22px 0 10px;
  color: var(--text-primary);
}
.legal-content p {
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 12px;
  color: var(--text-secondary);
}
.legal-content ul,
.legal-content ol {
  margin: 0 0 16px 20px;
  color: var(--text-secondary);
}
.legal-content li {
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 6px;
}
.legal-content a {
  color: var(--accent-primary);
  text-decoration: underline;
}
.legal-content a:hover { text-decoration: none; }
.legal-content strong { color: var(--text-primary); font-weight: 700; }
.legal-content .info-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}
.legal-content .info-card h3 { margin-top: 0; }
.legal-content .last-updated {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 24px;
  padding: 8px 14px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  display: inline-block;
}
.contact-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}
.contact-form label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: block;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}
.contact-form textarea { min-height: 120px; resize: vertical; }

/* ---------- Back to Top ---------- */
.back-top {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all .3s cubic-bezier(.2,.8,.2,1);
  box-shadow: var(--shadow-lg);
  z-index: 90;
}
.back-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-top:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow), var(--shadow-lg);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 24px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb a:hover { color: var(--accent-primary); }
.breadcrumb .sep { color: var(--border-strong); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-6 { grid-template-columns: repeat(4, 1fr); }
  .grid-5 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .hero-slide { grid-template-columns: 1fr; }
  .hero-visual { padding: 0 32px 32px; }
  .hero-visual img { max-width: 320px; }
  .detail-wrap { grid-template-columns: 1fr; }
  .detail-cover { max-width: 360px; }
  .grid-6, .grid-5, .grid-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .nav-links, .search-box { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-search-toggle { display: inline-flex; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    gap: 4px;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open a { width: 100%; }
  /* Mobile search box: show full width inside navbar when toggled */
  .search-box.mobile-open {
    display: block;
    position: absolute;
    top: 68px; left: 0; right: 0;
    width: auto;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 110;
  }
  .search-box.mobile-open input { width: 100%; }
  .search-box.mobile-open .search-dropdown {
    position: static;
    max-height: 60vh;
    box-shadow: none;
    border: none;
    margin-top: 8px;
  }
  .hero-content { padding: 36px 28px; }
  .hero-dots { left: 28px; bottom: 20px; }
  .grid-6, .grid-5, .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .section-title { font-size: 22px; }
  .section { padding: 36px 0 4px; }
  .detail-info h1 { font-size: 28px; }
  .detail-desc { font-size: 14px; line-height: 1.6; }
  .detail-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-box { padding: 12px 10px; }
  .stat-box .value { font-size: 14px; }
  .play-topbar { flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px 0 16px; }
  .play-topbar h1 { font-size: 22px; }
  .play-placeholder .ph-desc { font-size: 13px; }
  .page-header h1 { font-size: 32px; }
  .page-header p { font-size: 14px; }
}
@media (max-width: 480px) {
  .grid-6, .grid-5, .grid-4, .grid-3, .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .detail-stats { grid-template-columns: repeat(3, 1fr); }
  .detail-wrap { gap: 24px; padding: 20px 0; }
  .detail-cover { max-width: 100%; }
  .detail-info h1 { font-size: 24px; }
  .play-topbar h1 { font-size: 20px; }
  .page-header h1 { font-size: 26px; }
  .game-card .game-title { font-size: 13px; }
  .game-card.lg .game-title { font-size: 14px; }
  .game-card.lg .game-desc { font-size: 12px; }
}

/* ---------- Desktop / Mobile visibility ---------- */
.mobile-only { display: none; }
.desktop-only { display: block; }

/* ---------- Mobile Homepage (4 modules, ~50vh each) ---------- */
@media (max-width: 768px) {
  .desktop-only { display: none; }
  .mobile-only { display: block; }

  .container { padding: 0 14px; }

  .footer { margin-top: 24px; }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 24px;
    padding-bottom: 16px;
  }
  .footer-cols {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .footer-col h4 { font-size: 11px; }
  .footer-col a { font-size: 13px; }
  .footer-brand { gap: 8px; }
  .footer-brand .logo { font-size: 18px; }
  .footer-tag { font-size: 12px; }

  .m-section {
    padding: 12px 0 6px;
  }

  /* Section header */
  .m-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  .m-section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 19px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
  }
  .m-section-title .tag-emoji { font-size: 19px; }
  .m-section-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
  }
  .m-section-link:hover { color: var(--accent-primary); }

  /* Module 1: Mobile Hero */
  .m-hero { padding-top: 10px; padding-bottom: 2px; }
  .m-hero-card {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    aspect-ratio: 16 / 10;
  }
  .m-hero-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .m-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
  }
  .m-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15,23,42,0.88) 0%, rgba(15,23,42,0.45) 55%, rgba(15,23,42,0.05) 100%);
  }
  .m-hero-content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 12px 14px 14px;
    z-index: 2;
  }
  .m-hero-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(99,102,241,0.9);
    color: #fff;
    margin-bottom: 8px;
  }
  .m-hero-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 20px;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 6px;
  }
  .m-hero-desc {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    line-height: 1.35;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .m-hero-meta { margin-bottom: 8px; }
  .m-hero-cat {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
  .m-hero-btn {
    padding: 9px 20px;
    font-size: 13px;
  }

  /* Module 2 & 3: Horizontal scroll game rows */
  .m-scroll-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    padding-left: 4px;
    padding-right: 4px;
    scrollbar-width: none;
  }
  .m-scroll-row::-webkit-scrollbar { display: none; }

  .m-game-card {
    flex-shrink: 0;
    width: 115px;
    scroll-snap-align: start;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: transform .2s;
    opacity: 0;
    transform: translateY(12px);
    display: block;
  }
  .m-game-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .4s ease, transform .4s cubic-bezier(.2,.8,.2,1);
  }
  .m-game-card:active { transform: scale(0.97); }

  .m-game-cover {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--bg-soft);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .m-game-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center center;
  }
  .m-badge {
    position: absolute;
    top: 6px; left: 6px;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 6px;
    border-radius: 6px;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2;
  }
  .m-badge-hot {
    background: rgba(236, 72, 153, 0.9);
    color: #fff;
  }
  .m-badge-new {
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
  }

  .m-game-info {
    padding: 6px 8px 8px;
  }
  .m-game-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
  }

  /* Module 4: New Arrivals - 2-column grid with category label */
  .m-new-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .m-new-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: transform .2s;
    opacity: 0;
    transform: translateY(12px);
    display: block;
  }
  .m-new-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .4s ease, transform .4s cubic-bezier(.2,.8,.2,1);
  }
  .m-new-card:active { transform: scale(0.97); }
  .m-new-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--bg-soft);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .m-new-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform .3s;
  }
  .m-new-card.visible .m-new-cover img:hover { transform: scale(1.05); }
  .m-new-info {
    padding: 8px 10px 10px;
  }
  .m-new-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    margin-bottom: 3px;
  }
  .m-new-cat {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  /* Module 5: Category grid */
  .m-cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .m-cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 6px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    transition: all .2s;
    text-align: center;
  }
  .m-cat-item:active {
    transform: scale(0.95);
    border-color: var(--accent-primary);
  }
  .m-cat-icon {
    font-size: 26px;
    line-height: 1;
  }
  .m-cat-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .m-cat-count {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 2px;
  }
}

@media (max-width: 480px) {
  .m-hero-card { aspect-ratio: 4 / 2.8; }
  .m-hero-title { font-size: 18px; }
  .m-game-card { width: 105px; }
  .m-game-title { font-size: 11px; }
  .m-cat-icon { font-size: 22px; }
  .m-cat-name { font-size: 12px; }
}
