@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

:root {
  --bg: #f8f6f2;
  --surface: #ffffff;
  --surface2: #f2efe9;
  --border: #e8e3da;
  --text: #1a1814;
  --muted: #8a8278;
  --accent: #c84b2f;
  --accent2: #2d6a4f;
  --accent3: #1d3557;
  --gold: #c9963a;
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── HEADER ─────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
  background: rgba(248,246,242,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

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

.tagline {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 300;
  border-left: 1px solid var(--border);
  padding-left: 1.5rem;
}

.breadcrumbs {
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.breadcrumbs a { color: var(--accent); text-decoration: none; font-weight: 500; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { color: var(--border); }

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

/* ─── HERO ────────────────────────────────────────── */
.hero {
  padding: 4rem 0 2.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.hero-left {}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero-eyebrow::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--accent);
  display: block;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--muted);
  max-width: 42ch;
  line-height: 1.6;
}

.hero-stat {
  text-align: right;
}

.hero-stat-number {
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.04em;
}

.hero-stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-top: 0.25rem;
}

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

.filter-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

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

.filter-btn.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-md);
}

/* ─── SECTION HEADER ──────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-count {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface2);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  border: 1px solid var(--border);
}

/* ─── GRIDS ───────────────────────────────────────── */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

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

/* ─── 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;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s ease;
}

.game-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: rgba(200,75,47,0.2);
}

.game-card.featured {
  border-color: rgba(200,75,47,0.15);
}

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

.game-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(.25,.46,.45,.94);
}

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

.card-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.card-badge.featured-badge {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(200,75,47,0.4);
}

.card-badge.cat-badge {
  background: rgba(255,255,255,0.9);
  color: var(--muted);
  border: 1px solid var(--border);
  left: auto;
  right: 0.75rem;
  backdrop-filter: blur(8px);
}

.card-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background: rgba(26,24,20,0.35);
  backdrop-filter: blur(2px);
  transition: opacity 0.2s;
}

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

.card-play-icon svg {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.3));
}

.game-card-body {
  padding: 1.1rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.game-card h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
}

.game-card p {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.55;
}

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

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

.site-footer small { font-size: 0.82rem; }
.site-footer a { color: var(--accent2); text-decoration: none; font-weight: 500; }
.site-footer a:hover { text-decoration: underline; }

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

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

.game-category-tag {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent2);
  background: rgba(45,106,79,0.1);
  padding: 0.2rem 0.7rem;
  border-radius: 100px;
  border: 1px solid rgba(45,106,79,0.2);
}

.game-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.player-wrap { margin: 1.5rem 0; }

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

.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.2);
  background: rgba(26,24,20,0.7);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.15s;
  text-decoration: none;
}

.toolbar-btn:hover {
  background: rgba(200,75,47,0.6);
  border-color: rgba(255,255,255,0.3);
}

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

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

.game-desc {
  color: var(--muted);
  max-width: 65ch;
  font-size: 1rem;
  margin-top: 0.5rem;
  font-weight: 300;
  line-height: 1.7;
}

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

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

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(200,75,47,0.3);
  transform: translateY(-1px);
}

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

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ─── 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; }
  .hero { grid-template-columns: 1fr; }
  .hero-stat { text-align: left; }
  .hero h1 { font-size: 2.2rem; }
  .featured-grid { grid-template-columns: 1fr; }
}
