/*
Theme Name: ROM Vault
Theme URI: https://example.com/rom-vault
Author: ROM Vault
Description: A modern ROM listing theme that reads roms.json directly. No database import needed. Features console filtering, search, genre filtering, and per-game detail pages with permanent download links.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: rom-vault
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --bg: #0b0e14;
  --bg-soft: #131a24;
  --bg-card: #1a2230;
  --bg-hover: #232e40;
  --border: #2a3547;
  --border-strong: #37435a;
  --text: #eef1f6;
  --text-dim: #93a0b4;
  --accent: #5b9bff;
  --accent-2: #8a6bff;
  --accent-gradient: linear-gradient(135deg, #5b9bff 0%, #8a6bff 100%);
  --ok: #3fd0a0;
  --warn: #ffb648;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(91, 155, 255, 0.07), transparent),
    radial-gradient(900px 500px at 5% 20%, rgba(138, 107, 255, 0.06), transparent),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 700; }

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 17, 22, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.main-nav { flex: 1; display: flex; justify-content: center; }
.main-nav ul { justify-content: center; }
.main-nav + .nav-toggle { margin-left: 0; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: grid; place-items: center;
  color: #fff;
}
.brand-logo svg { width: 22px; height: 22px; }
.brand-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.3px;
  line-height: 1;
}
.brand-name span { color: var(--accent); }

.main-nav ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.main-nav li { position: relative; }
.main-nav a {
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  display: block;
}
.main-nav a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.main-nav a.active { color: var(--text); background: var(--bg-soft); }
.main-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  box-shadow: var(--shadow);
  z-index: 60;
}
.main-nav li:hover > .sub-menu,
.main-nav li.open > .sub-menu { display: block; }
.main-nav .sub-menu a { padding: 8px 10px; font-weight: 500; }
.main-nav .sub-menu a:hover { background: var(--bg-soft); }
.menu-item-has-children > a::after {
  content: "▾";
  margin-left: 6px;
  font-size: 10px;
  opacity: 0.7;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; }
  .nav-toggle { display: flex; order: 3; }
  .main-nav {
    order: 4;
    width: 100%;
    display: none;
    flex: none;
    justify-content: flex-start;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 2px; }
  .main-nav .sub-menu {
    position: static;
    box-shadow: none;
    padding-left: 14px;
    display: none;
    min-width: 0;
  }
  .main-nav li.open > .sub-menu { display: block; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: 72px 0 48px;
  text-align: center;
  background:
    radial-gradient(800px 420px at 20% -10%, rgba(91, 155, 255, 0.22), transparent),
    radial-gradient(800px 420px at 80% -10%, rgba(138, 107, 255, 0.22), transparent);
}
.hero-rating {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
}
.hero-rating .stars { color: var(--warn); letter-spacing: 2px; }
.hero h1 {
  font-size: clamp(30px, 5vw, 50px);
  margin-bottom: 12px;
  background: linear-gradient(120deg, #fff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { color: var(--text-dim); font-size: 17px; max-width: 640px; margin: 0 auto 32px; }
.hero-lead strong { color: var(--text); }
.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.btn-lg { padding: 14px 28px; font-size: 16px; }
.hero-stats {
  display: flex;
  gap: 40px;
  justify-content: center;
  flex-wrap: wrap;
  background: rgba(26, 34, 48, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 28px;
  max-width: 720px;
  margin: 0 auto;
  backdrop-filter: blur(8px);
}
.stat { text-align: center; }
.stat-num { font-size: 30px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 13px; color: var(--text-dim); }

/* ==========================================================================
   Search
   ========================================================================== */
.search-bar {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 8px;
}
.search-bar input[type="search"] {
  flex: 1;
  padding: 13px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.search-bar input[type="search"]:focus { border-color: var(--accent); }

/* ==========================================================================
   Filters
   ========================================================================== */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 18px 0 8px;
}
.filter-chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-chip:hover { color: var(--text); border-color: var(--accent); }
.filter-chip.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
}

/* ==========================================================================
   Console grid (home)
   ========================================================================== */
.section-title {
  font-size: 24px;
  margin: 8px 0 18px;
}
.console-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.console-card {
  display: block;
  padding: 24px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.console-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.console-card h3 { font-size: 18px; margin: 0 0 4px; }
.console-card .count { color: var(--text-dim); font-size: 14px; }

/* ==========================================================================
   Game grid
   ========================================================================== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.game-card {
  position: relative;
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.game-cover {
  aspect-ratio: 3 / 4;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.game-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.game-card:hover .game-cover img { transform: scale(1.06); }
.game-cover .no-cover {
  font-size: 40px;
  opacity: 0.35;
}
.game-card-body { padding: 12px 14px 14px; }
.game-card-body h3 {
  font-size: 15px;
  margin: 0 0 6px;
  color: var(--text);
  line-height: 1.35;
}
.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.rating-badge { color: var(--warn); font-weight: 700; }
.ia-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(63, 208, 160, 0.15);
  color: var(--ok);
  font-size: 11px;
  font-weight: 700;
  position: absolute;
  top: 8px; right: 8px;
  z-index: 2;
}

/* ==========================================================================
   Archive layout (sidebar + grid)
   ========================================================================== */
.archive-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  margin-top: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .archive-layout { grid-template-columns: 1fr; }
}
.archive-sidebar {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 4px;
  display: grid;
  gap: 20px;
}
@media (max-width: 860px) {
  .archive-sidebar { position: static; max-height: none; overflow: visible; }
}
.sidebar-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.sidebar-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.sidebar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sidebar-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14px;
  transition: background 0.12s ease, color 0.12s ease;
}
.sidebar-list a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.sidebar-list a.active { background: var(--bg-soft); color: var(--text); font-weight: 700; }
.sidebar-list .count {
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
}
.sidebar-list a.active .count { color: var(--accent); }

.archive-main { min-width: 0; }
.archive-main .search-bar { margin: 0 0 16px; }

.load-more-wrap { text-align: center; margin: 28px 0 8px; }
.load-more { min-width: 220px; justify-content: center; }
.load-more-hint { font-size: 12.5px; margin-top: 8px; }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Genre cloud */
.genre-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.genre-chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.genre-chip:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); text-decoration: none; box-shadow: var(--shadow-sm); }

/* ==========================================================================
   Detail page
   ========================================================================== */
.detail-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  padding: 40px 0;
}
@media (max-width: 800px) {
  .detail-layout { grid-template-columns: 1fr; }
}
.detail-cover {
  position: sticky;
  top: 90px;
  align-self: start;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.detail-cover img { width: 100%; display: block; aspect-ratio: 3/4; object-fit: cover; }
.detail-info h1 { font-size: 30px; margin-bottom: 6px; }
.detail-info .subtitle { color: var(--text-dim); margin-bottom: 18px; }
.info-table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.info-table th, .info-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.info-table th { color: var(--text-dim); font-weight: 600; width: 160px; }
.info-table td { color: var(--text); }
.description {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 18px 0;
  color: var(--text-dim);
  font-size: 15px;
}
.download-section { margin-top: 24px; }
.download-section h2 { font-size: 20px; margin-bottom: 12px; }
.download-list { display: grid; gap: 10px; }
.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.download-item .dl-name { font-weight: 600; font-size: 14px; }
.download-item .dl-size { color: var(--text-dim); font-size: 13px; margin-left: 8px; }
.download-item .dl-type {
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); text-decoration: none; }
.btn-accent { background: var(--accent-gradient); color: #fff; }
.btn-ghost { background: var(--bg-soft); color: var(--text); border: 1px solid var(--border); }
.btn-ia { background: rgba(63, 185, 143, 0.15); color: var(--ok); border: 1px solid rgba(63,185,143,0.4); }

/* Screenshots */
.screenshots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 20px; }
.screenshots img { border-radius: var(--radius-sm); border: 1px solid var(--border); width: 100%; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 32px 0 16px;
  color: var(--text-dim);
  font-size: 13px;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
  text-align: left;
  margin-bottom: 28px;
}
.footer-col h3 {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-col li { margin-bottom: 6px; }
.footer-col a { color: var(--text-dim); }
.footer-col a:hover { color: var(--accent); }
.footer-note {
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin: 0;
}

/* ==========================================================================
   SEO content blocks
   ========================================================================== */
.seo-intro {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 18px 0;
}
.seo-intro h2 {
  font-size: 20px;
  margin-bottom: 10px;
}
.seo-intro p {
  color: var(--text-dim);
  font-size: 15px;
  margin: 0 0 10px;
  line-height: 1.7;
}
.seo-intro p:last-child { margin-bottom: 0; }
.seo-intro a { color: var(--accent); }

/* ==========================================================================
   Utilities
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-state .big { font-size: 44px; margin-bottom: 10px; opacity: 0.5; }
.muted { color: var(--text-dim); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; } .mt-5 { margin-top: 60px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-4 { margin-bottom: 40px; }
.pt-4 { padding-top: 40px; } .pb-4 { padding-bottom: 40px; }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 14px;
}
.pagination a:hover { border-color: var(--accent); text-decoration: none; }
.pagination .current { background: var(--accent-gradient); color: #fff; border-color: transparent; }

/* Breadcrumb */
.breadcrumbs { font-size: 13px; color: var(--text-dim); margin: 18px 0 0; }
.breadcrumbs a { color: var(--text-dim); }
.breadcrumbs a:hover { color: var(--accent); }

/* Back to top */
.back-top {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  border: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}
.back-top.show { opacity: 1; pointer-events: auto; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 60;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   FAQ accordion blocks
   ========================================================================== */
.faq-blocks { display: grid; gap: 10px; margin-top: 20px; }
.faq-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.faq-block[open] { border-color: var(--border-strong); }
.faq-block summary {
  padding: 16px 20px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s ease;
}
.faq-block summary::-webkit-details-marker { display: none; }
.faq-block summary::after {
  content: '+';
  font-size: 20px;
  color: var(--accent);
  transition: transform 0.25s ease;
  margin-left: 12px;
}
.faq-block[open] summary::after { transform: rotate(45deg); }
.faq-block summary:hover { background: var(--bg-soft); }
.faq-body { padding: 0 20px 18px; color: var(--text-dim); font-size: 14.5px; line-height: 1.7; }
.faq-body p { margin: 0; }

/* ==========================================================================
   Console content section
   ========================================================================== */
.console-content { margin-bottom: 40px; }

/* ==========================================================================
   Ad slot containers
   ========================================================================== */
.ad-slot {
  margin: 24px 0;
  text-align: center;
  min-height: 0;
}

/* ==========================================================================
   Smooth scrollbar
   ========================================================================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ==========================================================================
   Focus & accessibility
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input:focus-visible, button:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ==========================================================================
   Refined transitions
   ========================================================================== */
.game-card {
  transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              border-color 0.25s ease,
              box-shadow 0.25s ease;
}
.game-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  text-decoration: none;
}
.game-cover img { transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.game-card:hover .game-cover img { transform: scale(1.08); }

.console-card {
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              border-color 0.2s ease,
              box-shadow 0.2s ease;
}
.console-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
}

.download-item {
  transition: border-color 0.2s ease, background 0.2s ease;
}
.download-item:hover { border-color: var(--border-strong); background: var(--bg-soft); }

.btn {
  transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover {
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.btn:active { transform: translateY(0); }

/* ==========================================================================
   Improved section titles
   ========================================================================== */
.section-title {
  font-size: 22px;
  font-weight: 800;
  margin: 8px 0 18px;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-top: 3px;
}

/* ==========================================================================
   Improved detail page
   ========================================================================== */
.detail-cover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}
.detail-cover:hover { transform: translateY(-2px); }
.detail-info h1 { font-size: 32px; letter-spacing: -0.3px; }

/* ==========================================================================
   Better sidebar
   ========================================================================== */
.sidebar-block {
  transition: border-color 0.2s ease;
}
.sidebar-list a {
  transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}
.sidebar-list a:hover { padding-left: 14px; }
.sidebar-list a.active { padding-left: 14px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ==========================================================================
   Improved header
   ========================================================================== */
.site-header {
  transition: background 0.2s ease, border-color 0.2s ease;
}
body:not(.home) .site-header { background: rgba(11, 14, 20, 0.95); }
.main-nav a { transition: background 0.15s ease, color 0.15s ease; }

/* ==========================================================================
   SEO intro refinement
   ========================================================================== */
.seo-intro {
  transition: border-color 0.2s ease;
}
.seo-intro:hover { border-color: var(--border-strong); }

/* ==========================================================================
   Search bar refinement
   ========================================================================== */
.search-bar input[type="search"] {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-bar input[type="search"]:focus {
  box-shadow: 0 0 0 3px rgba(91, 155, 255, 0.15);
}

/* ==========================================================================
   Responsive genre cloud
   ========================================================================== */
@media (max-width: 600px) {
  .genre-cloud { gap: 6px; }
  .genre-chip { font-size: 12px; padding: 6px 12px; }
}

/* ==========================================================================
   Homepage — quick genres
   ========================================================================== */
.quick-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}
.quick-genres .genre-chip { font-size: 13.5px; }
.quick-genres .chip-count {
  color: var(--accent);
  font-weight: 700;
  margin-left: 4px;
}

/* ==========================================================================
   Homepage — info cards
   ========================================================================== */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.info-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.info-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 26px;
  margin-bottom: 16px;
}
.info-card h2 { font-size: 19px; margin: 0 0 10px; }
.info-card p { color: var(--text-dim); font-size: 14.5px; line-height: 1.7; margin: 0 0 16px; flex: 1; }
.card-link {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}
.card-link:hover { text-decoration: underline; }

/* ==========================================================================
   Homepage — section head + features
   ========================================================================== */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.section-head .section-title { margin: 8px 0 18px; flex: 1; }
.section-link {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  margin-bottom: 10px;
}
.section-link:hover { text-decoration: underline; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.feature-card {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.feature-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 24px;
}
.feature-card h3 { font-size: 17px; margin: 0 0 8px; }
.feature-card p { color: var(--text-dim); font-size: 14px; line-height: 1.6; margin: 0; }

.faq-section { margin-top: 40px; }
.faq-section .section-title { margin-bottom: 18px; }

/* ==========================================================================
   Surprise Me! — banner & confetti
   ========================================================================== */
.btn-surprise {
  background: linear-gradient(135deg, #ff6b6b 0%, #feca57 50%, #48dbfb 100%);
  color: #111;
  font-weight: 800;
  animation: surprise-pulse 2s ease-in-out infinite;
}
.btn-surprise:hover { filter: brightness(1.1); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,107,107,0.4); }
@keyframes surprise-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,107,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(255,107,107,0); }
}

.surprise-banner {
  background: linear-gradient(135deg, rgba(255,107,107,0.15), rgba(254,202,87,0.12), rgba(72,219,251,0.15));
  border: 1px solid rgba(255,107,107,0.35);
  border-radius: var(--radius);
  padding: 0;
  margin: 20px 0 8px;
  overflow: hidden;
  animation: banner-slide 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transition: opacity 0.6s ease;
}
@keyframes banner-slide {
  0% { transform: translateY(-30px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.surprise-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  flex-wrap: wrap;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.surprise-emoji { font-size: 28px; animation: bounce-emoji 0.6s ease infinite alternate; }
@keyframes bounce-emoji {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}
.surprise-again {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.surprise-again:hover { background: rgba(255,255,255,0.2); text-decoration: none; }

.confetti-container {
  position: fixed;
  top: 0; left: 0; right: 0;
  pointer-events: none;
  z-index: 999;
  height: 0;
  overflow: visible;
}
.confetti-piece {
  position: absolute;
  top: -10px;
  animation: confetti-fall linear forwards;
  pointer-events: none;
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}