/* battle/formation-setup.css
 * Стили для окна расстановки войск (дизайн: docs/design-mockups/formation-setup.html).
 * Все переменные и классы scope'аются под .fs-app — корневой контейнер модалки.
 */

.fs-app {
  position: fixed;
  inset: 0;
  z-index: 10001;
  overflow: hidden;
  font-family: 'Inter', system-ui, sans-serif;
  color: #f4f1e8;
  background:
    radial-gradient(60% 50% at 18% 12%, rgba(140,100,210,0.12), transparent 65%),
    radial-gradient(70% 50% at 82% 18%, rgba(255,200,100,0.08), transparent 65%),
    radial-gradient(80% 60% at 50% 110%, rgba(80,60,160,0.10), transparent 60%),
    linear-gradient(180deg, #0d0d18 0%, #0a0a12 100%);

  --bg-deep: #0a0a12;
  --bg-mid:  #14141e;
  --bg-panel: #1c1c2a;
  --bg-panel-hi: #24243a;
  --bg-card: #2a2a3d;
  --bg-card-hi: #34344a;

  --gold:      #ffd960;
  --gold-deep: #d4a85a;
  --gold-dim:  #8a6f3a;

  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.14);
  --line-gold: rgba(255,217,96,0.35);

  --text:      #f4f1e8;
  --text-dim:  #b8b4a4;
  --text-meta: #8a8674;

  --serif: 'Marcellus', Georgia, serif;
  --ui:    'Inter', system-ui, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, Menlo, monospace;

  --f-fire:    #ff6b3d;
  --f-water:   #4d9eff;
  --f-wind:    #b9ddff;
  --f-earth:   #d4a85a;
  --f-nature:  #6dd66b;
  --f-blood:   #c43d3d;
  --f-steel:   #b8c7d9;
  --f-necro:   #8b6dd6;
  --f-poison:  #6dd6a8;
  --f-light:   #ffd960;
  --f-dark:    #6d3d8b;
}






/* faint star/rune dust */


/* faint star/rune dust */
.fs-app::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 22%, rgba(255,217,96,0.5), transparent 60%),
    radial-gradient(1px 1px at 28% 68%, rgba(255,255,255,0.3), transparent 60%),
    radial-gradient(1px 1px at 41% 14%, rgba(255,217,96,0.4), transparent 60%),
    radial-gradient(1px 1px at 56% 41%, rgba(255,255,255,0.2), transparent 60%),
    radial-gradient(1px 1px at 67% 78%, rgba(255,217,96,0.3), transparent 60%),
    radial-gradient(1px 1px at 79% 12%, rgba(255,255,255,0.4), transparent 60%),
    radial-gradient(1px 1px at 88% 56%, rgba(255,217,96,0.4), transparent 60%),
    radial-gradient(1px 1px at 92% 88%, rgba(255,255,255,0.3), transparent 60%);
  opacity: 0.7;
  z-index: 0;
}

/* =================================================================
   APP SHELL — landscape grid: topbar / 3 zones
================================================================= */
.fs-app .app {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 50px 1fr;
  z-index: 1;
  box-sizing: border-box;
}
.fs-app * { box-sizing: border-box; }

/* ====================== TOP BAR ============================= */
.fs-app .topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(28,28,42,0.8) 0%, rgba(20,20,30,0.6) 100%);
  backdrop-filter: blur(8px);
}

.fs-app .tb-section-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-meta);
  flex: 0 0 auto;
}

.fs-app .tb-preset {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-gold);
  background: linear-gradient(180deg, rgba(255,217,96,0.12) 0%, rgba(255,217,96,0.04) 100%);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 34px;
}
.fs-app .tb-preset:hover {
  border-color: rgba(255,217,96,0.6);
  background: linear-gradient(180deg, rgba(255,217,96,0.18) 0%, rgba(255,217,96,0.06) 100%);
}
.fs-app .tb-preset__num {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gold);
  opacity: 0.85;
}
.fs-app .tb-preset__name {
  font-family: var(--serif);
  font-size: 14px;
  color: #fff8e0;
  border: none;
  background: transparent;
  outline: none;
  min-width: 140px;
  border-bottom: 1px dashed rgba(255,217,96,0.3);
  padding: 0 2px 1px;
}
.fs-app .tb-preset__name:focus { border-bottom-color: var(--gold); }
.fs-app .tb-preset__caret {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold);
  margin-left: 2px;
  opacity: 0.7;
}

.fs-app .tb-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
}

.fs-app .tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: rgba(0,0,0,0.25);
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: all 0.15s;
}
.fs-app .tb-btn:hover { color: var(--text); border-color: rgba(255,217,96,0.4); }
.fs-app .tb-btn svg { width: 12px; height: 12px; }

.fs-app .tb-spacer { flex: 1; }

.fs-app .tb-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-meta);
}
.fs-app .tb-meta__count b {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--gold);
  font-weight: 400;
  margin: 0 1px;
}

.fs-app .tb-close {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: rgba(0,0,0,0.3);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s;
}
.fs-app .tb-close:hover { color: var(--text); border-color: rgba(255,217,96,0.4); }
.fs-app .tb-close svg { width: 12px; height: 12px; }

/* ====================== MAIN — 3 zones ============================= */
.fs-app .main {
  display: grid;
  grid-template-columns: minmax(240px, 24%) 1fr minmax(280px, 26%);
  gap: 12px;
  padding: 12px;
  min-height: 0;
  overflow: hidden;
}

/* zone shared chrome */
.fs-app .zone {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(28,28,42,0.6) 0%, rgba(20,20,32,0.7) 100%);
  border-radius: 10px;
  border: 1px solid var(--line);
  min-height: 0;
}
.fs-app .zone--active {
  border-color: rgba(255,217,96,0.18);
  box-shadow: 0 0 0 1px rgba(255,217,96,0.10), 0 0 28px rgba(255,217,96,0.06) inset;
}
.fs-app .zone__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.fs-app .zone__title {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-meta);
}
.fs-app .zone__title b { color: var(--gold); font-weight: 600; }
.fs-app .zone__title-side {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text-meta);
}
.fs-app .zone__title-side b { color: var(--text-dim); font-weight: 600; }

/* =================================================================
   ZONE 1 — BATTLEFIELD (5 slots vertical)
================================================================= */
.fs-app .battlefield {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  overflow-y: auto;
}

.fs-app .bf-slot {
  position: relative;
  flex: 1 1 0;
  min-height: 60px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 10px 10px 8px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s;
}

/* empty slot — dotted gold outline */
.fs-app .bf-slot--empty {
  background:
    repeating-linear-gradient(45deg, rgba(255,217,96,0.04) 0 8px, transparent 8px 16px),
    rgba(0,0,0,0.18);
  border: 1.5px dashed rgba(255,217,96,0.30);
  color: var(--text-meta);
}
.fs-app .bf-slot--empty:hover {
  border-color: rgba(255,217,96,0.55);
  background:
    repeating-linear-gradient(45deg, rgba(255,217,96,0.08) 0 8px, transparent 8px 16px),
    rgba(0,0,0,0.24);
}

/* drag-hover (pulsing gold) */
.fs-app .bf-slot--drag-hover {
  border: 1.5px solid rgba(255,217,96,0.85);
  background:
    repeating-linear-gradient(45deg, rgba(255,217,96,0.14) 0 8px, transparent 8px 16px),
    rgba(255,217,96,0.08);
  box-shadow:
    0 0 0 2px rgba(255,217,96,0.30),
    0 0 22px rgba(255,217,96,0.45),
    0 0 40px rgba(255,217,96,0.20) inset;
  animation: pulseGold 1.3s ease-in-out infinite;
}
@keyframes pulseGold {
  0%,100% { box-shadow: 0 0 0 2px rgba(255,217,96,0.30), 0 0 22px rgba(255,217,96,0.45), 0 0 40px rgba(255,217,96,0.20) inset; }
  50%     { box-shadow: 0 0 0 3px rgba(255,217,96,0.55), 0 0 32px rgba(255,217,96,0.65), 0 0 50px rgba(255,217,96,0.32) inset; }
}

/* filled slot — parchment texture + ornate frame */
.fs-app .bf-slot--filled {
  --accent: var(--gold);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255,217,96,0.04) 0%, transparent 60%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--accent) 6%, #2a2435) 0%,
      color-mix(in srgb, var(--accent) 3%, #1c1828) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line-strong));
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 4px 12px rgba(0,0,0,0.4);
}
.fs-app .bf-slot--filled.is-selected {
  border-color: var(--gold);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 0 0 1px rgba(255,217,96,0.45),
    0 0 18px rgba(255,217,96,0.30),
    0 6px 16px rgba(0,0,0,0.45);
}
.fs-app .bf-slot--filled::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9px;
  padding: 1px;
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--accent) 50%, transparent) 0%,
    rgba(255,255,255,0.10) 30%,
    rgba(0,0,0,0.4) 60%,
    color-mix(in srgb, var(--accent) 35%, transparent) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.8;
}

.fs-app .bf-slot__num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,217,96,0.35);
  flex: 0 0 auto;
  letter-spacing: 0;
}
.fs-app .bf-slot--empty .bf-slot__num {
  color: var(--text-meta);
  border-color: rgba(255,217,96,0.20);
  background: rgba(0,0,0,0.25);
}

/* portrait inside slot */
.fs-app .portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  color: #fff8e0;
  flex: 0 0 auto;
  background:
    radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 80%, white) 0%, var(--accent) 35%, color-mix(in srgb, var(--accent) 50%, #1a1a28) 100%);
  box-shadow:
    0 0 0 1.5px rgba(0,0,0,0.5),
    0 0 0 2.5px var(--accent),
    0 0 0 3.5px rgba(255,217,96,0.4),
    0 4px 10px rgba(0,0,0,0.4),
    inset 0 -6px 12px rgba(0,0,0,0.35);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.fs-app .bf-slot__portrait-wrap { width: 44px; height: 44px; flex: 0 0 auto; }
.fs-app .bf-slot__portrait-wrap .portrait { font-size: 18px; }

.bf-slot__
.fs-app .bf-slot__name {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.1;
  color: #fff8e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-app .bf-slot__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--text-meta);
}
.fs-app .bf-slot__meta-faction {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent);
}
.fs-app .faction-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 4px color-mix(in srgb, var(--accent) 60%, transparent);
}
.fs-app .bf-slot__lvl {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--gold);
  letter-spacing: 0;
}

.fs-app .bf-slot__empty-label {
  font-family: var(--ui);
  font-size: 11px;
  color: var(--text-meta);
  font-style: italic;
}
.fs-app .bf-slot__empty-hint {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,217,96,0.5);
  margin-top: 2px;
}

/* === Preset row at bottom of battlefield zone === */
.fs-app .bf-presets {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255,217,96,0.18);
}
.fs-app .bf-preset {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--ui);
  min-height: 28px;
  text-align: left;
  width: 100%;
}
.fs-app .bf-preset--filled {
  background: linear-gradient(180deg, rgba(255,217,96,0.14) 0%, rgba(255,217,96,0.04) 100%);
  border: 1px solid rgba(255,217,96,0.32);
  color: #fff8e0;
}
.fs-app .bf-preset--filled:hover {
  background: linear-gradient(180deg, rgba(255,217,96,0.22) 0%, rgba(255,217,96,0.08) 100%);
  border-color: rgba(255,217,96,0.55);
}
.fs-app .bf-preset--empty {
  background: rgba(0,0,0,0.18);
  border: 1.2px dashed rgba(255,217,96,0.22);
  color: var(--text-meta);
  grid-template-columns: 18px 1fr;
}
.fs-app .bf-preset--empty:hover {
  border-color: rgba(255,217,96,0.5);
  color: var(--text-dim);
}
.fs-app .bf-preset__num {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--gold);
  opacity: 0.7;
  letter-spacing: 0.06em;
  text-align: center;
}
.fs-app .bf-preset__name {
  font-family: var(--serif);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.fs-app .bf-preset__name--placeholder {
  font-family: var(--ui);
  font-size: 11px;
  font-style: italic;
}
.fs-app .bf-preset__count {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--gold);
  opacity: 0.85;
  letter-spacing: 0.04em;
}
.fs-app .bf-preset__del {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  color: #ff8a8a;
  border: 1px solid rgba(255,138,138,0.22);
  background: rgba(0,0,0,0.18);
}
.fs-app .bf-preset__del:hover {
  background: rgba(255,138,138,0.18);
  border-color: rgba(255,138,138,0.55);
}

.fs-app .bf-slot__remove {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.4);
  color: var(--text-meta);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: all 0.15s;
}
.fs-app .bf-slot__remove:hover { color: #ff8a8a; border-color: rgba(255,138,138,0.4); background: rgba(255,138,138,0.08); }
.fs-app .bf-slot__remove svg { width: 9px; height: 9px; }

/* =================================================================
   ZONE 2 — POOL
================================================================= */
.fs-app .pool-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fs-app .pool-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 8px;
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-meta);
}
.fs-app .pool-search svg { width: 10px; height: 10px; }

.fs-app .pool-filters {
  display: flex;
  align-items: center;
  gap: 4px;
}
.fs-app .pool-filter {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.3);
  color: var(--text-meta);
  cursor: pointer;
  transition: all 0.12s;
}
.fs-app .pool-filter:hover { color: var(--text-dim); border-color: var(--line-strong); }
.fs-app .pool-filter--active {
  color: var(--gold);
  background: rgba(255,217,96,0.1);
  border-color: rgba(255,217,96,0.45);
}

.fs-app .pool-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,217,96,0.25) transparent;
}
.fs-app .pool-grid::-webkit-scrollbar { width: 5px; }
.fs-app .pool-grid::-webkit-scrollbar-thumb { background: rgba(255,217,96,0.22); border-radius: 3px; }

/* wizard mini-card */
.fs-app .wiz {
  --accent: var(--gold);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px 8px;
  border-radius: 9px;
  background: linear-gradient(180deg, var(--bg-card-hi) 0%, var(--bg-card) 100%);
  border: 1px solid var(--line);
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  text-align: center;
  min-height: 110px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.fs-app .wiz:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent),
    0 0 16px color-mix(in srgb, var(--accent) 22%, transparent),
    0 8px 18px rgba(0,0,0,0.45);
}
.fs-app .wiz:active { cursor: grabbing; }
.fs-app .wiz.is-selected {
  border-color: var(--gold);
  box-shadow:
    0 0 0 1px rgba(255,217,96,0.55),
    0 0 22px rgba(255,217,96,0.30),
    0 8px 18px rgba(0,0,0,0.5);
}

.fs-app .wiz.is-placed {
  filter: grayscale(0.85) brightness(0.55);
  cursor: not-allowed;
}
/* IN FORMATION штамп убран — серый фильтр уже достаточно показывает что маг занят */
.fs-app .wiz.is-placed::before {
  display: none !important;
  content: none !important;
}

.fs-app .wiz__portrait-wrap {
  position: relative;
  width: 48px;
  height: 48px;
}
.fs-app .wiz__portrait-wrap .portrait { font-size: 19px; }

.fs-app .wiz__lvl {
  position: absolute;
  bottom: -2px;
  right: -3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 12px;
  color: #1a1208;
  background: radial-gradient(circle at 35% 30%, #fff5c0 0%, var(--gold) 50%, var(--gold-deep) 100%);
  box-shadow: 0 0 0 1.5px #1a1208, 0 0 0 2.5px var(--gold-deep), 0 2px 4px rgba(0,0,0,0.5);
  font-weight: 400;
  letter-spacing: 0;
}

.fs-app .wiz__faction {
  position: absolute;
  top: -2px;
  left: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid #1a1a28;
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 65%, transparent);
}

.fs-app .wiz__name {
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.05;
  color: #fff8e0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fs-app .wiz__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--text-meta);
}
.fs-app .wiz__meta b { color: var(--accent); font-weight: 600; }

/* Список заклинаний в пуле — мини-блоки под HP/DMG */
.fs-app .wiz__spells {
  align-self: stretch;
  width: 100%;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed rgba(255,217,96,0.18);
}
.fs-app .wiz__spell {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(255,217,96,0.10) 0%, rgba(255,217,96,0.04) 100%);
  border: 1px solid rgba(255,217,96,0.28);
  font-family: var(--ui);
  font-size: 9.5px;
  line-height: 1.15;
  color: #fff8e0;
  min-width: 0;
  cursor: pointer;
  transition: all 0.12s;
}
.fs-app .wiz__spell:hover {
  background: linear-gradient(180deg, rgba(255,217,96,0.22) 0%, rgba(255,217,96,0.10) 100%);
  border-color: rgba(255,217,96,0.6);
  transform: translateY(-1px);
}
.fs-app .wiz__spell-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  font-weight: 500;
}
.fs-app .wiz__spell-lvl {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(0,0,0,0.45);
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.fs-app .wiz__spell--empty {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
  border-style: dashed;
  color: var(--text-meta);
  opacity: 0.7;
  justify-content: center;
  font-style: italic;
  font-size: 8.5px;
  cursor: pointer;
}
.fs-app .wiz__spell--empty:hover {
  border-color: rgba(255,217,96,0.4);
  color: var(--text-dim);
  opacity: 1;
}

/* =================================================================
   ZONE 3 — DETAILS
================================================================= */
.fs-app .details {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fs-app .details__scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 14px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,217,96,0.22) transparent;
}
.fs-app .details__scroll::-webkit-scrollbar { width: 5px; }
.fs-app .details__scroll::-webkit-scrollbar-thumb { background: rgba(255,217,96,0.22); border-radius: 3px; }

.fs-app .det-hero {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.fs-app .det-hero__portrait-wrap { width: 64px; height: 64px; }
.fs-app .det-hero__portrait-wrap .portrait { font-size: 24px; }

.fs-app .det-hero__name {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.1;
  color: #fff8e0;
  margin: 0 0 4px;
  text-shadow: 0 2px 8px rgba(255,217,96,0.18);
}
.fs-app .det-hero__sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.10em;
  color: var(--text-meta);
}
.fs-app .det-hero__sub-faction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
}
.fs-app .det-hero__sub-lvl b {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--gold);
  font-weight: 400;
  margin: 0 1px;
}

/* stat block */
.fs-app .stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.fs-app .stat {
  position: relative;
  padding: 8px 8px 7px;
  border-radius: 7px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--line);
}
.fs-app .stat__label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-meta);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.fs-app .stat__icon { width: 9px; height: 9px; opacity: 0.8; }
.fs-app .stat__value {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: #fff8e0;
  line-height: 1;
}
.fs-app .stat--hp .stat__value { color: #ffb8b8; }
.fs-app .stat--dmg .stat__value { color: #ffc89d; }
.fs-app .stat--armor .stat__value { color: #c5d4dd; }

/* spell list */
.fs-app .det-section-title {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-meta);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fs-app .det-section-title b { color: var(--gold); font-weight: 600; }

.fs-app .spell-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.fs-app .spell-row {
  --accent: var(--gold);
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 8px 6px 6px;
  border-radius: 7px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--line);
  position: relative;
}
.fs-app .spell-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  border-radius: 7px 0 0 7px;
  background: var(--accent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 60%, transparent);
}
.fs-app .spell-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 60%, white) 0%, var(--accent) 50%, color-mix(in srgb, var(--accent) 30%, #0d0d18) 100%);
  display: grid; place-items: center;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.5),
    0 0 0 1.5px color-mix(in srgb, var(--accent) 80%, transparent),
    0 0 8px color-mix(in srgb, var(--accent) 50%, transparent),
    inset 0 -3px 6px rgba(0,0,0,0.35);
  position: relative;
}
.fs-app .spell-icon svg { width: 16px; height: 16px; position: relative; z-index: 1; }

.spell-row__
.fs-app .spell-row__name {
  font-family: var(--serif);
  font-size: 12px;
  color: #fff8e0;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-app .spell-row__pips {
  display: inline-flex;
  gap: 2px;
  margin-top: 3px;
}
.fs-app .spell-row__pip {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 3px color-mix(in srgb, var(--accent) 60%, transparent);
}
.fs-app .spell-row__pip--off {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: none;
}
.fs-app .spell-row__tier {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.10em;
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 12%, rgba(0,0,0,0.5));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  text-transform: uppercase;
}

/* details footer — action button */
.fs-app .det-actions {
  flex: 0 0 auto;
  padding: 10px 14px 72px; /* снизу место под плавающую «В бой» — она закрывала «Убрать со слота» */
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
}
.fs-app .det-action {
  width: 100%;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,138,138,0.45);
  background: linear-gradient(180deg, rgba(196,61,61,0.20) 0%, rgba(120,30,30,0.15) 100%);
  color: #ffb8b8;
  cursor: pointer;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.fs-app .det-action:hover {
  border-color: rgba(255,138,138,0.7);
  background: linear-gradient(180deg, rgba(196,61,61,0.30) 0%, rgba(120,30,30,0.20) 100%);
  color: #ffd8d8;
}
.fs-app .det-action svg { width: 12px; height: 12px; }

/* placeholder right panel (no selection) */
.fs-app .det-empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--text-meta);
}
.fs-app .det-empty__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  border: 1.5px dashed rgba(255,217,96,0.35);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.fs-app .det-empty__icon svg { width: 22px; height: 22px; opacity: 0.7; }
.fs-app .det-empty__title {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.fs-app .det-empty__msg {
  font-family: var(--ui);
  font-size: 11px;
  font-style: italic;
  line-height: 1.4;
}

/* =================================================================
   FLOATING CTA — INTO BATTLE
================================================================= */
.fs-app .cta-into-battle {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px 13px 18px;
  border-radius: 10px;
  border: none;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #1a1208;
  background:
    linear-gradient(180deg, #fff5c0 0%, var(--gold) 35%, var(--gold-deep) 100%);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.4),
    0 0 0 2px var(--gold-deep),
    0 0 22px rgba(255,217,96,0.55),
    0 0 50px rgba(255,217,96,0.30),
    0 8px 24px rgba(0,0,0,0.5),
    .fs-app inset 0 -4px 8px rgba(120, .fs-app 80, .fs-app 20, .fs-app 0.4),
    inset 0 1px 1px rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.18s;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
  animation: ctaGlow 2.2s ease-in-out infinite;
}
@keyframes ctaGlow {
  0%,100% { box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 0 0 2px var(--gold-deep), 0 0 22px rgba(255,217,96,0.55), 0 0 50px rgba(255,217,96,0.30), 0 8px 24px rgba(0,0,0,0.5), inset 0 -4px 8px rgba(120,80,20,0.4), inset 0 1px 1px rgba(255,255,255,0.6); }
  50%     { box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 0 0 2px var(--gold-deep), 0 0 28px rgba(255,217,96,0.75), 0 0 65px rgba(255,217,96,0.45), 0 8px 24px rgba(0,0,0,0.5), inset 0 -4px 8px rgba(120,80,20,0.4), inset 0 1px 1px rgba(255,255,255,0.6); }
}
.fs-app .cta-into-battle:hover { transform: translateY(-1px); }
.fs-app .cta-into-battle:active { transform: translateY(0); filter: brightness(0.95); }
.fs-app .cta-into-battle__icon {
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
}
.fs-app .cta-into-battle__icon svg { width: 22px; height: 22px; }
.fs-app .cta-into-battle__count {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(26,18,8,0.7);
  margin-left: 4px;
  padding-left: 10px;
  border-left: 1px solid rgba(26,18,8,0.3);
}

/* =================================================================
   COMPACT MODE — short landscape (≤480px height)
================================================================= */
@media (max-height: 480px) {
  .fs-app .topbar { padding: 0 10px; gap: 8px; }
  .fs-app .tb-section-label { display: none; }
  .fs-app .tb-preset__name { min-width: 90px; font-size: 12px; }
  .fs-app .tb-meta { font-size: 9px; gap: 10px; }
  .fs-app .tb-btn { padding: 6px 8px; font-size: 10px; }
  .fs-app .tb-btn span { display: none; }
  .fs-app .tb-meta__count-label { display: none; }

  .fs-app .main {
    grid-template-columns: minmax(180px, 32%) 1fr;
    padding: 8px;
    gap: 8px;
  }
  .fs-app .zone--details { display: none; }

  .fs-app .battlefield { padding: 6px; gap: 5px; }
  .fs-app .bf-slot { padding: 5px 7px 5px 5px; gap: 7px; min-height: 44px; }
  .fs-app .bf-slot__num { width: 20px; height: 20px; font-size: 9px; }
  .fs-app .bf-slot__portrait-wrap { width: 32px; height: 32px; }
  .fs-app .bf-slot__portrait-wrap .portrait { font-size: 13px; }
  .fs-app .bf-slot__name { font-size: 11px; }
  .fs-app .bf-slot__meta { font-size: 8px; }
  .fs-app .bf-slot__lvl { font-size: 12px; }
  .fs-app .bf-slot__remove { width: 18px; height: 18px; }
  .fs-app .bf-slot__empty-label { font-size: 10px; }
  .fs-app .bf-slot__empty-hint { display: none; }

  .fs-app .pool-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
  }
  .fs-app .wiz { padding: 6px 4px 4px; min-height: 86px; gap: 3px; }
  .fs-app .wiz__spells { gap: 2px; margin-top: 3px; padding-top: 3px; }
  .fs-app .wiz__spell { font-size: 8px; padding: 1px 4px; }
  .fs-app .wiz__spell-lvl { font-size: 7px; padding: 0 3px; }
  .fs-app .wiz__spell--empty { font-size: 7px; }
  .fs-app .wiz__portrait-wrap { width: 36px; height: 36px; }
  .fs-app .wiz__portrait-wrap .portrait { font-size: 14px; }
  .fs-app .wiz__lvl { width: 17px; height: 17px; font-size: 10px; }
  .fs-app .wiz__faction { width: 11px; height: 11px; }
  .fs-app .wiz__name { font-size: 10px; }
  .fs-app .wiz__meta { font-size: 7px; }
  .fs-app .pool-search { display: none; }
  .fs-app .pool-filter { padding: 3px 6px; font-size: 8px; }

  .fs-app .cta-into-battle {
    padding: 7px 12px 7px 10px;
    font-size: 11px;
    letter-spacing: 0.10em;
    bottom: 6px;
    right: 6px;
  }
  .fs-app .cta-into-battle__icon { width: 14px; height: 14px; }
  .fs-app .cta-into-battle__icon svg { width: 14px; height: 14px; }
  .fs-app .cta-into-battle__count { font-size: 8px; padding-left: 6px; margin-left: 2px; }
  /* Padding снизу у main чтобы slots/pool не накладывались на CTA */
  .fs-app .main { padding-bottom: 38px; }
  /* Compact preset row */
  .fs-app .bf-presets { gap: 4px; margin-top: 6px; padding-top: 6px; }
  .fs-app .bf-preset { min-height: 24px; padding: 3px 6px; }
  .fs-app .bf-preset__name { font-size: 11px; }
  .fs-app .bf-preset__name--placeholder { font-size: 10px; }
  .fs-app .bf-preset__count { font-size: 8px; }
  .fs-app .bf-preset__del { width: 16px; height: 16px; font-size: 12px; }
  /* Подсказку «сверху ↓ вниз» скрываем — место узкое */
  .fs-app .zone__title-side { display: none; }

  /* compact details = bottom half-sheet (visible when wizard selected) */
  .fs-app .compact-sheet {
    display: flex !important;
  }
}

@media (min-height: 481px) {
  .fs-app .compact-sheet { display: none !important; }
}

/* =================================================================
   COMPACT BOTTOM SHEET (only shown ≤480px height)
================================================================= */
.fs-app .compact-sheet {
  display: none;
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: 8px;
  max-height: 70vh;
  background: linear-gradient(180deg, #2a2a3d 0%, #1c1c2a 100%);
  border-radius: 12px 12px 10px 10px;
  border: 1px solid rgba(255,217,96,0.28);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.6),
    0 -8px 30px rgba(0,0,0,0.6),
    0 0 50px rgba(255,217,96,0.10);
  flex-direction: column;
  overflow: hidden;
  z-index: 40;
}
.fs-app .compact-sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,217,96,0.4);
  margin: 6px auto 4px;
}
.fs-app .compact-sheet__close {
  position: absolute;
  top: 8px; right: 10px;
  width: 22px; height: 22px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.4);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.fs-app .compact-sheet__close svg { width: 9px; height: 9px; }

