/* ==========================================
   1. GLOBALE LAYOUT-STILE & EBENEN-DEBUGGER
   ========================================== */

:root {
  --span_minusRunde_right: 32px;
  --span_minusRunde_left: 32px;
}

body {
  margin: 0;
  background-color: white;
  color: rgb(0, 0, 0);
  font-family: arial, sans-serif;
  overflow: hidden;
  height: 100dvh;
  width: 100vw;
  user-select: none;
}

/* Dein genialer Ebenen-Debugger bleibt aktiv */
/* body > * { outline: 1px solid red; }
body > * > * { outline: 2px solid orange; }
body > * > * > * { outline: 3px solid green; }
body > * > * > * > * { outline: 4px solid blue; }
body > * > * > * > * > * { outline: 5px solid purple; } */

section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 10px;
  box-sizing: border-box;
}

p {
  font-size: larger;
}

/* ==========================================
   2. DER WÜRFEL-BEREICH (Oben)
   ========================================== */

/* Container für den gesamten Würfel-Bereich */
#div_zsm_Würfel {
  display: flex;
  flex-direction: column;
  gap: clamp(0.5rem, 2vh, 1.5rem);
  background: white;
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  width: 100%;
  max-width: 600px; /* Hält das Dashboard kompakt */
  box-sizing: border-box;
}

/* Die Zeile, in der links Angreifer und rechts Verteidiger steht */
.div_Überschriften {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
}

.div_Überschriften p {
  margin: 0;
  font-weight: bold;
}
/* .div_Überschriften p:last-child {
  text-align: right; /* Verteidiger-Schrift nach rechts 
} */

/* Container für alle Würfel */
#div_alleWürfel {
  display: flex;
  justify-content: space-between;
  gap: clamp(0.5rem, 2vw, 1.5rem);
}

/* Angreifer- und Verteidiger-Spalten (Wieder UNTEREINANDER wie von dir gewünscht) */
#div_würfelAngr, 
#div_würfelVert {
  display: flex;
  flex-direction: column; 
  align-items: center;
  gap: clamp(0.4rem, 1.8vh, 1.5rem); 
  padding: clamp(8px, 1.5vh, 15px);
  border-radius: 6px;
  flex: 1;
}

/* --- HINTERGRUND-FARBEN FÜR DIE SEITEN --- */
#div_würfelAngr {
  background-color: rgba(217, 83, 79, 0.08); /* Sanftes Rot für Angreifer */
}

#div_würfelVert {
  background-color: rgba(2, 117, 216, 0.08);  /* Sanftes Blau für Verteidiger */
}

/* ==========================================
   3. BUTTONS (Würfel & Würfeln-Aktion)
   ========================================== */

button {
  width: clamp(4rem, 9vh, 5rem);
  height: clamp(4rem, 9vh, 5rem);
  border-radius: 0.4rem;
  border: 2px solid gray;
  font-size: clamp(1.2rem, 2.5vh, 1.5rem);
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
}

/* Der Gewinner-Würfel bekommt ein weiches, grünes Glühen */
.wuerfel-gewinner {
    box-shadow: 0 0 10px rgb(187, 174, 0);
    border-color: rgb(187, 174, 0) !important;
    transform: scale(1.03); /* Minimaler Plopp-Effekt */
    transition: all 0.3s ease;
}

/* Der Verlierer tritt dezent in den Hintergrund */
.wuerfel-verlierer {
    opacity: 0.9;
    transition: all 0.3s ease;
}

/* Deine funktionale Status-Färbung (aktiviert/deaktiviert) */
button[data-state="true"] {
  background-color: #5cb85c; /* Knalliges Grün für ausgewählt */
  color: white;
  border-color: #4cae4c;
}

button[data-state="false"] {
  background-color: #d9534f; /* Knalliges Rot für nicht ausgewählt */
  color: white;
  border-color: #d43f3a;
}

button:active {
  transform: scale(0.975);
}

/* Der große Würfeln-Button in der Mitte */
#button_würfeln {
  margin: clamp(0.4rem, 2vh, 1.5rem) auto;
  padding: 12px 50px;
  height: auto;
  width: auto;
  font-size: 1.2rem;
  background-color: aliceblue;
  color: black;
  border: 1px solid gray;
}

/* ==========================================
   4. TRUPPEN-BEREICH (Unten)
   ========================================== */

#div_zsm_Truppen {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: white;
  padding: 0px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
}

/* Überschriften für die Truppen */
#Truppenanzahlen {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.p_Truppen {
  flex: 1;
  margin: 0;
  font-size: medium;
  font-weight: bold;
}
#Truppenanzahlen .p_Truppen:last-child {
  text-align: right;
}

/* Container für die Inputs */
#div_inputs_numbers {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 1rem;
}

/* Die einzelnen Input-Boxen (Deine absolute Positionierung gerettet) */
.div_einzelneInputs {
  position: relative;
  display: inline-block;
  flex: 1;
  box-sizing: border-box;
}

.div_einzelneInputs input {
  width: 100%;
  height: 2.5rem;
  padding-right: 55px; /* Genug Platz, damit die Zahlen nicht mit den Spans überlappen */
  font-size: 1.1em;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: left;
  padding-left: 10px;
}

/* Deine absolut platzierten Spans im Input-Feld */
.div_einzelneInputs .span_minusRunde,
.div_einzelneInputs .span_minusInsg {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85em;
  font-weight: bold;
  pointer-events: none;
}

/* Runde Verluste (Gelb/Orange) und Gesamtverluste (Dunkelrot) */
#span_minusRunde_Angr {
  right: var(--span_minusRunde_left);
  color: #f0ad4e; 
}
#span_minusRunde_Vert {
  right: var(--span_minusRunde_right);
  color: #f0ad4e; 
}
.div_einzelneInputs .span_minusInsg {
  right: 7px;
  color: #d9534f;
}