/* ===================================================================
   modal.css — Modal de decisiones/informes + overlay "eject".
   =================================================================== */

/* ---------- Modal background y caja --------------------------- */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 16, .72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(2px);
}
.modal-bg.show { display: flex; }

.modal {
  background: var(--bg-frame);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 26px 18px;
  width: min(506px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  color: var(--text);
  animation: modalIn .18s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1);   }
}
.modal h3 {
  margin: 0 0 10px;
  font-size: 17px;
  color: var(--text);
}
.modal p { margin: 8px 0; font-size: 13px; color: var(--text-soft); line-height: 1.45; }
.modal p strong { color: var(--text); }
.modal hr {
  border: 0;
  border-top: 1px solid var(--border-soft);
  margin: 14px 0;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}
.choice {
  display: block;
  text-align: left;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.choice:hover { background: var(--bg-card-2); }
.choice.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.choice.primary:hover { filter: brightness(1.06); }
.choice .hint {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-mute);
}
.choice.primary .hint { color: rgba(255,255,255,.78); }

/* ---------- "Cómo voy" / informes diarios: tabla semanal ------ */
.status-block-title {
  margin: 6px 0 8px;
  font-size: 14px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-sep {
  border: 0;
  border-top: 1px dashed var(--border-soft);
  margin: 16px 0 12px;
}
.status-week-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 6px;
}
.status-week-table th,
.status-week-table td {
  text-align: left;
  padding: 5px 7px;
  border-bottom: 1px solid var(--border-soft);
}
.status-week-table th {
  font-weight: 600;
  color: var(--text-mute);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-week-table tr.today td {
  background: var(--accent-soft);
  color: #fff;
}

/* Marca de "rodada perdida" en informes (rojo) */
.report-lost {
  color: var(--bad);
  font-weight: 700;
}

/* ---------- Overlay "Te mandan para casa" -------------------- */
/* Fondo amarillo cálido + texto marrón: la jornada terminó, pero
   sin dramatismo rojo. Igual sigue siendo grave (cuenta como serious
   en el log de eventos), pero la lectura visual es más amable. */
.eject-overlay {
  position: fixed;
  inset: 0;
  background: #f3c01a;        /* amarillo base */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
.eject-overlay.show {
  visibility: visible;
  pointer-events: auto;
  animation: ejectFlash 2.5s ease-in-out forwards;
}
.eject-text {
  color: #5a3a14;             /* marrón cálido legible sobre amarillo */
  font-weight: 800;
  font-size: clamp(28px, 5vw, 56px);
  letter-spacing: .02em;
  text-align: center;
  padding: 0 24px;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
@keyframes ejectFlash {
  0%   { opacity: 0; background: #d9a30a; }
  10%  { opacity: 1; background: #ffd440; }
  60%  { opacity: 1; background: #f3c01a; }
  100% { opacity: 0; background: #d9a30a; }
}

/* ---------- Char-picker dentro del modal --------------------------
   Reusa el patrón visual del welcome del N1 pero adaptado al tema del
   N2 (variables --bg-card, --border-soft, --accent). El modal monta el
   HTML inline desde main.js; aquí solo estilamos el grid + cards. */
.modal .char-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 4px 0 6px;
}
.modal .char-card {
  appearance: none;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--r-md);
  padding: 10px 6px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font: inherit;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.modal .char-card:hover    { background: var(--bg-card-2); transform: translateY(-1px); }
.modal .char-card img      { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; pointer-events: none; }
.modal .char-card .char-name { font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.modal .char-card.is-active {
  border-color: var(--accent);
  background: var(--bg-card-2);
  box-shadow: 0 4px 14px rgba(123,93,190,.22);
}
.modal .char-card.is-active .char-name { color: var(--accent); }

/* ---------- Intro / Cómo se juega (carrusel multi-slide) -------------
   Overlay full-screen con una tarjeta central que contiene varias
   <section.n2-slide>. Solo .is-active es visible; las demás están
   display:none. Footer con dots + Anterior/Siguiente/Empezar.
*/
.n2-intro {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 16, .85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;        /* por encima del modal normal (200) */
  backdrop-filter: blur(3px);
  padding: 16px;
}
.n2-intro[hidden] { display: none; }

.n2-intro-card {
  background: var(--bg-frame);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-modal);
  color: var(--text);
  width: min(560px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn .22s ease-out;
}

.n2-intro-title {
  margin: 0;
  padding: 18px 22px 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.n2-intro-track {
  padding: 10px 22px 4px;
  flex: 1 1 auto;
  overflow-y: auto;
}

.n2-slide { display: none; }
.n2-slide.is-active { display: block; animation: slideIn .25s ease-out; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.n2-slide-icon {
  font-size: 44px;
  line-height: 1;
  text-align: center;
  margin: 10px 0 12px;
}
.n2-slide-title {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  line-height: 1.25;
}
.n2-slide-body {
  margin: 0 auto;
  max-width: 460px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-soft);
  text-align: center;
}
.n2-slide-body strong { color: var(--text); font-weight: 700; }
.n2-slide-body em     { font-style: italic; color: #d77; }

.n2-slide-keys {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 14px 0 4px;
  flex-wrap: wrap;
}
.n2-slide-keys .kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  font: 700 12px/1 ui-monospace, Menlo, Consolas, monospace;
  color: var(--text);
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
}
.n2-slide-keys .kbd-wide { min-width: 64px; }
.n2-slide-keys .kbd-sep  { color: var(--text-soft); padding: 0 4px; font-weight: 700; }

.n2-intro-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-frame);
}
.n2-intro-foot .n2-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto;          /* empuja Anterior a la izquierda y Sig/Empezar a la derecha */
}
.n2-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  background: var(--border);
  border: 0;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.n2-dot:hover         { background: var(--text-soft); }
.n2-dot.is-active     { background: var(--accent); transform: scale(1.25); }

.n2-intro-btn {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  transition: background .12s ease, transform .12s ease, opacity .12s ease;
}
.n2-intro-btn[hidden]   { display: none; }
.n2-intro-btn:disabled  { opacity: .4; cursor: not-allowed; }
.n2-intro-btn-ghost {
  background: var(--bg-card);
  color: var(--text);
}
.n2-intro-btn-ghost:hover:not(:disabled) { background: var(--bg-card-2); }
.n2-intro-btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(123,93,190,.32);
  animation: introPulse 1.6s ease-in-out infinite;
}
.n2-intro-btn-primary:hover { transform: translateY(-1px); }
@keyframes introPulse {
  0%, 100% { box-shadow: 0 2px  8px rgba(123,93,190,.30); }
  50%      { box-shadow: 0 4px 18px rgba(123,93,190,.60); }
}

/* ---------- Pregunta de control (gate antes de empezar el día) -------
   Overlay full-screen con tarjeta centrada. Solo .show la hace visible.
   Diseño coherente con el resto de N2 (tema oscuro).
*/
.question-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 16, .85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 310;        /* por encima del intro (300) y del modal (200) */
  backdrop-filter: blur(3px);
  padding: 16px;
}
.question-overlay.show { display: flex; }

.question-card {
  background: var(--bg-frame);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-modal);
  color: var(--text);
  width: min(560px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: modalIn .22s ease-out;
}
.question-card .q-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.question-card .q-sub {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.5;
}
.question-card .q-stem {
  margin: 6px 0 2px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  line-height: 1.45;
}
.question-card .q-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 2px 0;
}
.question-card .q-opt {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: var(--r-md);
  padding: 11px 13px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color .12s ease, background .12s ease;
}
/* Estados de la opción del quiz — borde de 2px en estados activos
   para que se distingan claramente del default sobre el tema oscuro.
   El padding se reduce a 10px/12px en .on/.right/.wrong para compensar
   el grosor extra del borde y evitar que la opción "salte" de tamaño. */
.question-card .q-opt:hover     { border-color: var(--accent); background: var(--bg-card-2); }
.question-card .q-opt.on        { border: 2px solid var(--accent); background: rgba(123,93,190,.28); padding: 10px 12px; font-weight: 600; }
.question-card .q-opt.right     { border: 2px solid #2EE07A; background: rgba(22,163,74,.38); color: #e8ffe9; padding: 10px 12px; font-weight: 700; }
.question-card .q-opt.wrong     { border: 2px solid #FF6B6E; background: rgba(229,72,77,.40); color: #ffe6e6; padding: 10px 12px; font-weight: 700; }
.question-card .q-opt[disabled] { cursor: default; opacity: .85; }

.question-card .q-feedback {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  margin: 4px 0 0;
  min-height: 18px;
}
.question-card .q-feedback.good { color: #6ee7a3; }
.question-card .q-feedback.bad  { color: #ff8a8a; font-weight: 600; }

.question-card .q-confirm {
  align-self: flex-end;
  appearance: none;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--r-md);
  padding: 10px 22px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(123,93,190,.32);
  transition: background .12s ease, transform .12s ease, opacity .12s ease;
}
.question-card .q-confirm:disabled {
  background: var(--bg-card-2);
  color: var(--text-soft);
  box-shadow: none;
  cursor: not-allowed;
}
.question-card .q-confirm:not(:disabled):hover { transform: translateY(-1px); }
