/* ===========================================================================
   Башня Металла — ТЗ docs/tz/bashnya-metalla/TZ-bashnya-metalla.md; макет стражей
   принят автором (docs/tz/bashnya-metalla/maket/index.html). Каркас экрана и боя —
   общий с Башней огня (fire-tower.css); здесь — сталь, серебро, латунь и то,
   чего у огня нет: купол барьера, цепи, метки, прицел.
   =========================================================================== */

:root {
  --mt-steel: #b9cde4;
  --mt-steel-hi: #e8f2ff;
  --mt-steel-deep: #3b5677;
  --mt-brass: #c99a4a;
}

/* --- Фон --------------------------------------------------------------------
   Фона святилища пока нет [ТЗ, раздел 5]: --mt-bg ставит клиент, только когда
   сервер сказал, что файл лежит (`background`). До того — стальной из макета. */
.ft-metal-screen,
.combat-screen.combat-screen--metal-tower {
  background:
    linear-gradient(to bottom, rgba(8, 10, 14, 0.25), rgba(8, 10, 14, 0.6)),
    var(--mt-bg, radial-gradient(120% 60% at 50% 0%, rgba(90, 120, 160, 0.22), transparent 60%)) center top / cover no-repeat,
    linear-gradient(180deg, #121823 0%, #0b0f15 55%, #0d1016 100%);
}
.ft-metal-screen::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 280px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, rgba(120, 160, 210, 0.22), rgba(60, 86, 119, 0.1) 45%, transparent 75%);
}

/* --- Экран: огненные акценты общего каркаса — сталью ----------------------- */
.ft-metal-screen .ft-btn--fire {
  background: linear-gradient(180deg, #5d7796, #33475f);
  border-color: var(--mt-steel);
  color: var(--mt-steel-hi);
}
.ft-metal-screen .ft-title h2 {
  color: var(--mt-steel);
}
.ft-metal-screen .ft-floor.is-guard {
  border-color: var(--mt-steel);
}
.ft-metal-screen .ft-pbar i,
.ft-metal-screen .ft-bar i {
  background: linear-gradient(90deg, #5d7796, var(--mt-steel));
}
.ft-wave__plan {
  font-weight: 400;
  opacity: 0.72;
}

/* --- Слова над бойцом ------------------------------------------------------- */
.ft-word--heal { color: #8fe3a8; text-shadow: 0 0 6px #123a22, 0 1px 0 #000; }
.combat-screen--metal-tower .ft-word--big {
  color: var(--mt-steel-hi);
  text-shadow: 0 0 16px rgba(80, 130, 200, 1), 0 0 4px #000, 0 1px 0 #000;
}
.combat-screen--metal-tower .ft-voice {
  color: var(--mt-steel-hi);
}

/* --- Кирпичи вида ----------------------------------------------------------- */
.mt-flash {
  background: radial-gradient(70% 50% at 50% 30%, rgba(235, 245, 255, 0.85), rgba(130, 170, 220, 0.45) 45%, transparent 80%);
}
.mt-glow {
  background: radial-gradient(closest-side, rgba(240, 247, 255, 0.85), rgba(150, 190, 240, 0.35) 55%, transparent 80%);
}
.mt-spark,
.mt-bolt,
.mt-steam {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
}
.mt-spark {
  background: #e4efff;
  box-shadow: 0 0 5px rgba(190, 215, 255, 0.95);
}
.mt-spark--warm {
  background: #ffd28c;
  box-shadow: 0 0 5px rgba(255, 190, 110, 0.95);
}
.mt-bolt {
  background: radial-gradient(circle at 40% 40%, #fff, #c6d6ea 55%, #6c809a);
  box-shadow: 0 0 8px rgba(190, 215, 255, 0.85);
}
.mt-bolt--repair {
  background: #ffd28c;
  box-shadow: 0 0 6px rgba(255, 210, 140, 0.95);
}
.mt-bolt--rune {
  background: radial-gradient(circle, #fff, #cfe2ff 55%, #7fa4d6);
  box-shadow: 0 0 12px rgba(190, 215, 255, 1);
}
.mt-bolt--mercury {
  background: radial-gradient(circle at 35% 30%, #fff, #b9c4cf 45%, #5f6b78);
  box-shadow: 0 0 6px rgba(210, 220, 230, 0.8);
}
.mt-bolt--blade {
  border-radius: 1px;
  background: #e8f2ff;
}
.mt-bolt--scrap {
  border-radius: 2px;
  background: #7f8b99;
  box-shadow: none;
}
.mt-bolt--rust {
  background: radial-gradient(circle, #e8b46a, #a4602a);
  box-shadow: 0 0 8px rgba(190, 110, 50, 0.9);
}
.mt-steam {
  background: radial-gradient(closest-side, rgba(235, 240, 245, 0.7), rgba(235, 240, 245, 0));
}
.mt-beam {
  background: linear-gradient(90deg, rgba(190, 215, 255, 0.2), #f0f7ff);
  box-shadow: 0 0 8px rgba(190, 215, 255, 0.9);
}
.mt-beam--arc {
  background: linear-gradient(90deg, rgba(140, 200, 255, 0.3), #d8f0ff);
  box-shadow: 0 0 12px rgba(120, 190, 255, 1);
}

/* --- Цепи титана — видны всегда -------------------------------------------- */
.mt-chains {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}
.mt-chain {
  fill: none;
  stroke: rgba(150, 165, 185, 0.7);
  stroke-width: 2;
  stroke-dasharray: 6 4;
}
.mt-chain--flash {
  stroke: rgba(230, 240, 255, 1);
  stroke-width: 4;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 6px #bcd4ff);
}

/* --- Длящееся в плитке ------------------------------------------------------ */
/* Купол барьера: свечение и пластины по краю (макет: `barrierDome`). */
.mt-dome {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 55%;
  width: 96%;
  height: 94%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  opacity: calc(0.45 + var(--frac, 1) * 0.55);
  background: radial-gradient(closest-side, rgba(120, 160, 220, 0) 55%, rgba(150, 190, 240, 0.16) 85%, rgba(220, 235, 255, 0.42) 100%);
}
.mt-dome i {
  position: absolute;
  width: 7%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%);
  background: rgba(225, 238, 255, 0.5);
}
/* Полоса барьера над здоровьем. */
.mt-barrier-bar {
  position: absolute;
  z-index: 3;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 4px;
  border-radius: 3px;
  background: rgba(8, 10, 14, 0.55);
  overflow: hidden;
  pointer-events: none;
}
.mt-barrier-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #9fb8d8, #f0f7ff);
  box-shadow: 0 0 6px rgba(190, 215, 255, 0.8);
}
/* Метки: «закалка +20%», заточка, несгибаемость, цепная связь. */
.mt-tags {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 7px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 3px;
  width: 112%;
  pointer-events: none;
}
.mt-tag {
  font: 600 0.6rem/1 var(--font-ui, sans-serif);
  color: var(--mt-steel-hi);
  background: rgba(8, 10, 14, 0.72);
  border: 1px solid rgba(185, 205, 228, 0.45);
  border-radius: 999px;
  padding: 2px 5px;
  white-space: nowrap;
}
.mt-tag.is-warm { color: #ffd7a0; border-color: rgba(255, 190, 120, 0.5); }
.mt-tag.is-bad { color: #f0b0a8; border-color: rgba(240, 150, 140, 0.5); }
/* Счётчики над бойцом: шестерни завода, деления воли, давление, наводка. */
.ft-heat.mt-heat {
  background: rgba(8, 10, 14, 0.8);
  border-color: rgba(185, 205, 228, 0.4);
  color: var(--mt-steel-hi);
  font-size: 0.66rem;
}
.ft-heat.mt-heat i {
  background: #202836;
  border-color: #3a4558;
}
.ft-heat.mt-heat--gear i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px dotted #4a5466;
  background: none;
}
.ft-heat.mt-heat--gear i.on {
  border-color: var(--mt-brass);
  box-shadow: 0 0 6px rgba(201, 154, 74, 0.85);
}
.ft-heat.mt-heat--will i.on {
  background: linear-gradient(180deg, #fff, #a9c4e6);
  border-color: #dbe8f8;
  box-shadow: 0 0 5px rgba(200, 225, 255, 0.85);
}
.ft-heat.mt-heat.is-full {
  border-color: #dbe8f8;
  box-shadow: 0 0 12px rgba(170, 205, 255, 0.7);
}
.ft-heat.mt-heat--steam { color: #f0e6d0; border-color: rgba(235, 220, 190, 0.55); }
.ft-heat.mt-heat--aim { color: #ffd7a0; border-color: rgba(255, 190, 120, 0.55); }
/* Свечение: маховик Привратника, лицо Хранителя, руна голема. */
.mt-glow-spot {
  position: absolute;
  z-index: 2;
  left: 50%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  transition: opacity 0.3s ease;
  opacity: var(--power, 0.3);
}
.mt-glow-spot--gear {
  top: 37%;
  width: 30%;
  background: radial-gradient(closest-side, rgba(255, 210, 140, 0.9), rgba(255, 160, 60, 0));
}
.mt-glow-spot--will {
  top: 22%;
  width: 34%;
  background: radial-gradient(closest-side, rgba(235, 245, 255, 0.95), rgba(150, 190, 255, 0));
}
.mt-glow-spot--rune {
  top: 42%;
  width: 26%;
  background: radial-gradient(closest-side, rgba(225, 240, 255, 0.95), rgba(130, 175, 245, 0));
}
/* Прицел Болтомёта над героем. */
.mt-reticle {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: 46%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(235, 242, 255, 0.9);
  box-shadow: 0 0 10px rgba(190, 215, 255, 0.9);
  pointer-events: none;
  background:
    linear-gradient(rgba(235, 242, 255, 0.9), rgba(235, 242, 255, 0.9)) center / 2px 100% no-repeat,
    linear-gradient(rgba(235, 242, 255, 0.9), rgba(235, 242, 255, 0.9)) center / 100% 2px no-repeat;
  animation: mt-aim 1s ease-in-out infinite alternate;
}
@keyframes mt-aim {
  from { transform: translate(-50%, -50%) scale(0.92); }
  to { transform: translate(-50%, -50%) scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .mt-reticle { animation: none; }
}
