/* Viewport anchors also cover touch tablets and a forced mobile preset. */
.app.device-mobile.battle-started.mobile-battle-workspace #extraActionSection.active:not(.reaction-window) {
  position: fixed !important;
  inset: auto max(12px, env(safe-area-inset-right, 0px)) max(122px, calc(env(safe-area-inset-bottom, 0px) + 122px)) auto !important;
  width: max-content !important;
  min-width: 164px;
  max-width: min(320px, calc(100dvw - 28px)) !important;
  max-height: calc(100dvh - 172px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
  padding: 7px 8px 6px !important;
  gap: 0;
  overflow: hidden !important;
  border: 1px solid #b6975066;
  border-radius: 13px 13px 9px 9px;
  background: linear-gradient(145deg, #273027eb, #111811f0);
  box-shadow: 0 5px 16px #0005, inset 0 1px 0 #ecd9a217;
  transform: none !important;
}

.app.device-mobile.battle-started #extraActionSection.active:not(.reaction-window) > .row {
  display: flex;
  min-width: 0;
  min-height: 16px;
  gap: 8px;
  margin: 0 0 5px;
  align-items: center;
}
.app.device-mobile.battle-started #extraActionSection.active:not(.reaction-window) > .row h3 {
  flex: 0 0 auto;
  padding-left: 6px;
  border-left: 2px solid #d9b765;
  color: #e6d3a1;
  font-size: 11px;
  line-height: 16px;
}
.app.device-mobile.battle-started #extraActionSection.active:not(.reaction-window) #extraActionHint {
  flex: 1 1 0;
  min-width: 0;
  max-width: 130px;
  font-size: 10px;
  line-height: 16px;
  color: #c7cbb7;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.app.device-mobile.battle-started #extraActionSection.active:not(.reaction-window) .extra-action-bar {
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 1px 0 3px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: thin;
  scrollbar-color: #b89b5166 transparent;
}
.app.device-mobile.battle-started #extraActionSection.active:not(.reaction-window) .extra-action-option {
  flex: 0 0 48px;
  gap: 3px;
}
.app.device-mobile.battle-started #extraActionSection.active:not(.reaction-window) .extra-action-option .skill-tooltip-anchor {
  width: 44px;
  flex-basis: 44px;
}
.app.device-mobile.battle-started #extraActionSection.active:not(.reaction-window) .extra-action-option .dock-skill-button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 9px;
}
.app.device-mobile.battle-started #extraActionSection.active:not(.reaction-window) .extra-action-label {
  width: 48px;
  font-size: 11px;
  line-height: 13px;
  color: #e7e4d3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* The reaction grid keeps its separate, centered layout and fixed directions. */
.app.device-mobile.battle-started.mobile-battle-workspace #extraActionSection.active.reaction-window {
  border: 1px solid #c3a45b9c;
  border-radius: 14px;
  background: linear-gradient(150deg, #273028f5, #111711f7);
}
.app.device-mobile.battle-started #extraActionSection.active.reaction-window .dir-sub,
.app.device-mobile.battle-started #extraActionSection.active.reaction-window .guard-sub {
  font-size: 10px;
  line-height: 12px;
}
.app.device-mobile.battle-started #extraActionSection.active.reaction-window .guard-sub {
  font-size: 0;
}
.app.device-mobile.battle-started #extraActionSection.active.reaction-window .guard-sub::after {
  content: "点击";
  font-size: 10px;
}

@media (max-height: 360px) and (orientation: landscape) {
  .app.device-mobile.battle-started.mobile-battle-workspace #extraActionSection.active:not(.reaction-window) {
    /* A narrow strip beside the center meter clears both status and commands. */
    inset: auto max(12px, env(safe-area-inset-right, 0px)) max(84px, calc(env(safe-area-inset-bottom, 0px) + 84px)) auto !important;
    width: min(184px, calc(50dvw - 96px)) !important;
    min-width: 0;
    max-width: min(184px, calc(50dvw - 96px)) !important;
    padding-block: 4px !important;
    max-height: calc(100dvh - 220px) !important;
  }
  .app.device-mobile.battle-started #extraActionSection.active:not(.reaction-window) > .row {
    min-height: 14px;
    margin-bottom: 2px;
  }
  .app.device-mobile.battle-started #extraActionSection.active:not(.reaction-window) > .row h3,
  .app.device-mobile.battle-started #extraActionSection.active:not(.reaction-window) #extraActionHint {
    line-height: 14px;
  }
  .app.device-mobile.battle-started #extraActionSection.active:not(.reaction-window) .extra-action-bar {
    padding-block: 0 1px;
  }
  .app.device-mobile.battle-started #extraActionSection.active:not(.reaction-window) .extra-action-label {
    font-size: 10px;
    line-height: 12px;
  }
}
