/* ===============================================================
   SELENE-7 · MANDOS COMUNES DE LA NAVE (común a todos los retos)
   Barra INFO · AYUDA · INICIO, ventanas propias, pantalla sin
   oxígeno y modos EXPLORADOR / MASTER. Ver comun/nave.js.
   Usa las variables de color de cada reto, con valores de reserva.
   =============================================================== */
.nave-mandos {
  --n-cian: var(--cian, #62dcff);
  --n-ambar: var(--ambar, #ffb13d);
  display: flex; align-items: stretch; gap: 6px; flex: none; margin-left: 4px;
}
.nave-mandos.flotante { position: fixed; top: 12px; right: 14px; z-index: 60; }
.nave-mando {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 44px; height: 44px; padding: 4px 6px; cursor: pointer; user-select: none;
  border: 1px solid var(--linea-2, rgba(126, 206, 255, .28)); border-radius: 3px;
  background: rgba(98, 220, 255, .05); color: var(--texto, #d7ecff);
  font: 500 8.5px/1 var(--f-ui, "Barlow Semi Condensed", "Segoe UI", sans-serif); letter-spacing: .2em;
  transition: transform .1s, border-color .2s, background .2s, box-shadow .2s;
}
.nave-mando svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nave-mando svg .lleno { fill: currentColor; stroke: none; }
.nave-mando:hover { border-color: var(--n-cian); background: rgba(98, 220, 255, .12); box-shadow: 0 0 16px rgba(98, 220, 255, .18); }
.nave-mando:active { transform: scale(.95); }
.nave-mando:focus-visible { outline: 1px solid var(--n-cian); outline-offset: 2px; }
.nave-mini { color: var(--texto-2, #9bb6cc); }

/* Idioma: ES | EN (comun/idioma.js), el primero de los mandos y en la pantalla de inicio */
.idioma-sel {
  display: inline-flex; align-self: center; flex: none; height: 30px;
  border: 1px solid var(--linea-2, rgba(126, 206, 255, .28)); border-radius: 3px; overflow: hidden;
  background: rgba(98, 220, 255, .05);
}
.idioma-sel button {
  min-width: 32px; padding: 0 7px; border: 0; background: none; cursor: pointer;
  color: var(--texto-2, #9bb6cc); font: 600 10.5px/1 var(--f-mono, Consolas, monospace); letter-spacing: .12em;
  transition: background .2s, color .2s;
}
.idioma-sel button + button { border-left: 1px solid var(--linea-2, rgba(126, 206, 255, .28)); }
.idioma-sel button:hover { color: var(--texto, #d7ecff); background: rgba(98, 220, 255, .12); }
.idioma-sel button.activo { color: #06121c; background: var(--cian, #62dcff); cursor: default; }
.idioma-sel button:focus-visible { outline: 1px solid var(--cian, #62dcff); outline-offset: -3px; }
/* En un reto, en el pie de la intro (a la izquierda) y en la cabecera de la ventana INFO (a la derecha) */
.nave-intro-modo .idioma-sel { margin-right: auto; height: 28px; }
.nave-cab .idioma-sel { height: 24px; }
.nave-cab .idioma-sel button { min-width: 28px; font-size: 9.5px; }
.nave-cab .nave-modo-txt { margin-left: auto; }

/* AYUDA: siempre el mismo «?» en un círculo, en ámbar para que se encuentre a la primera */
.nave-mando.nave-ayuda {
  flex-direction: row; gap: 9px; padding: 0 12px 0 9px; min-width: 150px; justify-content: flex-start;
  border-color: rgba(255, 177, 61, .6); background: linear-gradient(90deg, rgba(255, 177, 61, .16), rgba(255, 177, 61, .04)); color: #ffe0a8;
}
.nave-mando.nave-ayuda svg { width: 26px; height: 26px; color: var(--n-ambar); filter: drop-shadow(0 0 4px rgba(255, 177, 61, .5)); }
.nave-mando.nave-ayuda:hover { border-color: var(--n-ambar); background: linear-gradient(90deg, rgba(255, 177, 61, .26), rgba(255, 177, 61, .07)); box-shadow: 0 0 18px rgba(255, 177, 61, .25); }
.nave-mando.nave-ayuda:disabled { opacity: .38; cursor: default; box-shadow: none; }
.nave-ayuda-txt { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.nave-ayuda-txt b { font: 600 11px/1 var(--f-ui, sans-serif); letter-spacing: .18em; white-space: nowrap; }
.nave-ayuda-det { font: 500 10px/1 var(--f-mono, Consolas, monospace); letter-spacing: .02em; color: #c9a063; white-space: nowrap; }
.nave-ayuda-det:empty { display: none; }

/* Distintivo del modo */
.nave-modo {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; padding: 3px 6px 2px; vertical-align: 2px;
  border: 1px solid currentColor; border-radius: 2px; font: 600 8.5px/1 var(--f-mono, monospace); font-style: normal; letter-spacing: .16em;
}
.nave-modo svg { width: 9px; height: 9px; }
.nave-modo svg .lleno, .nave-btn-master svg .lleno, .nave-confirma h2 svg .lleno { fill: currentColor; }
.nave-modo.explorador { color: var(--cian, #62dcff); opacity: .8; }
.nave-modo.master { color: #ffd257; text-shadow: 0 0 8px rgba(255, 210, 87, .5); }

/* Pie de la intro: modo y acceso con código */
.nave-intro-modo { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--linea, rgba(126, 206, 255, .13)); font: 400 13px/1.3 var(--f-ui, sans-serif); color: var(--texto-2, #9bb6cc); }
.nave-intro-modo .nave-modo { margin-left: 0; font-size: 9.5px; padding: 4px 8px 3px; }
.nave-enlace { background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--texto-2, #9bb6cc); font: 500 11px/1 var(--f-mono, monospace); letter-spacing: .12em; text-decoration: underline; text-underline-offset: 4px; }
.nave-enlace:hover { color: #ffd257; }

/* Misión completada en MASTER: EXPLORADOR y MASTER en vez del botón de empezar de la intro (son copias suyas,
   con su mismo aspecto; MASTER, en dorado). El original se queda escondido */
#intro .nave-elegir-modo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
#intro .nave-elegir-modo .nave-elegir { margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
#intro .nave-elegir-modo .nave-elegir.master {
  border-color: rgba(255, 210, 87, .75); background: rgba(255, 210, 87, .12); color: #fff1c4;
  box-shadow: 0 0 22px rgba(255, 210, 87, .16), inset 0 0 16px rgba(255, 210, 87, .08);
}
#intro .nave-elegir-modo .nave-elegir.master svg { width: 15px; height: 15px; fill: #ffd257; filter: drop-shadow(0 0 4px rgba(255, 210, 87, .8)); }
.nave-oculto { display: none !important; }

/* ---------- Ventanas propias ---------- */
.nave-velo {
  position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(0, 4, 10, .74); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s;
}
.nave-velo.visible { opacity: 1; }
.nave-caja {
  position: relative; width: 100%; max-width: 640px; max-height: calc(100vh - 40px); overflow: auto; padding: 22px 30px 26px;
  background: rgba(4, 12, 21, .97); border: 1px solid var(--linea-2, rgba(126, 206, 255, .28)); box-shadow: 0 30px 90px rgba(0, 0, 0, .7);
  color: var(--texto, #d7ecff); font: 400 17px/1.5 var(--f-ui, "Barlow Semi Condensed", sans-serif);
  transform: translateY(10px); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.nave-velo.visible .nave-caja { transform: none; }
.nave-caja-peq { max-width: 460px; }
.nave-x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 3px; background: none; color: var(--texto-2, #9bb6cc); cursor: pointer; }
.nave-x:hover { border-color: var(--linea-2, rgba(126, 206, 255, .28)); color: var(--texto, #fff); }
.nave-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.nave-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 40px 16px 0; padding-bottom: 12px; border-bottom: 1px solid var(--linea, rgba(126, 206, 255, .13)); font: 500 10.5px/1 var(--f-mono, monospace); letter-spacing: .16em; color: var(--cian, #62dcff); }
.nave-cab > span:first-child { display: flex; align-items: center; gap: 8px; }
.nave-cab svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.nave-cab svg .lleno { fill: currentColor; stroke: none; }
.nave-modo-txt.master { color: #ffd257; }
.nave-modo-txt.explorador { color: var(--texto-2, #9bb6cc); }

/* Contenido del resumen (lo escribe cada reto en <template id="info-reto">) */
.nave-info h2 { margin: 4px 0 14px; font: 400 24px/1.2 var(--f-titulo, "Michroma", sans-serif); letter-spacing: .1em; color: var(--cian-2, #b8f2ff); }
.nave-info p { margin: 0 0 10px; color: var(--texto-2, #9bb6cc); }
.nave-info b { color: var(--texto, #fff); font-weight: 600; }
.nave-info ul, .nave-info ol { margin: 0 0 12px; padding-left: 22px; color: var(--texto-2, #9bb6cc); }
.nave-info li { margin: 0 0 7px; }
.nave-info li::marker { color: var(--cian, #62dcff); }
.nave-info .nave-etq { display: block; margin: 14px 0 6px; font: 600 10px/1 var(--f-mono, monospace); letter-spacing: .2em; color: var(--cian, #62dcff); }
.nave-info .nave-etq.ambar { color: var(--ambar, #ffb13d); }
.nave-info img { max-width: 100%; border-radius: 2px; }
.nave-info kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--linea-2, rgba(126, 206, 255, .28)); border-radius: 3px; font: 500 .85em/1.4 var(--f-mono, monospace); color: var(--texto, #fff); }

.nave-confirma h2 { display: flex; align-items: center; gap: 10px; margin: 2px 40px 12px 0; font: 400 20px/1.25 var(--f-titulo, "Michroma", sans-serif); letter-spacing: .1em; color: var(--cian-2, #b8f2ff); }
.nave-confirma h2 svg { width: 20px; height: 20px; color: #ffd257; }
.nave-confirma h2 svg.aviso { flex: none; width: 24px; height: 24px; color: var(--rojo, #ff5a4e); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(255, 90, 78, .5)); }
.nave-confirma h2 svg.aviso .lleno { fill: currentColor; stroke: none; }
.nave-confirma p { margin: 0 0 18px; color: var(--texto-2, #9bb6cc); }
.nave-codigo {
  width: 100%; padding: 12px 14px; border: 1px solid var(--linea-2, rgba(126, 206, 255, .28)); border-radius: 2px; outline: none;
  background: rgba(98, 220, 255, .06); color: var(--texto, #fff); font: 500 26px/1 var(--f-mono, monospace); letter-spacing: .4em; text-align: center;
}
.nave-codigo:focus { border-color: #ffd257; box-shadow: 0 0 16px rgba(255, 210, 87, .2); }
.nave-error { min-height: 22px; margin-top: 8px; font: 500 12px/1.6 var(--f-mono, monospace); letter-spacing: .1em; color: var(--rojo, #ff4d4d); }
.nave-confirma.temblor { animation: nave-temblor .4s; }
@keyframes nave-temblor { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.nave-botones { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.nave-botones.centro { justify-content: center; margin-top: 20px; }
.nave-btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 12px 20px; cursor: pointer; border-radius: 2px;
  font: 600 13px/1 var(--f-ui, sans-serif); letter-spacing: .2em; text-transform: uppercase;
  border: 1px solid rgba(77, 255, 160, .65); background: rgba(77, 255, 160, .12); color: #e3fff0;
  box-shadow: 0 0 22px rgba(77, 255, 160, .14);
  transition: filter .15s, transform .08s;
}
.nave-btn:hover { filter: brightness(1.25); }
.nave-btn:active { transform: scale(.97); }
.nave-btn.sec { border-color: var(--linea-2, rgba(126, 206, 255, .28)); background: rgba(98, 220, 255, .05); color: var(--texto, #d7ecff); box-shadow: none; }
.nave-btn.peligro { border-color: rgba(255, 90, 78, .75); background: rgba(255, 90, 78, .14); color: #ffe3e0; box-shadow: 0 0 22px rgba(255, 90, 78, .16); }
.nave-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* «Repetir en modo MASTER» (pantalla de éxito, solo en EXPLORADOR) */
.nave-btn-master {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 2px; text-decoration: none; cursor: pointer;
  border: 1px solid rgba(255, 210, 87, .7); background: linear-gradient(90deg, rgba(255, 210, 87, .18), rgba(255, 210, 87, .05)); color: #ffe9a8;
  font: 600 13px/1 var(--f-ui, sans-serif); letter-spacing: .18em; box-shadow: 0 0 22px rgba(255, 210, 87, .15);
  transition: filter .15s, transform .08s;
}
.nave-btn-master:hover { filter: brightness(1.2); }
.nave-btn-master:active { transform: scale(.97); }
.nave-btn-master svg { flex: none; width: 18px; height: 18px; color: #ffd257; filter: drop-shadow(0 0 4px rgba(255, 210, 87, .7)); }
.nave-btn-master span { display: flex; flex-direction: column; gap: 5px; text-align: left; }
.nave-btn-master small { font: 500 10px/1 var(--f-mono, monospace); letter-spacing: .06em; text-transform: none; color: #cfae5a; }

/* La barra superior nunca debe ensanchar la página: la rejilla de cada reto no pasa del ancho de la ventana */
#app { grid-template-columns: minmax(0, 1fr); }
#barra { min-width: 0; }

/* Pantallas estrechas (portátiles de 1366 px con la barra llena) */
@media (max-width: 1400px) {
  .nave-mando .nave-mini { display: none; }
  .nave-mando { min-width: 40px; height: 40px; }
  .nave-mando.nave-ayuda { min-width: 0; padding: 0 10px 0 7px; }
  #barra { gap: 20px; }
}
@media (max-width: 1300px) {
  #barra { gap: 14px; }
  .nave-mandos .nave-ayuda-det { display: none; }
}

/* Aviso del atajo secreto Mayús+0 (armado / desarmado): arriba en el centro, se va solo */
.nave-aviso-atajo { position: fixed; left: 50%; top: 76px; z-index: 2100; display: flex; align-items: center; gap: 10px; padding: 10px 16px; transform: translateX(-50%); background: rgba(30, 22, 2, .94); border: 1px solid rgba(255, 210, 87, .7); box-shadow: 0 10px 40px rgba(0, 0, 0, .6), 0 0 24px rgba(255, 210, 87, .2); color: #ffe39a; font: 600 11px/1.2 var(--f-mono, monospace); letter-spacing: .16em; pointer-events: none; animation: nave-aviso-atajo 3.5s ease both; }
.nave-aviso-atajo svg { flex: none; width: 15px; height: 15px; fill: #ffd257; }
@keyframes nave-aviso-atajo { 0% { opacity: 0; transform: translate(-50%, -8px); } 8%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
