/* Battle preparation: one illustrated frame, owned heroes, then their spell loadout. */
.battle-setup {
  overflow: hidden;
  border: 1px solid #a78d5c;
  border-radius: 28px;
  background: radial-gradient(ellipse at 100% 30%, #3a40512b, transparent 60%), #17212d;
  box-shadow:
    0 18px 48px #080d1655,
    inset 0 0 0 5px #c6a86c0b;
}
.setup-banner {
  position: relative;
  min-height: 230px;
  display: flex;
  align-items: center;
  padding: 32px;
  background:
    linear-gradient(270deg, #122331f5 0%, #122331d4 38%, #12233133 80%),
    url('/valley.webp') center 43% / cover;
  border-bottom: 1px solid #c8a35a66;
}
.setup-banner > div {
  max-width: 460px;
}
.setup-banner .eyebrow {
  color: #f1d294;
  letter-spacing: 0;
}
.setup-banner h2 {
  margin: 6px 0 10px;
  font-size: 30px;
  color: #fff2d3;
}
.setup-banner p {
  color: #e2e8eb;
  line-height: 1.9;
  margin: 0 0 18px;
}
.setup-duration {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 30px;
  background: #0e1a26ce;
  border: 1px solid #bda575;
  color: #ffe6b4;
  font-size: 14px;
}
.setup-duration .ui-icon {
  width: 20px;
  height: 20px;
}
.battle-setup form[data-battle-setup] {
  display: grid;
  gap: 0;
  padding: 0 28px 28px;
}
.setup-section {
  min-width: 0;
  padding: 26px 0;
  border-bottom: 1px solid #6d7b8c40;
}
.setup-section > h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 19px;
  color: #f4e4c1;
}
.setup-section > h3 > span {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  height: 32px;
  border-radius: 50%;
  color: #f5d99f;
  border: 1px solid #bda57588;
  background: #c9a96a12;
  font-size: 15px;
}
.setup-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.battle-setup label {
  color: #e1e4e7;
  min-width: 0;
  font-size: 14px;
}
.battle-setup input:not([type='radio']),
.battle-setup select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #68798b;
  border-radius: 12px;
  background: #101a25;
  color: #f5efdf;
  box-shadow: inset 0 2px 5px #080d1640;
}
.setup-hint {
  color: #bdcad7;
  font-size: 13px;
  line-height: 1.9;
  margin: 12px 0 0;
}
.setup-heroes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.battle-setup .setup-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  cursor: pointer;
  min-height: 200px;
  border-radius: 20px;
  border: 2px solid #5e7186;
  background:
    radial-gradient(ellipse at 50% 75%, #49627466, transparent 70%), linear-gradient(#253342, #121c29);
  box-shadow: inset 0 0 22px #0003;
  overflow: hidden;
  padding: 8px 8px 22px;
}
.setup-hero img {
  display: block;
  width: 100%;
  max-width: 160px;
  height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px #0008);
}
.setup-hero input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}
.battle-setup .setup-hero:has(:checked) {
  border-color: #f3cf82;
  background: radial-gradient(ellipse at 50% 75%, #b8954355, transparent 75%), #26333c;
  box-shadow:
    0 0 0 3px #e9c57822,
    inset 0 0 25px #e6bb5020;
}
.setup-hero-mark {
  position: absolute;
  inset-inline: 8px;
  bottom: 6px;
  text-align: center;
  color: #ffe6ac;
  font-size: 12px;
  visibility: hidden;
}
.setup-hero:has(:checked) .setup-hero-mark,
.setup-hero.is-unavailable .setup-hero-mark {
  visibility: visible;
}
.setup-hero.is-unavailable {
  filter: grayscale(1);
  opacity: 0.7;
  cursor: not-allowed;
}
.setup-hero.is-unavailable input {
  cursor: not-allowed;
}
.battle-setup button {
  border-radius: 12px;
  min-height: 44px;
}
.battle-setup :is(button, input, select, summary):focus-visible,
.setup-hero:has(input:focus-visible) {
  outline: 3px solid #ffe5a2;
  outline-offset: 4px;
}
.setup-spells .panel {
  border: 0;
  background: #111c2866;
  box-shadow: none;
  border-radius: 18px;
  margin: 0;
}
.setup-spells .panel > h2,
.setup-spells .frame-corner {
  display: none;
}
.setup-spells .panel-body {
  padding: 18px;
}
.setup-spells .panel-body > p:first-child {
  margin-top: 0;
}
.setup-spells .spell-loadout-slot,
.setup-spells .spell-choice {
  border-radius: 14px;
}
.setup-spells .spell-loadout-slot {
  min-width: 0;
}
.setup-advanced {
  padding: 18px 0;
  border-bottom: 1px solid #6d7b8c40;
}
.setup-advanced summary {
  cursor: pointer;
  padding-block: 8px;
  color: #e9d3aa;
  font-size: 14px;
}
.setup-advanced .setup-fields {
  margin-top: 16px;
}
.setup-advanced p {
  color: #bdcad7;
  line-height: 1.9;
  font-size: 13px;
}
.battle-setup [data-battle-setup] > button[type='submit'] {
  justify-self: center;
  width: min(100%, 440px);
  min-height: 54px;
  font-size: 17px;
  border: 1px solid #e7c785;
  border-radius: 16px;
  background: linear-gradient(#7a603a, #4d3e2a);
  color: #fff1ca;
  box-shadow:
    inset 0 1px #fff2cc44,
    0 6px 18px #0003;
}
.setup-army-note {
  text-align: center;
}
.battle-setup .form-error:empty {
  display: none;
}
.battle-setup .form-error {
  text-align: center;
  margin-block: 12px;
}
.battle-setup [data-battle-setup] > button[type='submit'] {
  margin-top: 18px;
}
@media (max-width: 650px) {
  .battle-setup {
    border-radius: 22px;
  }
  .setup-banner {
    min-height: 210px;
    padding: 22px;
    background-position: 60% center;
  }
  .setup-banner h2 {
    font-size: 26px;
  }
  .battle-setup form[data-battle-setup] {
    padding: 0 16px 22px;
  }
  .setup-fields {
    gap: 14px;
  }
  .setup-heroes {
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .battle-setup .setup-hero {
    min-height: 140px;
    padding: 4px 4px 22px;
    border-radius: 16px;
  }
  .setup-hero img {
    height: 120px;
  }
  .setup-spells .panel-body {
    padding: 12px;
  }
}
@media (max-width: 420px) {
  .setup-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .setup-banner {
    padding: 18px;
  }
  .setup-section > h3 {
    font-size: 17px;
  }
  .setup-hero img {
    height: 104px;
  }
  .setup-hero-mark {
    font-size: 12px;
    inset-inline: 2px;
  }
}
