/* =========================================================================
   6. MODALES PIXEL ART
   ========================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 14, 26, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 16px;
}
.modal-backdrop.open {
  display: flex;
  animation: modalFadeIn 0.18s ease-out;
}

/* Tarjetas del tutorial */
.tut-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(7, 10, 20, 0.84);
}
.tut-box {
  width: min(520px, 94vw);
  padding: 16px 18px;
  text-align: center;
  color: #f8fafc;
  background: #131b30;
  border: 3px solid #facc15;
  box-shadow: 0 10px 0 #090c17;
  font-family: var(--font-pixel, monospace);
  font-size: 11px;
  line-height: 1.55;
}
.tut-box p { margin: 6px 0; }
.tut-title { color: #fde047; font-size: 13px; font-weight: 900; margin-bottom: 10px; }
.tut-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.tut-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.tut-cand { display: flex; flex-direction: column; gap: 4px; padding: 8px; background: #0b1224; border: 2px solid #475569; }
.tut-cand small { color: #cbd5e1; font-size: 9px; }

.modal-backdrop.open .modal-window {
  animation: modalPopIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPopIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-window {
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-narrow { max-width: 520px; }

.modal-header {
  background: var(--slate-lo);
  color: #ffffff;
  border-bottom: 4px solid var(--ink);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.modal-title {
  font-family: var(--font-pixel);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-close-btn { width: 32px; height: 32px; font-size: 11px; padding: 0; flex-shrink: 0; }

.modal-body {
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-caption { font-family: var(--font-pixel); font-size: 9px; color: #4c587a; }

.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.stat-tile {
  background: var(--cream-hi);
  border: 3px solid var(--ink);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-tile-lbl { font-size: 10px; color: #5a6988; }
.stat-tile-val { font-family: var(--font-pixel); font-size: 13px; color: var(--ink); }

.history-wrap {
  background: var(--cream-hi);
  border: 3px solid var(--ink);
  max-height: 200px;
  overflow-y: auto;
}

.reset-zone {
  border-top: 3px dashed var(--cream-deep);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reset-confirm-box {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: #ffe0e2;
  border: 3px solid var(--ink);
  padding: 8px 10px;
}
.reset-confirm-box.show { display: flex; }
.reset-warn-txt { font-family: var(--font-pixel); font-size: 9px; color: var(--red-lo); }
.reset-btn-group { display: flex; gap: 8px; }

.rules-list { display: flex; flex-direction: column; gap: 8px; font-family: var(--font-mono); font-size: 21px; }
.rule-item {
  background: var(--cream-hi);
  border: 3px solid var(--ink);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rule-num {
  font-family: var(--font-pixel);
  font-size: 10px;
  background: var(--gold);
  border: 2px solid var(--ink);
  padding: 5px 7px;
}

.keys-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: var(--font-mono); font-size: 19px; }
.key-row {
  background: var(--navy);
  color: #ffffff;
  border: 3px solid var(--ink);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kbd-tag {
  font-family: var(--font-pixel);
  font-size: 8px;
  background: var(--cream);
  color: var(--ink);
  padding: 3px 5px;
  border: 2px solid var(--ink);
}

/* Pantalla de Resultados Estilo Fiesta 3DS */

.end-party-header {
  background: var(--shell-gold);
  color: var(--ink);
  border-bottom: 4px solid var(--ink);
  box-shadow: inset 0 3px 0 var(--shell-hi);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-pixel);
  font-size: 12px;
  text-transform: uppercase;
}

.party-diamond {
  width: 10px;
  height: 10px;
  background: var(--blue);
  border: 2px solid var(--ink);
  transform: rotate(45deg);
  display: inline-block;
}

.end-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.end-action-btn { height: 50px; font-size: 11px; }

/* Editor de Avatar Mii */

.avatar-preview-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.avatar-stage {
  width: 144px;
  height: 144px;
  background: #7888a6;
  border: 4px solid var(--ink);
  box-shadow: inset 3px 3px 0 #9aa9c4, inset -3px -3px 0 #4d5b85;
  display: flex;
  align-items: center;
  justify-content: center;
}

#avatar-preview-canvas {
  width: 128px;
  height: 128px;
}

.avatar-mood-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

/* =========================================================================
   7. RESPONSIVE MOVIL (< 850px): APILADO VERTICAL LIMPIO SIN SCROLL HORIZONTAL
   ========================================================================= */
@media (max-width: 850px) {
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

  .console-viewport {
    width: 100vw;
    height: 100vh;
    padding: 0;
    align-items: stretch;
  }

  .console-shell {
    width: 100%;
    max-width: 100%;
    height: 100%;
    padding: 0;
  }

  #app {
    height: 100%;
    overflow: hidden;
  }

  

  #menu-scene {
    width: 192px;
    height: 144px;
  }

  .dual-screen-layout {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }

  .left-hud {
    grid-template-columns: 1fr 1fr;
  }
  .hud-menu-btn {
    grid-column: 1 / 2;
    height: 36px;
  }
  .hud-timer-box {
    grid-column: 2 / 3;
    min-width: 0;
  }

  

  .crt-screen-wrap {
    min-height: 220px;
    width: 100%;
  }

  #chart-canvas {
    max-width: 100%;
  }

  .analysts-floor {
    height: 82px;
    padding: 24px 4px 2px;
    gap: 2px;
  }
  
  .analyst-name {
    font-size: 5px;
  }
  
  

    grid-template-columns: minmax(0, 1fr);
  }

  

  

  

  
  
  .draft-cards-grid {
    grid-template-columns: minmax(0, 1fr);
  }

.draft-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.draft-card {
  background: var(--navy);
  color: var(--cream);
  border: 4px solid var(--ink);
  box-shadow: inset 3px 3px 0 var(--slate), 0 5px 0 var(--ink);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
}
.draft-card:hover {
  border-color: var(--gold-hi);
  background: #1b2442;
}

