/* ══════════════════════════════════════════════════════════
   SteamDB Clone — Design System
   Dark theme · Purple (#9C51B6) + Cyan (#29d3d3) accents
   ══════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:      #0d0f14;
  --bg-2:    #111318;
  --card:    #161a22;
  --card-2:  #1a1f29;
  --surface: #1e2330;
  --border:  rgba(255,255,255,.06);
  --border-h:rgba(255,255,255,.12);
  --muted:   #8b95a8;
  --text:    #e8ecf2;
  --text-2:  #c5ccd9;
  --accent:  #9C51B6;
  --cyan:    #29d3d3;
  --green:   #4ade80;
  --red:     #f87171;
  --yellow:  #facc15;
  --ring:    rgba(156,81,182,.35);
  --glow-purple: rgba(156,81,182,.18);
  --glow-cyan:   rgba(41,211,211,.18);
  --radius:  14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Orbitron', var(--font);
  --shadow: 0 8px 32px rgba(0,0,0,.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.5);
  --transition: .22s cubic-bezier(.4,.0,.2,1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--cyan); text-decoration: none; transition: color var(--transition); }
a:hover { color: #5de8e8; }

img { max-width: 100%; display: block; }

/* ── Focus ──────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ══════════════════════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════════════════════ */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,15,20,.85);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700;
  color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.nav-brand .accent { color: var(--accent); }
.nav-links { display: flex; gap: 6px; }
.nav-link {
  padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px; font-weight: 500;
  transition: all var(--transition);
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.06); color: #fff;
}

/* ══════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════ */
.wrap {
  max-width: 1200px; margin: 0 auto; padding: 24px 20px 64px;
}

.page-bg {
  background: radial-gradient(ellipse 1200px 600px at 20% -10%, #1a1d24, var(--bg) 55%);
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════ */
.card {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.card-flat { transform: none !important; }

/* ══════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 14px; cursor: pointer;
  border: none; transition: all var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: #0d0f12;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset,
              0 8px 28px var(--glow-cyan),
              0 0 14px var(--glow-purple);
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 0 1px rgba(255,255,255,.1) inset,
              0 12px 36px rgba(41,211,211,.35),
              0 0 24px rgba(156,81,182,.35);
  filter: brightness(1.08);
}
.btn-ghost {
  background: rgba(255,255,255,.05); color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.1); border-color: var(--border-h);
}
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  border-radius: var(--radius-sm);
}

/* ══════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-weight: 700; font-size: 12px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: #0d0f12;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset, 0 4px 16px var(--glow-cyan);
}
.badge-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  box-shadow: none;
}
.badge-green { background: var(--green); color: #0a0f0a; box-shadow: none; }
.badge-red   { background: var(--red); color: #1a0a0a; box-shadow: none; }

/* ══════════════════════════════════════════════════════════
   SEARCH (Home Page)
   ══════════════════════════════════════════════════════════ */
.search-hero {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  min-height: calc(100vh - 56px); padding: 40px 20px;
}
.search-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: #fff; margin-bottom: 6px;
}
.search-hero h1 .glow {
  color: var(--accent);
  text-shadow: 0 0 20px rgba(156,81,182,.5);
}
.search-hero .tagline {
  color: var(--muted); font-size: 1rem; margin-bottom: 28px;
  max-width: 460px;
}

.search-box {
  position: relative; width: 100%; max-width: 560px;
}
.search-box input {
  width: 100%; padding: 14px 44px 14px 18px;
  font-size: 1.05rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card);
  color: #fff; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring), 0 8px 24px rgba(0,0,0,.3);
}
.search-box input::placeholder { color: var(--muted); }

.search-box .clear-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; color: var(--muted);
  font-size: 1.3rem; cursor: pointer; display: none;
  transition: color var(--transition);
}
.search-box .clear-btn:hover { color: #fff; }

/* Dropdown */
.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  max-height: 340px; overflow-y: auto; z-index: 50;
  display: none;
}
.dropdown-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover, .dropdown-item.active {
  background: rgba(156,81,182,.08);
}
.dropdown-item img.thumb {
  width: 72px; height: 27px; border-radius: 6px;
  object-fit: cover; flex-shrink: 0; background: var(--bg);
}
.dropdown-item .text-block {
  display: flex; flex-direction: column; gap: 2px;
}
.dropdown-item .text-block strong { font-size: 14px; }
.dropdown-item .appid-tag {
  font-size: 12px; color: var(--muted);
}
.dropdown .hint {
  padding: 12px 14px; color: var(--muted); font-style: italic; font-size: 14px;
}
mark { background: transparent; color: var(--accent); font-weight: 700; }

/* ══════════════════════════════════════════════════════════
   GAME PAGE
   ══════════════════════════════════════════════════════════ */

/* Hero */
.hero {
  position: relative; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  /* Prevent layout shift — reserve the hero height */
  min-height: 280px;
}
.hero img.hero-bg {
  width: 100%; height: 320px; object-fit: cover;
  filter: saturate(1.05) contrast(1.02);
  transform: scale(1.02);
  transition: transform .6s ease;
}
.hero:hover img.hero-bg { transform: scale(1.06); }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.7) 100%);
  pointer-events: none;
}
.hero-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 20px 24px; z-index: 2;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 3.4vw, 34px);
  text-shadow: 0 3px 20px rgba(0,0,0,.6);
  display: flex; flex-direction: column; gap: 4px;
}
.hero-sub { color: var(--muted); font-size: 13px; font-family: var(--font); }
.hero-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Content grid */
.game-grid {
  display: grid; grid-template-columns: 320px 1fr; gap: 20px; margin-top: 20px;
}
@media (max-width: 900px) { .game-grid { grid-template-columns: 1fr; } }

/* Cover sidebar */
.cover-wrap {
  border-radius: 12px; overflow: hidden; background: var(--bg);
  box-shadow: var(--shadow);
}
.cover-wrap img { width: 100%; height: auto; }

.meta-note {
  margin-top: 12px; font-size: 13px; color: var(--muted); line-height: 1.5;
}

/* Value card */
.value-card {
  background: linear-gradient(180deg, var(--card-2), var(--bg-2));
  border-radius: var(--radius); padding: 18px; margin-top: 14px;
  border: 1px solid var(--border);
}
.value-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.v-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: #0d0f12; font-weight: 800; padding: 12px 16px; border-radius: 12px;
  box-shadow: 0 8px 26px var(--glow-cyan), 0 0 0 1px rgba(255,255,255,.06) inset;
  transition: transform var(--transition);
}
.v-badge:hover { transform: scale(1.04); }
.v-score { font-size: 30px; line-height: 1; font-weight: 800; }
.v-label { font-weight: 700; color: var(--text); font-size: 15px; }

/* Value breakdown bars */
.v-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.v-bar-row {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.v-bar-label { width: 90px; color: var(--muted); flex-shrink: 0; }
.v-bar-track {
  flex: 1; height: 8px; background: rgba(255,255,255,.06);
  border-radius: var(--radius-pill); overflow: hidden;
}
.v-bar-fill {
  height: 100%; border-radius: var(--radius-pill);
  transition: width .8s cubic-bezier(.4,.0,.2,1);
}
.v-bar-fill.playtime  { background: var(--cyan); }
.v-bar-fill.positivity { background: var(--accent); }
.v-bar-fill.confidence { background: var(--yellow); }
.v-bar-val { width: 40px; text-align: right; color: var(--text-2); font-weight: 600; }

/* Stat chips */
.v-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px;
}
.v-chip {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 13px; color: var(--text-2);
}
.v-chip .label { opacity: .7; margin-bottom: 2px; font-size: 12px; }
.v-chip strong { color: var(--text); }

/* Vibes */
.vibes-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px;
}

/* ── Review Trend ─────────────────────────────────────── */
.review-trend {
  display: flex; gap: 12px; margin-top: 14px;
}
.trend-box {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; text-align: center;
}
.trend-box .trend-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.trend-box .trend-val { font-size: 20px; font-weight: 800; }
.trend-box .trend-val.positive { color: var(--green); }
.trend-box .trend-val.negative { color: var(--red); }
.trend-box .trend-val.neutral  { color: var(--yellow); }

/* ══════════════════════════════════════════════════════════
   PRICE TABLE
   ══════════════════════════════════════════════════════════ */
.prices-card {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border-radius: var(--radius); padding: 12px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.prices-card h2 {
  font-family: var(--font-display); font-size: 17px;
  margin: 8px 10px 14px; color: #fff; letter-spacing: .3px;
}
.price-row {
  display: grid; grid-template-columns: 130px 1fr 100px 80px 80px;
  gap: 10px; align-items: center; padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), transform var(--transition);
}
.price-row.header { color: var(--muted); font-weight: 600; font-size: 13px; }
.price-row:not(.header):hover {
  background: rgba(156,81,182,.06); transform: translateX(2px);
}
.price-row.cheapest {
  background: rgba(41,211,211,.06); border: 1px solid rgba(41,211,211,.15);
  box-shadow: 0 2px 12px rgba(41,211,211,.08);
}
.flag { font-size: 20px; }
.region-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.price-cell { font-variant-numeric: tabular-nums; }
.strike { text-decoration: line-through; opacity: .5; margin-right: 4px; }
.free-tag { color: var(--green); font-weight: 700; }
.vs-usd { font-size: 12px; font-weight: 600; }
.vs-usd.cheaper { color: var(--green); }
.vs-usd.same { color: var(--muted); }
.vs-usd.pricier { color: var(--red); }

@media (max-width: 700px) {
  .price-row { grid-template-columns: 1fr 1fr; gap: 6px; }
  .price-row .hide-mobile { display: none; }
}

/* ══════════════════════════════════════════════════════════
   SIMILAR GAMES / RECOMMENDATIONS
   ══════════════════════════════════════════════════════════ */
.section-title {
  font-family: var(--font-display); font-size: 17px;
  color: #fff; margin: 28px 0 14px; letter-spacing: .3px;
}
.recs-scroll {
  display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.recs-scroll::-webkit-scrollbar { height: 6px; }
.recs-scroll::-webkit-scrollbar-track { background: var(--bg-2); border-radius: 3px; }
.recs-scroll::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 3px; }
.rec-card {
  flex: 0 0 200px; scroll-snap-align: start;
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.rec-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-lg);
}
.rec-card img {
  width: 100%; height: 94px; object-fit: cover; background: var(--bg);
}
.rec-card .rec-info {
  padding: 8px 10px;
}
.rec-card .rec-name { font-size: 13px; font-weight: 600; color: var(--text); }
.rec-card .rec-reason { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════
   GAME PAGE — COMPACT DASHBOARD OVERRIDES
   Fits everything in one desktop viewport (no scroll).
   ══════════════════════════════════════════════════════════ */

/* --- Wrapper --- */
.wrap--game { padding: 12px 16px 12px; }

/* --- Hero compact --- */
.hero--compact { min-height: auto; }
.hero--compact img.hero-bg {
  height: 160px;
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;   /* Chromium sharpening hint */
  image-rendering: crisp-edges;                  /* Firefox hint */
  transform: none;                               /* no scale = no blur */
  filter: saturate(1.05) contrast(1.04);
}
.hero--compact:hover img.hero-bg { transform: none; }
.hero--compact .hero-bar { padding: 10px 16px; }
.hero--compact .hero-title { font-size: clamp(16px, 2.6vw, 24px); gap: 2px; }
.hero--compact .hero-sub { font-size: 11px; }

/* --- 3-column grid --- */
.game-grid--compact {
  grid-template-columns: 260px 1fr 220px;
  gap: 12px; margin-top: 10px;
}

/* --- Left column (cover + value) --- */
.card--compact { padding: 10px; }
.cover-wrap--sm { border-radius: 8px; }
.cover-wrap--sm img { max-height: 150px; object-fit: cover; }

/* Value card compact */
.value-card--compact { padding: 8px; margin-top: 6px; }
.value-card--compact .value-top { margin-bottom: 6px; gap: 6px; }
.v-badge--sm { padding: 8px 10px; border-radius: 8px; gap: 6px; }
.v-badge--sm .v-score { font-size: 22px; }
.value-card--compact .v-bars { gap: 4px; margin-top: 6px; }
.value-card--compact .v-bar-row { gap: 6px; font-size: 11px; }
.value-card--compact .v-bar-label { width: 70px; font-size: 11px; }
.value-card--compact .v-bar-track { height: 6px; }
.value-card--compact .v-bar-val { width: 34px; font-size: 11px; }

/* Stat chips compact */
.v-grid--compact { gap: 4px; margin-top: 6px; }
.v-grid--compact .v-chip { padding: 6px 8px; font-size: 11px; }
.v-grid--compact .v-chip .label { font-size: 10px; }

/* Review trend compact */
.review-trend--compact { gap: 4px; margin-top: 6px; }
.review-trend--compact .trend-box { padding: 6px 8px; }
.review-trend--compact .trend-label { font-size: 10px; margin-bottom: 2px; }
.review-trend--compact .trend-val { font-size: 15px; }

/* Vibes in compact */
.value-card--compact .vibes-row { margin-top: 8px; gap: 4px; }
.value-card--compact .vibes-row .badge { font-size: 10px; padding: 2px 6px; }

/* --- Middle column (prices) --- */
.prices-card--compact { padding: 8px; }
.prices-card--compact h2 { font-size: 14px; margin: 4px 6px 8px; }
.prices-scroll {
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  overflow-x: hidden;
}
.prices-scroll::-webkit-scrollbar { width: 5px; }
.prices-scroll::-webkit-scrollbar-track { background: var(--bg-2); border-radius: 3px; }
.prices-scroll::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 3px; }

.prices-card--compact .price-row {
  grid-template-columns: 110px 1fr 70px 60px 60px;
  gap: 6px; padding: 5px 8px; font-size: 12px;
}
.prices-card--compact .price-row.header { font-size: 11px; }
.prices-card--compact .flag { font-size: 15px; }
.prices-card--compact .region-cell { gap: 6px; font-size: 12px; }

/* --- Right column (recs) --- */
.recs-panel {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border-radius: var(--radius); padding: 8px;
  border: 1px solid var(--border);
}
.section-title--compact { font-size: 14px; margin: 4px 4px 8px; }
.recs-container--compact {
  max-height: calc(100vh - 320px);
  overflow-y: auto;
}
.recs-container--compact::-webkit-scrollbar { width: 4px; }
.recs-container--compact::-webkit-scrollbar-track { background: var(--bg-2); border-radius: 3px; }
.recs-container--compact::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 3px; }

/* Vertical stacked rec cards */
.recs-stack { display: flex; flex-direction: column; gap: 6px; }
.rec-card--row {
  flex: none; display: flex; align-items: center;
  border-radius: 8px; overflow: hidden;
  background: var(--bg); border: 1px solid var(--border);
  transition: background var(--transition);
}
.rec-card--row:hover { background: rgba(156,81,182,.06); transform: none; box-shadow: none; }
.rec-card--row img {
  width: 80px; height: 45px; object-fit: cover; flex-shrink: 0;
}
.rec-card--row .rec-info { padding: 4px 8px; min-width: 0; }
.rec-card--row .rec-name {
  font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rec-card--row .rec-reason { font-size: 10px; color: var(--muted); margin-top: 1px; }

/* --- Desktop: force no-scroll viewport fit --- */
@media (min-width: 1024px) {
  .wrap--game {
    max-height: calc(100vh - 56px);  /* minus nav height */
    overflow: hidden;
  }
  .game-col { overflow: hidden; }
  .game-col--left { overflow-y: auto; }
  .game-col--left::-webkit-scrollbar { width: 4px; }
  .game-col--left::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 3px; }
}

/* --- Tablet: 2-col fallback --- */
@media (max-width: 1023px) and (min-width: 769px) {
  .game-grid--compact {
    grid-template-columns: 240px 1fr;
  }
  .game-col--right { grid-column: 1 / -1; }
  .recs-container--compact { max-height: 200px; }
  .recs-stack { flex-direction: row; flex-wrap: wrap; }
  .rec-card--row { flex: 0 0 calc(50% - 4px); }
}

/* --- Mobile: stack everything --- */
@media (max-width: 768px) {
  .game-grid--compact { grid-template-columns: 1fr; }
  .wrap--game { max-height: none; overflow: auto; padding: 10px 12px 32px; }
  .hero--compact img.hero-bg { height: 140px; }
  .cover-wrap--sm img { max-height: 140px; }
  .prices-scroll { max-height: 300px; }
  .recs-container--compact { max-height: 240px; }
  .prices-card--compact .price-row { grid-template-columns: 1fr 1fr; gap: 4px; }
  .prices-card--compact .price-row .hide-mobile { display: none; }
}

/* Hide footer on game page desktop to save space */
@media (min-width: 1024px) {
  body:has(.wrap--game) .footer { display: none; }
}

/* ══════════════════════════════════════════════════════════
   TRENDING PAGE
   ══════════════════════════════════════════════════════════ */
.trending-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-top: 16px;
}
.trending-card {
  border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.trending-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.trending-cover {
  position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--bg);
}
.trending-cover img { width: 100%; height: 100%; object-fit: cover; }
.trending-rank {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  border-radius: var(--radius-pill); padding: 4px 10px;
  font-weight: 800; font-size: 13px; color: var(--cyan);
}
.trending-meta { padding: 12px 14px; }
.trending-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.trending-desc { font-size: 12px; color: var(--muted); line-height: 1.4; margin-bottom: 8px; }
.trending-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.trending-tags .tag {
  font-size: 11px; padding: 2px 8px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,.05); color: var(--text-2);
}
.trending-price {
  font-weight: 700; font-size: 14px; color: var(--green); margin-top: 6px;
}

/* ══════════════════════════════════════════════════════════
   COMPARE PAGE
   ══════════════════════════════════════════════════════════ */
.compare-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}
.compare-slots {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.compare-slot {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--card); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-2);
}
.compare-slot .remove-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 14px; padding: 0 2px;
}
.compare-slot .remove-btn:hover { color: var(--red); }
.compare-grid {
  display: grid; gap: 16px; margin-top: 16px;
}
.compare-table {
  width: 100%; border-collapse: collapse;
}
.compare-table th, .compare-table td {
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.compare-table th {
  color: var(--muted); font-weight: 600; font-size: 13px;
  background: var(--card);
  position: sticky; top: 56px;
}
.compare-table td { font-size: 14px; }
.compare-table tr:hover td { background: rgba(255,255,255,.02); }
.compare-cover { width: 100px; height: auto; border-radius: 6px; }

/* ══════════════════════════════════════════════════════════
   MOODS PAGE
   ══════════════════════════════════════════════════════════ */
.mood-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: var(--card);
  padding: 8px 14px; border-radius: var(--radius-pill);
  color: var(--text-2); cursor: pointer; user-select: none;
  transition: all var(--transition); font-size: 14px;
}
.chip:hover { transform: translateY(-1px); border-color: var(--border-h); }
.chip.active {
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: #0d0f12; border-color: transparent; font-weight: 600;
  box-shadow: 0 6px 20px var(--glow-cyan);
}

.mood-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px; margin-top: 16px;
}
.mood-card {
  border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.mood-card:hover { transform: translateY(-3px); }
.mood-cover { aspect-ratio: 16/9; background: var(--bg); overflow: hidden; }
.mood-cover img { width: 100%; height: 100%; object-fit: cover; }
.mood-meta {
  padding: 10px 12px; display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
}
.mood-left { display: flex; flex-direction: column; gap: 4px; }
.mood-name { font-weight: 700; font-size: 14px; }

/* ══════════════════════════════════════════════════════════
   RECENTLY VIEWED / FAVORITES SECTIONS
   ══════════════════════════════════════════════════════════ */
.home-section { margin-top: 36px; }
.home-section h2 {
  font-family: var(--font-display); font-size: 16px;
  color: var(--text); margin-bottom: 12px;
}
.home-scroll {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px;
}
.home-scroll::-webkit-scrollbar { height: 5px; }
.home-scroll::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 3px; }
.home-card {
  flex: 0 0 180px; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
  cursor: pointer; transition: transform var(--transition);
}
.home-card:hover { transform: translateY(-3px); }
.home-card img { width: 100%; height: 84px; object-fit: cover; }
.home-card .home-card-name {
  padding: 6px 8px; font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ══════════════════════════════════════════════════════════
   SKELETON LOADERS
   ══════════════════════════════════════════════════════════ */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, rgba(255,255,255,.06) 50%, var(--surface) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.w-60 { width: 60%; }
.skeleton-text.w-80 { width: 80%; }
.skeleton-text.w-40 { width: 40%; }
.skeleton-block { height: 120px; margin-bottom: 12px; }
/* Skeleton cards have fixed dimensions to prevent layout shift */
.skeleton-card { height: 200px; min-width: 180px; }
.skeleton-bar { height: 8px; border-radius: 4px; }

/* ══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 18px; border-radius: var(--radius-sm);
  background: var(--card-2); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(12px) scale(.96);
  transition: opacity .25s ease, transform .25s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: none; }
.toast.fade-out { opacity: 0; transform: translateY(-8px) scale(.96); }
@keyframes toastIn  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .search-hero h1 { font-size: 1.6rem; }
  .v-grid { grid-template-columns: 1fr; }
  .hero-bar { flex-direction: column; align-items: flex-start; }
  .trending-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════ */
.footer {
  text-align: center; padding: 28px 20px; color: var(--muted);
  font-size: 13px; border-top: 1px solid var(--border);
  margin-top: 48px;
}
.footer a { color: var(--cyan); }

/* Favourite heart */
.fav-btn {
  background: none; border: none; cursor: pointer; font-size: 20px;
  color: var(--muted); transition: all var(--transition);
  padding: 4px;
}
.fav-btn:hover { transform: scale(1.2); }
.fav-btn.active { color: #f87171; }

/* Loading spinner */
.spinner {
  width: 24px; height: 24px; border: 3px solid var(--surface);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
