.prep-collection-link {
  display: inline-flex; justify-content: center; align-items: center; min-height: 42px;
  padding: 0 16px; border: 1px solid #bda67e; border-radius: 3px;
  color: #f2dcb4; background: #243d3d; font-size: 16px; white-space: nowrap; text-decoration: none;
}
.prep-collection-link:hover, .prep-collection-link:focus-visible { background: #365354; color: white; }

/* 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.3 — supplied preparation artwork and live values
   share one stable layout; actual interactions remain on their existing nodes. */
.official-ui-active #deck-prep-screen .prep-pool-panel,
.official-ui-active #deck-prep-screen .prep-deck-panel {
  background: url("../assets/ui/prep/panel_underlay.png") center / 100% 100% no-repeat;
  border-radius: 0;
}
.official-ui-active #prep-type-tabs::after { background-position: left bottom; }
.official-ui-active .prep-type-tab.is-active::after {
  top: 0; right: auto; bottom: auto; left: 50%; width: 114px; height: 42px; transform: translateX(-50%);
  z-index: 3; background: var(--prep-selected-tab) center / contain no-repeat;
}
.official-ui-active .prep-type-tab[data-prep-type="all"] { --prep-selected-tab: url("../assets/ui/prep/navigation/tab_all_selected.png"); }
.official-ui-active .prep-type-tab[data-prep-type="infantry"] { --prep-selected-tab: url("../assets/ui/prep/navigation/tab_infantry_selected.png"); }
.official-ui-active .prep-type-tab[data-prep-type="cavalry"] { --prep-selected-tab: url("../assets/ui/prep/navigation/tab_cavalry_selected.png"); }
.official-ui-active .prep-type-tab[data-prep-type="archer"] { --prep-selected-tab: url("../assets/ui/prep/navigation/tab_archer_selected.png"); }
.official-ui-active .prep-type-tab[data-prep-type="cannon"] { --prep-selected-tab: url("../assets/ui/prep/navigation/tab_artillery_selected.png"); }
.official-ui-active .prep-type-tab[data-prep-type="navy"] { --prep-selected-tab: url("../assets/ui/prep/navigation/tab_navy_selected.png"); }
.official-ui-active .prep-type-tab[data-prep-type="siege"] { --prep-selected-tab: url("../assets/ui/prep/navigation/tab_siege_selected.png"); }
.official-ui-active .prep-type-tab[data-prep-type="dual"] { --prep-selected-tab: url("../assets/ui/prep/navigation/tab_dual_selected.png"); }
.official-ui-active .prep-type-tab[data-prep-type="tactic"] { --prep-selected-tab: url("../assets/ui/prep/navigation/tab_tactics_selected.png"); }

/* §4.2 / §4.3 — retain the scroll hit area but draw only the supplied handle. */
.official-ui-active .official-scrollbar { width: 10px; border: 0; border-image: none; background: none; }
/* design/SKILL.md §4.2 / §4.3 — both prep handles retain a 6px inset from the panel edge. */
.official-ui-active #deck-prep-screen .official-scrollbar { right: 6px; }
.official-ui-active .official-scrollbar-thumb {
  width: 10px; background: url("../assets/ui/prep/scrollbar_thumb.png") center / 100% 100% no-repeat;
}
/* design/SKILL.md §4.3 / §7.2 — the native 156x236 face has a 148x228
   visible frame at (4, 2). Keep both source images at native size so the
   selected border meets the card edge without a gap or rounded clipping. */
.official-ui-active #prep-grid .prep-card-wrap { position: relative; }
.official-ui-active #prep-grid .prep-card-wrap .card {
  width: 156px !important; height: 236px !important; flex: 0 0 236px;
  margin: 0; border-radius: 0;
}
.official-ui-active #prep-grid .prep-card-wrap.is-configured .card::after { content: none; display: none !important; }
.official-ui-active #prep-grid .prep-card-wrap.is-configured::after {
  content: ''; display: block; position: absolute; left: 50%; top: 2px; width: 148px; height: 228px;
  margin-left: -74px; background: url("../assets/ui/prep/selection_highlight.png") center / auto no-repeat;
  pointer-events: none; z-index: 10; opacity: 1; transform: none; animation: none;
}
/* design/SKILL.md §4.3 — the pool is a browsing surface, not a selection
   preview. Remove the translucent hover frame and glow while leaving the
   existing card hit target and configured-card frame intact. */
@media (hover: hover) and (pointer: fine) {
  .official-ui-active #prep-grid .card:hover {
    border-color: transparent !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
  }
  .official-ui-active #prep-grid .card:hover::after {
    content: none !important;
    display: none !important;
    background: none !important;
    box-shadow: none !important;
  }
}
/* design/SKILL.md §4.2 / §4.3 — keep quantity controls close to the card
   while preserving the 40px targets and the gap before the next card row. */
.official-ui-active #prep-grid .prep-card-wrap { gap: 0; }
.official-ui-active #prep-grid .prep-card-controls { height: 40px; flex: 0 0 40px; }
/* design/SKILL.md §4.2 / §4.3 — 数量与档案共用两枚构筑按钮之间的空间，卡面仍可点击读牌。 */
.campaign-profile-button {
  padding: 4px 10px; border: 1px solid #a68c60; border-radius: 4px;
  background: #172625; color: #efdcba; font: 600 14px/1.2 "Microsoft YaHei", sans-serif;
  cursor: pointer;
}
.campaign-profile-button:hover, .campaign-profile-button:focus-visible { border-color: #f3d49a; background: #34403a; }
#prep-grid .campaign-profile-button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 43px; min-height: 34px; padding: 0 3px; font-size: 11px;
}
#prep-grid .campaign-profile-button .prep-count { color: #fff0d9; line-height: 1.1; }
.campaign-reading-profile { display: none; }
#prep-grid .campaign-reading.campaign-enlarged-copy > .campaign-card-copy {
  flex-direction: column; align-items: stretch;
}
#prep-grid .campaign-reading.campaign-enlarged-copy .campaign-reading-profile {
  display: flex; align-items: center; min-height: 3.15em; margin-top: .3em;
  border-top: 1px solid #a68c60; color: #f4d799; font-weight: 700; pointer-events: auto;
}
.official-ui-active #prep-grid { grid-auto-rows: 278px; }
.official-ui-active #deck-prep-screen .prep-deck-item,
.official-ui-active #deck-prep-screen .prep-deck-item:hover {
  width: 348px; height: 82px; min-height: 82px; flex: 0 0 82px; padding: 8px 10px;
  border: 0; border-radius: 0; box-shadow: none;
  background: url("../assets/ui/prep/type_labels/frame.png") center / 100% 100% no-repeat;
}
.official-ui-active .official-prep-name-row { width: auto; min-width: 0; flex: 1; gap: 4px; }
.official-ui-active .official-prep-name-line { gap: 5px; }
.official-ui-active .official-prep-name { max-width: 148px; max-height: 27px; }
.official-ui-active .official-prep-types { display: inline-flex; align-items: center; gap: 2px; }
.official-ui-active .official-prep-type-label { display: block; width: auto; max-width: 35px; height: 16px; object-fit: contain; }
.official-ui-active .official-prep-name-row .prep-deck-item-meta {
  display: flex; align-items: center; gap: 4px; min-height: 17px; font-size: 13px; white-space: normal;
}
.official-ui-active .official-prep-attack-label { width: 38px; height: 17px; object-fit: contain; }
.official-ui-active .official-prep-tactic-description { display: block; max-width: 220px; max-height: 31px; line-height: 1.2; overflow: hidden; }
/* design/SKILL.md §4.3 — share the multiplication sign baseline with the
   bitmap digit baseline instead of vertically centering different line boxes. */
.official-ui-active #deck-prep-screen .prep-deck-item .prep-deck-item-count {
  display: inline-flex; align-items: baseline; justify-content: center; gap: 2px; margin: 0 5px; flex: none;
}
/* design/SKILL.md §4.1 / §4.3 — category dividers and row backgrounds share
   the panel/header center, with clearance for the separate scrollbar. */
.official-ui-active #deck-prep-screen #prep-deck-list {
  align-self: center;
  align-items: center;
}
.official-ui-active #deck-prep-screen .prep-deck-group {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.official-ui-active .prep-count-times { color: #e2d6ba; font-size: 17px; line-height: 1; }
.official-ui-active .bitmap-text--prep-right { display: inline-flex; align-items: center; justify-content: center; gap: 0; }
.official-ui-active .bitmap-text--prep-right .bitmap-glyph { width: auto; height: 14px; }
/* design/SKILL.md §4.3 / §6.4 — a background-only empty state must stretch
   across the centered list, otherwise flex intrinsic sizing clips its copy. */
.official-ui-active .official-prep-empty {
  align-self: stretch; width: 100%; min-width: 259px;
  background-image: url("../assets/ui/prep/right/empty_hint.png"); background-size: 259px 44px;
}


/* design/SKILL.md §4.3 / §7.2 — keep both dynamic quantities on the
   bottom baseline of the supplied description artwork. */
.official-ui-active #prep-deck-list-count.official-prep-deck-count,
.official-ui-active .official-prep-deck-count {
  position: relative; display: block; width: 298px; height: 43px; min-height: 43px; flex: 0 0 43px; margin: 0 auto;
}
.official-ui-active .official-prep-deck-count .prep-count-art { display: block; width: 298px; height: 43px; }
.official-ui-active #prep-deck-list-count.official-prep-deck-count > .prep-count-value,
.official-ui-active .official-prep-deck-count > .prep-count-value {
  position: absolute; top: 23px; height: 18px; display: flex; align-items: flex-end; justify-content: center;
}
.official-ui-active .prep-count-value--total { left: 52px; width: 31px; }
.official-ui-active .prep-count-value--remaining { left: 211px; width: 23px; }

/* design/SKILL.md §4.1 / §4.2 / §4.3 / §6.4 — use the supplied 770x500 frame,
   including its baked title, while preserving selection and confirmation hit areas. */
.official-ui-active #prep-auto-preview { display: none !important; }
.official-ui-active .prep-auto-target-layer { padding: 0; background: rgba(0, 0, 0, .3); backdrop-filter: none; }
.official-ui-active .prep-auto-target-panel {
  position: relative; flex: none; width: 770px; max-width: none; height: 500px; max-height: none;
  padding: 0; overflow: hidden; border: 0; border-image: none; border-radius: 0;
  background: url('../assets/ui/prep/targets/frame.png') center / 770px 500px no-repeat; filter: none;
}
.official-ui-active .prep-auto-target-heading {
  position: relative; z-index: 1; height: 33px; background: none;
}
.official-ui-active .prep-auto-target-heading h3 {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.official-ui-active #btn-prep-target-close {
  position: absolute; z-index: 2; top: 0; right: 8px; width: 32px; height: 33px; padding: 0;
  min-width: 0; min-height: 0; background-size: 16px 16px !important; border-radius: 0;
}
.official-ui-active .prep-auto-target-instruction {
  position: absolute; z-index: 1; top: 53px; left: 0; right: 0; height: 16px; margin: 0; text-align: center;
}
.official-ui-active .prep-auto-target-instruction img { display: inline-block; width: 319px; height: 15px; }
.official-ui-active .prep-auto-target-options {
  position: absolute; z-index: 1; top: 90px; left: 30px; right: 30px; height: 361px;
  display: flex; align-items: flex-start; gap: 10px; padding: 0; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin; scrollbar-color: #729d9c transparent;
}
.official-ui-active .prep-auto-target-options::-webkit-scrollbar { height: 8px; }
.official-ui-active .prep-auto-target-options::-webkit-scrollbar-thumb { background: #729d9c; }
.official-ui-active .prep-auto-target-option {
  position: relative; flex: 0 0 110px; width: 110px; height: 347px; min-height: 347px;
  padding: 0; border: 0; border-image: none; border-radius: 0; overflow: hidden;
  align-items: center; justify-content: center; gap: 0; text-align: center;
  background: transparent; filter: none; transform: none; transition: none;
}
.official-ui-active .prep-auto-target-option:hover,
.official-ui-active .prep-auto-target-option:focus-visible { transform: none; filter: brightness(1.1); }
.official-ui-active .prep-auto-target-option:focus-visible { outline-offset: -2px; }
.official-ui-active .prep-auto-target-option.is-selected { filter: none; }
.official-ui-active .prep-auto-target-option.is-selected::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 2; pointer-events: none;
  background: url('../assets/ui/prep/targets/selected.png') center / 110px 347px no-repeat;
}
.official-ui-active .prep-auto-target-art { display: block; width: 110px; height: 347px; }
.official-ui-active .prep-auto-target-fallback { background: #30424e; box-shadow: inset 0 0 0 1px #57737b; }
.official-ui-active .prep-auto-target-portrait {
  position: absolute; left: 0; bottom: 0; width: 110px; height: 290px; object-fit: cover; object-position: center bottom;
}
.official-ui-active .prep-auto-target-name { position: relative; align-self: stretch; margin: 0 3px auto; padding-top: 14px; font-size: 17px; color: #eef0e9; letter-spacing: 0; font-weight: normal; }
.official-ui-active .prep-auto-target-option.has-target-art .prep-auto-target-name { position: absolute; margin: 0; padding: 0; }
.official-ui-active .prep-auto-target-actions { position: absolute; z-index: 1; top: 454px; left: 0; right: 0; height: 44px; margin: 0; gap: 8px; }
.official-ui-active .prep-auto-target-actions .prep-auto-inline-btn {
  width: 98px; min-width: 98px; height: 44px; min-height: 44px; padding: 0; border-image: none;
  border-radius: 0; filter: none; background-size: 98px 32px !important;
}
/* design/SKILL.md §4.2 / §4.3 — keep the 98x44 hit target; show the supplied
   98x32 gold state artwork without system text or a second disabled tint. */
.official-ui-active #btn-prep-target-confirm {
  color: transparent !important; text-shadow: none !important;
  background-size: 98px 32px !important; filter: none; opacity: 1;
}
/* design/SKILL.md §6.4 — no disabled bitmap was supplied for the gold set;
   keep the same button surface while giving the locked action clear feedback. */
.official-ui-active #btn-prep-target-confirm:disabled {
  filter: grayscale(.7) brightness(.65) !important;
  opacity: 1;
}
.official-ui-active .prep-auto-target-options > .replay-empty-message { margin: auto; color: #eef0e9; }

/* design/SKILL.md §4.3 / §6.4 — the supplied success ribbon appears only after
   the restored deck has been saved; failures keep their actionable message. */
.official-ui-active #toast.official-restored-toast {
  width: 323px; min-width: 323px; height: 66px; min-height: 66px;
  padding: 0; border: 0; border-image: none; border-radius: 0;
  background: none; box-shadow: none; text-shadow: none;
}
.official-ui-active #toast.official-restored-toast > img { display: block; width: 323px; height: 66px; }

/* §4.3 — native faces have a 32 x 32 socket at (11, 8) on a 156 x 236
   card. Scale that socket with every face, including prep and battle previews. */
.official-ui-active .official-card-face .official-card-dynamic,
.official-ui-active .lane-cards .official-card-face .official-card-dynamic,
.official-ui-active .card-preview-ghost .official-card-dynamic,
.official-ui-active .battlefield-drag .official-card-dynamic,
.official-ui-active .official-battle-stack .official-card-dynamic {
  left: 7.0513%; top: 3.3898%; width: 20.5128%; height: 13.5593%;
  right: auto; bottom: auto; padding: 0; display: flex; align-items: center; justify-content: center;
}
.official-ui-active .official-card-dynamic > .bitmap-text {
  display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; gap: 0;
}
.official-ui-active .official-card-dynamic .bitmap-glyph { width: auto; height: 84.375%; max-width: 100%; object-fit: contain; }
.official-ui-active .official-card-dynamic > .bitmap-text:has(.bitmap-glyph:nth-of-type(2)) .bitmap-glyph { height: 72%; max-width: 50%; }
.official-ui-active .official-card-dynamic > .bitmap-text:has(.bitmap-glyph:nth-of-type(3)) .bitmap-glyph { height: 50%; max-width: 33.333%; }

/* design/SKILL.md §4.2 / §7.4 — use the fitted logical canvas on phones.
   Legacy physical-width breakpoints must not stack these fixed art panels
   or constrain the deck to 220px inside an already scaled 1268px stage. */
.official-ui-active.dx-host-layout #deck-prep-screen .prep-body { flex-direction: row; }
.official-ui-active.dx-host-layout #deck-prep-screen .prep-deck-panel { max-height: none; }
