/* ═══════════════════════════════════════════════════════════════
   НАБЕЙ ЕБЛО МОНОПОЛИСТУ
   ═══════════════════════════════════════════════════════════════ */

.fight {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  background: #06070a;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.fight__canvas { position: absolute; inset: 0; width: 100%; height: 100% }

/* ── КАТСЦЕНА ─────────────────────────────────────────────── */

.cut {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: radial-gradient(ellipse at 50% 30%, #131a2b, #05060a 70%);
  cursor: pointer;
}

.cut__portraits {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(12px, 6vw, 90px);
  gap: 20px;
}

.cut__portrait {
  position: relative;
  width: clamp(120px, 26vw, 300px);
  opacity: .28;
  filter: grayscale(.75) brightness(.55);
  transform: scale(.9);
  transition: opacity .4s, filter .4s, transform .4s;
}

.cut__portrait img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
}

.cut__portrait--active { opacity: 1; filter: none; transform: scale(1) }

.cut__portrait--hero img { box-shadow: 0 0 0 3px #3aa0ff, 0 20px 60px rgba(58,160,255,.35) }
.cut__portrait--boss img { box-shadow: 0 0 0 3px #ff9c3a, 0 20px 60px rgba(255,156,58,.35) }

.cut__name {
  margin-top: 10px;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(13px, 2.2vw, 19px);
  font-weight: 700;
  letter-spacing: .14em;
}

.cut__portrait--hero .cut__name { color: #3aa0ff }
.cut__portrait--boss .cut__name { color: #ff9c3a }

.cut__bubble {
  position: relative;
  margin: 0 auto clamp(24px, 6vh, 60px);
  width: min(880px, 92vw);
  min-height: 128px;
  padding: 24px 28px 34px;
  border-radius: 16px;
  background: rgba(10, 12, 18, .92);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 2px var(--line);
  transition: box-shadow .3s;
}

.cut__bubble--hero { box-shadow: inset 0 0 0 2px rgba(58,160,255,.6) }
.cut__bubble--boss { box-shadow: inset 0 0 0 2px rgba(255,156,58,.6) }

.cut__text {
  font-size: clamp(15px, 2.4vw, 20px);
  line-height: 1.55;
  color: var(--text);
  min-height: 3em;
}

.cut__next {
  position: absolute;
  right: 18px;
  bottom: 12px;
  font-size: 15px;
  color: var(--accent);
  animation: cutNext 1.1s ease-in-out infinite;
  transition: opacity .2s;
}

@keyframes cutNext {
  0%, 100% { transform: translateY(0); opacity: .5 }
  50%      { transform: translateY(4px); opacity: 1 }
}

.cut__skip {
  position: absolute;
  right: 18px;
  top: 18px;
  padding: 9px 18px;
  border-radius: 30px;
  font-size: 13px;
  color: var(--text-dim);
  background: rgba(0,0,0,.55);
  box-shadow: inset 0 0 0 1px var(--line);
}

.cut__start {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: #000;
  font-family: var(--font-display);
  font-size: clamp(64px, 18vw, 190px);
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--accent);
  text-shadow: 0 0 70px rgba(0,229,122,.6);
  animation: startPunch .45s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes startPunch {
  0%   { opacity: 0; transform: scale(2.6) }
  60%  { opacity: 1; transform: scale(.94) }
  100% { opacity: 1; transform: scale(1) }
}

/* ── ИНТЕРФЕЙС БОЯ ────────────────────────────────────────── */

.fhud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  padding: 14px clamp(10px, 3vw, 28px);
  display: flex;
  flex-direction: column;
}

.fhud__top { display: flex; align-items: flex-start; gap: 14px }
.fhud__vs {
  font-family: var(--font-display);
  font-size: clamp(16px, 3vw, 26px);
  font-weight: 700;
  color: var(--text-faint);
  padding-top: 14px;
}

.fbar { flex: 1; min-width: 0 }

.fbar__name {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--text-dim);
  margin-bottom: 5px;
}

.fbar--boss { text-align: right }

.fbar__track {
  height: 16px;
  border-radius: 3px;
  background: rgba(0,0,0,.55);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
  overflow: hidden;
}

.fbar__track i {
  display: block;
  height: 100%;
  transform-origin: left center;
  transition: transform .18s cubic-bezier(.22, 1, .36, 1);
}

.fbar--hero .fbar__track i { background: linear-gradient(90deg, #3aa0ff, #7ecbff) }
.fbar--boss .fbar__track i { background: linear-gradient(90deg, #ff9c3a, #ffcf7e); transform-origin: right center }
.fbar--boss .fbar__track { direction: rtl }

.fhud__bottom { margin-top: auto; display: flex; gap: 16px; align-items: flex-end }
.fbar--rage { max-width: 340px }
.fbar--rage .fbar__track { height: 12px }
.fbar--rage .fbar__track i { background: linear-gradient(90deg, #ff3b57, #ffd166) }

.fhud--rage-full .fbar--rage .fbar__track {
  box-shadow: inset 0 0 0 1px var(--gold), 0 0 22px rgba(255,194,61,.55);
  animation: ragePulse .9s ease-in-out infinite;
}

@keyframes ragePulse { 0%,100% { filter: brightness(1) } 50% { filter: brightness(1.45) } }

.fbar--dogs { max-width: 200px }
.fbar__dogs { display: flex; gap: 5px }
.fbar__dogs i {
  width: 20px; height: 12px;
  border-radius: 3px;
  background: rgba(255,255,255,.1);
  transition: background .2s;
}
.fbar__dogs i.on { background: #e8c98a; box-shadow: 0 0 10px rgba(232,201,138,.5) }

.fhud__hint {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--text-faint);
  text-align: center;
}

.fhud--ko .fbar--rage .fbar__track { box-shadow: inset 0 0 0 2px var(--gold), 0 0 30px var(--gold) }

.fight__banner {
  position: absolute;
  left: 50%;
  top: 26%;
  transform: translate(-50%, -50%) scale(.8);
  z-index: 20;
  font-family: var(--font-display);
  font-size: clamp(26px, 6vw, 58px);
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--gold);
  text-shadow: 0 0 50px rgba(255,194,61,.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s, transform .45s cubic-bezier(.22, 1, .36, 1);
}

.fight__banner--on { opacity: 1; transform: translate(-50%, -50%) scale(1) }

/* ── КНОПКИ ДЛЯ ПАЛЬЦЕВ ───────────────────────────────────── */

.fpad {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 15;
  display: none;
  gap: 8px;
  padding: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.fpad__btn {
  min-width: 62px;
  padding: 15px 12px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: rgba(26, 30, 42, .9);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .08s, background .12s;
}

.fpad__btn.is-down { transform: scale(.93); background: rgba(58,160,255,.35) }
.fpad__btn--wide { min-width: 84px }

.fpad__btn--ult { opacity: .35; pointer-events: none }
.fpad__btn--ult.is-ready {
  opacity: 1;
  pointer-events: auto;
  background: var(--gold);
  color: #1a1400;
  animation: ultReady .8s ease-in-out infinite;
}

@keyframes ultReady {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,194,61,.6) }
  50%     { box-shadow: 0 0 26px 6px rgba(255,194,61,.55) }
}

/* в нокауте остаётся только ульта */
.fpad--ko .fpad__btn:not(.fpad__btn--ult) { opacity: .2; pointer-events: none }

@media (hover: none), (max-width: 900px) {
  .fpad { display: flex }
  .fhud__hint { display: none }
  .fhud__bottom { margin-bottom: 150px }
}

/* ── УЛЬТА ────────────────────────────────────────────────── */

.ult {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.14), rgba(0,0,0,.88) 60%);
  animation: fadeIn .3s ease both;
  pointer-events: none;
}

.ult__tenshi {
  width: clamp(180px, 34vw, 380px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 90px rgba(255,255,255,.35);
  animation: tenshiDrop 1.4s cubic-bezier(.3, .8, .2, 1) both;
}

@keyframes tenshiDrop {
  0%   { transform: translateY(-120vh) scale(.5); opacity: 0 }
  70%  { transform: translateY(0) scale(1.06); opacity: 1 }
  100% { transform: translateY(0) scale(1); opacity: 1 }
}

.ult__name {
  position: absolute;
  bottom: 16%;
  font-family: var(--font-display);
  font-size: clamp(18px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: .2em;
  color: #fff;
  text-shadow: 0 0 40px rgba(255,255,255,.6);
  animation: riseIn .8s ease .5s both;
}

.ult--slash::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 46%, #fff 49%, #fff 51%, transparent 54%);
  animation: slashSweep .4s ease-out both;
}

@keyframes slashSweep {
  0%   { transform: translateX(-100%) scaleY(1.4); opacity: 0 }
  30%  { opacity: 1 }
  100% { transform: translateX(100%) scaleY(1.4); opacity: 0 }
}

.ult--out { animation: fadeOut .5s ease both }

/* ── ИТОГ ─────────────────────────────────────────────────── */

.fend {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: min(460px, 92vw);
  padding: 32px 28px;
  border-radius: 18px;
  text-align: center;
  background: rgba(10, 12, 18, .95);
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 90px rgba(0,0,0,.7), inset 0 0 0 1px var(--line);
  animation: dropIn .5s cubic-bezier(.22, 1, .36, 1) both;
}

.fend__title {
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 34px);
  font-weight: 700;
  color: var(--accent);
}

.fend__text { margin-top: 12px; color: var(--text-dim); font-size: 15px }

.fend__promo {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: clamp(18px, 4vw, 26px);
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--gold);
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255,194,61,.35);
}

.fend .btn-primary { margin-top: 22px; width: 100% }

/* ═══════════════════════════════════════════════════════════════
   СЦЕНА ПОСЛЕ ПОБЕДЫ
   ═══════════════════════════════════════════════════════════════ */

.fhud--hidden { opacity: 0; transition: opacity .5s; pointer-events: none }

/* реплики поверх арены */
.obub {
  position: absolute;
  left: 50%;
  bottom: 16%;
  transform: translate(-50%, 14px);
  z-index: 20;
  width: min(760px, 90vw);
  padding: 18px 22px;
  border-radius: 14px;
  background: rgba(8, 10, 16, .93);
  backdrop-filter: blur(10px);
  font-size: clamp(14px, 2.2vw, 19px);
  line-height: 1.5;
  color: var(--text);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .35s cubic-bezier(.22, 1, .36, 1);
}

.obub--on { opacity: 1; transform: translate(-50%, 0) }
.obub--hero { box-shadow: inset 0 0 0 2px rgba(58,160,255,.65) }
.obub--boss { box-shadow: inset 0 0 0 2px rgba(255,156,58,.65) }

.obub--shout {
  font-family: var(--font-display);
  font-size: clamp(24px, 6vw, 52px);
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--danger);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  text-shadow: 0 0 40px rgba(255,59,87,.7);
}

/* ═══════════════════════════════════════════════════════════════
   ЭКРАН ВВОДА КОДА
   ═══════════════════════════════════════════════════════════════ */

.gate {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: min(440px, 92vw);
  padding: 34px 28px;
  border-radius: 18px;
  text-align: center;
  background: rgba(8, 10, 16, .96);
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 90px rgba(0,0,0,.75), inset 0 0 0 1px var(--line);
  animation: gateUp .7s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes gateUp {
  from { opacity: 0; transform: translate(-50%, -38%) }
  to   { opacity: 1; transform: translate(-50%, -50%) }
}

.gate__title {
  font-family: var(--font-display);
  font-size: clamp(20px, 4.5vw, 30px);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .04em;
}

.gate__hint { margin-top: 10px; font-size: 14px; color: var(--text-dim) }

.gate input {
  width: 100%;
  margin-top: 22px;
  padding: 15px;
  text-align: center;
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: .18em;
  text-transform: uppercase;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  outline: none;
}

.gate input:focus { border-color: var(--accent-dim) }
.gate__err { margin-top: 10px; min-height: 18px; font-family: var(--mono); font-size: 12.5px; color: var(--danger) }
.gate .btn-primary { width: 100%; margin-top: 6px }

/* спойлер с подсказкой */
.gate__spoiler { margin-top: 20px }

.gate__spoiler-btn {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--text-faint);
  padding: 7px 14px;
  border-radius: 20px;
  background: var(--bg-2);
  transition: color .15s;
}

.gate__spoiler-btn::before { content: '▸ '; }
.gate__spoiler-btn:hover { color: var(--text-dim) }
.gate__spoiler.is-open .gate__spoiler-btn::before { content: '▾ '; }

.gate__spoiler-body {
  margin-top: 10px;
  padding: 0 14px;
  max-height: 0;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  transition: max-height .35s ease, opacity .3s ease, padding .35s ease;
}

.gate__spoiler.is-open .gate__spoiler-body {
  max-height: 70px;
  padding: 12px 14px;
  opacity: 1;
}

/* затемнение во время ульты — сам Тенши рисуется на арене */
.ult--dim { background: radial-gradient(ellipse at 50% 40%, rgba(255,255,255,.10), rgba(0,0,0,.72) 65%) }
.ult--dim .ult__name { bottom: 12% }
