/* Full-screen battle HUD shared by desktop and mobile. This layer intentionally
   loads last so the battle view no longer inherits the earlier card-stack layout. */

html:has(.app.battle-started),
body:has(.app.battle-started) {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.app.battle-started,
.app.device-mobile.battle-started.mobile-battle-workspace {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* The action sequence is no longer a battle HUD surface. Keep its runtime
   buttons mounted so tutorials and clock control do not lose their bindings. */
.app.battle-started #timelineFloat,
.app.battle-started #topbarTimelineHost,
.app.battle-started .timeline-float.in-topbar {
  display: none !important;
}

.app.battle-started .topbar.in-battle,
.app.device-desktop.battle-started .topbar.in-battle,
.app.device-mobile.battle-started .topbar.in-battle,
.app.mobile-battle-workspace .topbar.in-battle {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: block !important;
  width: 0;
  height: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.app.battle-started .topbar.in-battle > .actions,
.app.device-desktop.battle-started .topbar.in-battle > .actions,
.app.device-mobile.battle-started .topbar.in-battle > .actions,
.app.mobile-battle-workspace .topbar.in-battle > .actions {
  position: fixed;
  top: max(10px, env(safe-area-inset-top, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  z-index: 1;
  display: flex !important;
  width: auto !important;
  min-width: 0;
  grid-template-columns: none;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(215, 175, 84, 0.32);
  border-radius: 999px;
  background: rgba(8, 11, 8, 0.78);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

.app.battle-started .topbar.in-battle > .actions button,
.app.device-desktop.battle-started .topbar.in-battle > .actions button,
.app.device-mobile.battle-started .topbar.in-battle > .actions button {
  width: auto;
  min-width: 48px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.app.battle-started #campaignSaveBtn.hidden {
  display: none !important;
}

.app.battle-started .battle-stage,
.app.device-mobile.battle-started .battle-stage,
.app.device-mobile.battle-started.mobile-battle-workspace .battle-stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block !important;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.app.battle-started .board-shell,
.app.device-mobile.battle-started .board-shell,
.app.mobile-battle-workspace .board-shell {
  position: absolute;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr) !important;
}

.app.battle-started .board-panel,
.app.device-mobile.battle-started .board-panel,
.app.mobile-battle-workspace .board-panel {
  position: absolute;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100% !important;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(44, 57, 31, 0.2), transparent 48%),
    linear-gradient(160deg, #080a07, #10150d 52%, #070906);
  box-shadow: none;
  place-items: center;
}

.app.battle-started .board-panel > .row {
  display: none;
}

.app.battle-started .battle-board-wrap,
.app.device-mobile.battle-started .battle-board-wrap,
.app.mobile-battle-workspace .battle-board-wrap {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  place-items: center;
}

.app.battle-started .board,
.app.device-desktop.battle-started .board,
.app.device-mobile.battle-started .board,
.app.mobile-battle-workspace .board {
  width: min(calc(100vw - 8px), calc((100dvh - 8px) * var(--board-cols, 12) / var(--board-rows, 10)));
  max-width: 100vw;
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  padding: 3px;
  border-radius: 0;
}

.app.battle-started .mobile-board-status {
  display: none !important;
}

/* Board-piece vitals: HP is the only bar and sits on the cell floor. */
.app.battle-started .piece-hp {
  left: 4px;
  right: 4px;
  bottom: 2px;
  z-index: 9;
  height: 5px;
  border: 1px solid rgba(8, 10, 7, 0.72);
  background: rgba(20, 24, 18, 0.94);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.app.battle-started .piece-ep {
  display: none !important;
}

.piece-action-ring {
  --action-fill: 0%;
  --overcharge-fill: 0%;
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 11;
  width: clamp(14px, 26%, 22px);
  aspect-ratio: 1;
  padding: 2px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #f4c94f 0 var(--action-fill), rgba(49, 47, 34, 0.82) var(--action-fill) 100%);
  box-shadow: 0 0 0 1px rgba(8, 10, 7, 0.92), 0 0 7px rgba(244, 201, 79, 0.3);
  isolation: isolate;
  pointer-events: none;
}

.piece-action-ring::before {
  content: "";
  position: absolute;
  inset: -5px;
  z-index: 0;
  border-radius: inherit;
  background: conic-gradient(from 0deg, #f05a50 0 var(--overcharge-fill), rgba(92, 35, 31, 0.5) var(--overcharge-fill) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
  opacity: 0;
  transition: opacity 120ms linear;
}

.piece-action-ring.overcharging::before {
  opacity: 1;
  filter: drop-shadow(0 0 3px rgba(235, 85, 75, 0.72));
}

.piece-action-ring i {
  position: absolute;
  inset: 3px;
  z-index: 1;
  border-radius: 50%;
  background: rgba(9, 11, 8, 0.96);
  box-shadow: inset 0 0 0 1px rgba(244, 217, 132, 0.16);
}

.piece-action-ring i::before {
  content: "";
  position: absolute;
  inset: -3px;
  border: 2px solid #ffe58a;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.piece-action-ring.action-ready i::before {
  animation: action-ring-ready-flash 820ms ease-in-out infinite;
}

@keyframes action-ring-ready-flash {
  0%, 100% { opacity: 0.24; box-shadow: 0 0 2px rgba(255, 226, 116, 0.28); }
  50% { opacity: 1; box-shadow: 0 0 9px rgba(255, 226, 116, 0.94); }
}

/* School meter + Full Power share a single top-most bottom-center float. */
.combat-resource-float {
  position: fixed;
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
  z-index: 105;
  display: grid;
  min-width: 72px;
  max-width: min(72vw, 620px);
  max-height: min(154px, 24dvh);
  padding: 10px 10px 7px;
  transform: translate(var(--float-x, 0), var(--float-y, 0));
  border: 1px solid rgba(215, 175, 84, 0.36);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(18, 21, 15, 0.9), rgba(7, 9, 7, 0.82));
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.52), inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

.combat-resource-float.hidden {
  display: none !important;
}

/* 迎击盘优先接收操作；量谱保留位置，响应结束后自动恢复。 */
.app.battle-started:has(.extra-actions.active.reaction-window:not(.hidden)) .combat-resource-float {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: none;
}

.combat-resource-owner {
  overflow: hidden;
  color: rgba(242, 220, 160, 0.72);
  font-size: 9px;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-resource-drag-handle {
  position: absolute;
  top: 1px;
  left: 50%;
  z-index: 3;
  display: grid;
  width: 42px;
  height: 10px;
  transform: translateX(-50%);
  place-items: center;
  cursor: move;
  touch-action: none;
}

.combat-resource-drag-handle i {
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: rgba(244, 216, 132, 0.58);
  box-shadow: 0 0 5px rgba(244, 216, 132, 0.18);
}

.combat-resource-hud {
  min-width: 0;
  overflow: visible;
}

.combat-resource-hud .school-resource-row {
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  flex-wrap: nowrap;
  justify-content: center;
}

/* 手机与手动指定的平板布局保持真实字号，不能把追势数字随整栏缩小。 */
.app.device-mobile .combat-resource-hud:has(.yanyun-meter-board) .school-resource-row {
  transform: none;
}

.app.device-mobile .yanyun-meter-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: max-content;
  min-width: 160px;
  height: 80px;
  padding: 0 6px;
}

.app.device-mobile .yanyun-state-text {
  position: relative;
  left: auto;
  transform: none;
  font-size: 14px;
  bottom: auto;
}

.app.device-mobile .yanyun-swallow,
.app.device-mobile .yanyun-wings,
.app.device-mobile .yanyun-zong-aura {
  top: calc(50% - 8px);
}

/* The queued plan stays readable without becoming another blocking action panel. */
.precommand-queue-float {
  position: fixed;
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom, 0px));
  z-index: 108;
  display: flex;
  align-items: center;
  max-width: min(560px, calc(100vw - 28px));
  min-height: 24px;
  gap: 5px;
  padding: 3px 7px;
  overflow: hidden;
  transform: translateX(-50%);
  border: 1px solid rgba(239, 202, 111, 0.26);
  border-radius: 999px;
  color: rgba(255, 239, 192, 0.9);
  background: rgba(8, 10, 8, 0.58);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(7px);
  pointer-events: none;
}

.combat-resource-float:not(.hidden) + .precommand-queue-float:not(.hidden) {
  bottom: min(26dvh, 164px);
}

.precommand-queue-float.hidden {
  display: none !important;
}

.precommand-queue-label {
  flex: 0 0 auto;
  color: rgba(222, 194, 123, 0.68);
  font: 600 9px/1 ui-sans-serif, system-ui, sans-serif;
}

.precommand-queue-list {
  display: flex;
  min-width: 0;
  gap: 3px;
  overflow: hidden;
}

.precommand-queue-item {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
  padding: 2px 5px 2px 2px;
  border-radius: 999px;
  background: rgba(85, 61, 24, 0.42);
  font-size: 9px;
  white-space: nowrap;
}

.precommand-queue-item i {
  display: grid;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  place-items: center;
  border-radius: 50%;
  color: #2d210d;
  background: #f1cf77;
  font: 800 8px/1 ui-sans-serif, system-ui, sans-serif;
}

.precommand-queue-item b {
  max-width: 74px;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
}

/* Primary commands, summon orders and qi combos share circular quarter-radial launchers. */
.app.battle-started #readyActionSection,
.app.battle-started #turnFloat,
.app.battle-started #constructActionSection,
.app.battle-started #comboActionSection,
.app.device-mobile.battle-started #readyActionSection,
.app.device-mobile.battle-started #turnFloat,
.app.device-mobile.battle-started #constructActionSection,
.app.device-mobile.battle-started #comboActionSection {
  position: fixed !important;
  top: auto !important;
  bottom: max(18px, env(safe-area-inset-bottom, 0px)) !important;
  z-index: 96;
  display: block;
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  resize: none;
  transform: none !important;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.app.battle-started #readyActionSection {
  left: max(18px, env(safe-area-inset-left, 0px)) !important;
  right: auto !important;
}

.app.battle-started #turnFloat {
  right: max(18px, env(safe-area-inset-right, 0px)) !important;
  left: auto !important;
}

.app.battle-started #constructActionSection {
  left: max(94px, calc(env(safe-area-inset-left, 0px) + 94px)) !important;
  right: auto !important;
}

.app.battle-started #comboActionSection {
  right: max(18px, env(safe-area-inset-right, 0px)) !important;
  left: auto !important;
}

.app.battle-started #turnFloat.hidden,
.app.battle-started #readyActionSection.hidden,
.app.battle-started #constructActionSection.hidden,
.app.battle-started #comboActionSection:not(.active),
.app.battle-started #turnFloat.combo-replaced {
  display: none !important;
}

.app.battle-started #readyActionSection > .float-handle,
.app.battle-started #readyActionSection > .small,
.app.battle-started #turnFloat > .float-handle,
.app.battle-started #turnFloat > #turnInfo,
.app.battle-started #turnFloat .turn-actions > .row,
.app.battle-started #constructActionSection > .float-handle,
.app.battle-started #comboActionSection > .float-handle,
.app.battle-started #comboActionPager,
.app.battle-started #turnDockActionValue {
  display: none !important;
}

.radial-dock-toggle {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(232, 199, 112, 0.74);
  border-radius: 50%;
  color: #f6df9d;
  background:
    radial-gradient(circle at 38% 30%, rgba(244, 217, 132, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(61, 50, 27, 0.98), rgba(14, 17, 12, 0.98));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.54), inset 0 0 0 3px rgba(8, 10, 7, 0.72), 0 0 16px rgba(215, 175, 84, 0.18);
  font-size: 25px;
  font-weight: 800;
  font-family: "Songti SC", "STSong", serif;
  line-height: 1;
}

.radial-open .radial-dock-toggle,
.radial-dock-toggle[aria-expanded="true"] {
  border-color: #f4d884;
  color: #fff0b6;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.58), inset 0 0 0 3px rgba(8, 10, 7, 0.72), 0 0 24px rgba(244, 207, 104, 0.36);
}

@property --dock-resource-reveal {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}

.dock-resource-ring {
  position: absolute;
  inset: -5px;
  width: calc(100% + 10px);
  height: calc(100% + 10px);
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  transform: rotate(-90deg);
}

.radial-open .dock-resource-ring { opacity: 1; }

.dock-connection-layer {
  position: absolute;
  inset: 0;
  width: 64px;
  height: 64px;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
}
.radial-open .dock-connection-layer { opacity: 1; }
.dock-connection-layer path { fill: none; stroke-linecap: round; }
.dock-branch-link { stroke: rgba(227, 209, 160, 0.45); stroke-width: 1; }
.dock-queue-link {
  stroke: #efcd79;
  stroke-width: 1.7;
  stroke-dasharray: 5 7;
  filter: drop-shadow(0 0 2px rgba(241, 194, 85, 0.45));
  animation: dock-queue-stream 1.7s linear infinite;
}
@keyframes dock-queue-stream { to { stroke-dashoffset: -24; } }
.dock-resource-ring .dock-resource-ripple {
  stroke: #ffe765;
  stroke-width: 1;
  opacity: 0.16;
  animation: dock-resource-wave 5s linear infinite;
}
[data-radial-dock-toggle="turn"] .dock-resource-ripple { stroke: #83ccff; animation-direction: reverse; }
@keyframes dock-resource-wave {
  0% { stroke-dashoffset: 0; opacity: 0.10; }
  50% { opacity: 0.22; }
  100% { stroke-dashoffset: -20; opacity: 0.10; }
}
@media (prefers-reduced-motion: reduce) {
  .dock-queue-link, .dock-resource-ring .dock-resource-ripple { animation: none; }
}

.dock-resource-ring circle {
  fill: none;
  stroke-width: 4;
}

.dock-resource-track { stroke: #020403; }
.dock-resource-fill {
  stroke: #ffe765;
  stroke-dashoffset: calc(100 - var(--dock-resource-fill, 0) * var(--dock-resource-reveal, 1));
  filter: drop-shadow(0 0 2px rgba(255, 224, 76, 0.55));
}

[data-radial-dock-toggle="turn"] .dock-resource-fill {
  stroke: #4da9ff;
  filter: drop-shadow(0 0 2px rgba(77, 169, 255, 0.6));
}

.app.battle-started #staminaSkillBar,
.app.battle-started #skillList,
.app.battle-started #constructActionBar,
.app.battle-started #comboActionBar {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 64px;
  height: 64px;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  pointer-events: none;
}

.app.battle-started #staminaSkillBar > .skill-tooltip-anchor,
.app.battle-started #skillList > .skill-tooltip-anchor,
.app.battle-started #constructActionBar > .skill-tooltip-anchor,
.app.battle-started #comboActionBar > .skill-tooltip-anchor,
.app.battle-started .radial-branch-option {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 44px !important;
  height: 44px;
  margin: -22px 0 0 -22px;
  opacity: 0;
  visibility: hidden;
  transform: translate(0, 0) scale(0.55);
  transition: transform 170ms cubic-bezier(.2, .85, .25, 1), opacity 120ms ease, visibility 0s linear 170ms;
  pointer-events: none;
}

.app.battle-started .radial-open #staminaSkillBar > .skill-tooltip-anchor,
.app.battle-started .radial-open #skillList > .skill-tooltip-anchor,
.app.battle-started .radial-open #constructActionBar > .skill-tooltip-anchor,
.app.battle-started .radial-open #comboActionBar > .skill-tooltip-anchor,
.app.battle-started .radial-open .radial-branch-option {
  opacity: 1;
  visibility: visible;
  transform: translate(var(--radial-x), var(--radial-y)) scale(1);
  transition-delay: calc(var(--radial-index, 0) * 14ms);
  pointer-events: auto;
}

.app.battle-started .radial-branch-focus > .skill-tooltip-anchor:not(.radial-branch-parent):not(.radial-branch-option) {
  opacity: 0.28 !important;
  filter: grayscale(1);
}

.app.battle-started .radial-branch-focus > .radial-branch-parent {
  opacity: 1;
  filter: none;
}

.app.battle-started .radial-branch-option {
  z-index: 3;
  filter: drop-shadow(0 0 7px rgba(238, 204, 111, 0.32));
}

.app.battle-started #staminaSkillBar .dock-skill-button,
.app.battle-started #skillList .dock-skill-button,
.app.battle-started #constructActionBar .dock-skill-button,
.app.battle-started #comboActionBar .dock-skill-button {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 50% !important;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.48), inset 0 0 0 1px rgba(243, 213, 138, 0.14);
}

/* First ring: four icons across a quarter circle. Second ring: up to six. */
#staminaSkillBar > :nth-child(1) { --radial-x: 0px; --radial-y: -90px; --radial-index: 1; }
#staminaSkillBar > :nth-child(2) { --radial-x: 45px; --radial-y: -78px; --radial-index: 2; }
#staminaSkillBar > :nth-child(3) { --radial-x: 78px; --radial-y: -45px; --radial-index: 3; }
#staminaSkillBar > :nth-child(4) { --radial-x: 90px; --radial-y: 0px; --radial-index: 4; }
#staminaSkillBar > :nth-child(5) { --radial-x: 0px; --radial-y: -152px; --radial-index: 5; }
#staminaSkillBar > :nth-child(6) { --radial-x: 47px; --radial-y: -145px; --radial-index: 6; }
#staminaSkillBar > :nth-child(7) { --radial-x: 89px; --radial-y: -123px; --radial-index: 7; }
#staminaSkillBar > :nth-child(8) { --radial-x: 123px; --radial-y: -89px; --radial-index: 8; }
#staminaSkillBar > :nth-child(9) { --radial-x: 145px; --radial-y: -47px; --radial-index: 9; }
#staminaSkillBar > :nth-child(10) { --radial-x: 152px; --radial-y: 0px; --radial-index: 10; }

#constructActionBar > :nth-child(1) { --radial-x: 0px; --radial-y: -90px; --radial-index: 1; }
#constructActionBar > :nth-child(2) { --radial-x: 45px; --radial-y: -78px; --radial-index: 2; }
#constructActionBar > :nth-child(3) { --radial-x: 78px; --radial-y: -45px; --radial-index: 3; }
#constructActionBar > :nth-child(4) { --radial-x: 90px; --radial-y: 0px; --radial-index: 4; }
#constructActionBar > :nth-child(5) { --radial-x: 0px; --radial-y: -152px; --radial-index: 5; }
#constructActionBar > :nth-child(6) { --radial-x: 47px; --radial-y: -145px; --radial-index: 6; }
#constructActionBar > :nth-child(7) { --radial-x: 89px; --radial-y: -123px; --radial-index: 7; }
#constructActionBar > :nth-child(8) { --radial-x: 123px; --radial-y: -89px; --radial-index: 8; }
#constructActionBar > :nth-child(9) { --radial-x: 145px; --radial-y: -47px; --radial-index: 9; }
#constructActionBar > :nth-child(10) { --radial-x: 152px; --radial-y: 0px; --radial-index: 10; }

#skillList > :nth-child(1) { --radial-x: 0px; --radial-y: -90px; --radial-index: 1; }
#skillList > :nth-child(2) { --radial-x: -45px; --radial-y: -78px; --radial-index: 2; }
#skillList > :nth-child(3) { --radial-x: -78px; --radial-y: -45px; --radial-index: 3; }
#skillList > :nth-child(4) { --radial-x: -90px; --radial-y: 0px; --radial-index: 4; }
#skillList > :nth-child(5) { --radial-x: 0px; --radial-y: -152px; --radial-index: 5; }
#skillList > :nth-child(6) { --radial-x: -47px; --radial-y: -145px; --radial-index: 6; }
#skillList > :nth-child(7) { --radial-x: -89px; --radial-y: -123px; --radial-index: 7; }
#skillList > :nth-child(8) { --radial-x: -123px; --radial-y: -89px; --radial-index: 8; }
#skillList > :nth-child(9) { --radial-x: -145px; --radial-y: -47px; --radial-index: 9; }
#skillList > :nth-child(10) { --radial-x: -152px; --radial-y: 0px; --radial-index: 10; }

#comboActionBar > :nth-child(1) { --radial-x: 0px; --radial-y: -90px; --radial-index: 1; }
#comboActionBar > :nth-child(2) { --radial-x: -45px; --radial-y: -78px; --radial-index: 2; }
#comboActionBar > :nth-child(3) { --radial-x: -78px; --radial-y: -45px; --radial-index: 3; }
#comboActionBar > :nth-child(4) { --radial-x: -90px; --radial-y: 0px; --radial-index: 4; }
#comboActionBar > :nth-child(5) { --radial-x: 0px; --radial-y: -152px; --radial-index: 5; }
#comboActionBar > :nth-child(6) { --radial-x: -47px; --radial-y: -145px; --radial-index: 6; }
#comboActionBar > :nth-child(7) { --radial-x: -89px; --radial-y: -123px; --radial-index: 7; }
#comboActionBar > :nth-child(8) { --radial-x: -123px; --radial-y: -89px; --radial-index: 8; }
#comboActionBar > :nth-child(9) { --radial-x: -145px; --radial-y: -47px; --radial-index: 9; }
#comboActionBar > :nth-child(10) { --radial-x: -152px; --radial-y: 0px; --radial-index: 10; }

.app.battle-started #comboResourceStrip {
  position: absolute;
  inset: 0;
  width: 64px;
  height: 64px;
  margin: 0;
  overflow: visible;
  pointer-events: none;
}

.combo-qi-arc {
  position: absolute;
  left: -160px;
  top: -160px;
  width: 200px;
  height: 200px;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.82);
  transform-origin: 192px 192px;
  transition: opacity 120ms ease, transform 170ms cubic-bezier(.2, .85, .25, 1), visibility 0s linear 170ms;
}

.combo-dock.radial-open .combo-qi-arc {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition-delay: 0s;
}

.combo-qi-arc svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
}

.combo-qi-arc-track,
.combo-qi-arc-fill {
  stroke-width: 7;
  stroke-linecap: round;
}

.combo-qi-arc-track { stroke: rgba(57, 43, 26, 0.88); }
.combo-qi-arc-fill {
  stroke: #e7bd58;
  filter: drop-shadow(0 0 4px rgba(231, 189, 88, 0.62));
}

.combo-qi-arc > strong {
  position: absolute;
  top: 8px;
  right: 1px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #ffe69b;
  background: rgba(18, 14, 8, 0.9);
  font-size: 11px;
  line-height: 1;
}

.combo-qi-arc > strong small { font-size: 8px; color: rgba(255, 230, 155, 0.7); }

.app.battle-started #comboClearPrecommandsBtn {
  position: absolute;
  right: 70px;
  bottom: 15px;
  z-index: 6;
  width: 62px;
  min-width: 62px;
  min-height: 32px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  white-space: nowrap;
}

.app.battle-started #comboActionHint {
  position: absolute;
  right: 70px;
  bottom: 52px;
  width: max-content;
  max-width: 190px;
  color: rgba(242, 220, 160, 0.78);
  font-size: 10px;
  text-align: right;
  pointer-events: none;
}

.app.battle-started #turnFloat .turn-actions {
  position: absolute;
  right: 70px;
  bottom: 5px;
  z-index: 4;
  display: block;
  width: auto;
  margin: 0;
  transition: opacity 120ms ease, visibility 120ms ease;
}

.app.battle-started #turnFloat .board-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app.battle-started #turnFloat #endBtn {
  width: 52px;
  min-width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 3px;
  border-radius: 50%;
  font-size: 10px;
}

.app.battle-started #turnFloat #clearPrecommandsBtn {
  width: 62px;
  min-width: 62px;
  height: 34px;
  min-height: 34px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
}

.app.battle-started:has(#readyActionSection.radial-open, #turnFloat.radial-open, #constructActionSection.radial-open, #comboActionSection.radial-open) #turnFloat .turn-actions,
.app.battle-started #turnFloat .turn-actions:has(#endBtn:disabled):has(#clearPrecommandsBtn:disabled) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.dock-skill-button {
  position: relative;
}

.dock-skill-button.precommand-queued {
  border-color: rgba(255, 219, 111, 0.96) !important;
  box-shadow: 0 0 0 2px rgba(255, 205, 73, 0.28), 0 0 13px rgba(255, 191, 49, 0.62) !important;
}

.precommand-badges {
  position: absolute;
  top: -7px;
  right: -8px;
  z-index: 8;
  display: flex;
  width: 38px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1px;
  pointer-events: none;
}

.precommand-badges i {
  display: grid;
  width: 13px;
  height: 13px;
  place-items: center;
  border: 1px solid rgba(255, 230, 153, 0.82);
  border-radius: 50%;
  background: rgba(74, 46, 16, 0.96);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.66);
  color: #fff0b4;
  font: 700 8px/1 ui-sans-serif, system-ui, sans-serif;
}

.app.battle-started #readyActionSection .campaign-medicine-bar {
  position: absolute;
  left: 70px;
  bottom: 5px;
  z-index: 4;
  width: auto;
}

.app.battle-started #variantDock {
  z-index: 108;
}

/* Reaction and combo windows stay above the resource float instead of claiming
   permanent layout space at the bottom edge. */
.app.device-desktop.battle-started .extra-float.extra-actions.active:not(.reaction-window) {
  bottom: 116px;
}

/* Mobile keeps only compact status/log access in the corner; primary commands
   remain the same left/right radial controls used on desktop. */
.app.device-mobile.battle-started .mobile-battle-deck,
.app.device-mobile.battle-started.mobile-battle-workspace .mobile-battle-deck {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.app.device-mobile.battle-started .mobile-battle-tools {
  position: fixed;
  top: max(10px, env(safe-area-inset-top, 0px));
  left: max(10px, env(safe-area-inset-left, 0px));
  z-index: 2;
  display: flex;
  width: auto;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(215, 175, 84, 0.26);
  border-radius: 999px;
  background: rgba(8, 11, 8, 0.76);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.app.device-mobile.battle-started .mobile-operated-summary,
.app.device-mobile.battle-started .mobile-battle-prompt {
  display: none;
}

.app.device-mobile.battle-started .mobile-battle-tools button {
  width: auto;
  min-width: 42px;
  min-height: 30px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.app.device-mobile.battle-started #mobileBattlePanels,
.app.device-mobile.battle-started #mobileBattlePanels > * {
  pointer-events: auto;
}

/* 普通回合外行动会被 mobile-battle-layout 锚定到 #mobileBattleDeck，
   它不再是 #mobileBattlePanels 的子节点。该甲板本身为了让棋盘可点而
   关闭了指针事件，因此必须在浮窗边界显式恢复，不能依赖默认继承。 */
.app #extraActionSection.hidden,
.app #extraActionSection:not(.active) {
  display: none !important;
}

.app.device-mobile.battle-started #extraActionSection,
.app.device-mobile.battle-started #extraActionSection * {
  pointer-events: auto;
}

.app.device-mobile.battle-started #extraActionSection button {
  touch-action: manipulation;
}

/* The mobile deck fills the viewport. Out-of-turn windows must anchor to the
   viewport too: the former bottom: 100% deck anchor put them above the screen
   on touch tablets wider than the phone-only landscape breakpoint. */
.app.device-mobile.battle-started.mobile-battle-workspace #extraActionSection.hidden,
.app.device-mobile.battle-started.mobile-battle-workspace #extraActionSection:not(.active) {
  display: none !important;
}

.app.device-mobile.battle-started.mobile-battle-workspace #extraActionSection.active:not(.reaction-window) {
  position: fixed !important;
  inset: max(43px, calc(env(safe-area-inset-top, 0px) + 43px)) max(7px, env(safe-area-inset-right, 0px)) auto auto !important;
  display: grid !important;
  width: min(286px, calc(100dvw - 14px)) !important;
  max-width: min(286px, calc(100dvw - 14px)) !important;
  max-height: calc(100dvh - 50px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
  margin: 0 !important;
  padding: 7px !important;
  overflow: auto !important;
  transform: none !important;
  border-radius: 10px;
  z-index: 126;
}

.app.device-mobile.battle-started.mobile-battle-workspace #extraActionSection.active.reaction-window {
  position: fixed !important;
  inset: 50% auto auto 50% !important;
  display: block !important;
  width: min(280px, calc(100dvw - 20px), calc(100dvh - 68px)) !important;
  max-width: min(280px, calc(100dvw - 20px), calc(100dvh - 68px)) !important;
  max-height: calc(100dvh - 68px) !important;
  margin: 0 !important;
  padding: 5px 6px !important;
  overflow: auto !important;
  transform: translate(-50%, -50%) !important;
  border-radius: 11px;
  z-index: 151;
}

/* Keep every mobile follow-up reachable without a sideways swipe. The panel
   is a grid item, whose automatic minimum otherwise follows the full row. */
.app.device-mobile.battle-started #extraActionSection.active:not(.reaction-window) .extra-action-bar {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  overflow-x: hidden;
}

@media (max-width: 600px) {
  .app.device-mobile.battle-started.mobile-battle-workspace {
    --mobile-battle-top-rail: max(54px, calc(env(safe-area-inset-top, 0px) + 54px));
    --mobile-battle-command-rail: max(84px, calc(env(safe-area-inset-bottom, 0px) + 84px));
  }

  .app.battle-started .topbar.in-battle > .actions {
    top: max(7px, env(safe-area-inset-top, 0px));
    right: max(7px, env(safe-area-inset-right, 0px));
    gap: 3px;
    padding: 4px;
    min-height: 42px;
    border-radius: 14px;
    background: rgba(8, 11, 8, 0.88);
  }

  .app.device-mobile.battle-started .topbar.in-battle > .actions {
    top: max(7px, env(safe-area-inset-top, 0px));
  }

  .app.battle-started .topbar.in-battle > .actions button {
    min-width: 42px;
    min-height: 32px;
    padding: 3px 7px;
    font-size: 10px;
  }

  .app.device-mobile.battle-started .mobile-battle-tools {
    top: max(7px, env(safe-area-inset-top, 0px));
    left: max(7px, env(safe-area-inset-left, 0px));
    min-height: 42px;
    padding: 4px;
    border-radius: 14px;
    background: rgba(8, 11, 8, 0.88);
  }

  .app.device-mobile.battle-started .mobile-battle-tools button {
    min-width: 44px;
    min-height: 32px;
    padding: 3px 7px;
    font-size: 10px;
  }

  /* Mobile battle composition: one top utility rail, a readable centered
     battlefield, and one bottom command rail. The open radial menus use the
     deliberate clear zone between board and command rail. */
  .app.device-mobile.battle-started.mobile-battle-workspace .board-panel {
    padding: var(--mobile-battle-top-rail) 4px max(230px, 38dvh);
    background:
      radial-gradient(circle at 50% 42%, rgba(58, 72, 40, 0.24), transparent 46%),
      linear-gradient(180deg, #080a07 0%, #10150d 54%, #070906 100%);
    place-items: center;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace .battle-board-wrap {
    width: 100%;
    height: auto;
    max-height: none;
    align-content: center;
    place-items: center;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace .board {
    width: 100%;
    max-width: 100%;
    padding: 3px;
    border: 1px solid rgba(215, 175, 84, 0.22);
    border-radius: 12px;
    background:
      radial-gradient(ellipse 110% 55% at 50% 100%, rgba(30, 43, 21, 0.82), transparent 54%),
      linear-gradient(170deg, rgba(16, 20, 13, 0.96), rgba(10, 13, 9, 0.98));
    box-shadow:
      0 16px 42px rgba(0, 0, 0, 0.34),
      inset 0 0 52px rgba(0, 0, 0, 0.3),
      0 0 0 1px rgba(8, 10, 7, 0.86);
  }

  .app.device-mobile.battle-started.mobile-battle-workspace .cell {
    border-color: transparent;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace .piece {
    padding: 1px;
    border-radius: 7px;
    font-size: clamp(8px, 2.45vw, 10px);
  }

  .app.device-mobile.battle-started.mobile-battle-workspace .board-move-control {
    --move-control-w: 24px;
    --move-control-h: 24px;
    left: clamp(2px, calc(var(--move-control-x, 0px) - 27px), calc(100% - 26px));
    top: clamp(2px, calc(var(--move-control-y, 0px) - 12px), calc(100% - 26px));
    transform: none;
    border: 1px solid rgba(112, 167, 232, 0.7);
    border-radius: 50%;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace .board-move-label {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    letter-spacing: 0;
    font-size: 0;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace .board-move-label::after {
    content: "移";
    font-size: 12px;
    line-height: 1;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace .mobile-battle-deck::after {
    content: "";
    position: fixed;
    right: max(7px, env(safe-area-inset-right, 0px));
    bottom: max(6px, env(safe-area-inset-bottom, 0px));
    left: max(7px, env(safe-area-inset-left, 0px));
    z-index: 0;
    height: 76px;
    border: 1px solid rgba(215, 175, 84, 0.26);
    border-radius: 30px;
    background:
      linear-gradient(180deg, rgba(20, 23, 17, 0.86), rgba(7, 9, 7, 0.94));
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(12px);
    pointer-events: none;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace #turnFloat .turn-actions {
    position: fixed;
    right: max(20px, env(safe-area-inset-right, 0px));
    bottom: max(88px, calc(env(safe-area-inset-bottom, 0px) + 88px));
    width: auto;
    height: 32px;
    margin: 0;
    opacity: 1;
    transition: opacity 120ms ease;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace #turnFloat #endBtn {
    width: 50px;
    min-width: 50px;
    height: 32px;
    min-height: 32px;
    padding: 2px 5px;
    border-radius: 999px;
    font-size: 9px;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace #turnFloat #clearPrecommandsBtn {
    width: 58px;
    min-width: 58px;
    height: 32px;
    min-height: 32px;
    padding: 2px 5px;
    font-size: 8px;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace #turnFloat .turn-actions:has(#endBtn:disabled):has(#clearPrecommandsBtn:disabled),
  .app.device-mobile.battle-started.mobile-battle-workspace:has(#readyActionSection.radial-open, #turnFloat.radial-open, #constructActionSection.radial-open, #comboActionSection.radial-open) #turnFloat .turn-actions {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace:has(#readyActionSection.radial-open, #turnFloat.radial-open, #constructActionSection.radial-open, #comboActionSection.radial-open) .combat-resource-float:not(:has(.yanyun-meter-board)) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace[data-mobile-panel-open="focus"] #readyActionSection,
  .app.device-mobile.battle-started.mobile-battle-workspace[data-mobile-panel-open="focus"] #turnFloat,
  .app.device-mobile.battle-started.mobile-battle-workspace[data-mobile-panel-open="focus"] #constructActionSection,
  .app.device-mobile.battle-started.mobile-battle-workspace[data-mobile-panel-open="focus"] #comboActionSection,
  .app.device-mobile.battle-started.mobile-battle-workspace[data-mobile-panel-open="focus"] .combat-resource-float,
  .app.device-mobile.battle-started.mobile-battle-workspace[data-mobile-panel-open="log"] #readyActionSection,
  .app.device-mobile.battle-started.mobile-battle-workspace[data-mobile-panel-open="log"] #turnFloat,
  .app.device-mobile.battle-started.mobile-battle-workspace[data-mobile-panel-open="log"] #constructActionSection,
  .app.device-mobile.battle-started.mobile-battle-workspace[data-mobile-panel-open="log"] #comboActionSection,
  .app.device-mobile.battle-started.mobile-battle-workspace[data-mobile-panel-open="log"] .combat-resource-float {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace[data-mobile-panel-open="focus"] .mobile-battle-deck::after,
  .app.device-mobile.battle-started.mobile-battle-workspace[data-mobile-panel-open="log"] .mobile-battle-deck::after {
    opacity: 0;
  }

  .combat-resource-float {
    max-width: 64vw;
    max-height: 132px;
    padding: 9px 7px 5px;
    border-color: rgba(215, 175, 84, 0.2);
    background: rgba(10, 13, 9, 0.72);
    box-shadow: none;
    transition: opacity 120ms ease, visibility 0s linear 120ms;
  }

  .combat-resource-owner {
    display: none;
  }

  .combat-resource-hud .school-resource-row {
    transform: scale(0.86);
    transform-origin: center bottom;
  }

  .app.battle-started #readyActionSection,
  .app.battle-started #turnFloat,
  .app.battle-started #constructActionSection,
  .app.battle-started #comboActionSection {
    bottom: max(18px, env(safe-area-inset-bottom, 0px)) !important;
  }

  .radial-dock-toggle,
  .app.battle-started #readyActionSection,
  .app.battle-started #turnFloat,
  .app.battle-started #constructActionSection,
  .app.battle-started #comboActionSection {
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    height: 58px;
    min-height: 58px;
    max-height: 58px;
  }

  .radial-dock-toggle {
    font-size: 22px;
  }

  .app.battle-started #staminaSkillBar,
  .app.battle-started #skillList,
  .app.battle-started #constructActionBar,
  .app.battle-started #comboActionBar {
    width: 58px;
    height: 58px;
  }
}

/* Phone combat is intentionally landscape-first. Portrait keeps state intact
   behind a blocking rotation prompt; landscape reuses the desktop full-board
   composition and only compacts the floating controls. */
@media (max-width: 900px) and (orientation: portrait) {
  .app.device-mobile.battle-started::after {
    content: "请将手机横置以继续战斗";
    position: fixed;
    inset: 0;
    z-index: 15000;
    display: grid;
    padding: 28px;
    place-items: center;
    color: #f5df9d;
    background: radial-gradient(circle at 50% 42%, rgba(92, 70, 30, 0.3), transparent 34%), rgba(5, 7, 5, 0.98);
    font: 700 18px/1.5 ui-sans-serif, system-ui, sans-serif;
    letter-spacing: 0.08em;
    text-align: center;
    pointer-events: auto;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .app.device-mobile.battle-started.mobile-battle-workspace .board-panel {
    padding: 4px !important;
    place-items: center;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace .battle-board-wrap {
    width: 100%;
    height: 100%;
    max-height: 100%;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace .board {
    width: min(calc(100vw - 8px), calc((100dvh - 8px) * var(--board-cols, 12) / var(--board-rows, 10)));
    max-width: calc(100vw - 8px);
    max-height: calc(100dvh - 8px);
    padding: 2px;
    border-radius: 6px;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace .mobile-battle-deck::after {
    display: none;
  }

  .app.device-mobile.battle-started .topbar.in-battle > .actions,
  .app.device-mobile.battle-started .mobile-battle-tools {
    top: max(5px, env(safe-area-inset-top, 0px));
    min-height: 0;
    padding: 3px;
    border-radius: 999px;
  }

  .app.device-mobile.battle-started .topbar.in-battle > .actions button,
  .app.device-mobile.battle-started .mobile-battle-tools button {
    min-width: 38px;
    min-height: 28px;
    padding: 2px 6px;
    font-size: 9px;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace #turnFloat .turn-actions {
    position: absolute;
    right: 66px;
    bottom: 4px;
    height: auto;
  }

  .app.device-mobile.battle-started.mobile-battle-workspace #turnFloat #endBtn,
  .app.device-mobile.battle-started.mobile-battle-workspace #turnFloat #clearPrecommandsBtn {
    height: 30px;
    min-height: 30px;
  }

  .combat-resource-float {
    max-width: 52vw;
    max-height: 96px;
  }

  .combat-resource-float:not(.hidden) + .precommand-queue-float:not(.hidden) {
    bottom: max(102px, calc(env(safe-area-inset-bottom, 0px) + 102px));
  }

  .precommand-queue-float {
    min-height: 21px;
    max-width: min(52vw, 390px);
    gap: 3px;
    padding: 2px 5px;
    opacity: 0.88;
  }

  .precommand-queue-label {
    font-size: 8px;
  }

  .precommand-queue-item {
    padding-right: 4px;
    font-size: 8px;
  }

  .precommand-queue-item i {
    width: 12px;
    height: 12px;
    flex-basis: 12px;
    font-size: 7px;
  }

  /* 技能步骤的提示浮窗靠技能盘对侧，不遮住横屏扇形图标。 */
  #app[data-tutorial-dock-side] #tutorialHost .tutorial-mask.action-step .tutorial-dialog:not(.tutorial-collapsed) {
    top: max(5px, env(safe-area-inset-top, 0px));
    width: min(300px, 42vw);
    max-height: 34dvh;
    padding: 7px 10px;
    transform: none;
    border-radius: 12px;
    background: rgba(7, 14, 15, 0.86);
  }

  #app[data-tutorial-dock-side="left"] #tutorialHost .tutorial-mask.action-step .tutorial-dialog:not(.tutorial-collapsed) {
    left: auto;
    right: max(8px, env(safe-area-inset-right, 0px));
  }

  #app[data-tutorial-dock-side="right"] #tutorialHost .tutorial-mask.action-step .tutorial-dialog:not(.tutorial-collapsed) {
    left: max(8px, env(safe-area-inset-left, 0px));
    right: auto;
  }

  #app[data-tutorial-dock-side] #tutorialHost .tutorial-mask.action-step .tutorial-text {
    font-size: 12px;
    line-height: 1.35;
  }

  #app[data-tutorial-dock-side] #tutorialHost .tutorial-mask.action-step .tutorial-action-footer {
    margin-top: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app.battle-started #staminaSkillBar > .skill-tooltip-anchor,
  .app.battle-started #skillList > .skill-tooltip-anchor,
  .app.battle-started #constructActionBar > .skill-tooltip-anchor,
  .app.battle-started #comboActionBar > .skill-tooltip-anchor,
  .app.battle-started .radial-branch-option {
    transition: none;
  }

  .piece-action-ring.action-ready i::before {
    animation: none;
    opacity: 0.7;
  }
}
/* 紧凑技能展开区：保留圆环，给操作键留出独立竖向通道。 */
.app.battle-started #readyActionSection,
.app.battle-started #turnFloat,
.app.battle-started #constructActionSection,
.app.battle-started #comboActionSection,
.app.device-mobile.battle-started #readyActionSection,
.app.device-mobile.battle-started #turnFloat,
.app.device-mobile.battle-started #constructActionSection,
.app.device-mobile.battle-started #comboActionSection { bottom: max(66px, calc(env(safe-area-inset-bottom, 0px) + 66px)) !important; }
.dock-resource-amount { position: absolute; left: 3px; right: 3px; bottom: 8px; height: 12px; line-height: 12px; font: 600 10px/12px ui-sans-serif, system-ui, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; white-space: nowrap; pointer-events: none; opacity: 0; color: #f5df9d; text-shadow: 0 1px 3px #000; }
.radial-open .dock-resource-amount { opacity: 1; }
.radial-open:has(.dock-resource-amount) .radial-dock-toggle > span:not(.dock-resource-amount) { transform: translateY(-5px); }
[data-radial-dock-toggle="turn"] .dock-resource-amount { color: #b5ddff; }
.app.battle-started #turnFloat .turn-actions,
.app.device-mobile.battle-started.mobile-battle-workspace #turnFloat .turn-actions { inset: 0 !important; width: 100% !important; height: 100% !important; opacity: 1 !important; visibility: visible !important; pointer-events: none !important; }
.app.battle-started #turnFloat .board-actions { display: contents; }
.app.battle-started #turnFloat #clearPrecommandsBtn,
.app.device-mobile.battle-started.mobile-battle-workspace #turnFloat #clearPrecommandsBtn { position: absolute; left: 12px; right: auto; top: -32px; bottom: auto; width: 40px; min-width: 40px; height: 24px; min-height: 24px; padding: 1px 2px; white-space: normal; line-height: 10px; font-size: 9px; border-radius: 6px; color: #bddeee; border: 1px solid #527385; background: rgba(22, 42, 53, 0.96); pointer-events: auto; }
.app.battle-started #turnFloat #endBtn { position: absolute; left: 0; right: auto; top: 76px; bottom: auto; width: 64px; min-width: 64px; height: 32px; min-height: 32px; font-size: 10px; border-radius: 999px; color: #ffe6bd; border: 1px solid #a07843; background: rgba(75, 45, 22, 0.96); pointer-events: auto; }
.app.battle-started #turnFloat #endBtn:disabled, .app.battle-started #turnFloat #clearPrecommandsBtn:disabled { opacity: 0.38; pointer-events: none; }

/* 量谱不再常驻底板；点按或拖动时短暂浮现操作背景。 */
.app.battle-started .combat-resource-float {
  padding: 5px 7px;
  max-height: none;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  touch-action: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.app.battle-started .combat-resource-float.resource-interacting {
  background: rgba(0, 0, 0, 0.56);
  border-color: rgba(215, 175, 84, 0.2);
}
.combat-resource-float .combat-resource-owner { display: none; }
.combat-resource-float .combat-resource-drag-handle { top: -5px; width: 72px; height: 22px; }
.combat-resource-float .combat-resource-drag-handle i { opacity: 0; transition: opacity 160ms ease; }
.combat-resource-float.resource-interacting .combat-resource-drag-handle i { opacity: 0.7; }
.combat-resource-hud .yaowang-medicine-meter,
.combat-resource-hud .xianming-resource-controls { zoom: 0.9; }

.full-strike.active {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: #ffe0a2;
  box-shadow: 0 0 10px rgba(255, 211, 127, 0.85), 0 0 26px rgba(255, 122, 94, 0.65), inset 0 0 10px rgba(255, 222, 156, 0.3);
  animation: full-strike-radiance 2.4s ease-in-out infinite;
}
.full-strike.active i.on { background: #ffcb88; box-shadow: 0 0 7px #ffdf9d; }
.full-strike.active::after {
  content: "";
  position: absolute;
  inset: -25% -50%;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 245, 213, 0.95) 49%, transparent 60%);
  transform: translateX(-75%);
  animation: full-strike-light-sweep 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes full-strike-light-sweep {
  0%, 65% { transform: translateX(-75%); opacity: 0; }
  70% { opacity: 1; }
  90%, 100% { transform: translateX(75%); opacity: 0; }
}
@keyframes full-strike-radiance {
  50% { filter: brightness(1.3); }
}
@media (prefers-reduced-motion: reduce) {
  .full-strike.active { animation: none; }
  .full-strike.active::after { animation: none; display: none; }
}
