/* ==========================================================================
   r37dy J2ME Preservation Arcade — Shared Design System & Responsive Player
   - Widescreen Windows PC: 3-Column Director's Cut Stage + Native KeyHUD
   - Smartphones & Tablets: Zero Phone-in-Phone + Genre-Smart Touch Deck
   ========================================================================== */

:root {
  --bg-deep: #0b0b0e;
  --bg-panel: rgba(20, 20, 26, 0.84);
  --bg-card: rgba(28, 29, 38, 0.78);
  --bg-elev: rgba(38, 40, 52, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-main: #f4f2ed;
  --text-muted: #a3a19a;
  --text-dim: #6e6c66;
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.15);
  --accent-glow: rgba(245, 158, 11, 0.35);
  --ok: #34d399;
  --danger: #f87171;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Barlow Condensed', 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

body[data-theme="gangstar"] {
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.16);
  --accent-glow: rgba(245, 158, 11, 0.36);
}
body[data-theme="pop"] {
  --accent: #eab308;
  --accent-soft: rgba(234, 179, 8, 0.16);
  --accent-glow: rgba(234, 179, 8, 0.36);
}
body[data-theme="miami"] {
  --accent: #ec4899;
  --accent-soft: rgba(236, 72, 153, 0.16);
  --accent-glow: rgba(236, 72, 153, 0.36);
}
body[data-theme="diamond"] {
  --accent: #10b981;
  --accent-soft: rgba(16, 185, 129, 0.16);
  --accent-glow: rgba(16, 185, 129, 0.36);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body.player-body {
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  display: flex;
  flex-direction: column;
}

.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;
}

.hidden {
  display: none !important;
}

/* Ambient Backdrop */
.arcade-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-canvas {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  filter: blur(56px) saturate(1.35);
  opacity: 0.28;
  transform: translateZ(0);
}

.arcade-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 44%, transparent 20%, rgba(9, 9, 12, 0.82) 78%, #08080b 100%),
    linear-gradient(180deg, rgba(8, 8, 11, 0.65) 0%, transparent 18%, transparent 82%, rgba(8, 8, 11, 0.9) 100%);
}

/* Top Bar */
.arcade-topbar {
  position: relative;
  z-index: 10;
  height: 50px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(12, 12, 16, 0.86);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(14px);
  flex-shrink: 0;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.hub-back-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.hub-back-pill:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  flex-shrink: 0;
}

.game-h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edition-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 31px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, transform 0.08s;
  white-space: nowrap;
}
.hud-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
}
.hud-chip:active {
  transform: scale(0.97);
}
.hud-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #fff;
}

/* Main 3-Column Stage (Desktop) */
.arcade-stage {
  position: relative;
  z-index: 5;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr) 310px;
  gap: 18px;
  padding: 14px 20px 8px;
  align-items: center;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

body.zen-stage .arcade-stage {
  grid-template-columns: 1fr;
}
body.zen-stage .side-wing {
  display: none;
}

.side-wing {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
}

.wing-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  padding: 13px 14px;
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
}

.wing-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 9px;
}

.keybind-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.keybind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.keybind-row:hover, .keybind-row.pressed {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.keybind-action {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-main);
}

.kbd-group {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
}

kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
  color: #fff;
}

/* Center Viewport & Frame */
.center-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
  gap: 10px;
}

.canvas-bezel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050507;
  border-radius: 12px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.72),
    0 0 38px var(--accent-glow);
  max-height: calc(100% - 48px);
  max-width: 100%;
}

#game-canvas {
  display: block;
  background: #000;
  border-radius: 7px;
  cursor: crosshair;
  touch-action: none;
}

.pointer-ripple {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0;
}
.pointer-ripple.pop {
  animation: rippleOut 0.36s ease-out forwards;
}
@keyframes rippleOut {
  0% { transform: translate(-50%, -50%) scale(0.35); opacity: 0.95; }
  100% { transform: translate(-50%, -50%) scale(1.45); opacity: 0; }
}

/* Desktop Softkey & Action Dock under Canvas */
.pc-softkey-dock {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
  align-items: center;
  gap: 8px;
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.dock-btn:hover {
  background: var(--bg-elev);
  border-color: var(--accent);
}
.dock-btn:active {
  transform: translateY(1px);
}
.dock-btn.primary {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* Right Wing Controls & Mini Switcher */
.save-pill-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.09);
  border: 1px solid rgba(52, 211, 153, 0.28);
  font-size: 12px;
  margin-bottom: 9px;
}
.save-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
  margin-right: 6px;
}

.mini-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.wing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
}
.wing-btn:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--border-strong);
}
.wing-btn.accent {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.mini-hub-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mini-hub-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.12s;
}
.mini-hub-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--border-subtle);
}
.mini-hub-link.current {
  background: var(--accent-soft);
  color: #fff;
  border-color: var(--accent);
}

.tip-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.48;
  color: var(--text-muted);
}

/* Mobile Smart Touch Deck (Hidden on Desktop, Shown on Mobile) */
.mobile-touch-deck {
  display: none;
}

body.is-mobile .arcade-topbar {
  height: auto;
  min-height: 44px;
  flex-wrap: wrap;
  padding: 6px 8px;
  gap: 6px;
}

body.is-mobile .hub-back-pill {
  padding: 4px 8px;
  font-size: 11px;
  flex-shrink: 0;
}

body.is-mobile .live-dot {
  display: none;
}

body.is-mobile .game-h1 {
  font-size: 14px;
}

body.is-mobile .topbar-actions {
  gap: 4px;
}

body.is-mobile .topbar-actions .js-quicksave,
body.is-mobile #btn-upscale {
  display: none;
}

body.is-mobile .hud-chip {
  height: 28px;
  padding: 0 8px;
  font-size: 11px;
}

body.is-mobile .side-wing,
body.is-mobile .pc-softkey-dock,
body.is-mobile .desktop-only {
  display: none !important;
}

body.is-mobile .arcade-stage {
  grid-template-columns: 1fr;
  padding: 6px 8px 4px;
  gap: 4px;
}

body.is-mobile .canvas-bezel {
  padding: 3px;
  border-radius: 9px;
  max-height: 100%;
}

body.is-mobile .mobile-touch-deck {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(14, 14, 19, 0.78) 0%, rgba(10, 10, 14, 0.96) 100%);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* Compact Touch-HD bar for full-touch games like Diamond Rush */
body.is-mobile.touch-compact .mobile-pad-row {
  height: 76px;
}

.mobile-soft-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mob-soft-btn {
  flex: 1;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mob-soft-btn:active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.mobile-pad-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 138px;
  padding: 0 4px;
}

/* 8-Way Thumb Glide / D-Pad */
.thumb-glide {
  position: relative;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(42, 44, 58, 0.9) 0%, rgba(18, 19, 26, 0.95) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.65);
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.is-mobile.touch-compact .thumb-glide {
  width: 72px;
  height: 72px;
}

.glide-cross {
  position: absolute;
  inset: 12px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.28);
  font-size: 11px;
  font-family: var(--font-mono);
}

.glide-puck {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3a3d4e, #1d1e28);
  border: 1.5px solid var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 12px var(--accent-soft);
  pointer-events: none;
  transition: transform 0.05s linear;
}
body.is-mobile.touch-compact .glide-puck {
  width: 28px;
  height: 28px;
}

/* Right Action Cluster on Mobile */
.mob-action-cluster {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 8px;
  align-items: center;
  justify-items: end;
}

.mob-act-btn {
  min-width: 64px;
  height: 48px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(34, 36, 48, 0.92);
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  touch-action: none;
}
.mob-act-btn.primary {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--accent), #9a3412);
  border-color: #fff3;
  box-shadow: 0 6px 20px var(--accent-glow);
  font-size: 15px;
}
body.is-mobile.touch-compact .mob-act-btn.primary {
  width: 62px;
  height: 48px;
  border-radius: 12px;
}
.mob-act-btn:active, .mob-act-btn.pressed {
  transform: scale(0.94);
  filter: brightness(1.18);
}

/* Subtle Legal & r37dy.com Watermark Colophon */
.arcade-colophon {
  position: relative;
  z-index: 10;
  padding: 4px 14px calc(5px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(8, 8, 11, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  flex-shrink: 0;
}

body.is-mobile .arcade-colophon {
  font-size: 10px;
  padding: 3px 8px;
}

.r37dy-watermark {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: color 0.15s, border-color 0.15s;
}
.r37dy-watermark:hover {
  color: #fff;
  border-color: var(--accent);
}

.colophon-link {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.colophon-link:hover {
  color: #fff;
}

/* Modals (Settings & Legal/DMCA) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 4, 7, 0.78);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 620px;
  max-height: 86dvh;
  overflow-y: auto;
  background: #14151c;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.8);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}
.modal-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  color: var(--accent);
  text-transform: uppercase;
}
.modal-header h2 {
  margin: 4px 0 0;
  font-size: 19px;
}
.icon-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
}

.modal-section {
  margin-bottom: 16px;
}
.modal-section h3 {
  margin: 0 0 7px;
  font-size: 13.5px;
  color: #fff;
}
.modal-section p, .modal-section summary {
  margin: 0 0 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
}
.seo-faq-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  margin-bottom: 6px;
}
.seo-faq-item summary {
  cursor: pointer;
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 0;
}
.seo-faq-item[open] summary {
  margin-bottom: 6px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Toast */
.save-toast {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  padding: 8px 16px;
  border-radius: 999px;
  background: #10b981;
  color: #04130d;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   ARCADE HUB LANDING PAGE (https://j2me.r37dy.com/)
   ========================================================================== */
body.hub-body {
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(245, 158, 11, 0.13), transparent 52%),
    radial-gradient(ellipse at 85% 12%, rgba(236, 72, 153, 0.12), transparent 48%),
    #09090d;
}

.hub-wrap {
  max-width: 1260px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.hub-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 30px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(26, 27, 36, 0.92), rgba(15, 15, 22, 0.95));
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  margin-bottom: 24px;
}

.hub-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #f59e0b;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hub-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.hub-lead {
  margin: 0;
  max-width: 820px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

.hub-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}
.filter-pill:hover, .filter-pill.active {
  background: rgba(245, 158, 11, 0.16);
  border-color: #f59e0b;
  color: #fff;
}

.hub-search {
  min-width: 240px;
  padding: 8px 13px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 13px;
}

.cartridge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 18px;
  margin-bottom: 34px;
}

.cartridge-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
  color: inherit;
}
.cartridge-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55);
}

.card-banner {
  position: relative;
  aspect-ratio: 1200 / 630;
  background: #12131a;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}
.card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.card-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(8, 8, 12, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: #fff;
}
.card-pill.saved {
  background: rgba(16, 185, 129, 0.9);
  color: #03150e;
  border-color: transparent;
}

.card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}
.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 23px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.card-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.52;
  color: var(--text-muted);
  flex: 1;
}
.card-controls-preview {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #cbd5e1;
  padding: 6px 9px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  border-radius: 9px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.48);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

.hub-seo-section {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 24px;
}
.hub-seo-section h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 22px;
  text-transform: uppercase;
}

@media (max-width: 1080px) {
  .arcade-stage {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
  .side-wing.left-wing {
    display: none;
  }
}

/* Launch audit: readable focus, honest help and filter recovery. */
:focus-visible{outline:3px solid #ffe29a;outline-offset:3px}
.hub-links{margin:20px 0}.hub-links a{color:#ffd17a}.game-summary{font:12px/1.5 var(--font-ui, sans-serif);color:#cbd5e1;margin:0 0 12px}
#filter-status{color:#cbd5e1}#filter-empty{padding:20px;border:1px solid #665238;border-radius:10px;margin-bottom:24px}#clear-search{color:#ffe29a;background:#242028;border:1px solid #b68b40;padding:9px;border-radius:6px}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
