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

/* ── CSS VARIABLES (your theme lives here) ── */
:root {
  --bg:        #0a0a0b;
  --surface:   #111114;
  --border:    #1e1e24;
  --accent:    #e8ff47;
  --accent2:   #ff4d6d;
  --muted:     #3a3a44;
  --text:      #d4d4de;
  --text-dim:  #6b6b7a;
  --font-head: 'Bebas Neue', sans-serif;
  --font-ui:   'Syne', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── NOISE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* ── NAV ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 3rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(10,10,11,0.85);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.logo {
  font-family: var(--font-head);
  font-size: 2rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-decoration: none;
}

.logo span {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-family: var(--font-mono);
  letter-spacing: 0;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); }

/* ── HERO STRIP ── */
.hero {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding: 4rem 3rem 3rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  animation: fadeUp 0.6s ease both;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
  display: block;
}

.hero-meta {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.8;
}

/* ── FILTER BAR ── */
.filter-bar {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding: 1rem 3rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  animation: fadeUp 0.6s 0.1s ease both;
}

.filter-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-right: 0.5rem;
  letter-spacing: 0.1em;
}

.chip {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--text-dim);
  cursor: pointer;
  background: transparent;
  transition: all 0.15s;
  text-transform: uppercase;
}

.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: bold; }

/* ── GAME GRID ── */
.grid-wrap {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding: 2.5rem 3rem;
  animation: fadeUp 0.6s 0.2s ease both;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

/* ── GAME CARD ── */
a.card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card {
  background: var(--bg);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.2s;
  opacity: 0;
  animation: fadeUp 0.5s ease forwards;
}

.card:hover { background: var(--surface); }
.card:hover .card-img img { transform: scale(1.04); filter: brightness(0.85) saturate(0.85); }
.card:hover .card-score { color: var(--bg); }
.card:hover .score-ring { background: var(--accent); }

.card-img {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.4s ease;
  filter: brightness(0.75) saturate(0.7);
}

.genre-tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(10,10,11,0.8);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  color: var(--text-dim);
}

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

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-title {
  font-family: var(--font-head);
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  line-height: 1;
  flex: 1;
  padding-right: 0.5rem;
}

.score-ring {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.card-score {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--accent);
  transition: color 0.2s;
}

.card-meta {
  display: flex;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}

.card-blurb {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

.verdict {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.verdict.great { color: var(--accent); }
.verdict.good  { color: #7eb8ff; }
.verdict.mid   { color: #ffaa44; }
.verdict.poor  { color: var(--accent2); }

.read-link {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.15s;
}

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

/* ── FEATURED CARD ── */
.card.featured { grid-column: span 2; }
.card.featured .card-img { aspect-ratio: 21/9; }
.card.featured .card-title { font-size: 2.2rem; }
.card.featured .card-blurb { -webkit-line-clamp: 3; }

/* ── EMPTY STATE ── */
.empty {
  display: none;
  grid-column: 1 / -1;
  padding: 4rem;
  text-align: center;
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 0.85rem;
  background: var(--bg);
}

/* ── FOOTER ── */
footer {
  margin-top: 4rem;
  padding: 2rem 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 3px; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  nav { padding: 1rem 1.25rem; }
  .hero { padding: 2.5rem 1.25rem 2rem; flex-direction: column; align-items: flex-start; }
  .filter-bar { padding: 1rem 1.25rem; }
  .grid-wrap { padding: 1.5rem 1.25rem; }
  .card.featured { grid-column: span 1; }
  footer { padding: 1.5rem 1.25rem; flex-direction: column; gap: 0.5rem; }
}

/* ── SEARCH ── */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 0.5rem;
}

.container {
  position: relative;
  background: linear-gradient(135deg, #1e1e24 0%, #111114 100%);
  border-radius: 1000px;
  padding: 6px;
  display: grid;
  place-content: center;
  z-index: 0;
  max-width: 260px;
  margin: 0;
}

.search-container {
  position: relative;
  width: 100%;
  border-radius: 50px;
  background: linear-gradient(135deg, #16161a 0%, #111114 100%);
  padding: 4px;
  display: flex;
  align-items: center;
}

.search-container::after,
.search-container::before {
  content: "";
  width: 100%;
  height: 100%;
  border-radius: inherit;
  position: absolute;
}

.search-container::before {
  top: -1px;
  left: -1px;
  background: linear-gradient(0deg, #1e1e24 0%, #2a2a34 100%);
  z-index: -1;
}

.search-container::after {
  bottom: -1px;
  right: -1px;
  background: linear-gradient(0deg, #1a1a20 0%, #1e1e28 100%);
  box-shadow: none;
  z-index: -2;
}

.search-input {
  padding: 7px 10px;
  width: 170px;
  background: linear-gradient(135deg, #16161a 0%, #111114 100%);
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  border-radius: 50px;
  transition: background 0.2s;
}

.search-input:focus {
  outline: none;
  background: linear-gradient(135deg, #1e1e28 0%, #16161a 100%);
}

.search-input::placeholder {
  color: var(--accent);
  opacity: 0.6;
}

.search__icon {
  width: 36px;
  aspect-ratio: 1;
  border-left: 2px solid var(--border);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-radius: 50%;
  padding-left: 10px;
  margin-right: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-left-color 0.2s;
}

.search__icon:hover {
  border-left-color: var(--accent);
}

.search__icon path {
  fill: var(--text-dim);
  transition: fill 0.2s;
}

.search__icon:hover path {
  fill: var(--accent);
}

/* ── SEARCH RESULTS DROPDOWN ── */
.search-results {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  z-index: 999;
  display: none;
  flex-direction: column;
  max-height: 400px;
  overflow-y: auto;
}

.search-results.visible {
  display: flex;
}

.search-result-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--muted); }

.search-result-img {
  width: 60px;
  height: 45px;
  overflow: hidden;
}

.search-result-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.8) saturate(0.7);
}

.search-result-info {
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
}

.search-result-title {
  font-family: var(--font-head);
  font-size: 1rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.search-result-meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.search-result-score {
  font-family: var(--font-head);
  font-size: 1.4rem;
  color: var(--accent);
  padding: 0 0.75rem;
  display: flex;
  align-items: center;
}

.search-empty {
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
}