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

:root {
  --bg: #07080c;
  --surface: #10131a;
  --surface2: #181c27;
  --border: #1e2433;
  --text: #e2e8f8;
  --muted: #6b7590;
  --accent: #4f8aff;
  --accent2: #a78bfa;
  --green: #34d399;
  --radius: 14px;
  --radius-sm: 8px;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  background-image:
    radial-gradient(ellipse 60% 40% at 70% 0%, rgba(79,138,255,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 10% 80%, rgba(167,139,250,0.05) 0%, transparent 50%);
}

/* ─── HEADER ─────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(7, 8, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo::before {
  content: '▶';
  color: var(--accent);
  font-size: 0.75rem;
}

.logo:hover { color: var(--accent); }

.tagline {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 300;
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumbs a { color: var(--accent); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { color: var(--border); }

/* ─── CONTAINER ───────────────────────────────────── */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ─── HERO BANNER ─────────────────────────────────── */
.hero {
  padding: 3rem 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 40%, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 300;
  max-width: 50ch;
  margin-top: 0.25rem;
}

/* ─── FILTERS ─────────────────────────────────────── */
.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: 0.4rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ─── SECTION HEADER ──────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ─── FEATURED ROW ────────────────────────────────── */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

/* ─── GAME GRID ───────────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

/* ─── CARDS ───────────────────────────────────────── */
.game-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.game-card:hover {
  border-color: rgba(79, 138, 255, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.game-card.featured {
  border-color: rgba(79, 138, 255, 0.25);
}

.game-card.featured:hover {
  border-color: rgba(79, 138, 255, 0.6);
}

.card-img-wrap {
  position: relative;
  overflow: hidden;
}

.game-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.game-card:hover img { transform: scale(1.04); }

.card-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-badge.featured-badge {
  background: rgba(79, 138, 255, 0.85);
  color: #fff;
  backdrop-filter: blur(4px);
}

.card-badge.cat-badge {
  background: rgba(16, 19, 26, 0.8);
  color: var(--muted);
  border: 1px solid var(--border);
  backdrop-filter: blur(4px);
}

.card-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background: rgba(7,8,12,0.5);
  transition: opacity 0.2s;
}

.game-card:hover .card-play-icon { opacity: 1; }

.card-play-icon svg {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.game-card-body {
  padding: 0.9rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.game-card h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.game-card p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

/* ─── EMPTY STATE ─────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ─── FOOTER ──────────────────────────────────────── */
.site-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ─── GAME PAGE ───────────────────────────────────── */
.game-page-header {
  padding: 1.75rem 0 0;
}

.game-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.game-category-tag {
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.game-page h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
  line-height: 1.1;
}

.player-wrap {
  margin: 1.25rem 0;
  position: relative;
}

.player-ratio {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.player-ratio[data-ratio="4/3"] { padding-bottom: 75%; }

.game-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-toolbar {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.toolbar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(7, 8, 12, 0.75);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
  font-size: 0.9rem;
}

.toolbar-btn:hover {
  background: rgba(79, 138, 255, 0.3);
  border-color: var(--accent);
}

.fallback {
  color: var(--muted);
  margin: 0.75rem 0 0;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.fallback a { color: var(--accent); }
.hidden { display: none; }

.game-desc {
  color: var(--muted);
  max-width: 65ch;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.game-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover { background: #3a6fd4; border-color: #3a6fd4; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.btn-ghost:hover { color: var(--text); border-color: #333a4d; }

/* ─── LOADING SKELETON ────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ─── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 600px) {
  .site-header { padding: 0 1rem; }
  .container { padding: 1.25rem 1rem 3rem; }
  .featured-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .hero-sub { font-size: 0.95rem; }
  .game-page h1 { font-size: 1.5rem; }
}
