/* === NIGHT STAGE: Full-Width 60FPS Corridor Auto-Battler + Command Dock === */
.night-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 172px;
  height: 100%;
  min-height: 0;
  background: #120D1A;
  overflow: hidden;
}

.battle-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1F162D 0%, #0E0916 100%);
  overflow: hidden;
}

#battleCanvas {
  width: 100%;
  height: 100%;
  max-width: 1440px;
  object-fit: contain;
  display: block;
}

/* Floating Non-Intrusive Top Strips inside Battle Viewport */
.battle-hud-top {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
  z-index: 6;
}

.wave-banner {
  pointer-events: auto;
  background: rgba(16, 11, 25, 0.88);
  border: 1.5px solid #594473;
  border-radius: 10px;
  padding: 7px 13px;
  max-width: 560px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.wave-banner-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wave-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--stamp-red);
  color: #FFF;
}

.wave-tag.boss { background: #0284C7; }

.wave-name {
  font-family: var(--font-display);
  font-size: 16px;
  color: #FFF4DC;
}

.wave-intel {
  margin-top: 3px;
  font-size: 11.5px;
  color: #CFC3DC;
  line-height: 1.35;
}

.battle-controls {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 7px;
}

.speed-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1.5px solid #55456F;
  background: rgba(24, 17, 36, 0.9);
  color: var(--text-light);
  font-size: 12px;
  font-weight: 800;
}

.speed-btn.active {
  border-color: var(--gold-brass);
  background: #3E2A54;
  color: var(--gold-brass);
}

.prep-tip-bar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 12, 28, 0.9);
  border: 1px solid var(--gold-brass);
  border-radius: 99px;
  padding: 5px 16px;
  font-size: 12px;
  font-weight: 700;
  color: #FFE7A8;
  pointer-events: none;
  z-index: 6;
}

/* === Bottom Command Dock === */
.command-dock {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 295px;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #1E162B 0%, #130E1D 100%);
  border-top: 2px solid #4A3863;
  min-height: 0;
  overflow: hidden;
}

.dock-panel {
  background: rgba(12, 8, 19, 0.72);
  border: 1px solid #3D2E54;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
}

.dock-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--gold-brass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.synergy-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.syn-active-card {
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--gold-brass);
  font-size: 11px;
  line-height: 1.3;
}

.syn-active-card b { color: #FFF5DC; display: block; }
.syn-active-card span { color: #BFB2CE; font-size: 10.5px; }

/* Squad Status Cards */
.squad-cards {
  flex: 1;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.unit-mini-card {
  flex: 0 0 132px;
  background: #1F172D;
  border: 1.5px solid #46375E;
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  text-align: left;
  color: var(--text-light);
  transition: transform 0.12s, border-color 0.12s;
}

.unit-mini-card:hover {
  border-color: var(--gold-brass);
  transform: translateY(-2px);
}

.unit-mini-card.slacking { border-color: #3EC9C4; background: #182936; }
.unit-mini-card.angry { border-color: #FF5252; background: #331722; }
.unit-mini-card.defected { border-color: #5CC8FF; opacity: 0.65; }
.unit-mini-card.dead { opacity: 0.42; filter: grayscale(0.8); }

.umc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 800;
}

.umc-state {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}

.umc-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mini-bar-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  color: #B9ABC9;
}

.mini-track {
  flex: 1;
  height: 6px;
  background: #100B18;
  border-radius: 99px;
  overflow: hidden;
}

.mini-fill-hp { height: 100%; background: #2EB872; }
.mini-fill-grudge { height: 100%; background: linear-gradient(90deg, #F59E0B, #EF4444); }

.umc-action-hint {
  font-size: 10px;
  color: #FFD97D;
  font-weight: 700;
}

/* Red Packet + Live Log Column */
.redpacket-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.redpacket-btn {
  padding: 9px 12px;
  border-radius: 10px;
  border: 2px solid #FFE28A;
  background: linear-gradient(180deg, #E53935 0%, #A9191E 100%);
  color: #FFF9E6;
  font-size: 13.5px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(229, 57, 53, 0.38);
  transition: transform 0.1s, filter 0.12s;
  flex-shrink: 0;
}

.redpacket-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.redpacket-btn:active:not(:disabled) { transform: translateY(2px); }
.redpacket-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.battle-log-box {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: rgba(12, 8, 19, 0.78);
  border: 1px solid #3D2E54;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 11px;
  line-height: 1.42;
}

.log-line { color: #CFC3DC; margin-bottom: 3px; }
.log-line.danger { color: #FF8792; font-weight: 700; }
.log-line.warn { color: #FFD166; }
.log-line.good { color: #6EF0AD; }

@media (max-height: 760px) {
  .night-stage { grid-template-rows: minmax(0, 1fr) 148px; }
  .command-dock { padding: 7px 10px; grid-template-columns: 205px minmax(0, 1fr) 265px; }
}
