/* design/SKILL.md §4.2 / §4.3 / §6.4 — physical offsets and expanded selectors
   keep legacy Android WebViews in the same fitted stage as modern hosts. */
/* design/SKILL.md §2.3 / §4.2 / §4.3 — VK supplement originals keep their
   native geometry within the shared fitted stage on PC, Android and iOS. */
.official-ui-active.vk-host #game-container .vk-image-control,
.official-ui-active.vk-host #game-container .vk-text-control {
  padding: 0 !important; border: 0 !important; border-image: none !important;
  border-radius: 0 !important; box-shadow: none !important; color: transparent !important;
  font-size: 0 !important; text-shadow: none !important; background-color: transparent !important;
  background-image: var(--official-control-art) !important;
  background-position: center !important; background-size: contain !important;
  background-repeat: no-repeat !important; flex-shrink: 0; opacity: 1;
}
.official-ui-active.vk-host #game-container .vk-image-control > * { visibility: hidden !important; }
.official-ui-active.vk-host #game-container .vk-image-control::before,
.official-ui-active.vk-host #game-container .vk-image-control::after { content: none !important; }
.official-ui-active.vk-host #game-container .vk-image-control[data-vk-shape="rectangular"],
.official-ui-active.vk-host #game-container .vk-text-control[data-vk-shape="rectangular"] {
  width: 220px !important; min-width: 220px !important; height: 60px !important; min-height: 60px !important;
}
/* design/SKILL.md §4.3 / §6.4 — blank VK art keeps the actual action label;
   baked labels continue using image-only controls without duplicate text. */
.official-ui-active.vk-host #game-container .vk-text-control {
  color: #f5f2e6 !important; font: 26px/60px var(--font, serif) !important;
  text-align: center; white-space: nowrap; letter-spacing: 0;
  text-shadow: 0 1px 2px #243333 !important;
}
.official-ui-active.vk-host #game-container .vk-text-control > * {
  visibility: visible !important; color: inherit !important; font: inherit !important;
}
.official-ui-active.vk-host #game-container .vk-text-control::before,
.official-ui-active.vk-host #game-container .vk-text-control::after { content: none !important; }
/* §4.2 / §4.3 — the supplied restore button has a wider baked label. */
.official-ui-active.vk-host #game-container .vk-image-control[data-vk-shape="wide"] {
  width: 289px !important; min-width: 289px !important; height: 60px !important; min-height: 60px !important;
}
.official-ui-active.vk-host #game-container .vk-image-control[data-vk-shape="diamond"] {
  width: 98px !important; min-width: 98px !important; height: 98px !important; min-height: 98px !important;
}
.official-ui-active.vk-host #game-container .vk-image-control[data-vk-shape="icon"] {
  width: 44px !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important;
}
.official-ui-active.vk-host #game-container .vk-image-control[data-vk-shape="arrow"] {
  width: 48px !important; min-width: 48px !important; height: 84px !important; min-height: 84px !important;
}
/* §3.2 / §6.4 — no old hover image may replace the new surface. Disabled
   controls retain their supplied state, with a tint only where no state exists. */
.official-ui-active.vk-host #game-container .vk-image-control:hover:not(:disabled),
.official-ui-active.vk-host #game-container .vk-text-control:hover:not(:disabled) {
  background-image: var(--official-control-art-hover, var(--official-control-art)) !important;
  filter: brightness(1.12) !important;
}
.official-ui-active.vk-host #game-container .vk-image-control:focus-visible:not(:disabled),
.official-ui-active.vk-host #game-container .vk-text-control:focus-visible:not(:disabled) {
  background-image: var(--official-control-art-hover, var(--official-control-art)) !important;
  filter: brightness(1.12) !important;
}
.official-ui-active.vk-host #game-container .vk-image-control:active:not(:disabled),
.official-ui-active.vk-host #game-container .vk-text-control:active:not(:disabled) {
  background-image: var(--official-control-art-pressed, var(--official-control-art)) !important;
  filter: brightness(.88) !important;
}
.official-ui-active.vk-host #game-container .vk-image-control:disabled,
.official-ui-active.vk-host #game-container .vk-text-control:disabled {
  background-image: var(--official-control-art-disabled, var(--official-control-art)) !important;
  filter: grayscale(.75) brightness(.6) !important; cursor: not-allowed;
}
.official-ui-active.vk-host #game-container .vk-image-control[data-vk-shape="diamond"]:disabled { filter: none !important; }
.official-ui-active.vk-host #game-container #btn-one-click-deploy:disabled:not([data-official-asset*="/deploy_busy.png"]) { filter: grayscale(.75) brightness(.6) !important; }
.official-ui-active.vk-host #game-container .vk-image-control:focus-visible,
.official-ui-active.vk-host #game-container .vk-text-control:focus-visible { outline: 2px solid #b6f9ff; outline-offset: 3px; }

/* §4.1 / §4.2 — the cover help is adjacent to its primary action. */
.official-ui-active.vk-host #start-screen .start-content { top: 230px; }
.official-ui-active.vk-host #start-screen #btn-start { bottom: -98px; }
.official-ui-active.vk-host #start-screen .start-secondary-actions {
  left: calc(50% + 140px); bottom: -90px; width: 44px; height: 44px; transform: none;
}
.official-ui-active.vk-host #start-screen #btn-rules-start,
.official-ui-active.vk-host #terrain-legend-modal #btn-close-terrain-legend {
  background-image: var(--official-control-art) !important;
  background-size: 44px 44px !important;
}
/* design/SKILL.md §4.2 / §4.3 — match the terrain dialog's visible close
   icon across stage scales while keeping a 44px physical touch target. */
.official-ui-active.vk-host.h5-exit-enabled #btn-close-game {
  background-image: var(--official-control-art) !important;
  background-size: calc(44px * var(--dx-stage-scale, 1)) calc(44px * var(--dx-stage-scale, 1)) !important;
  color: transparent !important;
}
/* design/SKILL.md §4.2 / §4.3 / §6.4 — a modal owns the top layer: the
   global exit target becomes inert and falls behind the dimmer while its
   normal 44px hit area and artwork remain available after the modal closes. */
.official-ui-active.vk-host.h5-exit-enabled #btn-close-game.is-modal-blocked,
.official-ui-active.vk-host.h5-exit-enabled #btn-close-game.is-modal-blocked:disabled {
  z-index: 199 !important;
  pointer-events: none !important;
  cursor: default !important;
  opacity: .35 !important;
  filter: grayscale(.75) brightness(.65) !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}
/* design/SKILL.md §4.2 Fitts' Law / §6.4 Error Handling — press feedback is
   a small scale change, never a browser focus rectangle or tap highlight. */
.official-ui-active.vk-host.h5-exit-enabled #btn-close-game {
  -webkit-tap-highlight-color: transparent;
  transition: transform 90ms ease-out;
}
.official-ui-active.vk-host.h5-exit-enabled #btn-close-game:focus:not(:focus-visible) {
  outline: none !important;
}
.official-ui-active.vk-host.h5-exit-enabled #btn-close-game:active:not(:disabled) {
  transform: scale(.96) !important;
  filter: none !important;
  outline: none !important;
  box-shadow: none !important;
}
.official-ui-active.vk-host #enemy-selector-prev,
.official-ui-active.vk-host #enemy-selector-next { transform: none !important; }
#btn-vk-start-selected, #btn-close-terrain-legend-footer { display: none; }
.official-ui-active.vk-host #btn-vk-start-selected { display: block; }
.official-ui-active.vk-host #enemy-select-screen .select-actions-fixed { gap: 20px; }
/* design/SKILL.md §4.2 / §4.3 — keep the cancel action first and center
   every supplied diamond on the same rail, including narrow touch viewports. */
.official-ui-active.vk-host .battle-deploy-rail .one-click-preview-actions {
  order: -1;
  justify-items: center;
}
.official-ui-active.vk-host #deck-prep-screen .prep-actions {
  height: 76px; min-height: 76px; gap: 20px;
  /* design/SKILL.md §4.2 — lift footer actions clear of the bottom edge. */
  transform: translateY(-18px) !important;
}
.official-ui-active.vk-host #result-box.official-result-panel .result-actions { width: max-content; gap: 20px; }
/* design/SKILL.md §3.2 / §4.3 — enlarge the complete outcome frame and
   its live values; counter-scale only the actions to preserve their size. */
.official-ui-active.vk-host #result-box.official-result-panel {
  transform: scale(1.5); transform-origin: center;
  animation-name: vkResultFadeIn;
}
.official-ui-active.vk-host #result-box.official-result-panel .result-actions {
  transform: translateX(-50%) scale(.6666666667); transform-origin: top center;
}
@keyframes vkResultFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* §4.3 / §6.4 — full content images already contain titles and body copy. */
.official-ui-active.vk-host #rules-modal .rules-box,
.official-ui-active.vk-host #terrain-legend-modal .rules-box {
  width: 960px; height: 610px; max-width: none; max-height: none; padding: 0;
  background: none; border: 0; border-radius: 0; box-shadow: none;
}
.official-ui-active.vk-host #rules-modal.supplied-rules #rules-content,
.official-ui-active.vk-host #terrain-legend-modal #terrain-legend-content {
  top: 0; right: 0; bottom: 0; left: 0; width: 960px; height: 610px; margin: 0; padding: 0; overflow: hidden; background: none !important;
}
.official-ui-active.vk-host .official-terrain-legend-page { width: 960px; height: 610px; }
.official-ui-active.vk-host #rules-modal #btn-close-rules { display: none; }
.official-ui-active.vk-host #rules-modal.supplied-rules #btn-close-rules-icon,
.official-ui-active.vk-host #terrain-legend-modal #btn-close-terrain-legend,
.official-ui-active.vk-host #btn-prep-target-close {
  position: absolute; top: 8px; right: 28px; left: auto; bottom: auto; transform: none; z-index: 5;
}
.official-ui-active.vk-host #btn-close-terrain-legend-footer {
  display: block; position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
}
/* design/SKILL.md §4.2 / §4.3 — rules uses the same 44px close artwork as
   the terrain legend, overriding the legacy 16px title-band icon. */
.official-ui-active.vk-host #rules-modal.supplied-rules #btn-close-rules-icon {
  background-size: 44px 44px !important;
}

/* design/SKILL.md §4.2 / §4.3 — separate paging from card selection and
   make the preparation hint readable at the fitted phone scale. */
.official-ui-active.vk-host #enemy-select-screen .enemy-selector-shell {
  grid-template-columns: 48px auto 48px;
  column-gap: 28px;
}
.official-ui-active.vk-host #enemy-select-screen .official-enemy-prepare-description {
  /* design/SKILL.md §4.3 / §4.4 — keep this 298x21 source glyph slightly
     larger so its visible lettering matches the 2/2 pagination treatment. */
  width: auto; height: 20px; bottom: 90px;
}

/* design/SKILL.md §4.2 — bring both action rails inward, with larger
   right-hand targets through deploy, preview, cancel and settlement states. */
.official-ui-active.vk-host .battle-tool-dock,
.official-ui-active.vk-host .battle-utility-actions { left: 48px; }
.official-ui-active.vk-host .battle-deploy-rail {
  right: 40px !important; width: 118px;
}
.official-ui-active.vk-host #game-container .battle-deploy-rail .vk-image-control[data-vk-shape="diamond"] {
  width: 118px !important; min-width: 118px !important;
  height: 118px !important; min-height: 118px !important;
}
/* design/SKILL.md §3.2 / §4.3 / §6.4 — press feedback follows the artwork,
   without a WebView tap rectangle. Keyboard focus remains identifiable. */
.official-ui-active.vk-host .battle-tool-dock button,
.official-ui-active.vk-host .battle-utility-actions button,
.official-ui-active.vk-host .battle-deploy-rail button {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
  transition: transform 90ms ease-out;
}
.official-ui-active.vk-host .battle-tool-dock button:focus:not(:focus-visible),
.official-ui-active.vk-host .battle-utility-actions button:focus:not(:focus-visible),
.official-ui-active.vk-host .battle-deploy-rail button:focus:not(:focus-visible) {
  outline: none !important;
}
.official-ui-active.vk-host #game-container .battle-tool-dock button:active:not(:disabled),
.official-ui-active.vk-host #game-container .battle-utility-actions button:active:not(:disabled),
.official-ui-active.vk-host #game-container .battle-deploy-rail button:active:not(:disabled) {
  transform: scale(.96) !important;
  filter: none !important; outline: none !important; box-shadow: none !important;
}
.official-ui-active.vk-host .prep-auto-target-panel {
  width: 960px; height: 610px; background: url('../assets/ui/vk/target_panel.png') center / 100% 100% no-repeat;
}
.official-ui-active.vk-host .prep-auto-target-heading { height: 60px; }
.official-ui-active.vk-host .prep-auto-target-instruction { visibility: hidden; }
.official-ui-active.vk-host .prep-auto-target-options {
  top: 125px; left: 125px; right: 125px; height: 365px; gap: 10px;
}
.official-ui-active.vk-host .prep-auto-target-actions { top: auto; bottom: 20px; height: 60px; gap: 20px; }

/* §4.3 / §6.4 — a single warning banner and live actions share the stage.
   Generic confirmations retain their exact message, including remaining cards. */
.official-ui-active.vk-host #confirm-modal .confirm-box,
.official-ui-active.vk-host #confirm-modal.official-deploy-dialog .confirm-box {
  position: relative; display: block; width: 100%; min-width: 0; max-width: none;
  height: 410px; min-height: 410px; padding: 0; border: 0; border-radius: 0;
  background: url('../assets/ui/vk/confirm_panel.png') center top / 100% 272px no-repeat;
  transform: translateY(30px) !important; box-shadow: none;
}
.official-ui-active.vk-host #confirm-modal .confirm-box .confirm-msg {
  position: absolute; top: 0; right: 0; bottom: auto; left: 0; display: flex; align-items: center; justify-content: center;
  width: 100%; height: 272px; min-height: 272px; margin: 0; padding: 30px 80px;
  box-sizing: border-box; background: none !important; color: #d5f3f7 !important;
  font: 24px/1.5 var(--font); text-align: center; text-shadow: none;
}
.official-ui-active.vk-host #confirm-modal .confirm-msg img.vk-confirm-warning { width: auto; height: auto; flex: none; }
.official-ui-active.vk-host #confirm-modal .confirm-box .confirm-actions {
  position: absolute; top: 356px; left: 0; right: 0; height: 60px; margin: 0;
  display: flex; align-items: center; justify-content: center; gap: 30px;
}
