.fireball-layout{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
  gap:20px;
}

.card{
  background:var(--dark-gray);
  border:1px solid var(--light-gray);
  border-radius:16px;
  padding:24px;
}

.card h3{
  font-family:'Fredoka',sans-serif;
  color:var(--gold);
  font-size:1.4em;
  margin-bottom:16px;
}

.input-group{margin-bottom:16px}

.target-controls{
  margin-top:12px;
  border-top:1px solid var(--light-gray);
  padding-top:12px;
}

.target-grid{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:8px;
}

.target-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.target-row input{
  flex:1 1 140px;
}

.target-row button{
  background:transparent;
  border:1px solid var(--danger);
  color:var(--danger);
  padding:8px 12px;
  border-radius:8px;
  cursor:pointer;
  font-weight:600;
}

.damage-summary{
  background:#1c1c1c;
  border:1px solid var(--light-gray);
  border-radius:12px;
  padding:18px;
  min-height:90px;
  text-align:center;
}

.damage-summary .total{
  font-size:2.4em;
  color:var(--gold);
  font-family:'Fredoka',sans-serif;
}

.dice-display{
  margin-top:16px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.dice-display span{
  width:38px;
  height:38px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:'JetBrains Mono',monospace;
  background:#242424;
  border:1px solid var(--light-gray);
}

.targets-results{
  margin-top:18px;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.target-result{
  border:1px solid var(--light-gray);
  border-radius:12px;
  padding:12px;
  background:#1a1a1a;
}

.target-result h4{
  margin-bottom:6px;
  color:var(--gold);
}

.target-result .damage{
  font-size:1.4em;
  font-family:'JetBrains Mono',monospace;
}

.target-result.success .damage{color:var(--mint);}
.target-result.fail .damage{color:var(--danger);}

.history{
  margin-top:28px;
  border:1px solid var(--light-gray);
  border-radius:16px;
  background:var(--dark-gray);
  padding:24px;
}

.history-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.history-list{
  margin-top:16px;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.history-entry{
  border:1px solid var(--light-gray);
  border-radius:12px;
  padding:12px;
  background:#1b1b1b;
}

.history-entry h4{
  margin-bottom:6px;
  color:var(--gold);
}

.history-entry ul{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.history-entry li{
  font-family:'JetBrains Mono',monospace;
  background:#242424;
  border-radius:8px;
  padding:6px 10px;
}

@media(max-width:560px){
  .target-row{flex-direction:column;align-items:stretch}
  .damage-summary .total{font-size:2em}
}
