/* ===================================================================
   MORDHEIM CAMPAIGN MANAGER - LIVE BATTLE STYLES
   FEAT-BAT01/02/03 + Post-Battle Spectator
   =================================================================== */

/* ===================================================================
   JOIN BANNER
   =================================================================== */

.battle-join-banner {
  position: relative; overflow: hidden;
  margin-bottom: 24px; border-radius: 12px;
  border: 2px solid rgba(201, 169, 89, 0.5);
  background: linear-gradient(135deg, rgba(139, 0, 0, 0.2) 0%, rgba(42, 32, 32, 0.9) 50%, rgba(139, 0, 0, 0.15) 100%);
  animation: joinSlideIn 0.5s ease-out;
}
@keyframes joinSlideIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

.bjb-glow {
  position: absolute; top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: 13px; z-index: 0; opacity: 0.5; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(201, 169, 89, 0.4) 25%, rgba(201, 169, 89, 0.7) 50%, rgba(201, 169, 89, 0.4) 75%, transparent 100%);
  background-size: 200% 100%; animation: joinGlow 3s ease-in-out infinite;
}
@keyframes joinGlow { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.bjb-content {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 20px; padding: 20px 24px;
  background: linear-gradient(135deg, rgba(42, 32, 32, 0.95), rgba(30, 25, 25, 0.98)); border-radius: 10px;
}
.bjb-icon { font-size: 2.5rem; flex-shrink: 0; animation: bjbPulse 2s ease-in-out infinite; }
@keyframes bjbPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.bjb-text { flex: 1; min-width: 0; }
.bjb-title { font-family: 'Cinzel', serif; font-size: 1.15rem; font-weight: 700; color: var(--color-gold, #c9a959); margin-bottom: 8px; text-shadow: 0 2px 8px rgba(201, 169, 89, 0.3); }
.bjb-matchup { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.bjb-wb1 { font-family: 'Cinzel', serif; font-weight: 600; color: var(--color-gold, #c9a959); font-size: 1rem; }
.bjb-vs { font-family: 'Cinzel', serif; font-weight: 700; color: var(--text-muted, #888); font-size: 0.8rem; }
.bjb-wb2 { font-family: 'Cinzel', serif; font-weight: 600; color: #c45050; font-size: 1rem; }
.bjb-scenario { font-size: 0.85rem; color: var(--text-muted, #aaa); }

.bjb-actions {
  display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0;
}

.bjb-kill-btn {
  padding: 6px 12px; background: rgba(100,100,100,0.2);
  border: 1px solid rgba(100,100,100,0.3); border-radius: 6px;
  color: var(--text-muted, #888); font-size: 0.8rem; cursor: pointer;
  transition: all 0.2s ease;
}
.bjb-kill-btn:hover { background: rgba(220,38,38,0.2); border-color: rgba(220,38,38,0.5); color: #ef4444; }

.abc-kill-btn {
  padding: 4px 10px; background: rgba(100,100,100,0.15);
  border: 1px solid rgba(100,100,100,0.25); border-radius: 5px;
  color: var(--text-muted, #888); font-size: 0.75rem; cursor: pointer;
  transition: all 0.2s ease; margin-left: 6px;
}
.abc-kill-btn:hover { background: rgba(220,38,38,0.2); border-color: rgba(220,38,38,0.5); color: #ef4444; }

.bjb-join-btn {
  flex-shrink: 0; padding: 14px 28px;
  background: linear-gradient(135deg, #8B0000, #a01010);
  border: 2px solid var(--color-gold, #c9a959); border-radius: 10px;
  color: var(--color-gold, #c9a959); font-family: 'Cinzel', serif;
  font-size: 1.05rem; font-weight: 700; cursor: pointer;
  transition: all 0.25s ease; box-shadow: 0 4px 16px rgba(139, 0, 0, 0.4);
  animation: joinBtnGlow 2s ease-in-out infinite;
}
@keyframes joinBtnGlow { 0%, 100% { box-shadow: 0 4px 16px rgba(139, 0, 0, 0.4); } 50% { box-shadow: 0 4px 24px rgba(201, 169, 89, 0.4), 0 0 40px rgba(139, 0, 0, 0.3); } }
.bjb-join-btn:hover { background: linear-gradient(135deg, #a01010, #c01818); transform: translateY(-2px) scale(1.02); }

/* ===================================================================
   LIVE INDICATOR
   =================================================================== */

.battle-live-indicator {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px;
  background: rgba(220, 38, 38, 0.15); border: 1px solid rgba(220, 38, 38, 0.4);
  border-radius: 20px; position: absolute; top: 12px; right: 12px; z-index: 50;
  font-size: 0.8rem; letter-spacing: 1px; animation: liveFade 0.6s ease-out;
}
@keyframes liveFade { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.battle-screen, .pbw-container { position: relative; }

.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.7); animation: livePulse 1.5s ease-in-out infinite; flex-shrink: 0; }
@keyframes livePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(1.3); } }
.live-text { font-family: 'Cinzel', serif; font-weight: 700; color: #ef4444; text-transform: uppercase; }
.live-role { color: var(--text-muted, #888); font-family: 'Lato', sans-serif; font-weight: 400; font-size: 0.75rem; letter-spacing: 0; margin-left: 4px; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, 0.15); }
.battle-live-indicator.disconnected .live-dot { background: #888; box-shadow: none; animation: none; }
.battle-live-indicator.disconnected .live-text { color: #888; }

/* ===================================================================
   SHARE BUTTON
   =================================================================== */

.battle-share-section { margin-top: 16px; text-align: center; }
.btn-share {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px;
  background: linear-gradient(135deg, rgba(201, 169, 89, 0.2), rgba(201, 169, 89, 0.1));
  border: 1px solid rgba(201, 169, 89, 0.4); border-radius: 8px;
  color: var(--color-gold, #c9a959); font-family: 'Cinzel', serif; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
}
.btn-share:hover { background: linear-gradient(135deg, rgba(201, 169, 89, 0.35), rgba(201, 169, 89, 0.2)); border-color: var(--color-gold, #c9a959); transform: translateY(-1px); }
.share-hint { margin-top: 6px; opacity: 0.5; font-size: 0.75rem; color: var(--text-muted, #888); }

/* ===================================================================
   SPECTATOR MODE (Battle)
   =================================================================== */

.spectator-banner {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.08));
  border: 1px solid rgba(59, 130, 246, 0.3); border-radius: 10px;
  margin-bottom: 16px; font-size: 0.9rem; color: var(--text-primary, #e8e2d9);
  animation: liveFade 0.5s ease-out;
}
.spectator-icon { font-size: 1.3rem; }
.spectator-banner strong { color: #60a5fa; }
.spectator-mode .spectator-disabled { opacity: 0.3 !important; pointer-events: none !important; cursor: not-allowed !important; filter: grayscale(0.5); }
.spectator-mode .center-actions .btn-action { opacity: 0.35; pointer-events: none; }
.spectator-mode .btn-share { opacity: 1 !important; pointer-events: all !important; }

/* ===================================================================
   SPECTATOR POST-BATTLE — Read-Only Ansicht
   =================================================================== */

.spectator-post-battle .battle-live-indicator { position: relative; top: 0; right: 0; margin-bottom: 16px; display: inline-flex; }
.spectator-post-battle .spectator-banner { margin-bottom: 20px; }

.spb-step-title {
  font-family: 'Cinzel', serif; font-size: 1.2rem; font-weight: 700;
  color: var(--color-gold, #c9a959); margin-bottom: 6px;
}
.spb-step-desc { font-size: 0.9rem; color: var(--text-muted, #aaa); margin-bottom: 20px; }

.spb-warband-card {
  background: var(--bg-card, #1e1e1e); border: 1px solid rgba(201, 169, 89, 0.15);
  border-radius: 10px; padding: 16px 20px; margin-bottom: 14px;
}
.spb-warband-card h4 {
  font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 600;
  color: var(--color-gold, #c9a959); margin: 0 0 12px;
}
.spb-warband-card.spb-winner { border-color: rgba(201, 169, 89, 0.4); background: linear-gradient(135deg, rgba(201, 169, 89, 0.08), rgba(30, 30, 30, 1)); }
.spb-winner-badge { font-size: 1rem; }
.spb-pending { color: var(--text-muted, #888); font-style: italic; font-size: 0.9rem; }

/* Injuries */
.spb-injury-list { display: flex; flex-direction: column; gap: 6px; }
.spb-injury-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2); border-radius: 6px; font-size: 0.88rem;
}
.spb-injury-icon { font-size: 1.1rem; flex-shrink: 0; }
.spb-injury-name { font-weight: 600; color: var(--text-primary, #e8e2d9); min-width: 100px; }
.spb-injury-result { color: var(--text-secondary, #aaa); flex: 1; }

/* XP */
.spb-xp-total { font-size: 0.85rem; font-weight: 400; color: #4CAF50; margin-left: 8px; }
.spb-xp-list { display: flex; flex-direction: column; gap: 4px; }
.spb-xp-row { display: flex; justify-content: space-between; padding: 5px 10px; background: rgba(0, 0, 0, 0.15); border-radius: 4px; font-size: 0.85rem; }
.spb-xp-name { color: var(--text-primary, #e8e2d9); }
.spb-xp-val { color: #4CAF50; font-weight: 700; }

/* Exploration */
.spb-explore-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.spb-stat {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: rgba(0, 0, 0, 0.2); border-radius: 6px; font-size: 0.88rem;
  color: var(--text-primary, #e8e2d9);
}
.spb-stat-icon { font-size: 1rem; }

/* Summary */
.spb-summary-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.spb-sum-item {
  padding: 8px 14px; background: rgba(0, 0, 0, 0.2); border-radius: 8px;
  font-size: 0.9rem; color: var(--text-primary, #e8e2d9);
}
.spb-sum-item.negative { color: #ef4444; background: rgba(220, 38, 38, 0.1); border: 1px solid rgba(220, 38, 38, 0.2); }

/* Waiting Animation */
.spb-waiting {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px; color: var(--text-muted, #888); font-size: 0.95rem;
}
.spb-waiting-icon { font-size: 2rem; animation: waitSpin 2s linear infinite; }
@keyframes waitSpin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ===================================================================
   ACTIVE BATTLES LIST
   =================================================================== */

.active-battles-section { margin-top: 30px; padding-top: 25px; border-top: 1px solid rgba(201, 169, 89, 0.15); }
.active-battles-title { display: flex; align-items: center; gap: 10px; font-family: 'Cinzel', serif; font-size: 1.1rem; color: var(--color-gold, #c9a959); margin-bottom: 16px; font-weight: 600; }
.active-battles-title .live-dot { width: 8px; height: 8px; }
.active-battles-list { display: flex; flex-direction: column; gap: 10px; }

.active-battle-card {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 18px;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(42, 42, 42, 0.6));
  border: 1px solid rgba(220, 38, 38, 0.2); border-radius: 10px;
  cursor: pointer; transition: all 0.25s ease; gap: 12px;
}
.active-battle-card:hover { border-color: rgba(220, 38, 38, 0.5); transform: translateX(3px); box-shadow: 0 4px 16px rgba(220, 38, 38, 0.15); }

.abc-header { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.abc-wb1 { font-family: 'Cinzel', serif; font-weight: 600; color: var(--color-gold, #c9a959); font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abc-vs { font-family: 'Cinzel', serif; font-weight: 700; color: var(--text-muted, #888); font-size: 0.75rem; flex-shrink: 0; }
.abc-wb2 { font-family: 'Cinzel', serif; font-weight: 600; color: #c45050; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abc-details { display: flex; align-items: center; gap: 12px; flex-shrink: 0; font-size: 0.8rem; color: var(--text-muted, #888); }
.abc-round { background: rgba(220, 38, 38, 0.15); color: #ef4444; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }
.abc-time { font-size: 0.75rem; opacity: 0.6; }
.abc-join-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); border-radius: 6px; color: #60a5fa; font-size: 0.8rem; font-weight: 600; transition: all 0.2s ease; }
.active-battle-card:hover .abc-join-btn { background: rgba(59, 130, 246, 0.25); border-color: #60a5fa; }

/* ===================================================================
   RESPONSIVE
   =================================================================== */

@media (max-width: 768px) {
  .battle-live-indicator { top: 8px; right: 8px; padding: 4px 10px; font-size: 0.7rem; }
  .live-role { display: none; }
  .bjb-content { flex-direction: column; text-align: center; gap: 14px; padding: 18px 16px; }
  .bjb-matchup { justify-content: center; flex-wrap: wrap; }
  .bjb-join-btn { width: 100%; text-align: center; }
  .bjb-actions { width: 100%; }
  .bjb-kill-btn { width: 100%; text-align: center; }
  .active-battle-card { flex-direction: column; align-items: stretch; gap: 8px; }
  .abc-header { justify-content: center; }
  .abc-details { justify-content: center; flex-wrap: wrap; gap: 8px; }
  .abc-action { text-align: center; }
  .spectator-banner { font-size: 0.8rem; padding: 10px 14px; }
  .spb-injury-row { flex-wrap: wrap; }
  .spb-injury-name { min-width: auto; }
}
