/* Ядро «Матч РПГ» под телефон. Вертикаль — как в записи MysteryMatch: сверху
   стороны боя, поле во всю ширину, снизу действия. Горизонталь и большой
   экран — те же блоки тремя колонками. Размер поля считает ekran.js по месту,
   которое осталось, — CSS только раскладывает блоки. */
:root {
  --fon: #08061a; --tekst: #f1ecff; --tusk: #a59fcf;
  --st: env(safe-area-inset-top, 0px); --sr: env(safe-area-inset-right, 0px);
  --sb: env(safe-area-inset-bottom, 0px); --sl: env(safe-area-inset-left, 0px);
  --lico: clamp(64px, 17vh, 160px);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none;
  color: var(--tekst); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
body {
  background:
    radial-gradient(110% 55% at 50% -5%, #34155f 0%, transparent 62%),
    radial-gradient(90% 45% at 50% 105%, #0b3346 0%, transparent 60%),
    var(--fon);
}
button, a { font: inherit; color: inherit; }

#igra {
  position: fixed; inset: 0; display: grid; gap: 8px;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  padding: calc(var(--st) + 8px) calc(var(--sr) + 8px) calc(var(--sb) + 8px) calc(var(--sl) + 8px);
}

/* ---------- верх: меню, герой, враг ---------- */
/* как в Puzzle Quest: слева герой, справа враг — одинаковыми карточками */
#verh { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: stretch; }
.kruglaya {
  width: 44px; height: 44px; border-radius: 14px; border: 1px solid #ffffff22;
  background: #160f30cc; font-size: 20px; line-height: 1; cursor: pointer; align-self: start;
}
#geroy, #vrag {
  position: relative; display: flex; align-items: center; gap: 6px; min-width: 0;
  padding: 6px; border-radius: 16px; background: linear-gradient(180deg, #1a1236e6, #0f0b24e6);
  border: 1px solid #ffffff14; box-shadow: 0 8px 24px #0008;
}
/* карточки стоят столбиком: лицо сверху, имя и HP под ним во всю ширину —
   иначе на 375 точках имя врага обрезалось до «Ж…» */
#geroy, #vrag { flex-direction: column; align-items: stretch; text-align: center; }
#vrag .lico-ramka.bolshaya { margin: 0 auto; }
#geroy .lico-ramka { width: var(--lico); margin: 0 auto; border-color: #3dff8f55; }
/* приём врага и подписи заклинаний видны только там, где есть место (горизонталь) */
.priyom, .z-tekst { display: none; }
.lico-ramka {
  position: relative; flex: none; aspect-ratio: 1; overflow: hidden; border-radius: 16px;
  background: radial-gradient(circle at 50% 35%, #3a1d66, #0b0820 75%); border: 2px solid #ff3d6455;
}
.lico-ramka.bolshaya { width: var(--lico); }
.lico-ramka img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; display: block; }
#vrag_led {
  position: absolute; inset: 0; opacity: 0; transition: opacity .3s; pointer-events: none;
  background: linear-gradient(160deg, #bff3ffaa, #3fb8ff55 50%, #c8f7ff99); mix-blend-mode: screen;
}
#vrag.skovan #vrag_led { opacity: 1; }
.info { min-width: 0; flex: 1; display: grid; gap: 5px; }
.info b { font-size: clamp(11px, 3.3vw, 15px); letter-spacing: .1em; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.polosa { position: relative; height: 16px; border-radius: 9px; background: #00000080; border: 1px solid #ffffff1c; overflow: hidden; }
.polosa i, .polosa u { position: absolute; inset: 0 auto 0 0; width: 100%; }
.polosa u { background: #ffffffaa; transition: width .7s .28s ease-out; }
.polosa i { background: linear-gradient(90deg, #17c56a, #8dffbf); transition: width .38s cubic-bezier(.2, .8, .2, 1); }
.hp-vrag i { background: linear-gradient(90deg, #ff2453, #ff9a62); }
/* уровень-цель без врага: полоса — набрано воды, кружок — ходы */
#vrag.cel .hp-vrag i { background: linear-gradient(90deg, #2d7dff, #9fd8ff); }
#vrag.cel .lico-ramka { border-color: #3aa0ff88; }
#vrag.cel #udar { border-color: #3aa0ff; background: #0b2a3a; box-shadow: 0 0 14px #3aa0ff66; }
#vrag.cel .priyom { border-color: #3aa0ff66; background: #0b2a3a; }
#vrag.cel .dlya-vraga, #vrag:not(.cel) .dlya-celi { display: none; }
.polosa span { position: relative; z-index: 1; display: block; font-size: 11px; font-weight: 800; line-height: 15px; text-align: center; text-shadow: 0 1px 2px #000; }
#udar {
  position: absolute; top: -6px; right: -6px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: #2a0b18; border: 2px solid #ff3d64; box-shadow: 0 0 14px #ff3d6466;
}
#udar span { position: absolute; top: 2px; font-size: 10px; opacity: .8; }
#udar b { font-size: 17px; font-weight: 900; margin-top: 6px; }
#udar.skoro { animation: skoro .7s ease-in-out infinite; background: #5a0c22; }
#vrag.skovan #udar { border-color: #6fdcff; background: #082a3a; box-shadow: 0 0 14px #6fdcff88; }
@keyframes skoro { 50% { transform: scale(1.15); box-shadow: 0 0 22px #ff3d64; } }

.bolno { animation: bolno .34s ease-out; }
@keyframes bolno {
  0% { transform: translate(0); filter: brightness(2.2) saturate(.4); }
  20% { transform: translate(-6px, 2px); } 40% { transform: translate(5px, -2px); }
  60% { transform: translate(-3px, 1px); } 100% { transform: translate(0); filter: none; }
}
.ataka .lico-ramka { animation: ataka .42s cubic-bezier(.3, 1.6, .4, 1); }
@keyframes ataka { 40% { transform: scale(1.22) translateY(14px); box-shadow: 0 0 30px #ff3d64; } }
.pal { filter: grayscale(1) brightness(.6); transition: filter .6s; }
.razbit .lico-ramka img { animation: razbit .9s ease-in forwards; }
@keyframes razbit { 0% { filter: brightness(3); } 100% { filter: brightness(2) blur(6px); opacity: 0; transform: scale(1.3); } }
.lechitsya { animation: lechitsya .7s ease-out; }
@keyframes lechitsya { 0% { box-shadow: 0 0 0 0 #3dff8f; } 50% { box-shadow: 0 0 26px 4px #3dff8faa; } }

/* ---------- сцена-диорама: герой и враг дерутся сверху (yadro/scena.js) ---------- */
#scena { height: clamp(128px, 20vh, 200px); min-height: 0; }
#scena_holst { display: block; width: 100%; height: 100%; border-radius: 16px; }
/* в вертикали сцена заменяет большие портреты: под ней остаются имя и полоса здоровья */
#geroy .lico-ramka, #vrag .lico-ramka { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; padding: 0; border: 0; }
#vrag #udar { top: -6px; }

/* ---------- поле ---------- */
#arena { position: relative; min-height: 0; display: grid; place-items: center; }
#pole { display: block; touch-action: none; border-radius: 18px; }
#nadpisi { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; overflow: visible; }
.slovo {
  position: absolute; white-space: nowrap; font: 900 clamp(30px, 10vw, 60px)/1 system-ui, sans-serif; letter-spacing: .03em;
  background: linear-gradient(#fffbe0, #ffc04a 55%, #ff5a36); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #4a1200) drop-shadow(0 0 16px #ff8a2a99);
  animation: slovo 1s cubic-bezier(.2, 1.4, .3, 1) forwards;
}
.kaskad-metka {
  position: absolute; top: 4%; font: 900 clamp(16px, 5vw, 26px)/1 system-ui, sans-serif; color: #fff;
  text-shadow: 0 0 12px #6ff0ff, 0 2px 0 #10324a; animation: metka .8s ease-out forwards;
}
@keyframes slovo {
  0% { transform: scale(.25) rotate(-8deg); opacity: 0; } 22% { transform: scale(1.15) rotate(2deg); opacity: 1; }
  70% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.04) translateY(-24px); opacity: 0; }
}
@keyframes metka { 0% { transform: scale(.6); opacity: 0; } 20% { transform: scale(1.2); opacity: 1; } 100% { transform: translateY(-16px); opacity: 0; } }
.chislo {
  position: fixed; z-index: 40; pointer-events: none; font: 900 clamp(22px, 7vw, 38px)/1 system-ui, sans-serif;
  color: #fff; text-shadow: 0 0 10px currentColor, 0 2px 0 #000; animation: chislo 1s ease-out forwards; transform: translate(-50%, -50%);
}
.chislo.uron { color: #ffd7dd; text-shadow: 0 0 14px #ff2d55, 0 2px 0 #4a0010; }
.chislo.lech { color: #d8ffe9; text-shadow: 0 0 14px #2dff88, 0 2px 0 #003a1a; }
@keyframes chislo { 0% { opacity: 0; margin-top: 8px; } 15% { opacity: 1; margin-top: -6px; } 100% { opacity: 0; margin-top: -54px; } }

/* ---------- заклинания ---------- */
#niz { display: grid; gap: 6px; min-height: 0; }
#zakl { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
/* на уровне-цели заклинаний нет: display: grid перебивал атрибут hidden — кадр показал полосу */
#zakl[hidden] { display: none; }
#sovet {
  text-align: center; font-size: 13px; font-weight: 800; letter-spacing: .03em; color: #fff3c4;
  padding: 7px 10px; border-radius: 12px; background: #2a1d0acc; border: 1px solid #ffd56b55; animation: poyavlenie .3s ease-out;
}
#sovet[hidden] { display: none; }
/* арена с модификаторами (у ворот): строка над заклинаниями, холодная — синяя */
#arena_stroka {
  text-align: center; font-size: 13px; font-weight: 800; letter-spacing: .03em; color: #d8f1ff;
  padding: 7px 10px; border-radius: 12px; background: #0b2a3acc; border: 1px solid #3aa0ff66; animation: poyavlenie .3s ease-out;
}
#arena_stroka[hidden] { display: none; }
#igra.arena-holod { background:
    radial-gradient(110% 55% at 50% -5%, #163a66 0%, transparent 62%),
    radial-gradient(90% 45% at 50% 105%, #0b3346 0%, transparent 60%), var(--fon); }
.z {
  --c: #fff; --fill: 0;
  position: relative; min-height: 82px; padding: 6px 2px 5px; border-radius: 16px; overflow: hidden; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); background: #120d29;
  display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center; gap: 2px;
  transition: transform .12s;
}
.z .zhizha {
  position: absolute; inset: auto 0 0 0; height: calc(var(--fill) * 100%);
  background: linear-gradient(to top, color-mix(in srgb, var(--c) 70%, transparent), color-mix(in srgb, var(--c) 18%, transparent));
  transition: height .35s ease-out;
}
.z img { position: relative; width: min(54px, 74%); aspect-ratio: 1; object-fit: contain; filter: grayscale(.55) brightness(.75); transition: filter .2s, transform .2s; }
.z small { position: relative; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.z.gotovo { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 0 18px color-mix(in srgb, var(--c) 70%, transparent); animation: zhdyot 1.1s ease-in-out infinite; }
.z.gotovo img { filter: drop-shadow(0 0 8px var(--c)); transform: scale(1.08); }
.z.pulse { animation: pulse .26s ease-out; }
.z:active { transform: scale(.95); }
@keyframes zhdyot { 50% { transform: translateY(-3px); } }
@keyframes pulse { 40% { transform: scale(1.08); } }

/* ---------- слои поверх ---------- */
#effekty { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 30; }
#vspyshka { position: fixed; inset: 0; pointer-events: none; z-index: 31; opacity: 0; background: radial-gradient(circle at 50% 40%, transparent 30%, #ff1a3c88 100%); transition: opacity .35s ease-out; }
#vspyshka.na { opacity: 1; transition: none; }

#okno, #menyu {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: calc(var(--st) + 16px) 16px calc(var(--sb) + 16px);
  background: #05031099; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
#okno[hidden], #menyu[hidden] { display: none; }
#okno_karta, #menyu_karta {
  width: min(440px, 100%); max-height: 100%; overflow: auto; border-radius: 22px; padding: 18px 18px 16px;
  background: linear-gradient(180deg, #1d1440, #0d0a21); border: 1px solid #ffffff22; box-shadow: 0 20px 60px #000c;
  display: grid; gap: 12px; text-align: center; animation: poyavlenie .28s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes poyavlenie { from { transform: translateY(18px) scale(.96); opacity: 0; } }
/* кнопки окна видны всегда: текст прокручивается внутри, а не уносит их за край */
#okno_karta { grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden; }
#okno_tekst { min-height: 0; overflow: auto; overscroll-behavior: contain; }
#okno_lico { height: clamp(90px, 26vh, 250px); width: 100%; object-fit: contain; filter: drop-shadow(0 12px 22px #000c); }
#okno_lico[hidden] { display: none; }
#okno_zag { margin: 0; font: 900 clamp(22px, 7vw, 30px)/1.05 system-ui, sans-serif; letter-spacing: .06em; }
#okno_tekst { display: grid; gap: 10px; text-align: left; font: 17px/1.45 Georgia, "Times New Roman", serif; color: #efe6d6; }
#okno_tekst p { margin: 0; }
#okno_tekst p.nashe { font: 600 13px/1.4 system-ui, sans-serif; color: var(--tusk); }
#okno_tekst .itog { text-align: center; font: 700 15px/1.4 system-ui, sans-serif; color: var(--tusk); }
#okno_knopki { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.k, .m {
  min-height: 52px; border-radius: 14px; border: 0; cursor: pointer; font-weight: 900; font-size: 15px; letter-spacing: .08em;
  background: linear-gradient(180deg, #ffd56b, #f39a2b); color: #2a1300; box-shadow: 0 4px 0 #8a4a07, 0 10px 22px #0008;
  display: grid; place-items: center; text-decoration: none; padding: 0 12px;
}
.k.vtor, .m.tihaya { background: #ffffff10; color: var(--tekst); box-shadow: inset 0 0 0 1px #ffffff2a; }
.k:active, .m:active { transform: translateY(2px); }
#menyu_karta .m { width: 100%; }
.m.sprosil { background: linear-gradient(180deg, #ff6b7f, #c92446); color: #fff; box-shadow: 0 4px 0 #6a0a1e; }

/* ---------- карта мира: вертикальная тропа, как карта MysteryMatch ---------- */
#karta {
  position: fixed; inset: 0; z-index: 20; display: grid; grid-template-rows: auto minmax(0, 1fr);
  padding: calc(var(--st) + 8px) calc(var(--sr) + 8px) calc(var(--sb) + 8px) calc(var(--sl) + 8px);
  /* пергамент (Kenney Cartography, CC0) с тёмной виньеткой по краям — карта как лист на столе */
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, #1a0f06cc 100%), url(art/karta/pergament.webp) center / cover, #d9c090;
  overflow: clip;   /* не hidden: тот прокручивается фокусом/scrollIntoView, и карта съезжала вбок (декор шире экрана) */
}
#karta[hidden] { display: none; }
#karta_verh { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
#cel {
  min-width: 0; padding: 6px 12px; border-radius: 14px; background: #1b1238e6; border: 1px solid #ffd56b55;
  display: grid; text-align: center; box-shadow: 0 8px 24px #0008;
}
#cel small { font-size: 10px; letter-spacing: .14em; color: #ffd56b; font-weight: 900; }
#cel b { font-size: clamp(13px, 3.8vw, 16px); line-height: 1.2; }
#sumka { min-width: 44px; height: 44px; padding: 0 10px; border-radius: 14px; background: #160f30cc; border: 1px solid #ffffff22; display: grid; grid-auto-flow: column; align-items: center; gap: 4px; font-size: 18px; }
#sumka b { font-size: 14px; }
#karta_mesto { position: relative; min-height: 0; display: grid; place-items: center; }
#karta_pole { position: relative; height: 100%; width: min(100%, calc((100vh - 90px) * 0.66)); }
#karta_tropa { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: 1; }
/* тропа — чернилами по пергаменту: подложка-след и пунктир шагов */
#tropa_ten { fill: none; stroke: #6b4a2455; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-width: 14px; }
#tropa_put { fill: none; stroke: #3b2614; stroke-width: 4px; stroke-dasharray: 1 11; stroke-linecap: round; vector-effect: non-scaling-stroke; }
#karta_dekor { position: absolute; inset: 0; pointer-events: none; }
#karta_dekor img { position: absolute; width: calc(clamp(34px, 6.2vh, 56px) * var(--s, 1)); transform: translate(-50%, -80%); opacity: .82; }
.uzel {
  --r: clamp(52px, 9.5vh, 72px);
  position: absolute; transform: translate(-50%, -50%); width: calc(var(--r) + 40px); display: grid; justify-items: center; gap: 4px;
  background: none; border: 0; padding: 0; cursor: pointer; color: #2b1a0c; z-index: 2;
}
.uzel i {
  width: var(--r); height: var(--r); border-radius: 50%; display: grid; place-items: center; font-style: normal; overflow: hidden;
  font-size: calc(var(--r) * 0.46); background: radial-gradient(circle at 50% 40%, #fff4d6, #e6cf9c 70%);
  border: 3px solid #5a3b1c; box-shadow: 0 6px 14px #3b261466, inset 0 0 10px #8a5a2a44; position: relative;
}
.uzel i img { width: 78%; height: 78%; object-fit: contain; }
.uzel.s-licom i { background: radial-gradient(circle at 50% 35%, #33306a, #120f2b 75%); }
.uzel.s-licom i img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.uzel b { font: 900 11px/1 Georgia, serif; letter-spacing: .1em; padding: 4px 9px; border-radius: 4px; background: #f3e2b8; color: #3b2614; border: 1px solid #8a6a3a; box-shadow: 0 2px 6px #3b261444; white-space: nowrap; }
.uzel.zakryt { cursor: default; }
.uzel.zakryt i { filter: grayscale(1) sepia(.5) brightness(.75); border-color: #8a7a62; }
.uzel.zakryt::before { content: '🔒'; position: absolute; z-index: 1; left: calc(50% + var(--r) / 2 - 18px); top: calc(var(--r) - 20px); font-size: 17px; filter: drop-shadow(0 1px 1px #0008); }
.uzel.proyden i { border-color: #2f7a3a; }
.uzel.proyden::after { content: '✓'; position: absolute; left: calc(50% + var(--r) / 2 - 16px); top: -4px; width: 22px; height: 22px; border-radius: 50%; background: #2f9a4a; color: #fff; font-size: 14px; font-weight: 900; display: grid; place-items: center; }
.uzel.sled i { border-color: #c0392b; animation: sled 1.1s ease-in-out infinite; }
@keyframes sled { 50% { box-shadow: 0 0 0 8px #c0392b33, 0 0 22px #c0392b88; transform: scale(1.06); } }
#geroy_fishka {
  position: absolute; z-index: 3; width: clamp(40px, 7vh, 54px); aspect-ratio: 1; transform: translate(-50%, -110%);
  border-radius: 50%; overflow: hidden; border: 3px solid #3dff8f; background: #120f2b; box-shadow: 0 8px 18px #000c;
  pointer-events: none;
}
#geroy_fishka img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
#geroy_fishka.idyot { animation: shagi .32s ease-in-out infinite; }
@keyframes shagi { 50% { margin-top: -5px; } }
#zelye {
  justify-self: center; min-height: 44px; min-width: 64px; padding: 0 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid #3dff8f88; background: linear-gradient(180deg, #1b4a32, #0e2a1d); color: #d8ffe9; font-size: 16px; font-weight: 900;
}
#zelye[hidden] { display: none; }
#okno_avatar { justify-self: center; width: clamp(90px, 18vh, 150px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: clamp(48px, 10vh, 84px); background: radial-gradient(circle at 50% 35%, #3a2a5e, #120f2b 75%); border: 3px solid #ffd56b88; box-shadow: 0 12px 28px #000c; }
#okno_avatar[hidden] { display: none; }
#okno_karta .nagrada { text-align: center; font: 800 15px/1.3 system-ui, sans-serif; color: #ffd56b; }

/* ---------- горизонталь и большой экран: как в Puzzle Quest (PASS 41) ----------
   Слово Сергея 03.10: «только как в пазл-квесте — слева игрок, его магия, справа
   враг». Слева герой во весь рост и под ним его заклинания списком, в центре
   поле, справа враг во весь рост и его удар. */
@media (min-aspect-ratio: 5/4) {
  #igra { grid-template-columns: minmax(180px, 23%) minmax(0, 1fr) minmax(180px, 23%); grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; }
  #verh, #niz { display: contents; }
  #geroy { grid-column: 1; grid-row: 1; }
  #zakl { grid-column: 1; grid-row: 2; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(44px, 1fr); align-content: start; min-height: 0; gap: 6px; }
  #menyu_knopka { grid-column: 1; grid-row: 3; align-self: end; }
  #scena { grid-column: 2; grid-row: 1; align-self: start; height: min(24vh, 220px); }
  #arena { grid-column: 2; grid-row: 1 / -1; margin-top: calc(min(24vh, 220px) + 10px); }
  /* на большом экране портреты по бокам остаются во весь рост — сцена не вместо них, а над полем */
  #geroy .lico-ramka, #vrag .lico-ramka { position: relative; width: var(--lico); height: auto; overflow: hidden; opacity: 1; pointer-events: auto; border: 2px solid #ff3d6455; }
  #vrag { grid-column: 3; grid-row: 1; }
  #sovet { grid-column: 3; grid-row: 2; align-self: start; font-size: 12px; }
  #arena_stroka { grid-column: 3; grid-row: 2; align-self: start; font-size: 12px; }
  #geroy, #vrag { padding: 10px; gap: 8px; }
  #geroy .lico-ramka, #vrag .lico-ramka.bolshaya { width: min(100%, calc(38vh * 0.75)); aspect-ratio: 3 / 4; }
  .lico-ramka img { object-position: 50% 30%; }
  .info b { font-size: 15px; }
  .priyom {
    display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 8px; border-radius: 12px;
    font-size: 12px; font-weight: 800; letter-spacing: .06em; background: #2a0b18; border: 1px solid #ff3d6466;
  }
  .priyom b { font-size: 15px; color: #ffb3c1; }
  /* заклинание строкой: иконка, имя и что делает, мана заливает слева направо */
  /* min-height: 0 — у вертикали плитка 82 точки, и в списке плитки налезали друг на друга */
  .z { min-height: 0; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto; justify-items: start; align-content: center; text-align: left; column-gap: 10px; padding: 6px 10px; max-height: 92px; }
  .z img { grid-row: 1 / 3; width: 44px; }
  .z .z-tekst { display: grid; gap: 1px; min-width: 0; position: relative; }
  .z .z-tekst b { font-size: 12px; letter-spacing: .05em; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .z .z-tekst em { font-size: 11px; font-style: normal; color: #d7d1f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .z small { grid-column: 2; font-size: 12px; }
  .z .zhizha { inset: 0 auto 0 0; height: auto; width: calc(var(--fill) * 100%); transition: width .35s ease-out;
    background: linear-gradient(to right, color-mix(in srgb, var(--c) 55%, transparent), color-mix(in srgb, var(--c) 14%, transparent)); }
}
/* низкая горизонталь (телефон боком): портреты меньше, заклинания плитками 3×2; сцены нет — места мало */
@media (min-aspect-ratio: 5/4) and (max-height: 560px) {
  #scena { display: none; }
  #arena { margin-top: 0; }
  #igra { grid-template-columns: minmax(170px, 24%) minmax(0, 1fr) minmax(150px, 21%); gap: 8px; }
  #geroy, #vrag { padding: 6px; gap: 4px; }
  #geroy .lico-ramka, #vrag .lico-ramka.bolshaya { width: min(100%, calc(30vh * 0.75)); }
  #zakl { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 48px; align-content: start; }
  .z { min-height: 48px; max-height: 48px; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; text-align: center; padding: 3px 2px; gap: 0; }
  .priyom .kazhdye { display: none; }
  .z img { grid-row: auto; width: auto; height: 100%; max-height: 28px; min-height: 0; }
  .z .z-tekst { display: none; }
  .z small { grid-column: auto; font-size: 10px; }
  .z .zhizha { inset: auto 0 0 0; width: auto; height: calc(var(--fill) * 100%); }
  .priyom { padding: 4px 6px; font-size: 10px; }
  .priyom b { font-size: 13px; }
  .info b { font-size: 12px; }
}
/* низкая горизонталь телефона: портрет слева, текст и кнопки справа */
@media (min-aspect-ratio: 5/4) and (max-height: 560px) {
  #okno_karta { width: min(760px, 100%); grid-template-columns: 30% minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 16px; text-align: left; }
  #okno_lico { grid-column: 1; grid-row: 1 / span 3; height: 100%; max-height: 100%; }
  #okno_zag, #okno_tekst, #okno_knopki { grid-column: 2; }
  #okno_zag { text-align: left; }
  #okno_tekst { font-size: 15px; }
  #okno_lico[hidden] + #okno_zag, #okno_lico[hidden] ~ #okno_tekst, #okno_lico[hidden] ~ #okno_knopki { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .z.gotovo, #udar.skoro { animation: none; }
}

/* ---- награда 1 из 3 после победы (geroy.js): три карточки столбцом, каждая ≥ 64 px высотой */
#okno_knopki.vybor { grid-auto-flow: row; grid-auto-columns: auto; gap: 8px; }
.nagr {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  min-height: 64px; padding: 8px 12px; border-radius: 14px; cursor: pointer; text-align: left; color: var(--tekst);
  background: linear-gradient(180deg, #2b2050, #1a1336); border: 1px solid #ffd56b55; box-shadow: 0 4px 0 #0c0820, 0 10px 22px #0008;
  animation: nagr-vhod .38s cubic-bezier(.2, 1.4, .4, 1) both;
}
.nagr:nth-child(2) { animation-delay: .08s; } .nagr:nth-child(3) { animation-delay: .16s; }
.nagr:active { transform: translateY(2px); }
.nagr i { grid-row: 1 / span 2; font-style: normal; font-size: 30px; text-align: center; }
.nagr b { font: 900 16px/1.2 system-ui, sans-serif; letter-spacing: .03em; color: #ffe7a8; }
.nagr em { grid-column: 2; font: 500 13px/1.3 system-ui, sans-serif; font-style: normal; color: #d9cfe8; }
.nagr small { grid-column: 3; grid-row: 1 / span 2; font: 800 10px/1 system-ui, sans-serif; letter-spacing: .1em; color: #ffffff88; }
.nagr-rost { border-color: #ff6b6b77; } .nagr-umenie { border-color: #8fb7ff77; } .nagr-vesch { border-color: #ffd56b99; }
@keyframes nagr-vhod { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
#geroy_kratko { height: 44px; padding: 0 10px; border-radius: 14px; background: #160f30cc; border: 1px solid #ffffff22; display: grid; place-items: center; font: 800 14px/1 system-ui, sans-serif; white-space: nowrap; }
/* ранг заклинания на кнопке — маленькая римская цифра в углу */
.z.rang::after { content: attr(data-rang); position: absolute; top: 3px; right: 6px; font: 900 11px/1 system-ui, sans-serif; color: #ffe7a8; text-shadow: 0 1px 2px #000; }
/* 27.11, приёмка Fable: ранг крупнее, справка по касанию, вещи героя в бою, фишка не закрывает точку */
.z.rang::after { top: 2px; right: 3px; padding: 2px 5px; border-radius: 7px; background: #2b1a0ccc; font-size: 13px; }
.spravka {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--sb, 0px) + 22%); transform: translateX(-50%); max-width: min(92vw, 520px);
  padding: 10px 14px; border-radius: 12px; background: #120d26f2; border: 1px solid #ffd56b77; color: #f3ecff;
  font: 700 14px/1.35 system-ui, sans-serif; text-align: center; box-shadow: 0 10px 26px #000b; pointer-events: none;
  animation: spravka-vhod .18s ease-out;
}
@keyframes spravka-vhod { from { opacity: 0; transform: translate(-50%, 8px); } }
#geroy_veshchi { justify-self: start; min-height: 28px; padding: 2px 8px; border-radius: 9px; border: 1px solid #ffd56b55; background: #ffffff10; color: inherit; font-size: 16px; letter-spacing: 2px; cursor: pointer; }
#geroy_veshchi[hidden] { display: none; }
#geroy_fishka { transform: translate(15%, -125%); }

/* ---- сценка на карте (yadro/scenka.js): сюжет репликами у точки, не окном-стеной */
#scenka {
  position: absolute; z-index: 30; left: 50%; bottom: calc(var(--sb, 0px) + 10px); transform: translateX(-50%);
  width: min(560px, calc(100% - 16px)); display: grid; gap: 8px; animation: sc-vhod .28s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes sc-vhod { from { opacity: 0; transform: translate(-50%, 24px); } }
#scenka .sc-lica { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 6px; pointer-events: none; }
#scenka .sc-l { margin: 0; display: grid; justify-items: center; gap: 3px; transition: filter .2s, transform .2s; filter: brightness(.5) saturate(.6); transform: scale(.88); transform-origin: 50% 100%; }
#scenka .sc-ger, #scenka .sc-drug {
  width: clamp(48px, 13vh, 104px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid #5a3b1c;
  background: radial-gradient(circle at 50% 35%, #33306a, #120f2b 75%); box-shadow: 0 8px 18px #3b261488;
}
#scenka .sc-l figcaption { font: 900 10px/1 system-ui, sans-serif; letter-spacing: .12em; padding: 3px 7px; border-radius: 4px; background: #f3e2b8; color: #3b2614; border: 1px solid #8a6a3a; }
#scenka .sc-ger { object-fit: cover; object-position: 50% 15%; }
#scenka .sc-drug { display: grid; place-items: center; font-size: clamp(30px, 8vh, 64px); }
#scenka .sc-drug img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
#scenka .k.vtor { background: #2b1a0cdd; color: #fbf1d6; box-shadow: 0 4px 0 #120a04; }
#scenka[data-kto="ger"] .sc-gl, #scenka[data-kto="drugoy"] .sc-dl { filter: none; transform: scale(1); }
#scenka[data-kto="ger"] .sc-ger, #scenka[data-kto="drugoy"] .sc-drug { border-color: #c0392b; }
/* телефон боком: лица крупно по бокам пузыря, а не мелко над ним (Fable 27.11: 45–51 px) */
@media (max-height: 500px) {
  #scenka { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "gl puz dl" "kn kn kn"; align-items: end; column-gap: 10px; width: min(760px, calc(100% - 16px)); }
  #scenka .sc-lica { display: contents; }
  #scenka .sc-gl { grid-area: gl; } #scenka .sc-dl { grid-area: dl; } #scenka .sc-puzyr { grid-area: puz; min-height: 0; padding: 8px 12px 10px; font-size: 15px; } #scenka .sc-knopki { grid-area: kn; }
  #scenka .sc-knopki .k { min-height: 44px; }
  #scenka .sc-ger, #scenka .sc-drug { width: clamp(64px, 26vh, 110px); }
  #scenka .sc-puzyr::before { display: none !important; }
}
#scenka .sc-puzyr { min-height: 0; padding: 8px 12px 10px; font-size: 15px; } #scenka .sc-knopki .k { min-height: 44px; } }
#scenka .sc-drug { display: grid; place-items: center; font-size: clamp(40px, 8vh, 64px); }
#scenka[data-kto="ger"] .sc-ger, #scenka[data-kto="drugoy"] .sc-drug { filter: none; transform: scale(1); border-color: #c0392b; }
#scenka .sc-puzyr {
  position: relative; padding: 12px 16px 14px; border-radius: 16px; min-height: 74px; cursor: pointer;
  background: #fbf1d6; color: #2b1a0c; border: 2px solid #5a3b1c; box-shadow: 0 10px 26px #3b2614aa;
  font: 17px/1.45 Georgia, "Times New Roman", serif;
}
#scenka .sc-puzyr::before { content: ''; position: absolute; top: -11px; width: 18px; height: 18px; background: #fbf1d6; border: 2px solid #5a3b1c; border-right: 0; border-bottom: 0; transform: rotate(45deg); display: none; }
#scenka[data-kto="ger"] .sc-puzyr::before { display: block; left: 46px; }
#scenka[data-kto="drugoy"] .sc-puzyr::before { display: block; right: 46px; }
#scenka[data-kto="avtor"] .sc-puzyr { font-style: italic; background: #efe0b8; }
#scenka.nashe .sc-puzyr { font: 600 14px/1.4 system-ui, sans-serif; font-style: normal; color: #5a3b1c; }
#scenka_kto { display: block; font: 900 11px/1 system-ui, sans-serif; letter-spacing: .14em; color: #8a2a1c; margin-bottom: 4px; }
#scenka_kto:empty { display: none; }
#scenka_tekst { margin: 0; }
#scenka_n { position: absolute; right: 10px; bottom: 6px; font: 700 11px/1 system-ui, sans-serif; color: #8a6a3a; }
#scenka .sc-knopki { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
#scenka .sc-knopki [hidden] { display: none; }
.nagr i img { width: 34px; height: 34px; display: block; margin: auto; filter: drop-shadow(0 0 6px #ffd56b88); }
.nagr-vesch i img { filter: sepia(1) saturate(3) hue-rotate(5deg) brightness(1.1) drop-shadow(0 0 6px #ffd56b88); }
#geroy_veshchi { display: flex; gap: 6px; align-items: center; min-height: 44px; min-width: 44px; }
#geroy_veshchi img { width: 24px; height: 24px; filter: sepia(1) saturate(3) brightness(1.1); }
#titry { display: block; text-align: center; font: 500 11px/1.4 system-ui, sans-serif; color: #ffffff77; margin-top: 4px; }
#okno_knopki.vzyato .nagr:not(.vzyal) { opacity: .25; transform: scale(.96); transition: opacity .2s, transform .2s; }
.nagr.vzyal { animation: nagr-vzyal .42s ease-out forwards; }
@keyframes nagr-vzyal { 30% { transform: scale(1.06); box-shadow: 0 0 0 3px #ffd56b, 0 0 34px #ffd56bcc; } 100% { transform: scale(1.03); box-shadow: 0 0 0 2px #ffd56b, 0 0 22px #ffd56b88; } }

.spravka.dolgo { bottom: auto; top: calc(var(--st, 0px) + 12px); border-color: #ffd56b; font-size: 15px; }
/* телефон боком: поле в средней колонке от самого верха — долгая подсказка уходит в левую колонку (Fable 27.11) */
@media (max-height: 500px) and (orientation: landscape) {
  .spravka.dolgo { top: calc(var(--st, 0px) + 8px); left: calc(var(--sl, 0px) + 8px); transform: none; max-width: 24vw; font-size: 13px; animation: none; }
}

/* ---- районы карты (mir.js REGIONY): полоса во всю ширину, граница пунктиром, имя у края; закрытый — туман */
#karta_regiony { position: absolute; inset: 0; pointer-events: none; }
.region { position: absolute; left: -100vw; right: -100vw; border-top: 2px dashed #5a3b1c66; }
.region[data-region="kladbishche"] { background: linear-gradient(180deg, #3b2a4a1c, #3b2a4a30); }
.region[data-region="les"] { background: linear-gradient(180deg, #2f5a2a14, #2f5a2a24); }
.region[data-region="zamok"] { background: linear-gradient(180deg, #5a5a6a24, #5a5a6a10); border-top: 0; }
.region-imya {
  position: absolute; left: calc(100vw + 6px); bottom: 8px; font: 900 12px/1 Georgia, serif; letter-spacing: .18em; color: #5a3b1c;
  padding: 4px 10px; border-radius: 3px; background: #f3e2b8cc; border: 1px solid #8a6a3a; transform: rotate(-2deg);
}
.region-tuman { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity 1.2s ease; }
/* туман — под точками (z 1 < .uzel z 2), над декором: закрытая точка видна серой с замком, ничего не срезано
   (Fable 27.11: на 844×390 туман леса резал жабу). Строка замка — над точками (z 4). */
.region-tuman::before { content: ''; position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse at 50% 50%, #e8d9b8f0, #cbb48ae8 70%); }
.region-tuman span { position: relative; z-index: 4; max-width: min(80vw, 420px); padding: 8px 14px; border-radius: 10px; background: #2b1a0ce6; color: #fbf1d6; font: 700 13px/1.35 system-ui, sans-serif; text-align: center; }
.region.zakryt .region-tuman { opacity: 1; }
.region.otkrylsya { animation: region-svet 1.6s ease-out; }
@keyframes region-svet { 0% { box-shadow: inset 0 0 0 9999px #ffe9a855; } 100% { box-shadow: inset 0 0 0 9999px #ffe9a800; } }
.region-banner {
  position: absolute; z-index: 40; left: 50%; top: 38%; transform: translate(-50%, -50%); padding: 14px 26px; border-radius: 6px; text-align: center;
  background: #fbf1d6; border: 3px double #5a3b1c; box-shadow: 0 14px 34px #3b2614aa; color: #2b1a0c; pointer-events: none;
  animation: banner 2.6s ease-in-out forwards;
}
.region-banner small { display: block; font: 800 11px/1 system-ui, sans-serif; letter-spacing: .2em; color: #8a2a1c; margin-bottom: 6px; }
.region-banner b { font: 900 clamp(22px, 6vw, 34px)/1 Georgia, serif; letter-spacing: .08em; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } 25%, 80% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }

/* ---- рост героя: уровень и рамка по уровню (novichok — зелёная, serebro — синяя, zoloto — золотая) */
#geroy .ur { font: 900 13px/1 system-ui, sans-serif; letter-spacing: .04em; padding: 2px 6px; border-radius: 7px; background: #ffffff18; color: #d9cfe8; vertical-align: 2px; }
#geroy[data-tier="serebro"] .ur, #geroy_kratko[data-tier="serebro"] { color: #bfe0ff; border-color: #6fb7ffaa; }
#geroy[data-tier="zoloto"] .ur, #geroy_kratko[data-tier="zoloto"] { color: #ffe7a8; border-color: #ffd56bcc; }
#geroy[data-tier="novichok"] .lico-ramka { border-color: #3dff8faa; box-shadow: 0 0 12px #3dff8f44; }
#geroy[data-tier="serebro"] .lico-ramka { border-color: #6fb7ffaa; box-shadow: 0 0 14px #6fb7ff55; }
#geroy[data-tier="zoloto"] .lico-ramka { border-color: #ffd56bcc; box-shadow: 0 0 18px #ffd56b77; }
#geroy_fishka[data-tier="serebro"] { border-color: #6fb7ff; box-shadow: 0 0 0 3px #6fb7ff44, 0 8px 18px #000c; }
#geroy_fishka[data-tier="zoloto"] { border-color: #ffd56b; box-shadow: 0 0 0 3px #ffd56b55, 0 0 22px #ffd56b88, 0 8px 18px #000c; }
#geroy_fishka { overflow: visible; }
#geroy_fishka img { border-radius: 50%; }
#geroy_fishka::after { content: attr(data-ur); position: absolute; right: -8px; bottom: -6px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; background: #2b1a0c; color: #ffe7a8; border: 2px solid #f3e2b8; font: 900 11px/16px system-ui, sans-serif; text-align: center; }
#geroy_kratko { color: inherit; cursor: pointer; min-width: 44px; }
#geroy_kratko.rost, #geroy_fishka.rost { animation: rost 1.3s ease-out; }
@keyframes rost { 20% { transform: scale(1.18); box-shadow: 0 0 0 6px #ffd56b66, 0 0 30px #ffd56b; } 100% { transform: none; } }
#geroy_fishka.rost { animation-name: rost-fishka; }
@keyframes rost-fishka { 20% { transform: translate(15%, -125%) scale(1.25); box-shadow: 0 0 0 6px #ffd56b66, 0 0 30px #ffd56b; } 100% { transform: translate(15%, -125%); } }
.rost-nadpis { position: fixed; z-index: 55; transform: translate(-50%, -260%); font: 900 22px/1 Georgia, serif; color: #8a2a1c; text-shadow: 0 2px 0 #fbf1d6, 0 0 12px #fbf1d6; pointer-events: none; animation: rost-nadpis 1.5s ease-out forwards; white-space: nowrap; }
@keyframes rost-nadpis { 0% { opacity: 0; transform: translate(-50%, -180%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -260%) scale(1.1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -340%); } }
/* телефон боком: полосы районов низкие, подпись района ложится под подписи точек — прячем, имя есть в тумане и баннере */
@media (max-height: 500px) { .region-imya { display: none; } }

/* ---- переходы (yadro/perehody.js): занавес, появление и уход окон и сценки */
#perehod { position: fixed; inset: 0; z-index: 100; background: radial-gradient(circle at 50% 45%, #1c1438, #07050f 80%); pointer-events: all; }
#perehod[hidden] { display: none; }
.uhodit { animation: uhod var(--uhod, 180ms) ease-in forwards !important; pointer-events: none; }
@keyframes uhod { to { opacity: 0; transform: translateY(6px) scale(.98); } }
#okno:not([hidden]) { animation: okno-fon .22s ease-out; }
#okno:not([hidden]) #okno_karta { animation: okno-vhod .32s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes okno-fon { from { opacity: 0; } }
@keyframes okno-vhod { from { opacity: 0; transform: translateY(18px) scale(.94); } }
#scenka.uhodit { animation: uhod-scenka var(--uhod, 180ms) ease-in forwards !important; }
@keyframes uhod-scenka { to { opacity: 0; transform: translate(-50%, 14px); } }
/* отклик урона на полосе здоровья: короткий качок и белая вспышка (380 мс) */
.polosa.bol { animation: polosa-bol .38s ease-out; }
@keyframes polosa-bol { 0% { transform: translateX(0); filter: brightness(2.2); } 20% { transform: translateX(-4px) scale(1.03); } 40% { transform: translateX(4px); } 60% { transform: translateX(-2px); } 100% { transform: none; filter: none; } }
#menyu:not([hidden]) { animation: okno-fon .2s ease-out; }
#menyu:not([hidden]) #menyu_karta { animation: okno-vhod .28s cubic-bezier(.2, 1.3, .4, 1); }
/* имя врага не уходит под кружок удара (Fable 27.11: «РАЗБОЙНИК» обрезался на 390) */
#vrag .info > b { padding-right: 38px; }
/* щит стража: синее кольцо вокруг карточки врага, пока держится */
#vrag.shchit { box-shadow: 0 0 0 3px #6fb7ff, 0 0 26px #6fb7ffaa; }
#vrag.shchit .hp-vrag::after { content: '🛡 ×½'; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font: 900 11px/1 system-ui, sans-serif; color: #e6f3ff; text-shadow: 0 1px 2px #000; }
.z.pod-shchitom::before { content: '🛡½'; position: absolute; left: 3px; top: 2px; padding: 2px 4px; border-radius: 7px; background: #0b2a3ae6; color: #d8ecff; font: 900 11px/1 system-ui, sans-serif; z-index: 2; }
/* киллер-фича: самокаст — поле темнеет, имя заклинания во весь экран цветом стихии */
#igra.kast-moment #pole { filter: brightness(.55) saturate(.7); transition: filter .18s; }
#pole { transition: filter .3s; }
.slovo-zakl { position: fixed; left: 50%; top: 42%; z-index: 60; pointer-events: none; white-space: nowrap;
  font: 900 clamp(22px, 7.4vw, 64px)/1 Georgia, serif; letter-spacing: .06em; color: #fff;
  text-shadow: 0 0 18px var(--c), 0 0 42px var(--c), 0 4px 0 #0008; animation: slovo-zakl 1.3s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes slovo-zakl { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; } 18% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
  30% { transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { transform: translate(-50%, -60%) scale(1.04); opacity: 0; } }
#geroy.kastuet { animation: kastuet .7s ease-out; }
@keyframes kastuet { 0% { transform: none; } 25% { transform: translateY(-6px) scale(1.08); filter: brightness(1.6); } 100% { transform: none; } }
/* огненный шар — три тройки: три деления на кнопке (Сергей 01.09 «три раза красный взорвал») */
.z.tri-deleniya::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(0deg, transparent calc(33.33% - 1.5px), #0009 calc(33.33% - 1.5px), #0009 calc(33.33% + 1.5px), transparent calc(33.33% + 1.5px),
    transparent calc(66.66% - 1.5px), #0009 calc(66.66% - 1.5px), #0009 calc(66.66% + 1.5px), transparent calc(66.66% + 1.5px)); }
/* стоп-кадр попадания: белая вспышка на 80 мс */
#igra.hitstop::after { content: ''; position: fixed; inset: 0; z-index: 55; background: #fff6; pointer-events: none; }
/* долгая подсказка (ракета, бомба) — внизу над заклинаниями, не поверх полос здоровья (Fable 29.11) */
@media not ((max-height: 500px) and (orientation: landscape)) {
  .spravka.dolgo { top: auto; bottom: calc(var(--sb, 0px) + 8px); }
}
/* готовое заклинание светится; первый бой — «нажми» пульсом (Сергей 29.11 «Кнопкой») */
.z.zhmi { animation: zhmi .9s ease-in-out infinite; }
@keyframes zhmi { 50% { transform: scale(1.08); box-shadow: 0 0 0 3px #fff, 0 0 34px var(--c); } }
/* лесная арена (Сергей 04.10: «в природном биоме зелёное и лечение работает… вампиризм»): зелёный свет сверху и снизу */
#igra.arena-les { background:
    radial-gradient(110% 55% at 50% -5%, #1c4a24 0%, transparent 62%),
    radial-gradient(90% 45% at 50% 105%, #20401a 0%, transparent 60%), var(--fon); }
#arena_stroka { white-space: pre-line; }
#arena_stroka.dve { font-size: 12px; padding: 5px 8px; line-height: 1.35; }
/* лёд близко к обвалу — строка краснеет и пульсирует */
#arena_stroka.opasno { border-color: #ff6a5a; color: #ffe0dc; animation: zhmi 1s ease-in-out infinite; }

/* развилка (29.11): подпись риска под именем точки, элита — стальная рамка, выбор пути — обе точки зовут */
.uzel .podpis { font: 700 10px/1 system-ui, sans-serif; letter-spacing: .04em; padding: 3px 7px; border-radius: 3px; background: #2b2118e6; color: #f3e2b8; white-space: nowrap; margin-top: 2px; }
.uzel.elita .podpis { background: #0e2a33ee; color: #8ff3ff; }
.uzel.elita i { border-color: #4fd6ee; box-shadow: 0 0 0 2px #0e2a33, 0 0 14px #4fd6ee88; }
.uzel.vybor-puti i { animation: sled 1.1s ease-in-out infinite; }
/* глушилка железного волка: заглушённое заклинание серое, с молнией */
.z.zaglushen { filter: grayscale(1) brightness(.7); border-color: #4fd6ee; }
.z.zaglushen small { color: #8ff3ff; }
/* имплант в награде — холодный, не золотой */
.nagr.redkaya { border-color: #4fd6ee; box-shadow: 0 0 0 1px #4fd6ee, 0 0 18px #4fd6ee66; }
.nagr.redkaya i { font-size: 34px; }
/* низкая горизонталь: семь рядов точек по высоте не помещаются в узкий столбец — карта шире (развилка 29.11) */
@media (max-height: 560px) and (orientation: landscape) { #karta_pole { width: min(100%, calc((100vh - 90px) * 1.9)); } }
.region.dalniy .region-tuman span { display: none; }

/* ветки сборки в награде (29.11): огонь / лёд / импланты — цвет рамки и заголовка */
.nagr.vetka-ogon { border-color: #ff7a3c; } .nagr.vetka-ogon b { color: #ffb27a; }
.nagr.vetka-lyod { border-color: #6cc8ff; } .nagr.vetka-lyod b { color: #a8e2ff; }
.nagr.vetka-tekh { border-color: #9fe0c0; } .nagr.vetka-tekh b { color: #c8f5df; }
/* 29.11 вёрстка (Fable): длинное имя врага — в две строки мельче; техно-имена подписью над значком на телефоне;
   имя района «ЗАМОК» — по центру низа полосы: в левом углу его закрывала плашка «РАЗЛОМ» (оставалась «З») */
.info b.dlinnoe { white-space: normal; letter-spacing: .02em; line-height: 1.05; font-size: clamp(10px, 2.9vw, 13px); }
#igra.arena-tekh .z::before { content: attr(data-imya); position: absolute; top: 3px; left: 1px; right: 1px; z-index: 1; font: 800 9px/1 system-ui, sans-serif; text-align: center; color: #d8fff4; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
@media (min-aspect-ratio: 5/4) and (min-height: 561px) { #igra.arena-tekh .z::before { content: none; } }
.region[data-region="zamok"] .region-imya { left: calc(100vw + 50vw); transform: translateX(-50%) rotate(-2deg); }
