/* 0.15.2: combat-only layout. The arena never reflows when a panel opens. */
.spell-panel-battle {
  --combat-panel-height: 128px;
  --combat-hud-height: 56px;
  color: #315f55;
  background: #fbf5e7;
}
.spell-panel-battle .combat-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0 !important;
}
.spell-panel-battle .battle-header {
  min-height: 50px;
  padding: 7px 10px 8px;
  background: #fbf5e7;
  border: 0;
  gap: 9px;
}
.spell-panel-battle .battle-heading { flex: 1; min-width: 0; }
.spell-panel-battle .battle-heading .eyebrow { font-size: 8px; color: #93876c; }
.spell-panel-battle .battle-header h2 {
  font: 700 19px/1.15 Interface,sans-serif;
  margin: 2px 0 0;
  -webkit-line-clamp: 1;
  color: #315f55;
}
.spell-panel-battle .battle-header .battle-exit,
.spell-panel-battle .battle-header .battle-chat-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.spell-panel-battle .battle-exit .icon,
.spell-panel-battle .battle-chat-button .icon { font-size: 25px; }
.spell-panel-battle .battle-top {
  position: relative;
  z-index: 6;
  padding: 0 10px 7px;
  background: #fbf5e7;
  border-bottom: 1px solid #d9ddc8;
}
.spell-panel-battle .battle-status { min-height: 0; margin: 0 0 6px; display: block; }
.spell-panel-battle .battle-status .party-clock {
  position: relative;
  inset: auto;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 5px 8px;
  border: 1px solid #d5d9c5;
  border-radius: 10px;
  background: #fffbf1;
  box-shadow: none;
}
.spell-panel-battle .clock-copy { min-height: 22px; gap: 8px; font-size: 11px; }
.spell-panel-battle .battle-status .turn-badge {
  position: static;
  inset: auto;
  transform: none;
  border: 0;
  padding: 4px 8px;
  min-width: 0;
  border-radius: 6px;
  background: #e7eddf;
  color: #315f55;
  box-shadow: none;
  font-size: 11px;
  line-height: 1;
  animation: none;
}
.spell-panel-battle #party-clock-label { flex: 1; font-weight: 700; }
.spell-panel-battle .battle-clock-time { display: flex; align-items: center; gap: 5px; color: #ab8241; }
.spell-panel-battle .clock-copy strong { font-size: 12px; color: inherit; animation: none; }
.spell-panel-battle .hourglass,
.spell-panel-battle .hourglass img { width: 14px; height: 17px; }
.spell-panel-battle .hourglass:after { display: none; }
.spell-panel-battle .clock-track { height: 3px; margin: 3px 0 0; background: #e2e7d9; }
.spell-panel-battle .clock-track i { background: #90aa7b; }
.spell-panel-battle .party-clock.urgent { background: #fff5e6; border-color: #d9bd92; }
.spell-panel-battle .party-clock.connection-lost { opacity: 1; color: #977b5e; }
.spell-panel-battle .battle-top .party-bar { margin-bottom: 6px; }
.spell-panel-battle .enemy-panel {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.spell-panel-battle .enemy-cards {
  display: grid;
  grid-template-columns: repeat(var(--enemy-count, 4), minmax(0, 1fr));
  gap: 5px;
}
.spell-panel-battle .enemy-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 94px;
  min-height: 0;
  min-width: 0;
  padding: 0;
  border: 1px solid #d5d9c4;
  border-radius: 9px;
  background: #fffbf1;
  box-shadow: none;
  overflow: hidden;
}
.spell-panel-battle .enemy-card.selected {
  border-color: #38786b;
  background: #eff5e9;
  box-shadow: inset 0 0 0 1px #38786b;
}
.spell-panel-battle .enemy-card.pending,
.spell-panel-battle .enemy-card.dead { opacity: .64; filter: none; }
.spell-panel-battle .enemy-card-select {
  flex: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  padding: 4px 5px 0;
  border: 0;
  background: transparent;
  color: #315f55;
  text-align: center;
}
.spell-panel-battle .enemy-card-select:disabled { opacity: 1; }
.spell-panel-battle .enemy-card-main {
  position: static;
  display: grid;
  grid-template-rows: 31px 12px 12px 3px;
  justify-items: center;
  align-items: center;
  gap: 2px;
}
.spell-panel-battle .enemy-card-main > img { width: 31px; height: 31px; object-fit: contain; }
.spell-panel-battle .enemy-card-main strong { font-size: 10px; line-height: 12px; width: 100%; color: #315f55; }
.spell-panel-battle .enemy-card-main small { font-size: 10px; line-height: 12px; margin: 0; color: #315f55; font-variant-numeric: tabular-nums; }
.spell-panel-battle .enemy-card .progress { height: 3px; width: 100%; margin: 0; background: #e4e8d9; }
.spell-panel-battle .enemy-card .progress > span { background: #d58069; }
.spell-panel-battle .enemy-number,
.spell-panel-battle .battle-enemy-number {
  position: absolute;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ae853f;
  color: #fffcf1;
  font: 700 10px/1 sans-serif;
  pointer-events: none;
}
.spell-panel-battle .enemy-number { left: 4px; top: 4px; }
.spell-panel-battle .enemy-selected-mark { display: none; position: absolute; right: 5px; top: 5px; font-size: 13px; line-height: 16px; color: #38786b; }
.spell-panel-battle .selected .enemy-selected-mark { display: block; }
.spell-panel-battle .selected .enemy-number,
.spell-panel-battle .selected .battle-enemy-number { background: #38786b; }
.spell-panel-battle .battle-enemy-number { left: 48%; top: 8%; z-index: 7; border: 1px solid #fff7de; }
.spell-panel-battle .enemy-card-effects {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 2px;
  flex: none;
  height: 24px;
  min-height: 0;
  margin: 0;
  padding: 0 3px;
}
.spell-panel-battle .enemy-effect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  min-width: 0;
  padding: 2px 3px;
  font-size: 9px;
  line-height: 1;
  border-radius: 5px;
  border: 0;
  background: #eef1e2;
  color: #667e60;
  gap: 2px;
  animation: combat-effect-arrive 180ms ease-out;
}
.spell-panel-battle .enemy-effect img { width: 12px; height: 12px; object-fit: contain; }
.spell-panel-battle .enemy-effect .icon { font-size: 12px; }
.spell-panel-battle .enemy-effect.frost { background: #e4f2f7; color: #648ca3; }
.spell-panel-battle .enemy-effect.stun { background: #f7ecd1; color: #a17b36; }
.spell-panel-battle .enemy-effect[aria-expanded="true"] { box-shadow: inset 0 0 0 1px #38786b; }
.spell-panel-battle .enemy-effect-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  width: min(100%, 340px);
  border: 1px solid #b9cbae;
  border-radius: 10px;
  background: #fffbef;
  box-shadow: 0 5px 15px #264b3533;
  overflow: hidden;
  animation: combat-effect-arrive 160ms ease-out;
}
.spell-panel-battle .enemy-effect-popover header { display: flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-bottom: 1px solid #e1e5d0; }
.spell-panel-battle .enemy-effect-popover h3 { flex: 1; min-width: 0; font: 700 12px/1.35 sans-serif; }
.spell-panel-battle .enemy-effect-popover .icon-button { width: 32px; min-width: 32px; height: 32px; border: 0; background: transparent; box-shadow: none; }
.spell-panel-battle .enemy-effect-copy { max-height: min(160px, 30vh); overflow: auto; padding: 4px 10px 9px; overscroll-behavior: contain; }
.spell-panel-battle .enemy-effect-copy p { margin: 6px 0; font-size: 11px; line-height: 1.45; }
.spell-panel-battle .enemy-effect-copy strong,
.spell-panel-battle .enemy-effect-copy span,
.spell-panel-battle .enemy-effect-copy small { display: block; }
.spell-panel-battle .enemy-effect-copy small { margin-top: 4px; font-size: 10px; color: #71866a; }
.spell-panel-battle .battle-field { flex: 1 1 0; min-height: 0; }
.spell-panel-battle .monster-unit.selected:after { display: none; content: none; }
.spell-panel-battle .monster-unit.selected .monster-sprite { filter: none; }
.spell-panel-battle .monster-unit.frozen .monster-sprite { filter: saturate(.48) brightness(1.18) drop-shadow(0 0 4px #9be0ff); }
.spell-panel-battle .battle-unit.selected .target-ring { border: 2px solid #60998e; background: #d8f3e729; box-shadow: 0 0 0 1px #fff7cd80; animation: none; }
.spell-panel-battle .monster-unit.stunned .monster-sprite:before { animation: none; }
.spell-panel-battle .monster-control { display: none; }
.spell-panel-battle .battle-console {
  position: relative;
  flex: none;
  padding: 8px 10px 12px;
  margin-top: -8px;
  border-radius: 16px 16px 0 0;
  border-color: #dedec9;
  background: #fbf5e7;
  box-shadow: 0 -3px 10px #2c432416;
}
.spell-panel-battle .combat-player { position: relative; height: 48px; min-height: 48px; gap: 8px; margin: 0 0 8px; }
.spell-panel-battle .combat-player > img { width: 36px; height: 38px; border-radius: 50%; border: 1px solid #c9d4b8; }
.spell-panel-battle .combat-player-name { font-size: 13px; margin: 0 0 3px; line-height: 1.2; }
.spell-panel-battle .combat-player-name small { font-size: 9px; }
.spell-panel-battle .combat-vitals { grid-template-columns: 1fr 1fr; gap: 10px; }
.spell-panel-battle .combat-vitals .vital-row { font-size: 10px; margin: 0; gap: 4px; }
.spell-panel-battle .combat-vitals .vital-row > span { font-size: 9px; }
.spell-panel-battle .combat-vitals .vital-row strong { font-size: 10px; }
.spell-panel-battle .combat-vitals .progress { height: 4px; margin: 3px 0 0; }
.spell-panel-battle .combat-vitals .health .progress > span { background: #d58069; }
.spell-panel-battle .combat-vitals .mana .progress > span { background: #80aabe; }
[data-hero-class="warrior"] .spell-panel-battle .combat-vitals .mana .progress > span { background: #b49a5c; }
.spell-panel-battle .hero-effects { position: absolute; bottom: calc(100% + 12px); left: 0; right: 0; margin: 0; pointer-events: none; }
.spell-panel-battle .hero-effects > span { background: #fffbefed; }
.spell-panel-battle .combat-action-panel { position: relative; height: var(--combat-panel-height); min-height: var(--combat-panel-height); margin: 0; overflow: visible; }
.spell-panel-battle .combat-action-view { height: 100%; display: grid; grid-template-rows: 38px minmax(0, 1fr); gap: 8px; padding: 3px 0 4px; }
.spell-panel-battle .battle-log { position: static; padding: 0; margin: 0; border: 1px solid #d5dcc4; border-radius: 9px; background: #fffbef; }
.spell-panel-battle .battle-log-toggle { height: 36px; min-height: 36px; padding: 7px 10px; font-size: 11px; }
.spell-panel-battle .battle-log-content {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  bottom: calc(100% + var(--combat-hud-height));
  max-height: min(240px, 38vh);
  padding: 5px 8px 8px;
  border: 1px solid #c9d3b7;
  border-radius: 10px;
  background: #fffbef;
  box-shadow: 0 3px 12px #27442b25;
}
.spell-panel-battle .battle-buttons { gap: 8px; height: 100%; }
.spell-panel-battle .battle-console .battle-action { min-height: 0; height: 100%; padding: 6px 9px; font-size: 17px; border-radius: 10px; gap: 8px; box-shadow: none; }
.spell-panel-battle .battle-action .icon { font-size: 25px; }
.spell-panel-battle .battle-action small { margin-top: 3px; font-size: 9px; }
.spell-panel-battle .battle-console .battle-action[data-fight] { background: #315f58; border-color: #315f58; color: #fff9e5; }
.spell-panel-battle .battle-console .skills-button { background: #fffbef; border-color: #bfcdae; color: #315f55; }
.spell-panel-battle #skills-root {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 0 3px;
  overflow: hidden;
  border: 1px solid #d5dcc4;
  border-radius: 10px;
  background: #fffbef;
  box-shadow: none;
  pointer-events: auto;
}
.spell-panel-battle .combat-panel-head { display: flex; flex: none; align-items: center; justify-content: space-between; height: 32px; min-height: 32px; padding: 0 7px; gap: 7px; }
.spell-panel-battle .combat-panel-head h3 { min-width: 0; font: 700 14px/1.2 sans-serif; color: #315f55; }
.spell-panel-battle .combat-panel-collapse { min-height: 28px; padding: 4px 8px; background: #e8eedf; border: 0; border-radius: 7px; font-size: 11px; font-weight: 700; color: #315f55; }
.spell-panel-battle .combat-skills-list {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  gap: 6px;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 5px 2px;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: none;
  -ms-overflow-style: none;
  user-select: none;
  -webkit-user-select: none;
}
.spell-panel-battle .combat-skills-list::-webkit-scrollbar { display: none; width: 0; height: 0; }
.spell-panel-battle .combat-skills-list.few-skills { justify-content: center; }
.spell-panel-battle .combat-skill-row { flex: 0 0 calc((100% - 24px) / 5); min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.spell-panel-battle .combat-skill-cast {
  position: relative;
  flex: 1;
  min-height: 48px;
  min-width: 0;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 4px 2px;
  border: 1px solid #ced8bd;
  border-radius: 8px;
  background: #eef3e5;
  color: #315f55;
}
.spell-panel-battle .combat-skill-cast:enabled:hover { background: #e2ecd4; border-color: #8ea981; }
.spell-panel-battle .combat-skill-cast:enabled:active { background: #d9e7c8; }
.spell-panel-battle .combat-skill-cast:disabled { opacity: 1; pointer-events: none; }
.spell-panel-battle .combat-skill-cast .skill-asset { width: min(100%, 47px); height: 47px; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.spell-panel-battle .combat-skill-cost { position: absolute; top: 1px; right: 1px; display: flex; align-items: center; gap: 2px; padding: 2px 3px; border: 1px solid #d7ddc9; border-radius: 4px; background: #fffef7; color: #315f55; font-size: 10px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.spell-panel-battle .combat-skill-cost .resource-icon { width: 10px; height: 12px; }
.spell-panel-battle .combat-skill-cooldown { position: absolute; left: 3px; bottom: 3px; max-width: calc(100% - 6px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 3px; background: #fffbefed; border-radius: 4px; font-size: 8px; color: #947553; }
.spell-panel-battle .combat-skill-info { flex: none; width: 100%; height: 30px; min-height: 30px; padding: 0; border: 1px solid #cdd6bc; border-radius: 6px; background: #faf8e9; color: #315f55; font: 700 20px/1 Interface,sans-serif; }
.spell-panel-battle .combat-skill-row.inspected .combat-skill-cast,
.spell-panel-battle .combat-skill-info[aria-expanded="true"] { border-color: #38786b; background: #e3edda; }
.spell-panel-battle .combat-skill-row.unavailable .skill-asset { opacity: .46; }
.spell-panel-battle .combat-skill-row.unavailable .combat-skill-cast { background: #eceee3; }
.spell-panel-battle .combat-skill-description {
  position: absolute;
  inset: 34px 0 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid #cdd9be;
  background: #f3f7e9;
  color: #315f55;
  animation: combat-effect-arrive 160ms ease-out;
}
.spell-panel-battle .combat-skill-description > header { flex: none; display: flex; align-items: center; gap: 5px; min-height: 30px; padding: 1px 4px 0 7px; }
.spell-panel-battle .combat-skill-description .skill-asset { width: 25px; height: 25px; object-fit: contain; }
.spell-panel-battle .combat-skill-description h4 { flex: 1; min-width: 0; font: 700 12px/1.2 sans-serif; }
.spell-panel-battle .combat-description-cost { display: flex; align-items: center; flex: none; gap: 2px; font-size: 10px; font-weight: 700; }
.spell-panel-battle .combat-description-cost .resource-icon { width: 12px; height: 14px; }
.spell-panel-battle .combat-skill-description .icon-button { width: 30px; min-width: 30px; height: 30px; border: 0; background: transparent; box-shadow: none; }
.spell-panel-battle .combat-skill-description .icon-button .icon { font-size: 20px; }
.spell-panel-battle .combat-description-copy { flex: 1; min-height: 0; overflow-y: auto; padding: 3px 9px 7px; overscroll-behavior: contain; scrollbar-width: thin; font-size: 11px; line-height: 1.45; }
.spell-panel-battle .combat-description-copy p { margin: 0; }
.spell-panel-battle .combat-description-copy small { display: block; margin-top: 4px; font-size: 10px; line-height: 1.4; color: #71866a; }
.spell-panel-battle .combat-description-reason { display: block; margin-top: 4px; font-size: 10px; color: #9a7350; }
.spell-panel-battle .combat-panel-empty { flex: 1; align-self: center; padding: 8px; font-size: 11px; line-height: 1.45; color: #71866a; }
.spell-panel-battle button:focus-visible,
.spell-panel-battle [tabindex="0"]:focus-visible { outline: 2px solid #588f7c; outline-offset: -2px; }
@keyframes combat-effect-arrive { from { opacity: .45; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (min-width: 600px) {
  .spell-panel-battle { --combat-hud-height: 64px; }
  .spell-panel-battle .battle-header { padding: 9px 16px; min-height: 56px; }
  .spell-panel-battle .battle-header h2 { font-size: 23px; }
  .spell-panel-battle .battle-top { padding: 0 16px 8px; }
  .spell-panel-battle .enemy-card-main strong,
  .spell-panel-battle .enemy-card-main small { font-size: 11px; }
  .spell-panel-battle .battle-console { padding: 8px 16px 12px; }
  .spell-panel-battle .combat-player { height: 56px; min-height: 56px; }
  .spell-panel-battle .combat-player > img { width: 43px; height: 45px; }
  .spell-panel-battle .combat-player-name { font-size: 15px; }
  .spell-panel-battle .combat-vitals .vital-row strong { font-size: 12px; }
  .spell-panel-battle .combat-panel-head h3 { font-size: 16px; }
  .spell-panel-battle .combat-description-copy { font-size: 12px; }
}
@media (max-width: 350px) {
  .spell-panel-battle .battle-header h2 { font-size: 16px; }
  .spell-panel-battle .enemy-card-main small { font-size: 9px; }
  .spell-panel-battle .enemy-number { width: 16px; height: 16px; font-size: 9px; left: 3px; }
  .spell-panel-battle .enemy-card-effects { padding: 0 1px; gap: 1px; }
  .spell-panel-battle .enemy-effect { padding: 2px; font-size: 8px; }
  .spell-panel-battle .combat-vitals { gap: 6px; }
  .spell-panel-battle .combat-vitals .vital-row > span { font-size: 8px; }
  .spell-panel-battle .combat-vitals .vital-row strong { font-size: 9px; }
  .spell-panel-battle .combat-panel-head h3 { font-size: 12px; }
  .spell-panel-battle .combat-skill-cast .skill-asset { height: 42px; }
  .spell-panel-battle .combat-skill-cost { font-size: 9px; padding: 2px; }
}
@media (max-height: 640px) {
  .spell-panel-battle { --combat-panel-height: 122px; }
  .spell-panel-battle .battle-header { min-height: 44px; padding-top: 4px; padding-bottom: 4px; }
  .spell-panel-battle .enemy-card { height: 89px; }
  .spell-panel-battle .enemy-card-main { grid-template-rows: 27px 12px 12px 3px; }
  .spell-panel-battle .enemy-card-main > img { width: 27px; height: 27px; }
  .spell-panel-battle .battle-console { padding-bottom: 8px; }
  .spell-panel-battle .combat-skill-cast .skill-asset { height: 42px; }
}
.reduced-motion .spell-panel-battle .enemy-effect,
.reduced-motion .spell-panel-battle .enemy-effect-popover,
.reduced-motion .spell-panel-battle .combat-skill-description { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .spell-panel-battle .enemy-effect,
  .spell-panel-battle .enemy-effect-popover,
  .spell-panel-battle .combat-skill-description { animation: none; }
  .spell-panel-battle .clock-track i { transition: none; }
}
