/* ===========================
   VARIABLES GAME BOY
   =========================== */
:root {
  --gb-carcasa: #c5c5c5;
  --gb-carcasa-sombra: #8b8b8b;
  --gb-borde-pantalla: #3b3b3b;
  --gb-pantalla: #9bbc0f;
  --gb-pantalla-sombra: #7a9e0a;
  --gb-texto: #0f380f;
  --gb-texto-claro: #306230;
  --gb-rojo: #d04040;
  --gb-azul: #4040d0;
}

.modo-oscuro {
  --gb-carcasa: #2b2b2b;
  --gb-carcasa-sombra: #1a1a1a;
  --gb-borde-pantalla: #111;
  --gb-pantalla: #0f380f;
  --gb-pantalla-sombra: #0a2a0a;
  --gb-texto: #9bbc0f;
  --gb-texto-claro: #8bac0f;
}

/* ===========================
   RESET Y BASE
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #4a4a4a;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'VT323', monospace;
  padding: 20px;
}

/* ===========================
   CARCASA GAME BOY
   =========================== */
.gameboy {
  width: 100%;
  max-width: 420px;
  background: var(--gb-carcasa);
  border-radius: 12px 12px 35px 35px;
  padding: 18px 20px 25px;
  box-shadow:
    inset 0 -8px 0 var(--gb-carcasa-sombra),
    0 10px 20px rgba(0,0,0,0.5);
  position: relative;
  transition: background 0.3s;
}

/* Marca */
.brand {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  color: var(--gb-borde-pantalla);
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 12px;
  text-shadow: 1px 1px 0 var(--gb-carcasa-sombra);
}

/* ===========================
   PANTALLA
   =========================== */
.screen {
  background: var(--gb-borde-pantalla);
  border-radius: 8px;
  padding: 10px;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
}

.screen-inner {
  background: var(--gb-pantalla);
  border-radius: 4px;
  padding: 15px;
  min-height: 350px;
  box-shadow: inset 0 0 25px rgba(0,0,0,0.5);
  transition: background 0.3s;
  position: relative;
}

/* ===========================
   TIPOGRAFÍA DE PANTALLA
   =========================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

h1 {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.5rem;
  color: var(--gb-texto);
  text-shadow: 2px 2px 0 var(--gb-pantalla-sombra);
  line-height: 1.6;
}

.btn-tema {
  background: none;
  border: 2px solid var(--gb-texto);
  color: var(--gb-texto);
  font-size: 1rem;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-tema:hover {
  background: var(--gb-texto);
  color: var(--gb-pantalla);
}

/* ===========================
   TARJETAS DE RELOJ
   =========================== */
.zona-relojes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.tarjeta {
  background: var(--gb-pantalla-sombra);
  border: 2px solid var(--gb-texto);
  padding: 10px;
  text-align: center;
  position: relative;
  box-shadow: 2px 2px 0 var(--gb-texto);
}

.tarjeta .ciudad {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.4rem;
  color: var(--gb-texto);
  margin-bottom: 6px;
  word-break: break-word;
}

.tarjeta .hora {
  font-size: 2.2rem;
  color: var(--gb-texto);
  letter-spacing: 2px;
  line-height: 1;
}

.tarjeta .fecha {
  font-size: 0.8rem;
  color: var(--gb-texto-claro);
  margin-top: 4px;
}

.btn-eliminar {
  position: absolute;
  top: 4px;
  right: 6px;
  background: none;
  border: none;
  color: var(--gb-rojo);
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.8;
}

.btn-eliminar:hover {
  opacity: 1;
}

/* ===========================
   BUSCADOR Y SUGERENCIAS
   =========================== */
.agregar-ciudad {
  display: flex;
  gap: 8px;
}

.buscador-wrapper {
  flex: 1;
  position: relative;
}

#input-ciudad {
  width: 100%;
  padding: 8px;
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  background: var(--gb-pantalla);
  border: 2px solid var(--gb-texto);
  color: var(--gb-texto);
  outline: none;
}

#input-ciudad::placeholder {
  color: var(--gb-texto-claro);
}

.btn-accion {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  background: var(--gb-texto);
  color: var(--gb-pantalla);
  border: none;
  padding: 8px 15px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--gb-pantalla-sombra);
  transition: all 0.1s;
}

.btn-accion:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.sugerencias {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--gb-pantalla);
  border: 2px solid var(--gb-texto);
  border-top: none;
  list-style: none;
  max-height: 140px;
  overflow-y: auto;
  z-index: 20;
  font-size: 1rem;
}

.sugerencias.oculto {
  display: none;
}

.sugerencias li {
  padding: 6px 8px;
  cursor: pointer;
  color: var(--gb-texto);
  border-bottom: 1px solid var(--gb-texto-claro);
}

.sugerencias li:hover,
.sugerencias li.activo {
  background: var(--gb-texto);
  color: var(--gb-pantalla);
}

/* ===========================
   CONTROLES DECORATIVOS
   =========================== */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding: 0 10px;
}

/* D-Pad */
.dpad {
  position: relative;
  width: 70px;
  height: 70px;
}

.dpad-vertical,
.dpad-horizontal {
  position: absolute;
  background: var(--gb-borde-pantalla);
}

.dpad-vertical {
  width: 18px;
  height: 70px;
  left: 26px;
  top: 0;
}

.dpad-horizontal {
  width: 70px;
  height: 18px;
  top: 26px;
  left: 0;
}

.dpad-center {
  position: absolute;
  width: 18px;
  height: 18px;
  background: #1a1a1a;
  top: 26px;
  left: 26px;
}

/* Botones A y B */
.action-buttons {
  display: flex;
  gap: 18px;
  align-items: center;
}

.btn-a, .btn-b {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gb-rojo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.5rem;
  color: white;
  box-shadow: 0 5px 0 #882020;
  position: relative;
}

.btn-a {
  background: var(--gb-rojo);
}

.btn-b {
  background: var(--gb-azul);
  box-shadow: 0 5px 0 #202088;
}

/* Altavoz */
.speaker {
  margin-top: 15px;
  display: flex;
  justify-content: flex-end;
}

.speaker-lines {
  display: flex;
  gap: 4px;
}

.speaker-lines span {
  width: 6px;
  height: 30px;
  background: var(--gb-borde-pantalla);
  border-radius: 3px;
  opacity: 0.7;
}

/* ===========================
   ABOUT ME + SOCIAL
   =========================== */
.about-section {
  margin-top: 18px;
  text-align: center;
  color: var(--gb-borde-pantalla);
  font-family: 'Press Start 2P', cursive;
  font-size: 0.5rem;
  letter-spacing: 1px;
}

.about-title {
  font-size: 0.55rem;
  margin-bottom: 4px;
  color: var(--gb-carcasa-sombra);
}

.about-name {
  font-size: 0.7rem;
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--gb-borde-pantalla);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-social {
  text-decoration: none;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.45rem;
  padding: 6px 12px;
  border-radius: 0;
  background: var(--gb-borde-pantalla);
  color: var(--gb-carcasa);
  box-shadow: 2px 3px 0 var(--gb-carcasa-sombra);
  transition: all 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-social:hover {
  background: var(--gb-texto);
  color: var(--gb-pantalla);
}

.btn-discord {
  background: #5865F2;
  color: white;
  box-shadow: 2px 3px 0 #4040a0;
}

.btn-kofi {
  background: #FF5E5B;
  color: white;
  box-shadow: 2px 3px 0 #b03a3a;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 450px) {
  .gameboy {
    max-width: 100%;
    border-radius: 0;
    padding: 12px;
  }
  .zona-relojes {
    grid-template-columns: 1fr;
  }
  .controls {
    justify-content: space-evenly;
    margin-top: 12px;
  }
  .dpad {
    width: 55px;
    height: 55px;
  }
  .dpad-vertical {
    width: 14px;
    height: 55px;
    left: 20px;
  }
  .dpad-horizontal {
    width: 55px;
    height: 14px;
    top: 20px;
  }
  .dpad-center {
    width: 14px;
    height: 14px;
    top: 20px;
    left: 20px;
  }
  .btn-a, .btn-b {
    width: 32px;
    height: 32px;
    font-size: 0.4rem;
  }
  .social-links {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
}