/* Commander spells: shop, loadout, battle bar, fog of war and spell areas. */
.store-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.store-tabs a {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}
.spell-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}
.spell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.spell-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(var(--paper), var(--paper-deep));
}
.spell-card.is-owned {
  border-color: var(--teal);
}
.spell-card header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.spell-card h3 {
  margin: 0;
  font-size: 18px;
}
.spell-card header small,
.spell-meta {
  color: var(--muted);
  font-size: 14px;
}
.spell-card p {
  margin: 0;
}
.spell-card footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.spell-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.spell-price {
  color: var(--gold);
}
.spell-incompatible {
  color: #ffc58a;
}
.spell-icon {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  padding: 4px;
  border-radius: 12px;
  border: 2px solid var(--wood-edge);
  background: radial-gradient(#2a4550, #13262d);
  box-shadow: inset 0 0 0 1px #0007;
}
.spell-icon.small {
  width: 36px;
  height: 36px;
  padding: 2px;
  border-radius: 9px;
}
.spell-hero-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.spell-hero-picker a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.spell-hero-picker a.active {
  border-color: var(--gold);
  background: #d9b77722;
}
.spell-hero-picker img {
  object-fit: contain;
}
.spell-loadout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.spell-loadout-slot {
  display: grid;
  gap: 6px;
}
.spell-loadout-pick {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 120px;
  padding: 12px 8px;
  border-radius: 12px;
  border: 2px dashed var(--line);
  background: var(--input-surface);
}
.spell-loadout-slot.is-chosen .spell-loadout-pick {
  border-style: solid;
  border-color: var(--gold);
}
.spell-slot-tools {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.spell-slot-tools button {
  min-width: 44px;
  min-height: 36px;
  padding: 2px 8px;
}
.spell-number {
  position: absolute;
  top: 4px;
  inset-inline-start: 6px;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1b1209d9;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.spell-plus {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 2px dashed var(--muted);
  color: var(--muted);
  font-size: 30px;
  line-height: 1;
}
.spell-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.spell-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 12px;
  text-align: start;
  border-radius: 10px;
}
.spell-choice small {
  display: block;
  color: var(--muted);
}
.spell-choices.locked .spell-choice {
  border: 1px dashed var(--line);
  opacity: 0.85;
}
.spell-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.spell-mini {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
}
.spell-mini .spell-number {
  top: -4px;
  inset-inline-start: -4px;
  width: 18px;
  height: 18px;
  min-width: 18px;
  line-height: 18px;
  font-size: 12px;
}
.spell-mini .spell-plus {
  width: 36px;
  height: 36px;
  font-size: 20px;
}
.room-spells {
  display: grid;
  gap: 6px;
}
.room-spells small {
  color: var(--muted);
}

/* Battle bar beside the map (stacks under the map on narrow screens). */
.spell-bar {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--wood-edge);
  background: linear-gradient(#3b2b1ecc, #241a12cc);
}
.spell-commander {
  display: flex;
  align-items: center;
  gap: 10px;
}
.spell-commander span {
  margin-inline-start: auto;
  color: var(--muted);
}
.spell-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.spell-slot-wrap {
  position: relative;
}
.spell-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 48px;
  aspect-ratio: 1;
  min-height: 48px;
  padding: 4px;
  border-radius: 12px;
  border: 2px solid var(--wood-edge);
  background: radial-gradient(#2a4550, #13262d);
  overflow: hidden;
}
.spell-slot .spell-icon {
  width: 100%;
  height: auto;
  max-width: 64px;
  border: 0;
  background: none;
  box-shadow: none;
}
.spell-slot.is-empty {
  border-style: dashed;
  opacity: 0.5;
}
.spell-slot.is-ready {
  border-color: var(--gold);
  box-shadow: 0 0 10px #d9b77755;
}
.spell-slot.is-targeting {
  border-color: #ffe9a3;
  box-shadow:
    0 0 0 3px #ffe9a355,
    0 0 14px #ffe9a3aa;
}
.spell-slot.is-pending {
  opacity: 0.7;
  cursor: progress;
}
.spell-slot.is-active {
  border-color: #8fd36a;
  box-shadow: 0 0 10px #8fd36a66;
}
.spell-slot.is-cooldown::after {
  content: '';
  position: absolute;
  inset: 0;
  background: conic-gradient(#0a121cc2 calc(var(--cool, 0) * 360deg), transparent 0);
}
.spell-slot.is-dead,
.spell-slot.is-off {
  filter: grayscale(1) brightness(0.65);
}
.spell-slot.is-dead::before {
  content: '✕';
  position: absolute;
  z-index: 2;
  color: #ff9f8a;
  font-size: 26px;
  font-weight: 700;
}
.spell-timer {
  position: absolute;
  z-index: 2;
  inset-block-end: 3px;
  padding: 0 6px;
  border-radius: 8px;
  background: #0b1219d9;
  color: #fff3d0;
  font-size: 14px;
  font-weight: 700;
}
.spell-info-button {
  position: absolute;
  z-index: 3;
  top: -6px;
  inset-inline-end: -6px;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
}
.spell-hint,
.spell-track,
.spell-detail {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #0b1219a6;
  font-size: 15px;
}
.spell-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.spell-track small {
  flex-basis: 100%;
  color: var(--muted);
}
.spell-arrow {
  width: 22px;
  height: 22px;
  color: #c9e88b;
}
.spell-detail p {
  margin: 4px 0 0;
}

/* Fog of war: geography stays readable, unseen tiles are clearly darker. */
.natural-map .natural-cell .tile-top {
  transition:
    fill 0.25s,
    stroke 0.12s;
}
.natural-map .natural-cell.is-fog .tile-top {
  fill: #0b1426a8 !important;
  stroke: #0b1426 !important;
  stroke-opacity: 0.55 !important;
}
.fog-badge circle {
  fill: #0b1426d9;
  stroke: #9fb0c8;
  stroke-width: 0.8;
}
.fog-badge text {
  fill: #d7deea;
  font-size: 10px;
  font-weight: 700;
}
/* The caster's team sees its spell area with a fine outline only. */
.natural-map .natural-cell.spell-lit .tile-top {
  stroke: #f2c24e !important;
  stroke-opacity: 0.85 !important;
  stroke-width: 1.3 !important;
}
.natural-map .natural-cell.spell-veil .tile-top {
  stroke-dasharray: 3 2;
  stroke-opacity: 0.9 !important;
  stroke-width: 1.3 !important;
}
.natural-map .natural-cell.veil-ash .tile-top {
  fill: #8c867f2e !important;
  stroke: #ff9a3c !important;
}
.natural-map .natural-cell.veil-fog .tile-top {
  fill: #dcecff2e !important;
  stroke: #cfe5f7 !important;
}
.natural-map .natural-cell.veil-eclipse .tile-top {
  fill: #3a0d4a40 !important;
  stroke: #e2345b !important;
}
/* Rivals only get a generic marker where their own sight would normally reach. */
.natural-map .natural-cell.is-obscured .tile-top {
  stroke: #c8d0dc !important;
  stroke-dasharray: 2 2;
  stroke-opacity: 0.8 !important;
}
.natural-map .natural-cell.spell-target .tile-top {
  fill: #ffe9a333 !important;
  stroke: #ffe9a3 !important;
  stroke-opacity: 1 !important;
  stroke-width: 2 !important;
  stroke-dasharray: 5 3;
}
.natural-map .natural-cell.spell-preview .tile-top {
  stroke: #ffe9a3 !important;
  stroke-opacity: 0.9 !important;
  stroke-width: 1.4 !important;
  stroke-dasharray: 2 3;
}
.spell-marker {
  pointer-events: none;
}
@media (max-width: 640px) {
  .spell-loadout {
    grid-template-columns: minmax(0, 1fr);
  }
  .spell-slot {
    min-height: 56px;
  }
}
.reduce-motion .natural-map .natural-cell .tile-top {
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  .natural-map .natural-cell .tile-top {
    transition: none;
  }
}

/* Army support: the commander's own production queue and its effects (spell-icons.css from the kit). */
.spell-slot.is-active {
  border-color: var(--spell-accent, #8fd36a);
}
.spell-slot.is-debt {
  filter: saturate(0.4);
  border-style: dashed;
  border-color: #c3a0ff;
}
.spell-slot.is-debt::before {
  content: '⏳';
  position: absolute;
  z-index: 2;
  font-size: 22px;
}
.spell-slot:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.queue-status {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #0b1219a6;
  font-size: 14px;
  line-height: 1.8;
}
.queue-status p {
  margin: 0;
}
.queue-status ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.queue-label {
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 13px;
  animation: queue-label-in 0.2s ease-out;
}
.queue-label.is-boost {
  color: #efc56a;
}
.queue-label.is-freeze {
  color: #8adfff;
}
.queue-label.is-disrupt {
  color: #ff7864;
}
.queue-label.is-debt {
  color: #c3a0ff;
}
.queue-label.is-bonus {
  color: #e99555;
}
@keyframes queue-label-in {
  from {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .queue-label {
    animation: none;
  }
}
.store-tabs {
  flex-wrap: wrap;
}
.store-tabs a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.store-tabs a.active {
  border-color: var(--gold);
  color: var(--gold);
  background: #d9b77722;
}
.help-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.help-links > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}
a.commander-chip {
  color: inherit;
  text-decoration: none;
}
a.commander-chip:hover,
a.commander-chip:focus-visible {
  border-color: var(--gold);
}

/* Hero power (spell-icons.css from the kit): normal and golden extra health, effect labels. */
.hero-health {
  display: grid;
  gap: 4px;
}
.hero-health-track {
  position: relative;
  display: flex;
  height: 12px;
  border-radius: 6px;
  background: #0b1219;
  border: 1px solid #ffffff22;
  overflow: hidden;
}
.hero-health-normal {
  background: linear-gradient(#a8d177, #6f9f45);
}
.hero-health-extra {
  background: repeating-linear-gradient(135deg, #f0cb75 0 6px, #d6a94a 6px 9px);
  transition: width 0.25s;
}
.hero-health-cap {
  position: absolute;
  inset-block: 0;
  width: 2px;
  background: #fff8;
}
.hero-health small {
  color: var(--muted);
  font-size: 13px;
}
.hero-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hero-label {
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 13px;
  animation: queue-label-in 0.2s ease-out;
}
.hero-label.is-overflow {
  color: #f0cb75;
}
.hero-label.is-rage {
  color: #ffab65;
}
.hero-label.is-frost {
  color: #91ddff;
}
.hero-label.is-regen {
  color: #78e4af;
}
.hero-label.is-burn {
  color: #ff7c79;
}
.hero-label.is-siphon {
  color: #caa2ff;
}
@media (prefers-reduced-motion: reduce) {
  .hero-label,
  .hero-health-extra {
    animation: none;
    transition: none;
  }
}

/* Hero level, skills and daily training; experience on the result page. */
.hero-level {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: baseline;
  font-size: 17px;
}
.hero-level-next {
  margin: 8px 0 12px;
}
.hero-level-next small {
  color: var(--muted);
}
.hero-skill-table {
  width: 100%;
  border-collapse: collapse;
}
.hero-skill-table th,
.hero-skill-table td {
  padding: 6px 4px;
  text-align: start;
  border-bottom: 1px solid #ffffff1a;
}
.hero-skill-table button {
  min-height: 44px;
}
.training-today {
  margin: 10px 0 4px;
}
.hero-snapshot {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}
.result-xp {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.result-xp div {
  padding: 8px 10px;
  border-radius: 10px;
  background: #0b1219a6;
}
.result-xp dt {
  color: var(--muted);
  font-size: 13px;
}
.result-xp dd {
  margin: 2px 0 0;
}
.xp-cut {
  color: #ffb36b;
}
@media (max-width: 550px) {
  .hero-skill-table th:nth-child(3),
  .hero-skill-table td:nth-child(3),
  .hero-skill-table th:nth-child(4),
  .hero-skill-table td:nth-child(4) {
    display: none;
  }
}
