/* ================================
   Modalità Guerra – layout base
   ================================ */

.war-screen {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  background: #000;
  box-sizing: border-box;
  padding: 8px;
}

.war-frame {
  flex: 1;
  max-width: 480px;
  height: 100%;
  margin: 0 auto;
  border-radius: 16px;
  background: #101010;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  color: #f9fafb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Override bottoni globali SOLO dentro la guerra */
.war-frame button {
  width: auto;
  font-family: inherit;
  margin: 0;
}

/* Header */
.war-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.war-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.war-title {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: "Cinzel", system-ui, sans-serif;
}

.war-subtitle {
  font-size: 0.7rem;
  opacity: 0.75;
}

.war-back-btn {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #20252b;
  color: #e5e7eb;
  cursor: pointer;
}

/* Info mappa */
.war-map {
  font-size: 0.65rem;
  padding: 5px 7px;
  border-radius: 10px;
  background: #181818;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e5e7eb;
  margin-bottom: 6px;
}

/* Varianti (soldato/comandante, 5/10 min) */
.war-variant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.war-variant-button {
  flex: 1 1 calc(50% - 3px);
  border-radius: 999px;
  padding: 5px 8px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #181818;
  color: #e5e7eb;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.war-variant-button span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.war-variant-button i {
  font-size: 0.85rem;
}

.war-variant-button.war-active {
  border-color: #f97316;
  background: #22160b;
}

@media (max-width: 360px) {
  .war-variant-button {
    flex: 1 1 100%;
  }
}

/* Zona centrale */
.war-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ================================
   Barre vita (chiare e leggibili)
   ================================ */

.war-status-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 0.7rem;
}

.war-status-pill {
  flex: 1;
  padding: 4px 6px;
  border-radius: 10px;
  background: #181818;
  border: 1px solid rgba(148, 163, 184, 0.5);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.war-status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.war-status-name {
  font-weight: 600;
}

.war-status-value {
  opacity: 0.8;
}

.war-hp-bar,
.war-enemy-bar {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: #050505;
  overflow: hidden;
}

.war-hp-fill,
.war-enemy-fill {
  position: absolute;
  inset: 0;
}

/* Player: arancione/rosso, Nemico: azzurro */
.war-hp-fill {
  background: linear-gradient(90deg, #f97316, #ef4444);
}

.war-enemy-fill {
  background: linear-gradient(90deg, #7dd3fc, #0ea5e9);
}

/* ================================
   Chat minimale scrollabile
   ================================ */

.war-chat-window {
  flex: 1;
  min-height: 0;
  background: #151515;
  border-radius: 10px;
  border: 1px solid #222;
  padding: 6px;
  overflow-y: auto;
  box-sizing: border-box;
  margin-bottom: 6px;
}

/* lista messaggi */
.war-chat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* singola riga (nessuna icona) */
.war-chat-row {
  display: flex;
}

/* bolla base: rettangolo semplice con nome + testo */
.war-chat-bubble {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  background: #1f2933;
  border: 1px solid #313c46;
  font-size: 0.8rem;
  line-height: 1.3;
}

.war-chat-speaker-name {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.8;
  margin-bottom: 2px;
}

.war-chat-text {
  font-size: 0.8rem;
}

/* Varianti leggere sui colori per speaker */

.war-chat-row.speaker-lagertha .war-chat-bubble {
  background: #1e293b;
  border-color: #334155;
}

.war-chat-row.speaker-enemy_warlord .war-chat-bubble {
  background: #2b1a1a;
  border-color: #7f1d1d;
}

.war-chat-row.speaker-valhalla_herald .war-chat-bubble {
  background: #23201a;
  border-color: #a16207;
}

.war-chat-row.speaker-narrator .war-chat-bubble {
  background: #111827;
  border-color: #4b5563;
  font-style: italic;
}

/* Barra comandi in basso */

.war-command-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.war-command-button {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.75rem;
  border: none;
  background: #20252b;
  color: #f9fafb;
  cursor: pointer;
}

.war-command-button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Mobile */
@media (max-width: 480px) {
  .war-frame {
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
  }
}
