/* ============================================================
   NES EMU — Main Stylesheet
   Palette: NES Red #E60012 | White #FFFFFF | Light Grey #F5F5F5
            Mid Grey #EBEBEB | Dark Text #1A1A1A | Muted #6B6B6B
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
  --red:        #E60012;
  --red-hover:  #C4000F;
  --red-light:  #FFF0F1;
  --red-mid:    #FFD6D9;
  --white:      #FFFFFF;
  --bg:         #F7F7F7;
  --bg-card:    #FFFFFF;
  --bg-section: #F2F2F2;
  --border:     #E2E2E2;
  --border-mid: #CFCFCF;
  --text:       #1A1A1A;
  --text-muted: #6B6B6B;
  --text-light: #9B9B9B;
  --grey-dark:  #3A3A3A;
  --pixel-font: 'Press Start 2P', monospace;
  --body-font:  'Inter', sans-serif;
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.12);
  --shadow-red: 0 4px 16px rgba(230,0,18,0.20);
  --transition: 0.18s ease;
  --container:  1280px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--body-font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--red-hover); }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: var(--body-font); border: none; background: none; }

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container-sm { max-width: 960px; }
.container-xs { max-width: 720px; }

/* ============================================================
   HEADER / NAVBAR
   ============================================================ */
.site-header {
  background: var(--white);
  border-bottom: 2px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-badge {
  background: var(--red);
  color: var(--white);
  font-family: var(--pixel-font);
  font-size: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  line-height: 1;
  letter-spacing: -0.5px;
}
.logo-text {
  font-family: var(--pixel-font);
  font-size: 11px;
  color: var(--text);
  line-height: 1.3;
}
.logo-text span { color: var(--red); }

.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav a {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav a.active {
  background: var(--red-light);
  color: var(--red);
}

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.btn-search {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: all var(--transition);
}
.btn-search:hover { border-color: var(--red); color: var(--red); }
.btn-search svg { width: 18px; height: 18px; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
}
.nav-toggle span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--body-font);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
  box-shadow: var(--shadow-red);
}
.btn-primary:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(230,0,18,0.28);
}
.btn-secondary {
  background: var(--white);
  color: var(--red);
  border-color: var(--red);
}
.btn-secondary:hover {
  background: var(--red);
  color: var(--white);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-sm { font-size: 13px; padding: 8px 16px; }
.btn-lg { font-size: 16px; padding: 16px 32px; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}
/* Subtle pixel-grid background pattern */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(230,0,18,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230,0,18,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
/* Red accent bar top */
.hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--red);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red-light);
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--red-mid);
  margin-bottom: 20px;
}
.hero-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--red);
  border-radius: 50%;
  animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}
.hero-title {
  font-family: var(--pixel-font);
  font-size: clamp(18px, 2.5vw, 28px);
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 16px;
}
.hero-title span { color: var(--red); }
.hero-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 520px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.hero-stats {
  display: flex;
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.hero-stat-num {
  font-family: var(--pixel-font);
  font-size: 16px;
  color: var(--red);
  display: block;
  margin-bottom: 4px;
}
.hero-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Hero visual: NES console illustration */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}
.nes-console-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
}
.nes-console-img {
  width: 100%;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
/* Platform badges floating on visual */
.platform-badges {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.platform-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.platform-badge svg { width: 16px; height: 16px; }
.platform-badge.windows svg { color: #0078D4; }
.platform-badge.android svg { color: #3DDC84; }
.platform-badge.ios svg { color: #555; }

/* ============================================================
   DOWNLOAD TABLE SECTION  (anchor: #download-table)
   ============================================================ */
.download-section {
  background: var(--white);
  padding: 60px 0;
  border-bottom: 1px solid var(--border);
}
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.section-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}
.section-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.section-title-pixel {
  font-family: var(--pixel-font);
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
}

/* Platform filter tabs */
.platform-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.platform-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--white);
  cursor: pointer;
  transition: all var(--transition);
}
.platform-tab:hover,
.platform-tab.active {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
}
.platform-tab svg { width: 16px; height: 16px; }

/* Download table */
.download-table-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.download-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.download-table thead {
  background: var(--bg-section);
  border-bottom: 1.5px solid var(--border);
}
.download-table th {
  padding: 12px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.download-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.download-table tr:last-child td { border-bottom: none; }
.download-table tbody tr { transition: background var(--transition); }
.download-table tbody tr:hover { background: var(--red-light); }
.download-table .emu-name { font-weight: 600; color: var(--text); }
.download-table .emu-version {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.platform-icon-list { display: flex; gap: 6px; align-items: center; }
.platform-icon-list svg { width: 18px; height: 18px; color: var(--text-muted); }

/* ============================================================
   PLATFORM PAGES (Windows / Android / iOS)
   ============================================================ */
.platform-hero {
  background: var(--white);
  padding: 60px 0;
  border-bottom: 1px solid var(--border);
}
.platform-hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.platform-logo-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.platform-logo-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
}
.platform-logo-icon.windows { background: #E8F4FF; }
.platform-logo-icon.android { background: #E8FFF0; }
.platform-logo-icon.ios     { background: #F5F5F5; }
.platform-logo-icon svg { width: 32px; height: 32px; }

/* Appbox-style download button */
.appbox {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--text);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition);
  min-width: 180px;
}
.appbox:hover { background: var(--grey-dark); color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.appbox svg { width: 28px; height: 28px; flex-shrink: 0; }
.appbox-text { display: flex; flex-direction: column; }
.appbox-sub { font-size: 10px; opacity: 0.7; }
.appbox-name { font-size: 16px; font-weight: 700; line-height: 1.2; }
.appbox.red { background: var(--red); }
.appbox.red:hover { background: var(--red-hover); }

/* System requirements table */
.sysreq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.sysreq-table tr { border-bottom: 1px solid var(--border); }
.sysreq-table tr:last-child { border-bottom: none; }
.sysreq-table td { padding: 12px 16px; }
.sysreq-table td:first-child {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  width: 140px;
  background: var(--bg-section);
}

/* ============================================================
   SCREENSHOTS BLOCK
   ============================================================ */
.screenshots-section {
  background: var(--bg-section);
  padding: 60px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.screenshot-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16/10;
  background: var(--border);
  cursor: pointer;
  border: 1.5px solid var(--border);
}
.screenshot-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.screenshot-item:hover img { transform: scale(1.04); }
.screenshot-overlay {
  position: absolute;
  inset: 0;
  background: rgba(230,0,18,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}
.screenshot-item:hover .screenshot-overlay { opacity: 1; }
.screenshot-overlay svg { width: 32px; height: 32px; color: var(--white); }
/* Large first screenshot */
.screenshots-grid .screenshot-item:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox-img { max-width: 90vw; max-height: 85vh; border-radius: var(--radius-lg); }
.lightbox-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  color: var(--white);
  font-size: 22px;
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.3);
  transition: all var(--transition);
}
.lightbox-close:hover { background: var(--red); border-color: var(--red); }

/* ============================================================
   CONTENT BLOCK (Editable via Admin Post Editor)
   ============================================================ */
.content-block {
  background: var(--white);
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}
.content-block-inner {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 48px;
  box-shadow: var(--shadow-sm);
}
/* Typography for post editor content */
.editor-content h1 { font-size: 28px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.editor-content h2 { font-size: 22px; font-weight: 700; margin: 28px 0 12px; color: var(--text); border-bottom: 2px solid var(--red-light); padding-bottom: 8px; }
.editor-content h3 { font-size: 18px; font-weight: 600; margin: 20px 0 10px; color: var(--text); }
.editor-content p  { font-size: 15px; line-height: 1.8; color: var(--text-muted); margin-bottom: 16px; }
.editor-content ul { margin: 0 0 16px 20px; list-style: disc; }
.editor-content ol { margin: 0 0 16px 20px; list-style: decimal; }
.editor-content li { font-size: 15px; line-height: 1.8; color: var(--text-muted); margin-bottom: 6px; }
.editor-content a  { color: var(--red); }
.editor-content strong { color: var(--text); font-weight: 600; }
.editor-content blockquote {
  border-left: 3px solid var(--red);
  padding: 12px 20px;
  margin: 20px 0;
  background: var(--red-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-muted);
}
.editor-content img { border-radius: var(--radius-md); margin: 20px 0; }
.editor-content table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.editor-content table th { background: var(--bg-section); padding: 10px 14px; text-align: left; font-size: 13px; border: 1px solid var(--border); }
.editor-content table td { padding: 10px 14px; border: 1px solid var(--border); font-size: 14px; }
/* Read more toggle */
.content-block-toggle {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.content-readmore {
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: gap var(--transition);
}
.content-readmore:hover { gap: 10px; }
.content-readmore svg { width: 16px; height: 16px; transition: transform var(--transition); }
.content-readmore.open svg { transform: rotate(180deg); }
.content-overflow { overflow: hidden; transition: max-height 0.4s ease; }

/* ============================================================
   FEATURES ZIGZAG
   ============================================================ */
.features-section { padding: 80px 0; background: var(--white); }
.zigzag-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}
.zigzag-item:last-child { border-bottom: none; }
.zigzag-item:nth-child(even) .zigzag-text { order: 2; }
.zigzag-item:nth-child(even) .zigzag-visual { order: 1; }

.zigzag-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.zigzag-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 14px;
}
.zigzag-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
}
.zigzag-features { display: flex; flex-direction: column; gap: 10px; }
.zigzag-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
}
.zigzag-feature-item::before {
  content: '';
  width: 18px; height: 18px;
  background: var(--red);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 11px;
  background-repeat: no-repeat;
  background-position: center;
}
.zigzag-visual {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1.5px solid var(--border);
  aspect-ratio: 16/10;
  background: var(--bg-section);
}
.zigzag-visual img { width: 100%; height: 100%; object-fit: cover; }

/* Placeholder visual for zigzag (when no image) */
.zigzag-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}
.zigzag-placeholder svg { width: 48px; height: 48px; color: var(--red); opacity: 0.4; }
.zigzag-placeholder span { font-size: 13px; color: var(--text-light); }

/* ============================================================
   GAMES / ROMS / EMULATORS GRID  (5/3/2 responsive)
   ============================================================ */
.grid-section { padding: 60px 0; }
.grid-section + .grid-section { padding-top: 0; }

.content-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
/* Tablet */
@media (max-width: 1100px) { .content-grid { grid-template-columns: repeat(3, 1fr); } }
/* Mobile */
@media (max-width: 640px)  { .content-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* Game / ROM card */
.game-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}
.game-card:hover {
  border-color: var(--red);
  box-shadow: var(--shadow-red);
  transform: translateY(-3px);
}
.game-card-art {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--bg-section);
  overflow: hidden;
  position: relative;
}
.game-card-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.game-card:hover .game-card-art img { transform: scale(1.06); }
.game-card-art .card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(230,0,18,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}
.game-card:hover .card-overlay { opacity: 1; }
.card-overlay .btn { font-size: 12px; padding: 8px 16px; }

.game-card-body { padding: 12px; }
.game-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-red   { background: var(--red); color: var(--white); }
.badge-grey  { background: var(--bg-section); color: var(--text-muted); border: 1px solid var(--border); }
.badge-green { background: #E8FFF0; color: #1B7A3E; border: 1px solid #B6EAC8; }
.badge-blue  { background: #E8F4FF; color: #0E5EA8; border: 1px solid #B6D8F5; }
.badge-new   { background: var(--red); color: var(--white); }

/* Rating stars */
.rating { display: flex; align-items: center; gap: 3px; margin-top: 4px; }
.rating svg { width: 12px; height: 12px; color: #F5A623; fill: #F5A623; }
.rating svg.empty { color: var(--border); fill: var(--border); }
.rating-num { font-size: 11px; color: var(--text-muted); margin-left: 2px; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  flex: 1;
  min-width: 180px;
  transition: border-color var(--transition);
}
.filter-search:focus-within { border-color: var(--red); }
.filter-search svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.filter-search input {
  border: none;
  background: none;
  font-family: var(--body-font);
  font-size: 14px;
  color: var(--text);
  width: 100%;
  outline: none;
}
.filter-search input::placeholder { color: var(--text-light); }

.filter-select {
  appearance: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 32px 8px 12px;
  font-family: var(--body-font);
  font-size: 13px;
  color: var(--text);
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
  cursor: pointer;
  transition: border-color var(--transition);
}
.filter-select:focus { outline: none; border-color: var(--red); }

.filter-results {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

/* ============================================================
   TAXONOMY / REGION TABS
   ============================================================ */
.tax-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tax-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--white);
  cursor: pointer;
  transition: all var(--transition);
}
.tax-tab:hover,
.tax-tab.active {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.tax-tab-count {
  background: rgba(255,255,255,0.25);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
}
.tax-tab:not(.active) .tax-tab-count {
  background: var(--bg-section);
  color: var(--text-muted);
}

/* ============================================================
   SINGLE PAGE — ROM / GAME / EMULATOR
   ============================================================ */
.single-hero {
  background: var(--white);
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}
.single-hero-inner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
}
.single-cover {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
  aspect-ratio: 3/4;
  background: var(--bg-section);
}
.single-cover img { width: 100%; height: 100%; object-fit: cover; }
.single-meta-block { display: flex; flex-direction: column; gap: 16px; }
.single-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.single-title { font-size: 32px; font-weight: 700; color: var(--text); line-height: 1.2; }
.single-subtitle { font-size: 16px; color: var(--text-muted); }
.single-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.download-btn-group {
  display: flex;
  align-items: center;
  gap: 0;
}
.download-btn-group .btn-primary {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.download-btn-group .download-arrow {
  background: var(--red-hover);
  color: var(--white);
  padding: 12px 14px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-left: 1px solid rgba(255,255,255,0.2);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--transition);
}
.download-btn-group .download-arrow:hover { background: #A0000C; }

/* Info table on single pages */
.info-table-card {
  background: var(--bg-section);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 32px 0;
}
.info-table-head {
  background: var(--red);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.info-table { width: 100%; border-collapse: collapse; }
.info-table tr { border-bottom: 1px solid var(--border); }
.info-table tr:last-child { border-bottom: none; }
.info-table td { padding: 12px 20px; font-size: 14px; }
.info-table td:first-child {
  font-weight: 600;
  color: var(--text-muted);
  width: 160px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-section);
}
.info-table td:last-child {
  color: var(--text);
  background: var(--white);
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--red); }
.breadcrumb-sep { color: var(--border-mid); }
.breadcrumb-current { color: var(--text); font-weight: 500; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
}
.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--white);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.page-btn:hover { border-color: var(--red); color: var(--red); }
.page-btn.active { background: var(--red); color: var(--white); border-color: var(--red); }
.page-btn.disabled { opacity: 0.4; pointer-events: none; }

/* ============================================================
   ADSENSE SLOTS (lazy loaded, pre-reserved dimensions)
   ============================================================ */
.ad-slot {
  background: var(--bg-section);
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 32px 0;
}
.ad-slot-leaderboard  { width: 100%; height: 90px; }
.ad-slot-rectangle    { width: 336px; height: 280px; margin: 32px auto; }
.ad-slot-banner       { width: 100%; height: 60px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 60px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 280px 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand .logo-badge { margin-bottom: 14px; display: inline-block; }
.footer-brand p { font-size: 13px; line-height: 1.7; margin-bottom: 16px; }
.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white);
  margin-bottom: 14px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  transition: color var(--transition);
}
.footer-col ul li a:hover { color: var(--red); }
.footer-bottom {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom a { color: rgba(255,255,255,0.4); }
.footer-bottom a:hover { color: var(--red); }
.footer-legal-links { display: flex; gap: 16px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .zigzag-item { grid-template-columns: 1fr; gap: 32px; }
  .zigzag-item:nth-child(even) .zigzag-text,
  .zigzag-item:nth-child(even) .zigzag-visual { order: unset; }
  .screenshots-grid { grid-template-columns: repeat(2, 1fr); }
  .screenshots-grid .screenshot-item:first-child { grid-column: span 2; grid-row: span 1; }
  .platform-hero-inner { grid-template-columns: 1fr; }
  .single-hero-inner { grid-template-columns: 160px 1fr; gap: 24px; }
}

@media (max-width: 768px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .hero { padding: 48px 0 40px; }
  .hero-title { font-size: 16px; }
  .hero-stats { gap: 20px; }
  .section-title { font-size: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .download-table { font-size: 13px; }
  .download-table th,
  .download-table td { padding: 10px 12px; }
  .content-block-inner { padding: 24px 20px; }
  .single-hero-inner { grid-template-columns: 1fr; }
  .single-cover { aspect-ratio: 16/9; max-width: 300px; }
  .single-title { font-size: 22px; }
  .filter-bar { gap: 8px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-actions { flex-direction: column; }
  .hero-stats { flex-wrap: wrap; gap: 16px; }
  .platform-badges { flex-direction: column; align-items: center; }
  .screenshots-grid { grid-template-columns: 1fr; }
  .screenshots-grid .screenshot-item:first-child { grid-column: span 1; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .tax-tabs { gap: 4px; }
  .tax-tab { font-size: 12px; padding: 5px 10px; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.text-red    { color: var(--red); }
.text-muted  { color: var(--text-muted); }
.fw-bold     { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.font-pixel  { font-family: var(--pixel-font); }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   SEARCH OVERLAY
   ============================================================ */
.search-bar {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 2px solid var(--red);
  padding: 14px 0;
  display: none;
  position: relative;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}
.search-bar.open { display: block; }
.search-bar-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.search-bar-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  background: var(--bg);
  border: 2px solid var(--red);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: 0 0 0 3px rgba(230,0,18,0.08);
}
.search-bar-input-wrap svg {
  width: 18px; height: 18px;
  color: var(--red);
  flex-shrink: 0;
}
.search-bar-input-wrap input {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--body-font);
  font-size: 16px;
  color: var(--text);
  outline: none;
}
.search-bar-input-wrap input::placeholder { color: var(--text-light); }
.search-kbd {
  font-size: 11px;
  color: var(--text-light);
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
  display: none;
}
@media (min-width: 768px) { .search-kbd { display: inline; } }

.search-quick {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.search-quick-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.search-quick a {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  text-decoration: none;
  transition: all var(--transition);
}
.search-quick a:hover {
  background: var(--red-light);
  border-color: var(--red-mid);
  color: var(--red);
}

/* Search backdrop */
.search-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 998;
  backdrop-filter: blur(2px);
}
.search-backdrop.open { display: block; }

/* ── Active nav link highlight ── */
.main-nav a.active {
  background: var(--red-light);
  color: var(--red);
}
