/* ==========================================================
   THEME: MEGA DRIVE STYLE (v2)
   Estética Sega 1991–1994 + Memphis Design
   ========================================================== */

:root {
  --blue: #0073ff;
  --red: #ff0033;
  --yellow: #ffef00;
  --green: #00d26a;
  --text-dark: #000;
  --text-light: #fff;
  --shadow: #000;
}

/* ----------------------------------------------------------
   GLOBAL
---------------------------------------------------------- */
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Trebuchet MS', 'Arial Black', sans-serif;
  color: var(--text-dark);
  background: #fff;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Contenido principal centrado */
main {
  flex: 1;
  width: 80%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 0;
  background: #fff;
  z-index: 1;
}

#content {
  width: 100%;
  min-height: 74.5vh;
   
 
}


#content.ready {
  opacity: 1;
   transition: opacity 0.3s ease-in;
}

#content.off {
  opacity: 0;
   transition: opacity 0s ease-in;
}

/* ----------------------------------------------------------
   HEADER
---------------------------------------------------------- */
header {
  width: 100%;
  position: relative;
  z-index: 100;
}

.top-bar {
  background: var(--blue);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 40px;
  border-bottom: 4px solid var(--yellow);
  flex-wrap: wrap;
}

/* Marca */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  height: 48px;
  width: auto;
  filter: drop-shadow(2px 2px 0 var(--shadow));
  transform: translateY(2px);
  transition: transform 0.2s ease;
}

.brand-logo:hover {
  transform: scale(1.1) rotate(-2deg);
}

.top-bar h1 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--text-light);
  font-weight: 800;
  letter-spacing: 1px;
}

/* Navegación */
.top-bar nav a {
  color: var(--text-light);
  font-weight: bold;
  text-decoration: none;
  margin: 0 6px;
  transition: color 0.2s, transform 0.2s;
}

.top-bar nav a:hover {
  color: var(--yellow);
  transform: scale(1.1);
}

/* Controles (idioma + tema) */
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

#lang-select {
  padding: 4px 6px;
  border: 2px solid var(--shadow);
  background: #fff;
  font-weight: bold;
}

#theme-toggle {
  background: var(--yellow);
  border: 2px solid var(--shadow);
  padding: 5px 10px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--shadow);
  transition: all 0.2s ease;
}

#theme-toggle:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--shadow);
}

/* ----------------------------------------------------------
   FOOTER
---------------------------------------------------------- */
footer {
  width: 100%;
  background: var(--blue);
  color: var(--text-light);
  border-top: 4px solid var(--yellow);
  padding: 16.5px 0;
  text-align: center;
  font-size: 0.9rem;
  text-shadow: 2px 2px 0 var(--shadow);
  position: relative;
  z-index: 100;
}

footer p {
  margin: 5px 0;
}

footer a {
  color: var(--yellow);
  text-decoration: none;
  font-weight: bold;
}

footer a:hover {
  color: var(--red);
}

/* ----------------------------------------------------------
   BOTONES / GENERAL UI
---------------------------------------------------------- */
button, .btn {
  background: var(--yellow);
  border: 3px solid var(--shadow);
  box-shadow: 4px 4px 0 var(--red);
  color: var(--text-dark);
  font-weight: bold;
  padding: 8px 16px;
  cursor: pointer;
  text-transform: uppercase;
  transition: transform 0.2s, box-shadow 0.2s;
}

button:hover, .btn:hover {
  transform: translateY(-2px);
  box-shadow: 5px 5px 0 var(--green);
}

/* ----------------------------------------------------------
   UTILIDADES
---------------------------------------------------------- */
hr {
  border: none;
  border-top: 2px solid var(--yellow);
  margin: 10px 0;
}

.blink {
  animation: blink 1.5s step-start infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ----------------------------------------------------------
   RESPONSIVE
---------------------------------------------------------- */
@media (max-width: 700px) {
  .top-bar {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  main {
    width: 95%;
  }

  #theme-toggle {
    padding: 6px 12px;
  }
}

/* ==========================================================
   THEME: MEGA DRIVE DARK / CRT
   Activo cuando <body> tiene class="crt-mode"
   ========================================================== */

body.crt-mode {
  background: radial-gradient(circle at center, #000 0%, #050505 60%, #000 100%);
  color: #fff;
  font-family: 'Trebuchet MS', 'Arial Black', sans-serif;
  text-shadow: 0 0 4px #00ffcc;
}

/* --- Layout --- */
body.crt-mode main {
  background: rgba(0, 0, 0, 0.75);
  border: 2px solid #00c87a; /* verde Sega */
  box-shadow: 0 0 12px #00ffcc;
  position: relative;
  z-index: 10;
}

body.crt-mode #content {
  background: rgba(0, 0, 0, 0);
  border-top: 4px solid #00c87a;
  border-bottom: 4px solid #007bff;
  color: #fff;
}

/* --- HEADER --- */
body.crt-mode .top-bar {
  background-color: #000;
  color: #fff;
  border-bottom: 4px solid #00c87a;
  box-shadow: 0 0 8px #00ffcc;
}

body.crt-mode .logo-area h1,
body.crt-mode .top-bar h1 {
  color: #ffeb00;
  text-shadow:
    0 0 6px #00ffcc,
    0 0 2px #00ffcc;
}

body.crt-mode .subtitle {
  color: #ffeb00;
  text-shadow: 0 0 6px #00ffcc;
}

body.crt-mode .controls {
  color: #fff;
}

/* --- NAV --- */
body.crt-mode nav a {
  color: #ffeb00;
  text-shadow: 0 0 6px #00ffcc;
  transition: color 0.2s ease;
}

body.crt-mode nav a:hover {
  color: #ff3355;
  text-shadow: 0 0 8px #ff3355;
  transform: scale(1.1);
}

/* --- SELECT IDIOMA --- */
body.crt-mode #lang-select {
  background-color: #000;
  color: #00ffcc;
  border: 2px solid #00ffcc;
  box-shadow: 0 0 6px #00ffcc;
  font-family: "Courier New", monospace;
}

/* --- BOTÓN CAMBIO TEMA --- */
body.crt-mode #theme-toggle {
  background-color: #00c87a;
  color: #000;
  font-weight: bold;
  border: 2px solid #ffeb00;
  box-shadow: 3px 3px 0 #ff3355, 0 0 8px #00ffcc;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}

body.crt-mode #theme-toggle:hover {
  background-color: #ffeb00;
  color: #000;
  box-shadow: 4px 4px 0 #00c87a, 0 0 8px #ffeb00;
  transform: translate(-2px, -2px);
}

/* --- SECCIONES (títulos, párrafos) --- */
body.crt-mode .section h2,
body.crt-mode h2,
body.crt-mode h3,
body.crt-mode h4 {
  color: #ffeb00;
  text-shadow:
    0 0 6px #00ffcc,
    0 0 2px #00ffcc;
}

body.crt-mode .section p,
body.crt-mode p {
  color: #d5ffe9;
  text-shadow: 0 0 4px #00ffcc;
}

/* --- GALERÍA / IMÁGENES / CARDS --- */
body.crt-mode .screenshot,
body.crt-mode .game-thumb,
body.crt-mode .carousel,
body.crt-mode .about-box,
body.crt-mode .video-wrapper {
  background-color: #000;
  border: 3px solid #00c87a;
  box-shadow:
    4px 4px 0 #00c87a,
    0 0 8px #00ffcc;
  filter: brightness(0.9) contrast(1.2) drop-shadow(0 0 6px #00ffcc);
  color: #fff;
}

body.crt-mode .about-box h3 {
  color: #ffeb00;
  text-shadow: 0 0 6px #00ffcc;
}

body.crt-mode .about-box li {
  color: #d5ffe9;
}

/* las imágenes adentro mantienen relación y brillo */
body.crt-mode .screenshot img,
body.crt-mode .game-thumb,
body.crt-mode .carousel-img,
body.crt-mode .video-wrapper video {
  filter: brightness(1.05) contrast(1.15);
  background-color: #000;
}

/* --- BOTONES / LINKS DE ACCIÓN --- */
body.crt-mode button,
body.crt-mode .btn,
body.crt-mode .game-link {
  background-color: #00c87a;
  color: #000;
  border: 2px solid #ffeb00;
  box-shadow: 3px 3px 0 #ff3355, 0 0 8px #00ffcc;
  font-weight: bold;
  padding: 8px 16px;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  transition: all 0.15s ease;
}

body.crt-mode button:hover,
body.crt-mode .btn:hover,
body.crt-mode .game-link:hover {
  background-color: #ffeb00;
  color: #000;
  box-shadow: 4px 4px 0 #00c87a, 0 0 8px #ffeb00;
  transform: translate(-2px, -2px);
}

/* --- BLOQUE "PRÓXIMAMENTE" (ideas frescas) --- */
body.crt-mode .coming-future {
  background: rgba(0, 0, 0, 0.6);
  border: 3px solid #00c87a;
  box-shadow: 4px 4px 0 #00c87a, 0 0 8px #00ffcc;
  padding: 20px;
  border-radius: 2px;
}

body.crt-mode .quote {
  color: #d5ffe9;
  text-shadow: 0 0 4px #00ffcc;
}

body.crt-mode .quote .highlight {
  color: #ffeb00;
  text-shadow: 0 0 6px #00ffcc;
  font-weight: bold;
}

/* --- FOOTER --- */
body.crt-mode footer {
  background-color: #000;
  color: #ffeb00;
  border-top: 4px solid #00c87a;
  text-shadow:
    0 0 6px #00ffcc,
    0 0 2px #00ffcc;
  box-shadow: 0 0 12px #00ffcc;
}

body.crt-mode footer a {
  color: #00c87a;
  text-decoration: none;
  font-weight: bold;
  text-shadow: 0 0 6px #00ffcc;
}

body.crt-mode footer a:hover {
  color: #ff3355;
  text-shadow: 0 0 8px #ff3355;
}

/* --- LÍNEAS, DETALLES, ETC --- */
body.crt-mode hr {
  border: none;
  border-top: 2px solid #00c87a;
  box-shadow: 0 0 6px #00ffcc;
  margin: 10px 0;
}

body.crt-mode .blink {
  color: #00c87a;
  text-shadow: 0 0 6px #00ffcc;
}

/* --- micro detalle CRT scanline opcional --- */
body.crt-mode::after {
  content: "";
  pointer-events: none;
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0,255,200,0.07) 0px,
    rgba(0,255,200,0.07) 2px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0) 4px
  );
  mix-blend-mode: screen;
  opacity: 0.4;
  z-index: 9999;
}
