/* =========================================================
   🌙 GLOBAL – Cyberpunk Verde Neón
   ========================================================= */
:root {
  --bg: #0e0e0e;
  --bg-panel: #141414;
  --neon: #00ff88;
  --neon-soft: #00cc70;
  --danger: #4f1981;
  --text: #e6ffe6;
  --border: rgba(0, 255, 136, 0.4);
  --font: 'Fira Code', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* Neon glowing frame */
.neon-border {
  border: 1px solid var(--border);
  box-shadow:
    0 0 12px rgba(0, 255, 136, 0.2),
    0 0 24px rgba(0, 255, 136, 0.1);
  border-radius: 12px;
}

/* =========================================================
   🖥 SCREENS
   ========================================================= */
.screen {
  width: 100%;
  max-width: 750px;
  background: var(--bg-panel);
  padding: 25px;
  border-radius: 12px;
  display: none;
  flex-direction: column;
  gap: 18px;
  animation: fadeIn 0.3s ease-out;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* =========================================================
   🖊 TITLES & TEXT
   ========================================================= */

.title {
  font-size: 28px;
  font-weight: 600;
  color: var(--neon);
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.8);
}

.title.small {
  font-size: 20px;
}

.subtitle {
  color: #d0ffd0;
  margin-bottom: 10px;
}

/* =========================================================
   🟩 START SCREEN — Minimal Cyberpunk Premium
   ========================================================= */

.start-header {
  text-align: center;
  margin-bottom: 30px;
  animation: fadeIn 0.6s ease-out;
}

.start-title {
  font-size: 34px;
  font-weight: 700;
  color: var(--neon);
  margin-bottom: 6px;
  text-shadow: 0 0 12px rgba(0, 255, 136, 0.8);
  letter-spacing: 1.4px;
}

.start-pulse {
  width: 80%;
  height: 2px;
  margin: 0 auto 12px auto;
  background: linear-gradient(90deg,
      transparent,
      rgba(0, 255, 136, 0.8),
      transparent);
  filter: drop-shadow(0 0 6px rgba(0, 255, 136, 0.4));
  animation: pulseGlow 2.5s infinite ease-in-out;
}

@keyframes pulseGlow {
  0% {
    opacity: 0.25;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.25;
  }
}

.start-subtitle {
  font-size: 15px;
  color: #d8ffe9;
  opacity: 0.9;
  margin-top: 4px;
  letter-spacing: 0.3px;
}

.start-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  animation: fadeIn 0.8s ease-out;
}

.start-btn {
  width: 85%;
  max-width: 360px;
  font-size: 16px;
}


/* =========================================================
   🟩 INPUTS
   ========================================================= */

.input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--neon);
  background: #0b0b0b;
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  transition: box-shadow 0.2s;
}

.input:focus {
  outline: none;
  box-shadow: 0 0 12px var(--neon);
}

/* =========================================================
   🟨 BUTTONS
   ========================================================= */
.btn {
  padding: 12px 20px;
  background: var(--neon);
  color: #000;
  font-size: 15px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn:hover {
  background: var(--neon-soft);
  box-shadow: 0 0 10px var(--neon);
}

/* Secondary button */
.btn.secondary {
  background: transparent;
  border: 1px solid var(--neon);
  color: var(--neon);
}

.btn.secondary:hover {
  background: var(--neon);
  color: #000;
}

/* Button small */
.btn.small {
  padding: 6px 12px;
  font-size: 13px;
}

/* Danger button */
.btn.danger {
  border: 1px solid var(--danger);
  color: var(--danger);
}

.btn.danger:hover {
  background: var(--danger);
  color: #000;
}

/* Back button */
.btn.back {
  align-self: flex-start;
  margin-bottom: 5px;
}

/* Tiny (for hints etc.) */
.btn.tiny {
  padding: 4px 10px;
  font-size: 12px;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* =========================================================
   🧩 GAME LAYOUT
   ========================================================= */

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
}

.meta {
  color: var(--neon);
  font-weight: bold;
}

.description {
  background: #0d0d0d;
  border-left: 3px solid var(--neon);
  padding: 12px;
  border-radius: 6px;
}

.info-card {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111;
  color: #ccffdd;
}

/* =========================================================
   🧮 SQL AREA
   ========================================================= */

.sql-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.textarea {
  width: 100%;
  height: 130px;
  padding: 12px;
  background: #0c0c0c;
  color: var(--neon);
  border: 1px solid var(--neon);
  border-radius: 8px;
  resize: none;
  font-size: 14px;
  font-family: var(--font);
}

.textarea:focus {
  outline: none;
  box-shadow: 0 0 10px var(--neon);
}

/* =========================================================
   📊 RESULT BOX
   ========================================================= */

.result-box {
  margin-top: 10px;
  padding: 15px;
  background: #121212;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* =========================================================
   📊 TABLAS (preview + resultado)
   ========================================================= */
.table-preview {
  margin-top: 12px;
  padding: 12px;
  background: #121212;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 136, 0.25);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.08);
}


.table-preview table,
#result-table table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}

/* Encabezados */
.table-preview thead th,
#result-table thead th {
  background: linear-gradient(90deg,
      rgba(0, 255, 136, 0.18),
      rgba(0, 255, 136, 0.04));
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
  font-weight: 600;
}

/* Celdas */
.table-preview tbody td,
#result-table tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Zebra */
.table-preview tbody tr:nth-child(even),
#result-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* Hover fila */
.table-preview tbody tr:hover,
#result-table tbody tr:hover {
  background: rgba(0, 255, 136, 0.08);
  transition: background 0.15s ease-out;
}

/* Feedback text */
.feedback {
  margin-top: 8px;
  font-weight: bold;
  color: var(--neon);
}

/* =========================================================
   📘 HINT AREA
   ========================================================= */

.hint-box {
  text-align: left;
}

.hint-text {
  margin-top: 6px;
  color: #99ffcc;
  font-size: 14px;
}

/* =========================================================
   🗺️ MAPA DE NIVELES — Cyberpunk PRO
   ========================================================= */

/* Contenedor del grupo */
.level-row-title {
  font-size: 16px;
  color: #00ff88;
  margin-bottom: 6px;
  text-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
  border-left: 3px solid rgba(0, 255, 136, 0.4);
  padding-left: 6px;
}

/* Contenedor de los niveles */
.level-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

/* Botones base */
.level-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(0, 255, 136, 0.35);
  background: #0f0f0f;
  color: #00ff88;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: 0.15s ease;
  box-shadow: 0 0 6px rgba(0, 255, 136, 0.15);
}

.level-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.35);
}

/* Nivel completado */
.level-btn.completed {
  background: #0d3a68;
  border-color: #1a7cff;
  color: #d6e7ff;
  box-shadow: 0 0 8px rgba(26, 124, 255, 0.4);
}

.level-btn.completed:hover {
  transform: scale(1.12);
  box-shadow: 0 0 12px rgba(26, 124, 255, 0.4);
}

/* Nivel disponible */
.level-btn.available {
  border-color: #00ff88;
  background: #112b20;
  color: #00ff88;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.35);
}

.level-btn.available:hover {
  transform: scale(1.18);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.55);
}

/* Nivel bloqueado */
.level-btn.locked {
  border-color: #333;
  background: #0a0a0a;
  color: #444;
  cursor: not-allowed;
  box-shadow: none;
}

.level-btn.locked:hover {
  transform: none;
  box-shadow: none;
}


/* =========================================================
   🎖 ACHIEVEMENTS
   ========================================================= */

.achievement {
  padding: 12px;
  background: #101010;
  border: 1px solid var(--neon-soft);
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.achievement-icon {
  width: 40px;
  height: 40px;
}

.achievement-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--neon);
}

.achievement-desc {
  font-size: 13px;
  opacity: 0.8;
}

/* =========================================================
   🟩 SUCCESS / ERROR EFFECTS
   ========================================================= */

body.success {
  background: #032615;
  transition: background 0.6s ease;
}

body.error {
  background: #260404;
  transition: background 0.6s ease;
}
/* =========================================================
   📝 TOOLTIP CYBERPUNK
   ========================================================= */

.level-btn {
  position: relative;
}

.level-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: #0b0b0b;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0,255,136,0.4);
  color: #c8ffe0;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(0,255,136,0.2);
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.level-btn:hover[data-tooltip]::after {
  opacity: 1;
  transform: translateX(-50%) translateY(2px);
}
@keyframes unlockPulse {
  0% { box-shadow: 0 0 6px rgba(0,255,136,0.2); }
  50% { box-shadow: 0 0 14px rgba(0,255,136,0.55); }
  100% { box-shadow: 0 0 6px rgba(0,255,136,0.2); }
}

.level-btn.available {
  animation: unlockPulse 1.6s infinite ease-in-out;
}
/* =========================================================
   🗺️ CONTENEDOR DEL MAPA (Pro, centrado, elegante)
   ========================================================= */

#levels-container {
  max-width: 700px;          /* para evitar que se estire demasiado */
  margin: 0 auto;            /* centrar */
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 30px;                 /* separación más elegante entre grupos */
}
.level-row-title {
  font-size: 18px;
  color: #00ff88;
  text-shadow: 0 0 6px rgba(0,255,136,0.6);
  letter-spacing: .5px;
  margin-bottom: 10px;

  border-left: 4px solid rgba(0,255,136,0.45);
  padding-left: 10px;
}

.level-row-title::after {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(90deg, #00ff88 0%, transparent 80%);
  margin-top: 6px;
  opacity: 0.4;
}
.level-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;     /* ⭐ centrado profesional */
  margin-top: 6px;
}
#screen-level-map {
  padding-top: 10px;
  padding-bottom: 25px;
}
#levels-container {
  box-shadow: 0 0 22px rgba(0,255,136,0.12);
  border: 1px solid rgba(0,255,136,0.15);
  border-radius: 10px;
  padding: 30px;
  background: rgba(10,10,10,0.6);
  backdrop-filter: blur(2px);
}
/* Loader neon minimal */
.level-map-loader {
  text-align: center;
  color: #00ff88;
  font-size: 16px;
  padding: 20px 0;
  opacity: 0.8;
  text-shadow: 0 0 8px rgba(0,255,136,0.6);
}

.level-map-loader::after {
  content: "•••";
  animation: blink 1s infinite alternate;
}

@keyframes blink {
  0% { opacity: 0.2; }
  100% { opacity: 1; }
}
