.battle-preparation { color:#fff0ce; display:grid; gap:24px; margin:20px 0; }
.battle-preparation h3 { font-family:"Barlow Condensed",sans-serif; font-size:26px; margin:0 0 8px; }
.battle-preparation p { color:#dfd8c8; line-height:1.5; margin:8px 0 12px; max-width:70ch; }
.battle-preparation button,.battle-preparation select { font:inherit; min-height:44px; border:1px solid #82909a; border-radius:6px; padding:10px 12px; color:#fff0ce; background:#203244; cursor:pointer; }
.battle-preparation button:hover { background:#31495d; }
.battle-preparation button:focus-visible,.battle-preparation select:focus-visible,.battle-preparation summary:focus-visible { outline:3px solid #f2cd6c; outline-offset:3px; }
.battle-preparation button:disabled { opacity:.5; cursor:default; }
.prepare-heading { display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.prepare-heading strong,.battle-preparation .prepare-slot-source { color:#f2cd6c; }
.prepare-spells { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:14px 0; }
.prepare-spells button { display:flex; text-align:left; align-items:center; gap:12px; }
.prepare-spells button[aria-pressed="true"] { border:2px solid #f2cd6c; background:#314152; }
.prepare-spells button > span:first-child { flex:0 0 44px; width:44px; height:44px; }
.prepare-spells img { max-width:44px; max-height:44px; object-fit:contain; }
.prepare-spells strong,.prepare-spells small { display:block; line-height:1.4; }
.prepare-spells small { color:#dfd8c8; font-size:13px; }
.prepare-defenders { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.prepare-defenders label { display:grid; gap:6px; margin:12px 0; }
.prepare-defenders select { width:100%; min-width:0; }
.prepare-intel { padding-bottom:16px; border-bottom:1px solid #82909a; }
.prepare-intel summary { cursor:pointer; padding:12px 0; min-height:44px; color:#f2cd6c; }
.prepare-intel dl { margin:0; }
.prepare-intel dl > div { padding:12px 0; }
.prepare-intel dt { font-weight:700; }
.prepare-intel dd { margin:6px 0 0; color:#dfd8c8; line-height:1.5; }
.battle-preparation .prepare-warning,.battle-preparation .prepare-boss { color:#f3c08a; }
.level-camp .camp-panel { max-height:100%; min-height:0; overflow:auto; }
.level-camp #campTitle { font-size:clamp(28px,3vw,40px); line-height:1.1; }
@media(max-width:560px) { .prepare-spells,.prepare-defenders { grid-template-columns:1fr; } .battle-preparation { gap:20px; } }
.formation-slots { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0; }
.formation-slots .formation-slot { display:flex;flex-direction:column;gap:8px;min-width:0;margin:0;padding:12px;border:1px solid #647586;border-radius:12px;background:#192a3b;color:#fff0ce; }
.formation-art { display:block;align-self:center;width:104px;height:104px;flex:none;background-repeat:no-repeat; }
.formation-mercenary { background-image:var(--company-battle-art);background-size:300% 200%;background-position:calc(var(--formation-column) * 50%) 0; }
.formation-tower { background-image:url('assets/command-icons-v1.png');background-size:500% 400%;background-position:calc(var(--formation-column) * 25%) 0; }
.formation-empty { display:grid;place-items:center;color:#cbd7df;border:1px dashed #82909a;border-radius:8px; }
.formation-name { font-size:14px;line-height:1.35;min-height:2.7em;overflow-wrap:anywhere; }
.formation-slot > strong { font:800 18px 'Barlow Condensed',sans-serif; }
.formation-slot select { margin-top:auto;width:100%;min-width:0;min-height:44px;padding:8px 4px;background:#102131;color:#fff0ce;border:1px solid #82909a;border-radius:6px;font:inherit;font-size:13px; }
.formation-slot select:focus-visible { outline:3px solid #f2cd6c;outline-offset:3px; }
.war-room-relic-link { display:flex;flex:none;align-items:center;justify-content:space-between;gap:8px;min-height:44px;margin:0 0 10px;padding:8px 12px;text-align:left;background:#203244;color:#fff0ce;border:1px solid #a98a4c;border-radius:8px;cursor:pointer; }
.war-room-relic-link strong { color:#f2cd6c; }
.war-room-relic-link span { font-size:12px; }
.war-room-relic-link:hover { background:#31495d; }
.war-room-relic-link:focus-visible { outline:3px solid #f2cd6c;outline-offset:3px; }
.relic-vault .relic-row:disabled { opacity:1; }
@media(max-width:700px) {
  .relic-vault .relic-copy strong { font-size:14px;white-space:normal;line-height:1.2; }
  .relic-vault .relic-rank { font-size:11px; }
  .relic-vault .relic-rank em { font-size:11px; }
  .relic-vault .relic-row { padding-block:10px; }
  .relic-vault .relic-row:nth-child(even) { box-shadow:none; }
}
@media(max-width:380px) { .formation-slots {gap:8px;} .formation-slots .formation-slot {padding:8px;} .formation-art {width:88px;height:88px;} }
/* Tower forms share the existing painted icon atlas. */
.tower-icon-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:10px 0; }
:is(.battle-preparation,.keep-preparation,#mercenaryDeployment) .tower-icon-grid button { display:flex;flex-direction:column;justify-content:flex-start;align-items:center;gap:4px;padding:8px 4px;min-width:0;width:100%;height:100%;border:1px solid #82909a;border-radius:8px;background:#102131;color:#fff0ce;text-align:center; }
:is(.battle-preparation,.keep-preparation,#mercenaryDeployment) .tower-icon-grid button:hover { background:#31495d; }
:is(.battle-preparation,.keep-preparation,#mercenaryDeployment) .tower-icon-grid button[aria-pressed="true"] { border-color:#f2cd6c;box-shadow:inset 0 0 0 1px #f2cd6c;background:#314152; }
:is(.battle-preparation,.keep-preparation,#mercenaryDeployment) .tower-icon-grid button strong { font:700 14px/1.2 'Barlow Condensed',sans-serif;overflow-wrap:anywhere; }
:is(.battle-preparation,.keep-preparation,#mercenaryDeployment) .tower-icon-grid button small { font:400 12px/1.3 'Barlow',sans-serif;color:#dfd8c8; }
:is(.battle-preparation,.keep-preparation,#mercenaryDeployment) .tower-icon-grid :is(.formation-art,.keep-battery-art) { display:block;flex:0 0 64px;width:64px;height:64px; }
.keep-conversion h5 { margin:0;font:700 18px 'Barlow Condensed',sans-serif; }
.tower-information { min-width:0; }
:is(.battle-preparation,.keep-preparation) .tower-information p { min-height:0;font-size:13px;line-height:1.5;margin:8px 0; }
.tower-information summary { min-height:44px;padding:12px 0;color:#f2cd6c;cursor:pointer;font-size:13px; }
.tower-information summary:focus-visible { outline:3px solid #f2cd6c;outline-offset:3px; }
.tower-information ol { list-style:none;padding:0;margin:0; }
.tower-information li { padding:8px 0;border-top:1px solid #435569;font-size:13px;line-height:1.45; }
.tower-information li :is(strong,span) { display:block; }
.tower-information li span { color:#dfd8c8; }
.prepare-defenders > section:first-child .formation-slots { grid-template-columns:1fr; }
@media(min-width:700px) { .keep-conversion .tower-icon-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
.skill-slot-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:20px 0; }
.skill-slot-grid button { display:flex;flex-direction:column;gap:8px;align-items:center;justify-content:center;min-width:0;padding:12px 6px;text-align:center; }
.skill-slot-grid button > span { display:block;width:52px;height:52px; }
.skill-slot-grid img { width:52px;height:52px;object-fit:contain; }
.skill-slot-grid strong { font-size:14px;line-height:1.2; }
.skill-slot-grid small { font-size:12px;color:#cbd7df; }
.skill-slot-grid .empty-skill-slot { font-size:36px;line-height:52px;color:#f2cd6c; }
.skill-slot-grid button[aria-pressed=true] { border:2px solid #f2cd6c;background:#31495d; }
.slot-spell-picker { border-block:1px solid #647586;padding:16px 0;margin:16px 0; }
.slot-spell-picker h4 { margin:0 0 12px;font-size:20px; }
.slot-spell-options { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:12px; }
.slot-spell-options button { display:flex;gap:10px;align-items:center;text-align:left;min-width:0; }
.slot-spell-options button > :first-child { width:40px;height:40px;flex:none; }
.slot-spell-options strong,.slot-spell-options small { display:block;line-height:1.35; }
.slot-spell-options strong { font-size:14px; }
.slot-spell-options small { font-size:12px; }
#profilesDrawer .inventory-tabs [hidden] { display:none; }
.back-to-slots { min-height:44px;padding:10px 16px;color:#fff0ce;background:#203244;border:1px solid #82909a;border-radius:6px;margin-bottom:12px;cursor:pointer; }
@media(max-width:500px) { .skill-slot-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .slot-spell-options {grid-template-columns:1fr;} }
@media(min-width:701px) {
  #profilesDrawer [data-inventory-pane=skills] { overflow:auto; }
  #profilesDrawer [data-inventory-pane=skills] .spell-path-workspace { display:flex;flex-direction:column; }
  #profilesDrawer [data-inventory-pane=skills] .spell-tree-detail { display:none; }
  #profilesDrawer [data-inventory-pane=skills] .info-open .spell-tree-detail {display:block;}
  #profilesDrawer [data-inventory-pane=skills] .tree-compact-action { display:flex;position:sticky;bottom:0;gap:10px;padding:12px 0;background:#142334;z-index:5; }
  #profilesDrawer [data-inventory-pane=skills] .tree-compact-action .tree-spend-point { display:block;flex:1;width:auto;min-height:48px;margin:0; }
  #profilesDrawer [data-inventory-pane=skills] #skillTreeGrid {height:auto;min-height:0;}
}
.keep-preparation .tower-icon-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px; }
.keep-preparation .tower-icon-grid button { aspect-ratio:auto;min-width:0;min-height:136px;height:auto;padding:8px 3px;gap:4px;justify-content:flex-start; }
.keep-preparation .tower-icon-grid button .keep-battery-art { width:48px;height:48px;aspect-ratio:1;max-width:100%;flex:0 0 48px; }
.keep-preparation .tower-icon-grid button small { margin-top:auto; }
#profilesDrawer [data-inventory-pane=skills] .spell-map-column {width:100%;}
#profilesDrawer [data-inventory-pane=skills] .tree-compact-action {width:100%;align-self:stretch;}
#profilesDrawer [data-inventory-pane=skills] .tree-info-button { min-height:44px;min-width:52px;border:1px solid #82909a;border-radius:6px;background:#203244;color:#fff0ce; }
.level-camp .camp-actions > div {min-width:0;max-width:100%;}
.level-camp .camp-actions .primary-action {min-width:0;max-width:100%;white-space:normal;}
.keep-preparation .tower-icon-grid button.is-equipped { background:#294938;border:2px solid #a9db8a;box-shadow:inset 0 -4px #a9db8a; }
.keep-preparation .tower-icon-grid button.is-equipped small { color:#ceefba; }

/* Ally choices use the same portrait buttons and equipped state as tower forms. */
#mercenaryDeployment .ally-preview { display:flex;flex-direction:column;align-items:center;gap:12px;margin:0 0 8px;padding:12px 0 16px;border-bottom:1px solid #435569; }
#mercenaryDeployment .ally-preview .formation-art { width:160px;height:160px;flex:0 0 160px; }
#mercenaryDeployment .ally-preview .formation-name { min-height:0;text-align:center;font:700 20px/1.3 'Barlow Condensed',sans-serif;color:#fff0ce; }
#mercenaryDeployment .ally-icon-grid { grid-template-columns:repeat(3,minmax(0,1fr));margin:0; }
#mercenaryDeployment .ally-icon-grid button { min-height:120px;padding:8px 4px;cursor:pointer; }
#mercenaryDeployment .ally-icon-grid button .formation-art { width:48px;height:48px;flex:0 0 48px; }
#mercenaryDeployment .ally-icon-grid button small { margin-top:auto; }
#mercenaryDeployment .ally-icon-grid button.is-equipped { background:#294938;border:2px solid #a9db8a;box-shadow:inset 0 -4px #a9db8a; }
#mercenaryDeployment .ally-icon-grid button.is-equipped small { color:#ceefba; }
#mercenaryDeployment .ally-icon-grid button:disabled { opacity:.65;cursor:default; }
#mercenaryDeployment .ally-icon-grid button:focus-visible { outline:3px solid #f2cd6c;outline-offset:3px; }
#mercenaryDeployment .ally-icon-grid .formation-empty { display:grid; }
@media(max-width:600px) { #mercenaryDeployment .formation-slots {grid-template-columns:minmax(0,1fr);} }

/* Show the authored tower appearance beside each upgrade milestone. */
.tower-information li.tower-upgrade-preview { display:flex;align-items:center;gap:16px;padding:12px 0; }
.tower-upgrade-preview > div { min-width:0;flex:1; }
.tower-information .tower-tier-art { display:block;flex:0 0 88px;width:88px;height:88px;background-image:var(--tower-upgrade-previews);background-size:500% 300%;background-position:calc(var(--tower-preview-column) * 25%) calc(var(--tower-preview-row) * 50%);background-repeat:no-repeat; }
.tower-upgrade-preview small { display:block;margin-top:6px;color:#cbd7df;font-size:12px;line-height:1.4; }
@media(max-width:480px) { .tower-information li.tower-upgrade-preview { gap:12px; } .tower-information .tower-tier-art { flex-basis:72px;width:72px;height:72px; } }

/* Embedded preparation panels use the same dark palette as their surroundings. */
#profilesDrawer.preparation-war-room .wall-armory,
#profilesDrawer.preparation-war-room .keep-customizer {background:#142334;border-color:#465b6c;color:#fff0ce;}
#profilesDrawer.preparation-war-room .skin-options button {background:#203244;color:#cbd5d9;border:1px solid #465b6c;border-radius:6px;font:600 14px/1.3 'Barlow',sans-serif;text-transform:none;letter-spacing:0;text-shadow:none;box-shadow:none;transform:none;}
#profilesDrawer.preparation-war-room .skin-options button:hover {background:#2d4153;color:#fff0ce;border-color:#8b9ca8;transform:none;}
#profilesDrawer.preparation-war-room .skin-options button[aria-pressed=true] {background:#303a37;color:#f2cd6c;border-color:#f2cd6c;box-shadow:inset 0 0 0 1px #f2cd6c;}
#profilesDrawer.preparation-war-room .skin-options button:focus-visible {outline:3px solid #ffe69a;outline-offset:3px;}
#profilesDrawer.preparation-war-room .skin-customizer p {color:#cbd5d9;font-size:14px;line-height:1.5;}
#profilesDrawer.preparation-war-room .skin-customizer p strong {color:#fff0ce;}
