/* ================================================================
   GamePulse — Modern Redesign
   Glassmorphism · Gradient Mesh · Bento Grid · Premium Typography
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --bg: #060608;
  --bg-2: #0c0d12;
  --glass: rgba(255, 255, 255, 0.035);
  --glass-hover: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.14);
  --text: #ecedf0;
  --text-dim: #8e9098;
  --text-faint: #52545d;

  /* Premium multi-gradient accent system (no more single GX pink) */
  --grad-1: #6366f1;   /* indigo */
  --grad-2: #a855f7;   /* violet */
  --grad-3: #ec4899;   /* pink */
  --grad-4: #06b6d4;   /* cyan */
  --accent: var(--grad-1);
  --accent-grad: linear-gradient(135deg, var(--grad-4), var(--grad-1), var(--grad-2), var(--grad-3));
  --accent-grad-text: linear-gradient(135deg, var(--grad-4), var(--grad-2), var(--grad-3));
  --green: #34d399;
  --green-glow: rgba(52, 211, 153, 0.25);
  --gold: #fbbf24;
  --red: #f87171;

  --radius: 16px;
  --radius-sm: 12px;
  --shadow-soft: 0 2px 20px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--glass-border-hover);

  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* ===== Animated gradient mesh background ===== */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 700px 500px at 15% -5%, rgba(99, 102, 241, 0.12), transparent 60%),
    radial-gradient(ellipse 600px 400px at 85% 5%, rgba(168, 85, 247, 0.10), transparent 55%),
    radial-gradient(ellipse 500px 350px at 50% 95%, rgba(6, 182, 212, 0.07), transparent 50%),
    radial-gradient(ellipse 400px 300px at 95% 60%, rgba(236, 72, 153, 0.06), transparent 50%);
  animation: meshFloat 20s ease-in-out infinite;
  pointer-events: none;
}
@keyframes meshFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-2%, 1%) scale(1.03); }
  66% { transform: translate(2%, -1%) scale(0.98); }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.5); }

a { color: inherit; text-decoration: none; }

/* ===== Top bar — glassmorphic floating nav ===== */
header.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px;
  background: rgba(6, 6, 8, 0.65);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--glass-border);
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo .mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--accent-grad);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
  position: relative;
}
.logo .mark::after {
  content: ''; position: absolute; inset: 8px;
  border-radius: 6px;
  background: var(--bg);
  clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 35%);
}
.logo .name {
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  background: var(--accent-grad-text); -webkit-background-clip: text;
  background-clip: text; color: transparent;
  letter-spacing: -0.02em;
}
.logo .tag {
  color: var(--text-faint); font-size: 10px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; line-height: 1;
  margin-top: 2px;
}

.topbar .spacer { flex: 1; }

/* ===== Status indicator ===== */
.status {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--text-dim); font-family: var(--font-mono);
}
.status .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px var(--green-glow); animation: pulse 2s infinite;
}
.status .dot.err { background: var(--red); box-shadow: 0 0 8px rgba(248,113,113,0.5); }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.8); } }

/* ===== Buttons ===== */
.refresh-btn, .auto-btn {
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-dim); padding: 7px 14px; border-radius: 20px;
  cursor: pointer; font-size: 12px; font-weight: 600;
  font-family: var(--font-body); transition: all .25s cubic-bezier(.4,0,.2,1);
}
.refresh-btn:hover {
  border-color: var(--grad-1); color: var(--text);
  box-shadow: 0 0 16px rgba(99,102,241,0.2);
  transform: translateY(-1px);
}
.auto-btn { font-family: var(--font-mono); }
.auto-btn:hover { border-color: var(--green); color: var(--green); transform: translateY(-1px); }
.auto-btn.on {
  border-color: rgba(52,211,153,0.3); color: var(--green);
  background: rgba(52,211,153,0.06); box-shadow: 0 0 12px rgba(52,211,153,0.08);
}
.auto-btn.off { color: var(--text-faint); }

.updated { font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); }
.updated.fresh { color: var(--green); }

/* ===== Hero ===== */
.hero { padding: 48px 24px 20px; max-width: 1440px; margin: 0 auto; position: relative; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 52px); font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.05;
  color: var(--text);
}
.hero h1 .accent {
  background: var(--accent-grad-text); -webkit-background-clip: text;
  background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(99,102,241,0.15));
}
.hero p {
  color: var(--text-dim); margin-top: 12px; max-width: 580px;
  font-size: 15px; line-height: 1.65;
}

/* ===== Tabs — pill nav ===== */
.tabs {
  display: flex; gap: 6px; padding: 0 24px; max-width: 1440px;
  margin: 0 auto; margin-bottom: 28px; overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 16px; cursor: pointer; color: var(--text-faint);
  font-weight: 600; font-size: 12px; letter-spacing: 0.02em;
  white-space: nowrap; border-radius: 100px; border: 1px solid transparent;
  transition: all .25s cubic-bezier(.4,0,.2,1);
}
.tab:hover { color: var(--text-dim); background: var(--glass); }
.tab.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(236,72,153,0.12));
  border-color: rgba(99,102,241,0.25);
  box-shadow: 0 2px 12px rgba(99,102,241,0.1);
}

/* ===== Sections ===== */
main { max-width: 1440px; margin: 0 auto; padding: 0 24px 80px; position: relative; z-index: 1; }
.section { margin-bottom: 44px; }

.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.section-head h2 {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  letter-spacing: -0.02em;
}
.section-head .sub {
  color: var(--text-faint); font-size: 11px; font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.section-head .line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--glass-border), transparent);
}

/* ===== Cards — shared glassmorphic base ===== */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-hover);
  background: var(--glass-hover);
}
.card a { display: block; }

/* Gradient hover border glow */
.card::before {
  content: ''; position: absolute; inset: 0; border-radius: var(--radius);
  padding: 1px; opacity: 0; transition: opacity .3s;
  background: linear-gradient(135deg, rgba(99,102,241,0.4), rgba(236,72,153,0.3), rgba(6,182,212,0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }

/* ===== Horizontal rail ===== */
.rail-wrap { overflow-x: auto; padding-bottom: 14px; margin: 0 -24px; padding-left: 24px; padding-right: 24px; scrollbar-width: thin; }
.rail { display: flex; gap: 16px; min-width: min-content; }

/* ===== News card ===== */
.news-card { width: 310px; flex-shrink: 0; border-radius: var(--radius); }
.news-card .thumb {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block;
  background: var(--bg-2);
}
.news-card .body { padding: 14px 16px 18px; }
.news-card .pub {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: var(--text-faint); font-family: var(--font-mono); margin-bottom: 8px;
}
.news-card .pub .pub-name {
  color: var(--grad-1); font-weight: 600;
}
.news-card .pub .pub-author { color: var(--text-faint); }
.news-card .pub .sep { color: var(--text-faint); opacity: 0.5; }
.news-card .title {
  font-size: 15px; font-weight: 600; line-height: 1.4;
  color: var(--text); display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* ===== Deal card ===== */
.deal-card { width: 230px; flex-shrink: 0; border-radius: var(--radius); }
.deal-card .thumb-wrap {
  width: 100%; aspect-ratio: 16/9; background: var(--bg-2);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.deal-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.deal-card .body { padding: 12px 14px 14px; }
.deal-card .game {
  font-size: 14px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.deal-card .store {
  font-size: 10px; color: var(--text-faint); font-family: var(--font-mono);
  margin-top: 4px; letter-spacing: 0.03em;
}
.deal-card .prices { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.deal-card .sale { font-size: 20px; font-weight: 700; color: var(--green); }
.deal-card .normal { font-size: 12px; color: var(--text-faint); text-decoration: line-through; }
.deal-card .savings {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px; margin-left: 4px;
  background: rgba(52,211,153,0.1); color: var(--green);
  border: 1px solid rgba(52,211,153,0.2);
}
.deal-card .meta {
  font-size: 10px; color: var(--text-faint); font-family: var(--font-mono);
  margin-top: 8px;
}

/* ===== Steam card ===== */
.steam-card { width: 270px; flex-shrink: 0; border-radius: var(--radius); }
.steam-card .thumb-wrap { width: 100%; aspect-ratio: 16/9; background: var(--bg-2); overflow: hidden; }
.steam-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.steam-card .body { padding: 12px 14px 14px; }
.steam-card .game {
  font-size: 14px; font-weight: 600; -webkit-line-clamp: 1;
  -webkit-box-orient: vertical; overflow: hidden; display: -webkit-box;
}
.steam-card .disc { margin-top: 8px; font-size: 13px; }
.steam-card .pct { font-size: 22px; font-weight: 700; color: var(--green); }
.steam-card .price {
  color: var(--text-dim); margin-top: 4px; font-size: 12px; font-family: var(--font-mono);
}
.steam-card .platforms { display: flex; gap: 5px; margin-top: 8px; }
.steam-card .plat {
  font-size: 9px; padding: 2px 7px; border-radius: 4px;
  background: rgba(255,255,255,0.05); color: var(--text-faint);
  letter-spacing: 0.03em;
}

/* ===== Free games card ===== */
.free-card { width: 250px; flex-shrink: 0; border-radius: var(--radius); }
.free-card .thumb-wrap {
  width: 100%; aspect-ratio: 16/9; background: var(--bg-2);
  overflow: hidden; position: relative;
}
.free-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.free-card .free-flag {
  position: absolute; top: 10px; left: 10px;
  background: linear-gradient(135deg, var(--grad-1), var(--grad-2), var(--grad-3));
  color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: 6px;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
  text-transform: uppercase;
}
.free-card .body { padding: 12px 14px 14px; }
.free-card .game {
  font-size: 14px; font-weight: 600; -webkit-line-clamp: 1;
  -webkit-box-orient: vertical; overflow: hidden; display: -webkit-box;
}
.free-card .store {
  font-size: 10px; color: var(--text-faint); font-family: var(--font-mono);
  margin-top: 4px; letter-spacing: 0.03em;
}
.free-card .prices { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.free-card .free-price {
  font-size: 20px; font-weight: 700; color: var(--green);
  text-shadow: 0 0 12px var(--green-glow);
}
.free-card .normal { font-size: 12px; color: var(--text-faint); text-decoration: line-through; }

/* ===== Empty / fallback ===== */
.fallback-rail { display: flex; gap: 16px; }
.fallback-card {
  width: 240px; height: 170px; border-radius: var(--radius);
  background: var(--glass); border: 1px dashed var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 12px; font-family: var(--font-mono);
}
.empty { color: var(--text-faint); font-family: var(--font-mono); font-size: 13px; padding: 20px; }

/* ===== Skeleton shimmer ===== */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 37%, rgba(255,255,255,0.03) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius);
}
.skeleton-card { width: 280px; height: 230px; flex-shrink: 0; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ===== Footer ===== */
footer {
  text-align: center; padding: 40px 24px; color: var(--text-faint);
  font-size: 12px; border-top: 1px solid var(--glass-border);
  position: relative;
}
footer a { color: var(--grad-1); transition: color .2s; }
footer a:hover { color: var(--grad-3); }
footer p { line-height: 1.7; }

/* ===== Ad slots ===== */
.ad-slot {
  max-width: 1100px; margin: 20px auto; border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 20px; text-align: center;
  background: var(--glass); min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.ad-placeholder {
  color: var(--text-faint); font-size: 11px; font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.ad-top { margin-top: 0; }
.ad-mid { margin: 36px auto; }

/* ===== Blog grid ===== */
.blog-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px; margin-bottom: 20px;
}
.blog-card {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 24px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
.blog-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent-grad); opacity: 0; transition: opacity .3s;
}
.blog-card:hover {
  transform: translateY(-4px); border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-hover);
}
.blog-card:hover::after { opacity: 1; }
.blog-card .blog-tag {
  display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 5px;
  background: rgba(99,102,241,0.12); color: var(--grad-1); margin-right: 6px; margin-bottom: 12px;
  border: 1px solid rgba(99,102,241,0.2);
}
.blog-card h3 {
  font-family: var(--font-display); font-size: 19px; font-weight: 700;
  line-height: 1.3; margin-bottom: 10px; letter-spacing: -0.01em;
}
.blog-card p { color: var(--text-dim); font-size: 14px; line-height: 1.65; }
.blog-card .read-more {
  margin-top: 16px; color: var(--grad-1); font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.blog-card .read-more:hover { color: var(--grad-3); gap: 8px; }

/* ===== Fade-in animation on load ===== */
.section { animation: fadeUp .5s cubic-bezier(.4,0,.2,1) both; }
.section:nth-child(2) { animation-delay: .05s; }
.section:nth-child(3) { animation-delay: .1s; }
.section:nth-child(4) { animation-delay: .15s; }
.section:nth-child(5) { animation-delay: .2s; }
.section:nth-child(6) { animation-delay: .25s; }
.section:nth-child(7) { animation-delay: .3s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  header.topbar { padding: 10px 16px; gap: 10px; }
  .logo .tag { display: none; }
  .hero, main, .tabs { padding-left: 16px; padding-right: 16px; }
  .rail-wrap { margin: 0 -16px; padding: 0 16px; }
  .news-card { width: 280px; }
  .deal-card, .steam-card, .free-card { width: 240px; }
  .hero { padding-top: 32px; }
  .hero h1 { font-size: 28px; }
  .section-head h2 { font-size: 18px; }
  .blog-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .news-card, .deal-card, .steam-card, .free-card { width: 260px; }
  .status { font-size: 10px; }
  .status #clock, .status .updated { display: none; }
}
