/*
Theme Name: NSRpedia
Theme URI: https://nsrpedia.com
Author: NSRpedia
Description: Lightweight ROM catalog theme. RomsFun-style console families and post pages (/roms/3ds/game/), NSWpedia-style home grid. Sky / white / silver / navy / red. Auto sitemap, IndexNow, mobile-first.
Version: 1.4.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: switchpedia
Tags: blog, grid-layout, custom-colors, custom-logo, custom-menu, featured-images, translation-ready, entertainment, two-columns, sticky-post, theme-options
*/

:root {
  --sp-sky: #38bdf8;
  --sp-sky-soft: #e8f7fe;
  --sp-white: #ffffff;
  --sp-silver: #c5cdd6;
  --sp-silver-soft: #eef2f6;
  --sp-black: #0b1220;
  --sp-red: #e11d2e;
  --sp-navy: #0a2540;
  --sp-muted: #6b7785;
  --sp-dl: #22c55e;
  --sp-emu: #0a2540;
  --sp-star: #f5a623;
  --sp-fact: #f4f6f8;
  --sp-install: #eef6fd;
  --sp-line: #e4eaef;
  --sp-radius: 4px;
  --sp-shadow: 0 1px 0 rgba(10, 37, 64, .06);
  --sp-shadow-hover: 0 4px 12px rgba(10, 37, 64, .1);
  --sp-max: 1080px;
  --sp-header-h: 56px;
  --sp-font: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --sp-ui: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sp-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--sp-black);
  background: var(--sp-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeSpeed;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
img { content-visibility: auto; }
a { color: var(--sp-navy); text-decoration: none; }
a:hover { color: var(--sp-sky); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 0; background: none; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 700; letter-spacing: .01em; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25rem; }
.screen-reader-text {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  overflow: hidden;
  height: 1px; width: 1px;
}

.wrap {
  width: min(100% - 32px, var(--sp-max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--sp-white);
  border-bottom: 1px solid var(--sp-line);
  height: var(--sp-header-h);
  overflow: visible;
}
.site { background: transparent; }
.site-main { padding-bottom: 8px; }
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--sp-header-h);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sp-navy);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
}
.brand:hover { color: var(--sp-sky); }
.brand-mark {
  width: 26px; height: 26px;
  border-radius: 3px;
  background: var(--sp-navy);
  color: var(--sp-white);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
  flex: 0 0 26px;
  font-family: var(--sp-ui);
}
.brand-text { font-size: 1rem; font-family: var(--sp-ui); letter-spacing: .02em; text-transform: none; }
.primary-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.primary-nav a, .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--sp-black);
  font-weight: 600;
  font-size: .92rem;
}
.primary-nav a:hover, .nav-link:hover, .primary-nav a.is-active {
  background: var(--sp-sky-soft);
  color: var(--sp-navy);
}
.primary-nav svg { width: 20px; height: 20px; }

.search-form { position: relative; width: min(280px, 32vw); }
.search-form input {
  width: 100%;
  border: 1px solid var(--sp-line);
  background: var(--sp-silver-soft);
  border-radius: 999px;
  padding: 9px 40px 9px 16px;
  color: var(--sp-black);
  outline: 0;
}
.search-form input:focus {
  border-color: var(--sp-sky);
  background: var(--sp-white);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .2);
}
.search-form button {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  color: var(--sp-navy);
}
.icon-btn { width: 40px; height: 40px; display: none; place-items: center; color: var(--sp-black); border-radius: 8px; }
.icon-btn:hover { background: var(--sp-silver-soft); }

.more-wrap { position: relative; flex: 0 0 auto; }
.more-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--sp-black);
}
.more-btn:hover, .more-wrap.is-open .more-btn {
  background: var(--sp-sky-soft);
  color: var(--sp-navy);
}
.more-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: min(840px, calc(100vw - 20px));
  background: var(--sp-white);
  border: 1px solid var(--sp-line);
  border-radius: 4px;
  box-shadow: var(--sp-shadow-hover);
  padding: 14px 16px 10px;
  z-index: 70;
  max-height: 78vh;
  overflow: auto;
}
.more-wrap.is-open .more-panel { display: block; }
.more-kicker {
  margin: 0 0 10px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sp-muted);
}
.more-panel h3 {
  margin: 0 0 8px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sp-navy);
}
.more-panel .chips { margin: 0 0 12px; }
.cat-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 22px;
  margin-bottom: 12px;
}
.cat-col h3 {
  margin: 0 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--sp-line);
}
.cat-col ul { list-style: none; padding: 0; margin: 0 0 12px; }
.cat-col a {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  padding: 2px 0;
  color: #1a4a73;
  line-height: 1.45;
}
.cat-col a:hover { color: var(--sp-red); }

.mobile-bar { display: none; }
.mobile-search { display: none; padding: 0 16px 12px; }
.mobile-search.is-open { display: block; }

/* Drawer */
.drawer {
  position: fixed; inset: 0;
  z-index: 50;
  pointer-events: none;
}
.drawer.is-open { pointer-events: auto; }
.drawer-bg {
  position: absolute; inset: 0;
  background: rgba(11, 18, 32, .45);
  opacity: 0; transition: opacity .2s;
}
.drawer.is-open .drawer-bg { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: min(320px, 88vw);
  background: var(--sp-white);
  transform: translateX(-100%);
  transition: transform .22s ease;
  padding: 18px;
  overflow: auto;
}
.drawer.is-open .drawer-panel { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.drawer-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--sp-line);
  color: var(--sp-black);
  font-weight: 600;
}

/* Sections */
.section { margin: 28px 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}
.section-head h2 { margin: 0; }
.see-all { font-size: .9rem; font-weight: 600; color: var(--sp-sky); }
.see-all:hover { color: var(--sp-navy); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; }
.chip {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--sp-silver-soft);
  color: var(--sp-navy);
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid var(--sp-line);
}
.chip:hover, .chip.is-active { background: var(--sp-navy); color: var(--sp-white); border-color: var(--sp-navy); }

.console-board { margin: 8px 0 28px; }
.family-block { margin: 0 0 28px; }
.family-block > h2 {
  font-size: 1.25rem;
  margin: 0 0 14px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--sp-line);
  color: #111827;
}
.console-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.console-card {
  display: flex;
  flex-direction: column;
  background: var(--sp-white);
  border: 1px solid var(--sp-line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--sp-shadow);
  color: #374151;
}
.console-card:hover {
  box-shadow: var(--sp-shadow-hover);
  color: var(--sp-navy);
}
.console-art {
  background: #f7f8fa;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  padding: 8px 10px 0;
}
.console-art svg { width: 100%; height: auto; }
.console-name {
  display: block;
  text-align: center;
  padding: 12px 10px 16px;
  font-weight: 600;
  font-size: 1.02rem;
  color: #4b5563;
}
.console-count {
  display: block;
  text-align: center;
  padding: 0 10px 14px;
  margin-top: -8px;
  font-size: .78rem;
  color: var(--sp-muted);
}
.console-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  margin: 0 0 22px;
  padding: 12px;
  background: #f7f8fa;
  border: 1px solid var(--sp-line);
  border-radius: 8px;
}
.console-hero .console-art {
  width: 220px;
  min-width: 180px;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.console-hero h1 { margin: 0 0 8px; }

/* Game cards */
.game-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.game-card {
  position: relative;
  background: var(--sp-white);
  border-radius: var(--sp-radius);
  overflow: hidden;
  box-shadow: var(--sp-shadow);
  border: 1px solid var(--sp-line);
  content-visibility: auto;
  contain-intrinsic-size: 320px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.game-card:hover { transform: none; box-shadow: var(--sp-shadow-hover); }
.cover {
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, var(--sp-navy), var(--sp-sky));
  overflow: hidden;
  position: relative;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: var(--sp-white);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: .04em;
  text-align: center;
  padding: 12px;
}
.badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--sp-navy);
  color: var(--sp-white);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}
.badge.nsp { background: var(--sp-sky); color: var(--sp-navy); }
.badge.xci { background: var(--sp-navy); }
.badge.hot { background: var(--sp-red); }
.game-body { padding: 10px 10px 12px; }
.game-title {
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 6px;
  color: var(--sp-black);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}
.game-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: .75rem;
  color: var(--sp-muted);
}
.game-meta .ver { color: var(--sp-navy); font-weight: 700; }

/* Tutorial cards */
.article-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.article-card {
  display: flex;
  gap: 12px;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  overflow: hidden;
  background: var(--sp-white);
  min-height: 108px;
  box-shadow: var(--sp-shadow);
}
.article-card:hover { box-shadow: var(--sp-shadow-hover); }
.article-card img, .article-thumb {
  width: 118px;
  min-width: 118px;
  height: 108px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--sp-sky), var(--sp-navy));
}
.article-body { padding: 10px 10px 10px 0; display: flex; flex-direction: column; min-width: 0; }
.article-body h3 {
  font-size: .9rem;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-body p {
  font-size: .78rem;
  color: var(--sp-muted);
  margin: 0 0 auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-date { font-size: .72rem; color: var(--sp-silver); margin-top: 6px; }

/* Breadcrumbs */
.crumbs {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: .8rem; font-weight: 600;
  color: var(--sp-muted);
  margin: 12px 0 8px;
  padding: 0; list-style: none;
}
.crumbs a { color: #1a4a73; }
.crumbs a:hover { color: var(--sp-red); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--sp-silver); }

/* ROM post (RomsFun: cover + meta, screenshots, description, related, comments) */
.rom-post { margin: 4px 0 40px; }
.rom-head {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin: 6px 0 8px;
  padding: 0;
  background: transparent;
  border: 0;
}
.rom-head .cover,
.rom-cover {
  width: 210px;
  min-width: 210px;
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(10, 37, 64, .12);
  border: 0;
}
.rom-meta { min-width: 0; flex: 1; }
.rom-meta h1 {
  font-size: 1.7rem;
  margin: 0 0 10px;
  font-weight: 800;
  letter-spacing: 0;
  color: #111827;
}
.rom-meta .rating { margin: 0 0 8px; font-size: .95rem; gap: 6px; }
.rom-meta .rating strong { font-size: 1.1rem; }
.rom-meta .muted { color: var(--sp-muted); font-weight: 500; }
.rom-stats {
  margin: 0 0 12px;
  font-size: .9rem;
  color: var(--sp-muted);
  font-weight: 600;
}
.rom-stats .dot { margin: 0 6px; color: var(--sp-silver); }
.tax-line { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.tax-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: .8rem;
  font-weight: 700;
  border-radius: 999px;
}
.tax-pill:hover { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.rom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
  margin: 0 0 16px;
}
.rom-table th,
.rom-table td {
  text-align: left;
  padding: 9px 0;
  border-bottom: 1px solid var(--sp-line);
  vertical-align: top;
}
.rom-table th {
  width: 150px;
  color: #6b7280;
  font-weight: 600;
}
.rom-table td { font-weight: 600; color: #111827; }
.rom-table td a { color: #2563eb; font-weight: 600; }
.rom-table td a:hover { color: var(--sp-red); }
.file-facts {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}
.file-fact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: var(--sp-fact, #f4f6f8);
  border-radius: 12px;
}
.file-fact dt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #6b7280;
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
}
.file-fact dt svg { width: 16px; height: 16px; flex: none; color: #94a3b8; }
.file-fact dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
  color: #111827;
  font-size: .92rem;
}
.file-fact dd a { color: var(--sp-red); font-weight: 700; }
.file-fact dd a:hover { color: var(--sp-navy); }
.rom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
}
.rom-actions .btn {
  width: auto;
  min-width: 0;
  padding: 12px 22px;
  border-radius: 999px;
}
.btn-dl {
  background: var(--sp-dl);
  color: #fff;
  font-size: 1.02rem;
  letter-spacing: .02em;
  border-radius: 999px;
  min-height: 46px;
}
.btn-dl:hover { background: #16a34a; color: #fff; }
.btn-emu {
  background: #fff;
  color: var(--sp-emu, var(--sp-navy));
  border: 1px solid var(--sp-line);
  border-radius: 999px;
  min-height: 46px;
}
.btn-emu:hover { background: var(--sp-sky-soft); color: var(--sp-navy); }
.rom-block { margin: 28px 0 8px; }
.rom-block > h2 {
  font-size: 1.35rem;
  margin: 0 0 14px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--sp-line);
  display: block;
  width: 100%;
  color: #111827;
}
.rom-desc .prose { max-width: none; font-size: 1rem; line-height: 1.7; color: #1f2937; }
.rom-desc .prose p { margin: 0 0 1em; }
.install-box {
  margin: 28px 0 8px;
  padding: 20px 22px 18px;
  max-width: 760px;
  background: linear-gradient(180deg, #fff 0%, var(--sp-install, #eef6fd) 100%);
  border: 1px solid #d7e8f6;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(10, 37, 64, .08);
}
.sp-install-motion .install-box {
  animation: install-glide .7s ease-out both, install-beat .65s ease-in-out 2s 2;
}
.install-box h2 {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  font-size: 1.2rem;
  color: var(--sp-navy);
}
.install-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: install;
}
.install-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 9px 0;
  color: #1f2937;
  font-weight: 600;
  line-height: 1.45;
}
.install-steps li::before {
  counter-increment: install;
  content: counter(install);
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sp-navy);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  margin-top: 1px;
}
.install-note { margin-top: 10px; color: var(--sp-muted); font-size: .92rem; }
.install-note p { margin: 0 0 .6em; }
@keyframes install-glide {
  from { opacity: 0; transform: translateX(-22px); }
  to { opacity: 1; transform: none; }
}
@keyframes install-beat {
  0%, 100% { transform: scale(1); }
  28% { transform: scale(1.035); }
  52% { transform: scale(.985); }
  76% { transform: scale(1.018); }
}
@media (prefers-reduced-motion: reduce) {
  .sp-install-motion .install-box { animation: none; }
}
.related-grid { margin-top: 4px; }
.comments-body { margin-top: 8px; }
.stars { color: var(--sp-star); letter-spacing: 1px; }

.slider {
  position: relative;
  padding: 0 36px;
}
.slider-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding: 2px 2px 10px;
}
.slider-track::-webkit-scrollbar { height: 6px; }
.slider-track::-webkit-scrollbar-thumb { background: var(--sp-silver); border-radius: 4px; }
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sp-navy);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(10, 37, 64, .2);
}
.slider-btn:hover { background: var(--sp-sky); color: var(--sp-navy); }
.slider-prev { left: 0; }
.slider-next { right: 0; }

.shots {
  display: flex;
  flex-wrap: nowrap;
  grid-template-columns: none;
}
.slider-track.shots > a,
.slider-track.shots > .shot-fallback {
  flex: 0 0 260px;
  width: 260px;
  min-width: 260px;
  scroll-snap-align: start;
}
.shots a, .shots img, .shots .shot-fallback {
  border-radius: 4px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #111827;
  overflow: hidden;
  width: 100%;
  height: auto;
  display: block;
}
.shots .shot-fallback,
.shots .shot-fallback .cover-fallback {
  width: 100%;
  height: 100%;
  min-height: 140px;
}

.slider-track.related-grid {
  display: flex;
  flex-wrap: nowrap;
  grid-template-columns: none;
  gap: 12px;
}
.slider-track.related-grid .game-card {
  flex: 0 0 120px;
  width: 120px;
  min-width: 120px;
  scroll-snap-align: start;
  content-visibility: visible;
}
.slider-track.related-grid .game-title {
  font-size: .78rem;
  min-height: 2em;
}
.slider-track.related-grid .game-body { padding: 8px 8px 10px; }
.slider-track.related-grid .game-meta { font-size: .68rem; }

/* Single game (legacy panel, still used if needed) */
.game-hero {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  margin: 8px 0 24px;
}
.game-hero .cover {
  width: 188px;
  min-width: 188px;
  border-radius: 10px;
  box-shadow: var(--sp-shadow-hover);
}
.game-hero h1 { font-size: 1.45rem; margin-bottom: 8px; }
.version-pill {
  display: inline-block;
  background: var(--sp-silver-soft);
  border: 1px solid var(--sp-line);
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 700;
  font-size: .85rem;
  margin-bottom: 8px;
}
.rating { display: flex; align-items: center; gap: 8px; font-size: .9rem; margin: 10px 0; }

.panel {
  border: 1px solid var(--sp-line);
  border-radius: 10px;
  margin: 16px 0;
  overflow: hidden;
  background: var(--sp-white);
}
.panel-h {
  background: var(--sp-silver-soft);
  padding: 10px 16px;
  font-weight: 700;
  border-bottom: 1px solid var(--sp-line);
}
.panel-b { padding: 14px 16px; }
.info-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--sp-line);
  font-size: .92rem;
}
.info-row:last-child { border-bottom: 0; }
.info-row dt { color: var(--sp-muted); font-weight: 600; }
.info-row dd { margin: 0; font-weight: 600; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--sp-navy);
  color: var(--sp-white);
  font-weight: 700;
  border-radius: 8px;
  padding: 12px 22px;
  min-height: 46px;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--sp-sky); color: var(--sp-navy); }
.btn-red { background: var(--sp-red); }
.btn-red:hover { background: #b31422; color: var(--sp-white); }
.btn-sky { background: var(--sp-sky); color: var(--sp-navy); }
.btn-wide { width: 100%; }
.dl-list { display: grid; gap: 10px; }

.prose { max-width: 760px; }
.prose h2, .prose h3 { margin-top: 1.4em; }
.prose a { color: var(--sp-sky); text-decoration: underline; text-underline-offset: 2px; }
.faq details {
  border: 1px solid var(--sp-line);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: var(--sp-white);
}
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin: 8px 0 0; color: var(--sp-muted); }

.mini-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.mini {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--sp-line);
  border-radius: 8px;
  padding: 6px;
  overflow: hidden;
}
.mini img, .mini .cover-fallback {
  width: 40px; height: 52px; min-width: 40px;
  border-radius: 4px; object-fit: cover; font-size: .7rem;
}
.mini span { font-size: .8rem; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Pagination */
.pager { display: flex; justify-content: center; gap: 6px; margin: 28px 0; flex-wrap: wrap; }
.pager a, .pager span {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--sp-silver-soft);
  font-weight: 700;
  color: var(--sp-black);
}
.pager .current, .pager a:hover { background: var(--sp-navy); color: var(--sp-white); }

/* Archive header */
.archive-lead { margin: 8px 0 18px; color: var(--sp-muted); max-width: 720px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--sp-line);
  padding: 28px 0 40px;
  color: var(--sp-muted);
  font-size: .85rem;
  background: var(--sp-silver-soft);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 4px; margin-bottom: 10px; }
.footer-links a { color: var(--sp-muted); }
.footer-links a:hover { color: var(--sp-navy); }
.footer-links span { color: var(--sp-silver); margin: 0 6px; }

.empty {
  text-align: center;
  padding: 48px 16px;
  border: 1px dashed var(--sp-silver);
  border-radius: 12px;
  color: var(--sp-muted);
}
.notice {
  background: var(--sp-sky-soft);
  border: 1px solid var(--sp-sky);
  color: var(--sp-navy);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .9rem;
  margin: 12px 0;
}

/* Comments */
.comment-list { list-style: none; padding: 0; }
.comment { border-bottom: 1px solid var(--sp-line); padding: 12px 0; }
.comment-form textarea, .comment-form input {
  width: 100%;
  border: 1px solid var(--sp-line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

/* Mobile */
@media (max-width: 1100px) {
  .game-grid, .mini-grid { grid-template-columns: repeat(5, 1fr); }
  .console-grid { grid-template-columns: repeat(3, 1fr); }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .game-grid, .mini-grid { grid-template-columns: repeat(4, 1fr); }
  .console-grid { grid-template-columns: repeat(3, 1fr); }
  .slider { padding: 0 32px; }
  .slider-track.shots > a,
  .slider-track.shots > .shot-fallback { flex: 0 0 234px; width: 234px; min-width: 234px; }
  .primary-nav, .search-form.desktop { display: none; }
  .icon-btn { display: grid; }
  .header-inner { justify-content: space-between; }
  .mobile-bar { display: flex; }
  .more-panel {
    left: auto;
    right: 0;
    width: min(96vw, 420px);
    max-height: 74vh;
    overflow: auto;
  }
  .cat-board { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .game-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .console-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .console-hero { flex-direction: column; align-items: stretch; }
  .console-hero .console-art { width: 100%; }
  .mini-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: 1fr; }
  .article-card { min-height: 96px; }
  .game-hero { flex-direction: column; align-items: stretch; }
  .game-hero .cover { width: 140px; min-width: 140px; }
  .rom-head { flex-direction: column; align-items: stretch; padding: 0; }
  .rom-head .cover, .rom-cover { width: 160px; min-width: 160px; }
  .rom-meta h1 { font-size: 1.35rem; }
  .rom-actions { max-width: none; }
  .file-fact { align-items: flex-start; flex-direction: column; gap: 4px; }
  .file-fact dd { text-align: left; }
  .info-row { grid-template-columns: 1fr; gap: 2px; }
  .slider { padding: 0 28px; }
  .slider-track.shots > a,
  .slider-track.shots > .shot-fallback { flex: 0 0 208px; width: 208px; min-width: 208px; }
  .slider-track.related-grid .game-card { flex: 0 0 100px; width: 100px; min-width: 100px; }
  .wrap { width: min(100% - 20px, var(--sp-max)); }
  h1 { font-size: 1.25rem; }
  .cat-board { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .console-grid { grid-template-columns: repeat(2, 1fr); }
}

.lightbox {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(11, 18, 32, .88);
  display: none; place-items: center; padding: 24px;
}
.lightbox.is-open { display: grid; }
.lightbox img { max-height: 86vh; max-width: 92vw; border-radius: 10px; }
