.gallery-item img {
  display: block;
  width: 100%;
  max-width: 140px;
  height: 140px;
  object-fit: contain;
  margin: 0 auto 8px auto;
  background: #222;
}
/* Gallery Modal Image Alignment Fix */
.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-panel);
  border-radius: 8px;
  padding: 12px 8px 16px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.gallery-item img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 8px;
}

.gallery-label {
  font-weight: 600;
  text-align: center;
  margin-bottom: 2px;
}

.gallery-status {
  font-size: 0.95em;
  text-align: center;
  margin-bottom: 0;
}
/* Admin Editor Form Styles */
.editor-form .row { display:flex; gap:8px; margin-bottom:8px; }
.editor-form label { width:130px; font-weight:600; }
.editor-form input[type=text], .editor-form input[type=number], .editor-form textarea, .editor-form select { flex:1; padding:8px; background:var(--bg-panel); border:1px solid rgba(255,255,255,0.06); color:var(--text-main); border-radius:6px; }
.editor-form select option { background:var(--bg-panel); color:var(--text-main); }
.editor-form textarea { min-height:80px; }
.muted { opacity:0.8; font-size:0.9rem }
.actions-cell { display:flex; gap:6px; align-items:center; }
.actions-cell button { padding:6px 10px; border-radius:5px; border:1px solid rgba(138,43,226,0.5); background:rgba(138,43,226,0.12); color:var(--text-main); cursor:pointer; font-size:0.85rem; transition:all 0.2s; }
.actions-cell button:hover { background:rgba(138,43,226,0.25); border-color:var(--accent); }
.actions-cell button.delete { border-color:rgba(255,100,100,0.5); background:rgba(255,100,100,0.12); }
.actions-cell button.delete:hover { background:rgba(255,100,100,0.25); border-color:#ff6464; }
.form-modal { display:none !important; }
#filterUid { width:140px; }
#filterYearMin { width:120px; }
#filterYearMax { width:120px; }
.editor-filters { margin-bottom:12px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.editor-filters input[type=text], .editor-filters input[type=number], .editor-filters select { padding:8px 10px; border-radius:6px; border:1px solid rgba(255,255,255,0.06); background:var(--bg-panel); color:var(--text-main); }
.editor-filters .filter-select { padding:8px 10px; border-radius:6px; border:1px solid rgba(255,255,255,0.06); background:var(--bg-panel); color:var(--text-main); }
.editor-filters label { display:flex; align-items:center; gap:6px; margin:0; padding:0; }
.editor-filters label input { margin:0; width:auto; }
.editor-filters button { padding:8px 12px; border-radius:6px; border:1px solid rgba(255,255,255,0.1); background:rgba(255,255,255,0.05); color:var(--text-main); cursor:pointer; transition:all 0.2s; font-size:0.9rem; }
.editor-filters button:hover { background:rgba(255,255,255,0.1); border-color:rgba(255,255,255,0.2); }
.form-modal .modal-content { max-width:800px; width:90%; background:var(--bg-panel); border:1px solid var(--border-soft); max-height:90vh; overflow-y:auto; }
.form-modal-header { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px; position:sticky; top:0; background:var(--bg-panel); padding-bottom:8px; border-bottom:1px solid rgba(255,255,255,0.1); z-index:10; }
.btn-open-form { padding:8px 12px; border-radius:6px; border:1px solid var(--accent); background:rgba(138,43,226,0.15); color:var(--text-main); cursor:pointer; }
/* Table thumbnails */
.table-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
/* =========================================================
   SKIP LINK (ACCESSIBILITY)
   ========================================================= */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--text-main);
  padding: 8px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--accent-highlight);
  outline-offset: 2px;
}

/* =========================================================
   ROOT VARIABLES
   ========================================================= */
:root {
  --bg-dark: #08162a;
  --bg-panel-base: #0f243d;
  --bg-panel: color-mix(in srgb, var(--bg-panel-base) 82%, var(--accent) 18%);
  --text-main: #f2f6ff;
  --text-muted: #9dabcd;
  --border-soft: #141b2a;

  /* Logo-inspired accent companion */
  --accent-highlight: #73c1f6;
  --accent-strong: var(--accent);

  /* Brand accent colors */
  --accent-sega: #0a94f1;
  --accent-nintendo: #e60012;
  --accent-playstation: #0070CC;
  --accent-playstation-black: #000000;
  --accent-playstation-white: #FFFFFF;
  --accent-xbox: #107c0f;
  --accent-atari: #e41b17;

  /* Default accent (homepage uses Sega blue) */
  --accent: var(--accent-sega);
}

/* =========================================================
   BRAND ACCENT OVERRIDES
   ========================================================= */
body[data-brand="Sega"]        { --accent: var(--accent-sega);        --accent-strong: color-mix(in srgb, var(--accent-sega) 75%, #ffffff 10%); }
body[data-brand="Nintendo"]    { --accent: var(--accent-nintendo);    --accent-strong: color-mix(in srgb, var(--accent-nintendo) 82%, #ffe2e2 12%); }
body[data-brand="PlayStation"] { --accent: var(--accent-playstation); --accent-strong: color-mix(in srgb, var(--accent-playstation) 60%, var(--accent-playstation-white) 40%); }
body[data-brand="Xbox"]        { --accent: var(--accent-xbox);        --accent-strong: color-mix(in srgb, var(--accent-xbox) 78%, #dfffe0 12%); }
body[data-brand="Atari"]       { --accent: var(--accent-atari);       --accent-strong: color-mix(in srgb, var(--accent-atari) 78%, #ffd6d6 10%); }

/* Brand pages: global glow driven by accent color */
body[data-brand]:not(.home) {
  background:
    radial-gradient(circle at 18% 20%, color-mix(in srgb, var(--accent) 45%, transparent) 0%, transparent 36%),
    radial-gradient(circle at 82% 12%, color-mix(in srgb, var(--accent) 35%, transparent) 0%, transparent 34%),
    var(--bg-dark);
}

/* Brand-tinted backdrops for extra flavor */
body[data-brand="Nintendo"] {
  background:
    radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--accent-nintendo) 18%, transparent), transparent 32%),
    radial-gradient(circle at 82% 8%, color-mix(in srgb, var(--accent-nintendo) 12%, transparent), transparent 30%),
    var(--bg-dark);
}

body[data-brand="PlayStation"] {
  background:
    radial-gradient(circle at 15% 25%, color-mix(in srgb, var(--accent-playstation) 28%, transparent), transparent 32%),
    radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--accent-playstation) 22%, transparent), transparent 30%),
    radial-gradient(circle at 50% 80%, color-mix(in srgb, var(--accent-playstation-white) 12%, transparent), transparent 35%),
    var(--bg-dark);
}

body[data-brand="Xbox"] {
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 34%),
    radial-gradient(circle at 80% 12%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 30%),
    var(--bg-dark);
}

/* =========================================================
   HOMEPAGE COLOR OVERRIDE
   ========================================================= */
body.home {
  --bg-dark: #0a1d33;
  --bg-panel-base: #123055;
  --bg-panel: color-mix(in srgb, var(--bg-panel-base) 82%, var(--accent) 18%);
  --accent: var(--accent-sega);
}

/* =========================================================
   GLOBAL BASE STYLES
   ========================================================= */
body {
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 34%),
    radial-gradient(circle at 82% 4%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 32%),
    var(--bg-dark);
  color: var(--text-main);
  font-family: "Segoe UI", sans-serif;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Retro scanline overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.03) 0px,
    rgba(255,255,255,0.03) 1px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.25;
  z-index: 1;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 2;
}

/* =========================================================
   HEADER
   ========================================================= */
header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--accent);
}

/* Keep header background transparent to avoid boxes around subtitle */
header, .header-left, .header-text {
  background: transparent;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-text {
  display: flex;
  flex-direction: column;
}

/* Header color tools */
.header-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.color-bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
}

.accent-select {
  appearance: none;
  background: var(--bg-panel);
  color: var(--text-main);
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 12px;
  min-width: 120px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.color-reset { padding: 4px 8px; font-size: 12px; }

.console-logo {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: var(--bg-panel);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: bold;
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

h1 {
  font-family: "Press Start 2P", monospace;
  font-size: 20px;
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent);
}

.subtitle {
  margin: 6px 0 0 0;
  padding: 0;
  text-align: left;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-muted);
  font-size: 12px;
}
/* =========================================================
   MAIN NAVIGATION
   ========================================================= */
.main-nav {
  margin: 16px 0 12px 0;
  background:
    linear-gradient(135deg, var(--accent) 0%, rgba(255,255,255,0.06) 18%, transparent 42%),
    var(--bg-panel);
  border-radius: 12px;
  border: 1.5px solid var(--accent);
  box-shadow: 0 2px 16px rgba(0,0,0,0.25), 0 0 14px rgba(0,0,0,0.25);
}

.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 12px;
  margin: 0;
}

.nav-link {
  padding: 8px 14px;
  border: 2.5px solid var(--accent);
  background:
    linear-gradient(120deg, rgba(255,255,255,0.06) 0%, transparent 36%),
    linear-gradient(120deg, var(--accent) -10%, rgba(0,0,0,0) 58%),
    #181c2b;
  color: var(--accent);
  border-radius: 12px;
  cursor: pointer;
  font-family: 'Press Start 2P', 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: 0.18s;
  white-space: nowrap;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.18), 0 0 0 1.5px #000 inset;
  outline: none;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 1px #000, 0 0 1px var(--accent);
  border-style: double;
  text-decoration: none;
}

.nav-link:hover {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-strong), 0 2px 10px rgba(0,0,0,0.2);
  border-color: #fff;
  text-shadow: 0 1px 4px #000, 0 0 1px #fff;
}

.nav-link.active {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 0 14px var(--accent-strong), 0 2px 12px rgba(0,0,0,0.22);
  border-color: #fff;
  text-shadow: 0 1px 5px #000, 0 0 1px #fff;
}

/* =========================================================
   INTRO TEXT (RETRO MANUAL FRAME)
   ========================================================= */
.intro-text {
  margin-top: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--bg-panel);
  border: 2px solid var(--accent);
  border-radius: 16px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.6), 0 0 12px var(--accent);
  position: relative;
}

.intro-text h2 {
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 12px;
  text-shadow: 0 0 6px var(--accent);
}

.intro-text p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* =========================================================
   ACCOUNT BOX
   ========================================================= */
.account-box {
  margin: 20px 0 30px 0;
  padding: 20px;
  background: var(--bg-panel);
  border: 2px solid var(--accent);
  border-radius: 16px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.6), 0 0 12px var(--accent);
  position: relative;
}

.account-box h3 {
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  color: var(--accent);
  margin: 0 0 12px 0;
  text-shadow: 0 0 6px var(--accent);
}

.account-box p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 16px 0;
}

.account-box .brand-grid {
  margin: 0;
}

/* =========================================================
   BRAND GRID (HOME PAGE)
   ========================================================= */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.brand-tile {
  background:
    linear-gradient(145deg, var(--accent) 0%, rgba(255,255,255,0.04) 24%, transparent 46%),
    var(--bg-panel);
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  padding: 12px;
  text-decoration: none;
  color: var(--text-main);
  transition: 0.2s;
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  min-height: 140px;
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.brand-tile span {
  display: block;
  margin-top: 6px;
  font-size: 8px;
  line-height: 1.3;
  color: var(--text-muted);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.console-name {
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  color: var(--text-main);
  margin-top: 0;
}

.console-year {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Brand tile accents */
.brand-tile.sega        { border-color: var(--accent-sega); }
.brand-tile.nintendo    { border-color: var(--accent-nintendo); }
.brand-tile.playstation { border-color: var(--accent-playstation); }
.brand-tile.xbox        { border-color: var(--accent-xbox); }
.brand-tile.atari       { border-color: var(--accent-atari); }

/* Neon hover glow */
.brand-tile.sega:hover        { box-shadow: 0 0 10px var(--accent-strong), 0 0 16px var(--accent-strong); }
.brand-tile.nintendo:hover    { box-shadow: 0 0 10px var(--accent-strong), 0 0 16px var(--accent-strong); }
.brand-tile.playstation:hover { box-shadow: 0 0 10px var(--accent-strong), 0 0 16px var(--accent-strong); }
.brand-tile.xbox:hover        { box-shadow: 0 0 10px var(--accent-strong), 0 0 16px var(--accent-strong); }
.brand-tile.atari:hover       { box-shadow: 0 0 10px var(--accent-strong), 0 0 16px var(--accent-strong); }

/* Brand logos */
.brand-logo {
  width: 120px;
  height: auto;
  max-height: 50px;
  object-fit: contain;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.4));
  display: block;
}

/* Hide missing/broken images */
img:not([src]),
img[src=""],
img[src="#"],
img[src="null"],
img[src="undefined"] {
  display: none;
}

/* =========================================================
   PLATFORM SELECTOR
   ========================================================= */
.platform-selector {
  margin: 28px 0 16px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background:
    linear-gradient(135deg, var(--accent) 0%, rgba(255,255,255,0.05) 24%, transparent 48%),
    var(--bg-panel);
  border-radius: 16px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.22), 0 0 12px rgba(0,0,0,0.2);
  padding: 16px 12px;
  border: 1.5px solid var(--accent);
  min-height: 60px;
}

.platform-bubble-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.platform-bubble {
  padding: 8px 20px;
  border: 2.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  border-radius: 12px;
  cursor: pointer;
  font-family: 'Press Start 2P', 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: 0.18s;
  white-space: nowrap;
  box-shadow: 0 0 8px var(--accent);
  outline: none;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 1px #000, 0 0 1px var(--accent);
  border-style: double;
}

.platform-bubble:hover {
  background: transparent;
  color: var(--accent-strong);
  box-shadow: 0 0 16px var(--accent-strong);
  border-color: var(--accent-strong);
  text-shadow: 0 1px 4px #000, 0 0 2px var(--accent-strong);
}

.platform-bubble.active {
  background: transparent;
  color: var(--accent-strong);
  box-shadow: 0 0 18px var(--accent-strong);
  border-color: var(--accent-strong);
  text-shadow: 0 1px 5px #000, 0 0 2px var(--accent-strong);
}

/* =========================================================
   GAME GRID + CARDS
   ========================================================= */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 20px;
  margin-bottom: 32px;
  align-items: start;
  align-content: start;
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
    margin-bottom: 12px;
  }
  .game-card {
    min-height: 280px;
    padding: 10px;
  }
  .game-image-wrap {
    height: 150px;
    margin-bottom: 8px;
  }
  .game-info h3 {
    font-size: 11px;
    margin-bottom: 4px;
  }
}
/* =========================================================
   FOOTER
   ========================================================= */
footer {
  margin-top: 40px;
  padding: 24px 20px;
  text-align: center;
  background: var(--bg-panel);
  border-top: 2px solid var(--accent);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
}

footer p {
  margin: 0;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.footer-disclaimer-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: 0.2s ease;
  border-bottom: 1px solid transparent;
}

.footer-disclaimer-link:hover {
  color: var(--accent-strong);
  border-bottom-color: var(--accent-strong);
}

.game-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px;
  text-decoration: none;
  color: var(--text-main);
  transition: 0.2s;
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 300px;
}

/* Tablet and larger screens */
@media (min-width: 768px) {
  .game-card {
    min-height: 320px;
  }
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 12px var(--accent);
}

.game-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.game-image-wrap {
  width: 100%;
  height: 200px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  position: relative;
}

.game-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.badge-owned {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  background: var(--accent);
  color: #fff;
  border: 1.5px solid var(--accent);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 12px var(--accent), inset 0 1px 2px rgba(255,255,255,0.2);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.game-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.game-info h3 {
  font-size: 13px;
  margin: 0 0 6px 0;
  color: var(--text-main);
  line-height: 1.2;
  font-weight: 600;
}

.game-info .meta {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.game-title {
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  line-height: 1.3;
}

.badge {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: rgba(0,0,0,0.5);
}

.game-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* =========================================================
   DETAIL PAGE
   ========================================================= */
.game-detail-container {
  margin-top: 30px;
}

.game-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 8px;
  margin-top: 20px;
}

.game-cover-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.game-detail-cover {
  position: relative;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  border: 2px solid var(--accent);
  overflow: hidden;
  box-shadow: 0 0 16px var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
  height: 100%;
  flex: 1;
}

.game-detail-cover img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
}

.game-detail-info {
  padding: 20px;
  background: var(--bg-panel);
  border-radius: 12px;
  border: 1px solid var(--border-soft);
}

.game-detail-info h2 {
  font-size: 24px;
  margin: 0 0 20px 0;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 12px;
}

.game-meta-info {
  margin-bottom: 20px;
}

.game-meta-info p {
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.6;
}

.game-meta-info strong {
  color: var(--accent);
  font-weight: 600;
}

.game-description {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  margin: 20px 0;
}

.game-description p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-main);
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.back-link:hover {
  transform: translateX(-4px);
  box-shadow: 0 0 12px var(--accent);
}

.game-detail {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  margin-top: 20px;
}

.game-cover {
  background: #000;
  border-radius: 12px;
  border: 2px solid var(--accent);
  padding: 10px;
  box-shadow: 0 0 12px var(--accent);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-detail-content h2 {
  font-family: "Press Start 2P", monospace;
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 8px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 800px) {
  .game-detail-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .game-detail {
    grid-template-columns: 1fr;
  }
  .game-detail-cover {
    min-height: 350px;
  }
}
@media (max-width: 880px) {
  .brand-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
  }
  
  /* Hide accent picker on smaller screens */
  .header-tools {
    display: none;
  }
  
  /* Limit thumbnail gallery width */
  .image-gallery {
    max-width: 100%;
  }
  
  .gallery-wrapper {
    max-width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 600px) {
  .page {
    padding: 12px;
  }
  header {
    gap: 12px;
    flex-wrap: wrap;
  }
  .header-logo {
    max-width: 120px;
  }
  h1 {
    font-size: 14px;
    line-height: 1.4;
  }
  .subtitle {
    font-size: 11px;
  }
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .brand-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-list {
    flex-wrap: wrap;
    gap: 8px;
  }
  .nav-link {
    font-size: 11px;
    padding: 8px 12px;
  }
  .game-card {
    min-height: 280px;
  }
  .game-image-wrap {
    height: 160px;
  }
  .game-detail-info {
    padding: 15px;
  }
  .game-detail-info h2 {
    font-size: 18px;
    margin-bottom: 15px;
  }
  .game-meta-info p {
    font-size: 12px;
    margin: 8px 0;
  }
  .game-detail-cover {
    min-height: 280px;
  }
  .back-link {
    padding: 8px 12px;
    font-size: 12px;
    margin-top: 15px;
  }
}
@media (max-width: 480px) {
  .header-logo {
    max-width: 100px;
  }
  h1 {
    font-size: 12px;
  }
  .subtitle {
    font-size: 10px;
  }
  .games-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .game-card {
    min-height: 260px;
    padding: 12px;
  }
  .game-image-wrap {
    height: 140px;
    margin-bottom: 10px;
  }
  .brand-grid {
    grid-template-columns: 1fr;
  }
  .nav-link {
    font-size: 10px;
    padding: 6px 10px;
  }
  .game-detail-layout {
    gap: 12px;
  }
  .game-detail-info {
    padding: 12px;
  }
  .game-detail-info h2 {
    font-size: 14px;
    margin-bottom: 10px;
  }
  .game-meta-info p {
    font-size: 11px;
    margin: 6px 0;
  }
  .game-detail-cover {
    min-height: 240px;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .page {
    padding: 10px;
  }
  .games-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .game-card {
    min-height: 240px;
    padding: 10px;
  }
  .game-image-wrap {
    height: 120px;
    margin-bottom: 8px;
  }
  .game-info h3 {
    font-size: 11px;
  }
  .game-info .meta {
    font-size: 10px;
  }
  .game-detail-info {
    padding: 10px;
  }
  .game-detail-info h2 {
    font-size: 12px;
  }
  .game-meta-info p {
    font-size: 10px;
    margin: 4px 0;
  }
  .game-detail-cover {
    min-height: 200px;
  }
}

.header-logo {
    max-width: 240px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Themed Home link below header logo */
.home-link {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 10px;
  text-decoration: none;
  text-align: center;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  font-weight: 600;
}

.home-link:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px var(--accent);
}

/* =========================================================
   FILTER MODAL
   ========================================================= */
.filter-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.filter-modal[style*="display: flex"],
.filter-modal[style*="display:flex"] {
  display: flex;
}

.filter-modal-content {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent) 0%, rgba(255,255,255,0.04) 22%, transparent 44%),
    var(--bg-panel);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 20px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent-strong) 70%, transparent), 0 0 22px rgba(0,0,0,0.45);
}

.filter-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--accent-strong);
  padding-bottom: 12px;
}

.filter-modal-header h2 {
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  color: var(--accent-strong);
  margin: 0;
  text-shadow: 0 0 8px var(--accent-strong);
}

.filter-modal-close {
  background: none;
  border: none;
  color: var(--accent-strong);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.filter-modal-close:hover {
  color: #fff;
  text-shadow: 0 0 10px var(--accent-strong);
}

.filter-modal-body {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-modal-body .platform-bubble {
  flex: 1 1 calc(50% - 6px);
  min-width: 120px;
}

/* =========================================================
   EDIT CONSOLES PAGE STYLES
   ========================================================= */
.btn-clear-cache {
  background: linear-gradient(90deg, #2b181c 70%, #d9534f 120%);
  border-color: #d9534f;
  color: #d9534f;
}

.table-header-img {
  width: 140px;
}

.checkbox-label-auto {
  width: auto;
}

.form-actions {
  text-align: right;
  margin-top: 8px;
}

.btn-delete {
  margin-left: 8px;
  color: #fff;
  background: #b33;
}

/* Image Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--bg-panel);
  padding: 24px;
  border-radius: 8px;
  border: 2px solid var(--accent);
  max-width: 500px;
  width: 90%;
  font-size: 16px;
}

.modal-title {
  margin: 0 0 8px 0;
  color: var(--accent);
  font-size: 20px;
  line-height: 1.2;
}

.modal-console-info {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.modal-section {
  margin-bottom: 16px;
}

.modal-section-title {
  margin: 0 0 8px 0;
  font-weight: 600;
}

.modal-current-img {
  max-width: 100%;
  height: auto;
  max-height: 200px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.modal-current-path {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.modal-flex-section {
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.modal-flex-1 {
  flex: 1;
}

.modal-label-block {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.modal-select {
  width: 100%;
  padding: 8px;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-radius: 4px;
}

.modal-file-input {
  width: 100%;
  padding: 8px;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-radius: 4px;
}

.modal-preview-img {
  max-width: 100%;
  height: auto;
  max-height: 150px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.modal-btn-cancel {
  padding: 8px 16px;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-radius: 4px;
  cursor: pointer;
}

.modal-btn-download {
  padding: 8px 16px;
  background: transparent;
  border: 2px dashed var(--accent);
  color: var(--accent);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
}

.modal-btn-save {
  padding: 8px 16px;
  background: var(--accent);
  border: 2px solid var(--accent);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
}

/* Gallery Modal */
.gallery-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9998;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.gallery-modal-content {
  background: var(--bg-panel);
  padding: 24px;
  border-radius: 8px;
  border: 2px solid var(--accent);
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  font-size: 16px;
}

.gallery-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.gallery-modal-title {
  margin: 0;
  color: var(--accent);
  font-size: 20px;
}

.gallery-modal-close {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
}

.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.footer-disclaimer-link {
  color: var(--accent);
  text-decoration: none;
}

/* =========================================================
   SEARCH FILTER SECTION
   ========================================================= */
.search-filter-section {
  margin: 20px 0;
  padding: 16px;
  background: var(--bg-panel);
  border-radius: 8px;
  border: 1px solid var(--border-soft);
}

.search-filter-section h3 {
  margin-top: 0;
}

.search-filter-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 8px 10px;
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--text-main);
  border-radius: 6px;
  box-shadow: 0 0 8px var(--accent);
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-label-with-margin {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.filter-clear-btn {
  padding: 8px 12px;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 0 8px var(--accent);
}

.filter-clear-btn-auto {
  margin-left: auto;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  background: var(--bg-panel);
  color: var(--text-main);
}

.filter-select {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--bg-panel);
  color: var(--text-main);
}

.filter-select-per-page {
  padding: 6px 8px;
  background: var(--bg-dark);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-radius: 6px;
  cursor: pointer;
}

/* =========================================================
   PAGINATION
   ========================================================= */
.pagination {
  display: none;
  text-align: center;
  margin: 2rem 0;
}

.pagination-btn {
  margin: 0 1rem;
}

.pagination-info {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-color);
}

/* =========================================================
   MODAL & DISPLAY UTILITIES
   ========================================================= */
.display-none {
  display: none;
}

.hidden-input {
  display: none;
}

/* =========================================================
   CONTENT UTILITY CLASSES
   ========================================================= */
.text-indent {
  margin-left: 20px;
}

.news-date {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

/* =========================================================
   DISCLAIMER PAGE STYLES
   ========================================================= */
.disclaimer-section {
  padding: 20px;
  margin: 20px 0;
  background: var(--bg-panel);
  border-radius: 12px;
  border: 1px solid var(--border-soft);
}

.disclaimer-heading {
  font-family: 'Press Start 2P', monospace;
  color: var(--accent);
}

.disclaimer-heading-top {
  font-family: 'Press Start 2P', monospace;
  color: var(--accent);
  margin-top: 0;
}

.disclaimer-text {
  line-height: 1.6;
  color: var(--text-muted);
}

.disclaimer-list {
  color: var(--text-muted);
  line-height: 1.8;
}

.disclaimer-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid var(--accent);
}

.disclaimer-update {
  color: var(--accent);
  font-weight: 600;
}

/* =========================================================
   NINTENDO ACCENT WHITE BACKGROUND HANDLING
   ========================================================= */
body.nintendo-accent-active {
  background: white !important;
  color: var(--accent) !important;
  --bg-dark: #ffffff;
  --bg-panel-base: #ffffff;
  --bg-panel: color-mix(in srgb, var(--bg-panel-base) 82%, #fff 18%);
}

/* White backgrounds with red text for all major elements when Nintendo accent is active */
body.nintendo-accent-active * {
  background: white !important;
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}

/* Preserve transparency for specific elements */
body.nintendo-accent-active input::placeholder,
body.nintendo-accent-active textarea::placeholder {
  color: var(--accent) !important;
  opacity: 0.6;
}

/* Override for elements that should keep their styles */
body.nintendo-accent-active img,
body.nintendo-accent-active svg {
  background: transparent !important;
  border-color: transparent !important;
}

/* Header styling */
body.nintendo-accent-active header {
  background: white !important;
  border-color: var(--accent) !important;
}

/* =========================================================
   PLAYSTATION ACCENT WHITE BACKGROUND HANDLING
   ========================================================= */
body.playstation-accent-active {
  background: white !important;
  color: var(--accent) !important;
  --bg-dark: #ffffff;
  --bg-panel-base: #ffffff;
  --bg-panel: color-mix(in srgb, var(--bg-panel-base) 82%, #fff 18%);
}

/* White backgrounds with blue text for all major elements when PlayStation accent is active */
body.playstation-accent-active * {
  background: white !important;
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}

/* Preserve transparency for specific elements */
body.playstation-accent-active input::placeholder,
body.playstation-accent-active textarea::placeholder {
  color: var(--accent) !important;
  opacity: 0.6;
}

/* Override for elements that should keep their styles */
body.playstation-accent-active img,
body.playstation-accent-active svg {
  background: transparent !important;
  border-color: transparent !important;
}

/* Header styling */
body.playstation-accent-active header {
  background: white !important;
  border-color: var(--accent) !important;
}

/* =========================================================
   XBOX ACCENT WHITE BACKGROUND HANDLING
   ========================================================= */
body.xbox-accent-active {
  background: white !important;
  color: var(--accent) !important;
  --bg-dark: #ffffff;
  --bg-panel-base: #ffffff;
  --bg-panel: color-mix(in srgb, var(--bg-panel-base) 82%, #fff 18%);
}

/* White backgrounds with green text for all major elements when Xbox accent is active */
body.xbox-accent-active * {
  background: white !important;
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}

/* Preserve transparency for specific elements */
body.xbox-accent-active input::placeholder,
body.xbox-accent-active textarea::placeholder {
  color: var(--accent) !important;
  opacity: 0.6;
}

/* Override for elements that should keep their styles */
body.xbox-accent-active img,
body.xbox-accent-active svg {
  background: transparent !important;
  border-color: transparent !important;
}

/* Header styling */
body.xbox-accent-active header {
  background: white !important;
  border-color: var(--accent) !important;
}