/* =========================================================================
   LA TORRE — panel de Top, Misiones, Album y Vitrina (Fase 4)
   ========================================================================= */
#tower-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(5, 8, 16, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.tw-box {
  width: min(760px, 96vw);
  height: min(620px, 94vh);
  display: flex;
  flex-direction: column;
  background: #111827;
  border: 3px solid #e6b83a;
  box-shadow: 0 8px 0 #05070a;
  color: #e6edf2;
  font-family: 'Silkscreen', monospace;
}

.tw-head, .tw-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 2px solid #05070a;
}

.tw-tabs { justify-content: flex-start; flex-wrap: wrap; }
.tw-title-main { color: #ffec94; font-size: 14px; }

.tw-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tw-body > * { flex-shrink: 0; }

.tw-card {
  background: #10171f;
  border: 2px solid #283947;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tw-card.is-ready, .tw-card.is-next { border-color: #e6b83a; background: #1c190d; }
.tw-card.is-done { opacity: 0.6; }

.tw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tw-title { font-size: 11px; font-weight: 700; color: #ffec94; }
.tw-text { font-size: 10px; font-weight: 700; color: #eef4f8; line-height: 1.35; }
.tw-sub { font-size: 9px; color: #9eb3bf; line-height: 1.4; }
.tw-tag { font-size: 9px; color: #6ce8e8; }
.tw-reward { font-size: 9px; color: #4ce668; text-align: right; }
.tw-count { font-size: 9px; color: #cbd5e1; }

.tw-track {
  flex: 1;
  height: 7px;
  background: #070a0e;
  border: 1px solid #263542;
  overflow: hidden;
}

.tw-fill { height: 100%; background: #6ce8e8; }
.tw-mission.is-ready .tw-fill { background: #e6b83a; }

.tw-btn {
  font-family: 'Silkscreen', monospace;
  font-weight: 700;
  font-size: 10px;
  color: #dce6ed;
  background: #1c2933;
  border: 2px solid #05070a;
  box-shadow: inset 1px 1px 0 #415969;
  padding: 4px 8px;
  cursor: pointer;
}

.tw-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.tw-btn.is-active { background: #1a5463; color: #c2ffff; border-color: #6ce8e8; }
.tw-btn.is-gold { background: #4d3916; color: #ffec94; }
.tw-btn.is-green { background: #1b4d2b; color: #88ffa0; }
.tw-btn.is-red { background: #3d1414; color: #ff9c94; }

.tw-album { width: 100%; border-collapse: collapse; font-size: 9px; text-align: center; }
.tw-album th, .tw-album td { border: 1px solid #283947; padding: 3px 4px; }
.tw-album td.is-have { color: #ffec94; background: #1c190d; }
.tw-album td.is-na { color: #475569; background: #0b0f16; }

.tw-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tw-chip { font-size: 9px; padding: 3px 6px; border: 1px solid #334155; color: #64748b; }
.tw-chip.is-have { border-color: #f59e0b; color: #fde68a; }

.tw-goals, .tw-trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.tw-trophy { flex-direction: row; align-items: center; gap: 8px; }

/* Copa pixel hecha solo con sombras */
.tw-cup {
  width: 14px;
  height: 10px;
  flex-shrink: 0;
  margin: 0 2px 6px;
  background: var(--cup);
  box-shadow: -3px 0 0 -1px var(--cup), 3px 0 0 -1px var(--cup), 0 6px 0 -4px var(--cup);
  border-bottom: 2px solid rgba(0, 0, 0, 0.35);
}

/* ---------------- Avisos apilados ---------------- */
#tower-banners {
  position: fixed;
  top: 54px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1300;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.tower-banner {
  pointer-events: auto;
  max-width: min(520px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  background: #1c190d;
  border: 2px solid #e6b83a;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.7);
  color: #f8fafc;
  font-family: 'Silkscreen', monospace;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
}

.tower-banner strong { color: #ffec94; }

/* ---------------- Hub: siguiente rival y accesos ---------------- */
.esc-tower-strip {
  position: absolute;
  top: 6px;
  left: 384px; /* a la derecha del portapapeles (acaba en 370px) */
  z-index: 30;
  display: flex;
  gap: 6px;
  align-items: center;
}

.esc-tower-strip .tw-btn { font-size: 9px; padding: 3px 7px; }
.esc-tower-strip .esc-rival-next { color: #ffec94; border-color: #e6b83a; }
.esc-tower-strip .esc-special-flag { color: #fecaca; background: #3d1414; border-color: #f87171; }

/* ---------------- Agencia: tablero lateral y barra de informacion ------- */
.iso-tasks-body .tw-card { flex-shrink: 0; }

.iso-term {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 21;
  max-width: min(640px, calc(100% - 20px));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  background: rgba(14, 20, 26, 0.94);
  border: 2px solid #05070a;
  font-size: 9px;
  line-height: 1.4;
  color: #cbd5e1;
  pointer-events: none;
}

.iso-term #termBadge { color: #ffec94; font-weight: 700; white-space: nowrap; }
.iso-bonus { font-size: 9px; color: #4ce668; line-height: 1.35; }
.iso-bonus-state { font-size: 8px; color: #8aa3b5; }
