/*
Theme Name:     Retro Arcade
Theme URI:      https://github.com/retro-arcade
Description:    A dark/light retro gaming theme with EmulatorJS and LaunchBox integration. Built for the Retro Arcade plugin.
Version:        1.0.0
Author:         Retro Arcade
License:        GPL-2.0+
Text Domain:    retro-arcade-theme
Tags:           dark, light, games, retro, gaming, custom-background, custom-logo, full-width-template
*/

/* ============================================================
   RETRO ARCADE THEME – Core Styles
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Orbitron:wght@400;600;700;900&family=Exo+2:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ── */
:root,
[data-ra-theme="dark"] {
  --ra-bg:           #0a0a0f;
  --ra-bg2:          #12121a;
  --ra-bg3:          #1a1a28;
  --ra-card-bg:      #16161f;
  --ra-border:       #2a2a3a;
  --ra-text:         #e8e8f0;
  --ra-text2:        #a0a0b8;
  --ra-text3:        #606080;
  --ra-accent:       #00d4ff;
  --ra-accent2:      #ff6600;
  --ra-green:        #00ff88;
  --ra-purple:       #b44fff;
  --ra-red:          #ff3355;
  --ra-shadow:       0 4px 24px rgba(0,212,255,0.12);
  --ra-glow:         0 0 20px rgba(0,212,255,0.3);
  --ra-glow-strong:  0 0 40px rgba(0,212,255,0.5);
  --ra-radius:       12px;
  --ra-radius-sm:    6px;
  --ra-font-head:    'Orbitron', 'Press Start 2P', monospace;
  --ra-font-pixel:   'Press Start 2P', monospace;
  --ra-font-body:    'Exo 2', sans-serif;
  --ra-nav-height:   64px;
  --ra-scanlines-opacity: 0.03;
}

[data-ra-theme="light"] {
  --ra-bg:           #f5f0e8;
  --ra-bg2:          #ede8de;
  --ra-bg3:          #e0d8cc;
  --ra-card-bg:      #faf8f4;
  --ra-border:       #c8c0b0;
  --ra-text:         #1a1a2e;
  --ra-text2:        #4a4a5e;
  --ra-text3:        #888898;
  --ra-accent:       #c85a00;
  --ra-accent2:      #0a5ac8;
  --ra-green:        #207840;
  --ra-purple:       #6020a0;
  --ra-red:          #cc1133;
  --ra-shadow:       0 4px 24px rgba(200,90,0,0.1);
  --ra-glow:         0 0 20px rgba(200,90,0,0.2);
  --ra-glow-strong:  0 0 40px rgba(200,90,0,0.35);
  --ra-scanlines-opacity: 0.015;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--ra-font-body);
  background-color: var(--ra-bg);
  color: var(--ra-text);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* CRT scanlines effect */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,var(--ra-scanlines-opacity)) 2px,
    rgba(0,0,0,var(--ra-scanlines-opacity)) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

a { color: var(--ra-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--ra-font-head);
  line-height: 1.3;
  color: var(--ra-text);
}

.pixel-text {
  font-family: var(--ra-font-pixel);
  font-size: 10px;
  letter-spacing: 1px;
}

.glow-text { text-shadow: var(--ra-glow); }
.accent-text { color: var(--ra-accent); }

/* ── Layout ── */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-content {
  flex: 1;
  padding-top: var(--ra-nav-height);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navigation ── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--ra-nav-height);
  background: var(--ra-bg2);
  border-bottom: 1px solid var(--ra-border);
  z-index: 1000;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.3s;
}

[data-ra-theme="dark"] .site-header {
  background: rgba(18, 18, 26, 0.9);
}

.site-header.scrolled {
  box-shadow: 0 2px 24px rgba(0,0,0,0.45);
  background: var(--ra-bg2);
}

[data-ra-theme="dark"] .site-header.scrolled {
  background: rgba(10, 10, 15, 0.98);
  box-shadow: 0 2px 32px rgba(0, 212, 255, 0.08);
}

.site-header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 24px;
}

.site-logo {
  font-family: var(--ra-font-head);
  font-size: 18px;
  font-weight: 900;
  color: var(--ra-accent);
  text-decoration: none;
  white-space: nowrap;
  text-shadow: var(--ra-glow);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo span.logo-icon {
  font-size: 22px;
  animation: raBlink 3s infinite;
}

.main-nav {
  flex: 1;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--ra-radius-sm);
  color: var(--ra-text2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.main-nav a:hover,
.main-nav .current-menu-item a {
  color: var(--ra-accent);
  background: var(--ra-bg3);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.header-search {
  display: flex;
  align-items: center;
  background: var(--ra-bg3);
  border: 1px solid var(--ra-border);
  border-radius: 20px;
  overflow: hidden;
  transition: border-color 0.2s;
  width: 220px;
}

.header-search:focus-within {
  border-color: var(--ra-accent);
}

.header-search input {
  background: none;
  border: none;
  color: var(--ra-text);
  padding: 8px 14px;
  font-size: 13px;
  font-family: var(--ra-font-body);
  width: 100%;
  outline: none;
}

.header-search button {
  background: none;
  border: none;
  padding: 8px 12px;
  color: var(--ra-text2);
  cursor: pointer;
  font-size: 14px;
}

.theme-toggle {
  background: var(--ra-bg3);
  border: 1px solid var(--ra-border);
  border-radius: 20px;
  padding: 8px 16px;
  color: var(--ra-text);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--ra-font-body);
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.theme-toggle:hover {
  border-color: var(--ra-accent);
  color: var(--ra-accent);
}

.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--ra-border);
  border-radius: var(--ra-radius-sm);
  padding: 8px;
  cursor: pointer;
  color: var(--ra-text);
  font-size: 18px;
}

/* ── Hero section ── */
.site-hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  background: var(--ra-bg2);
  overflow: hidden;
  border-bottom: 1px solid var(--ra-border);
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

[data-ra-theme="light"] .hero-bg-grid {
  background-image:
    linear-gradient(rgba(200,90,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200,90,0,0.04) 1px, transparent 1px);
}

.hero-bg-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,255,0.08) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  pointer-events: none;
}

[data-ra-theme="light"] .hero-bg-glow {
  background: radial-gradient(circle, rgba(200,90,0,0.06) 0%, transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 80px 0;
}

.hero-eyebrow {
  font-family: var(--ra-font-pixel);
  font-size: 9px;
  color: var(--ra-accent2);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 2px;
  background: var(--ra-accent2);
}

.hero-title {
  font-family: var(--ra-font-head);
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 900;
  color: var(--ra-accent);
  margin-bottom: 20px;
  line-height: 1.1;
  text-shadow: var(--ra-glow-strong);
}

.hero-subtitle {
  font-size: 18px;
  color: var(--ra-text2);
  margin-bottom: 36px;
  max-width: 560px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat-num {
  font-family: var(--ra-font-head);
  font-size: 28px;
  font-weight: 900;
  color: var(--ra-accent);
  display: block;
  text-shadow: var(--ra-glow);
}

.hero-stat-label {
  font-size: 11px;
  color: var(--ra-text3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--ra-radius-sm);
  font-family: var(--ra-font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--ra-accent);
  color: #000;
  box-shadow: var(--ra-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: var(--ra-glow-strong);
  text-decoration: none;
  color: #000;
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--ra-accent);
  color: var(--ra-accent);
}

.btn-secondary:hover {
  background: var(--ra-accent);
  color: #000;
  text-decoration: none;
  transform: translateY(-2px);
}

/* ── Section ── */
.ra-section {
  padding: 64px 0;
}

.ra-section-alt {
  background: var(--ra-bg2);
  border-top: 1px solid var(--ra-border);
  border-bottom: 1px solid var(--ra-border);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-family: var(--ra-font-head);
  font-size: clamp(16px, 3vw, 24px);
  color: var(--ra-text);
  margin: 0;
  position: relative;
  padding-left: 20px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 100%;
  background: var(--ra-accent);
  border-radius: 3px;
}

.section-link {
  font-size: 13px;
  color: var(--ra-accent);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-link:hover { text-decoration: underline; }

/* ── Genre pills ── */
.ra-genre-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 24px 0;
}

.ra-genre-pill {
  padding: 10px 20px;
  background: var(--ra-bg2);
  border: 1px solid var(--ra-border);
  border-radius: 24px;
  color: var(--ra-text2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.ra-genre-pill:hover {
  border-color: var(--ra-accent);
  color: var(--ra-accent);
  background: var(--ra-bg3);
  text-decoration: none;
  transform: translateY(-2px);
}

/* ── Featured carousel ── */
.ra-featured {
  position: relative;
  overflow: hidden;
}

.ra-featured-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.ra-featured-track::-webkit-scrollbar { display: none; }

.ra-featured-card {
  scroll-snap-align: start;
  flex: 0 0 200px;
  background: var(--ra-card-bg);
  border: 1px solid var(--ra-border);
  border-radius: var(--ra-radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: var(--ra-text);
}

.ra-featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  text-decoration: none;
  color: var(--ra-text);
}

.ra-featured-art {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--ra-bg3);
  overflow: hidden;
}

.ra-featured-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.ra-featured-card:hover .ra-featured-art img {
  transform: scale(1.06);
}

.ra-featured-info {
  padding: 10px 12px;
}

.ra-featured-name {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.ra-featured-platform {
  font-size: 10px;
  color: var(--ra-text3);
}

.ra-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--ra-bg2);
  border: 1px solid var(--ra-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: var(--ra-text);
  font-size: 18px;
  z-index: 2;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ra-scroll-btn:hover {
  background: var(--ra-accent);
  color: #000;
}

.ra-scroll-prev { left: 0; }
.ra-scroll-next { right: 0; }

/* ── Footer ── */
.site-footer {
  background: var(--ra-bg2);
  border-top: 1px solid var(--ra-border);
  padding: 48px 0 24px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .site-logo { font-size: 16px; margin-bottom: 12px; display: flex; }
.footer-brand p {
  font-size: 13px;
  color: var(--ra-text3);
  line-height: 1.7;
}

.footer-col h4 {
  font-family: var(--ra-font-head);
  font-size: 11px;
  color: var(--ra-accent);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a {
  font-size: 13px;
  color: var(--ra-text3);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--ra-accent); }

.footer-bottom {
  border-top: 1px solid var(--ra-border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p {
  font-size: 12px;
  color: var(--ra-text3);
}

.footer-badges {
  display: flex;
  gap: 8px;
}

.footer-badge {
  font-family: var(--ra-font-pixel);
  font-size: 8px;
  padding: 4px 8px;
  border: 1px solid var(--ra-border);
  border-radius: 4px;
  color: var(--ra-text3);
}

/* ── Mobile nav ── */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--ra-bg2);
  z-index: 9999;
  flex-direction: column;
  padding: 80px 24px 24px;
  gap: 16px;
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  font-family: var(--ra-font-head);
  font-size: 14px;
  color: var(--ra-text);
  padding: 16px 0;
  border-bottom: 1px solid var(--ra-border);
  text-decoration: none;
}

.mobile-nav a:hover { color: var(--ra-accent); }
.mobile-nav-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: 1px solid var(--ra-border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: var(--ra-text);
  font-size: 16px;
}

/* ── Animations ── */
@keyframes raBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes raSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes raGlow {
  0%, 100% { text-shadow: var(--ra-glow); }
  50% { text-shadow: var(--ra-glow-strong); }
}

.ra-animate-in {
  animation: raSlideUp 0.4s ease forwards;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .main-nav { display: none; }
  .hamburger { display: block; }
  .header-search { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-stats { gap: 20px; }
  .hero-title { font-size: 28px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-content { padding: 48px 0; }
  .btn { padding: 12px 20px; font-size: 14px; }
}
