*{box-sizing:border-box} :root{color-scheme:dark;font-family:Georgia,serif;background:#0d1114;color:#eee7d9}body{margin:0;background:radial-gradient(ellipse at 50% 0,#283b37 0,#12191a 42%,#0c1012 100%);min-height:100vh}button,select{font:inherit}button{cursor:pointer}.game{max-width:1500px;margin:auto;padding:36px 5vw 45px}header,.section-head{display:flex;align-items:end;justify-content:space-between;gap:20px}header{margin-bottom:24px}.eyebrow,.scene-label{font:700 12px/1.4 system-ui;letter-spacing:.18em;color:#c9ad78}h1{font-size:clamp(36px,4.5vw,64px);font-weight:400;letter-spacing:-.04em;margin:8px 0}header p,.section-head p{font:15px system-ui;color:#a3aaa2;margin:0}.round{border-left:1px solid #6c694f;padding-left:20px;font:11px system-ui;letter-spacing:.16em;color:#a5ab9d}.round b{display:block;font:36px Georgia;color:#e3d0a8}.battlefield{height:clamp(300px,34vw,465px);position:relative;border:1px solid #827252;background:linear-gradient(90deg,rgba(6,15,14,.72),rgba(7,12,10,.12),rgba(6,12,10,.67)),linear-gradient(0deg,#101917 0,transparent 70%),url('assets/forest.png') center 48%/cover;box-shadow:0 18px 65px #0008;overflow:hidden}.scene-label{position:absolute;top:22px;left:25px;text-shadow:0 2px 6px #000}.scene-label span{color:#758773}.enemies{height:100%;display:flex;align-items:center;justify-content:center;gap:clamp(12px,4vw,60px);padding:60px 20px}.enemy{min-width:160px;text-align:center;background:#111d1bdc;border:1px solid #a7956d;padding:14px 18px;box-shadow:0 10px 25px #0009}.enemy.dead{opacity:.35;filter:grayscale(1)}.enemy .sigil{font-size:38px;color:#d0b57b}.enemy strong{display:block;font-size:19px;margin:5px}.enemy small{font:12px system-ui;color:#d5c7aa}.bar{height:5px;background:#3b4540;margin-top:10px}.bar span{display:block;height:100%;background:#b88564}.battle-caption{position:absolute;bottom:0;left:0;right:0;text-align:center;padding:16px;background:#0c1615d9;font-size:17px}.party-section,.control,.log-section{margin-top:30px}.section-head{margin-bottom:14px}h2{font-size:27px;font-weight:400;margin:4px 0}.party{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.hero{border:1px solid #454d42;background:#18211f;min-width:0}.portrait{height:135px;background-size:cover;background-position:center 22%;position:relative}.portrait:after{content:'';position:absolute;inset:0;background:linear-gradient(0deg,#18211f,transparent 70%)}.hero-body{padding:0 12px 13px}.hero h3{font-size:20px;font-weight:400;margin:0 0 7px}.stats{font:12px/1.7 system-ui;color:#bfc8b6}.stats b{color:#eee4d0}.hero label{display:block;font:11px system-ui;color:#a5ad9f;margin:9px 0 4px}.hero select{width:100%;border:1px solid #56604e;background:#101916;color:#e7e4d6;padding:8px;font:13px system-ui}.hero.fallen{opacity:.45}.control{display:flex;gap:24px;justify-content:space-between;align-items:center}.actions{display:flex;gap:8px;flex-wrap:wrap}.actions button{border:1px solid #8b846a;color:#e9e3d3;background:#202a26;padding:12px 15px;font:600 13px system-ui}.actions .primary{background:#c4a672;border-color:#c4a672;color:#151d19}.actions button:disabled{opacity:.42;cursor:not-allowed}.actions .quiet{background:transparent}.hint{max-width:440px;color:#abb6a6;font:13px/1.55 system-ui}.hint strong{color:#e4d0a9}.log-section{border-top:1px solid #3d493f;padding-top:19px}#log{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}#log li{font:13px/1.5 system-ui;color:#c4cbbe;background:#1a2420;border-left:2px solid #ab9364;padding:8px 12px}footer{margin-top:28px;font:12px system-ui;color:#77847a}@media(max-width:950px){.party{grid-template-columns:repeat(3,1fr)}.control{align-items:start;flex-direction:column}}@media(max-width:600px){.game{padding:22px 16px}.party{grid-template-columns:repeat(2,1fr)}.section-head p{display:none}.battlefield{height:320px}.enemies{gap:5px;padding:45px 5px}.enemy{min-width:0;width:32%;padding:10px 4px}.enemy strong{font-size:15px}.enemy .sigil{font-size:29px}.actions button{flex:1}.round{align-self:start}.portrait{height:110px}}
/* Battle formation */
.battlefield{height:clamp(450px,48vw,650px);background:linear-gradient(0deg,#111b17aa,transparent 25%),url('assets/battle-arena-v1.png') center/cover;isolation:isolate}
.enemies{display:block;position:absolute;inset:0;padding:0}.unit{position:absolute;width:16%;height:44%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;transition:opacity .25s,filter .25s}.unit:after{content:'';position:absolute;z-index:-1;bottom:0;width:75%;height:8%;border-radius:50%;background:#0b160dc4;filter:blur(5px)}.unit img{display:block;min-height:0;width:100%;height:calc(100% - 44px);object-fit:contain;object-position:center bottom;filter:drop-shadow(0 8px 5px #07110acc)}.unit.fallen{opacity:.3;filter:grayscale(1)}.unit-health{flex:none;text-align:center;min-width:95px;max-width:150px;width:90%;padding:3px 4px;background:#141b15df;border:1px solid #b9a16e;box-shadow:0 2px 4px #000b;color:#f4e7c9;text-shadow:0 1px 2px #000;font:700 clamp(10px,1vw,13px) system-ui}.unit-health b{white-space:nowrap}.unit-health small{display:block;font:10px system-ui;color:#ded6bd}.hp-track{height:7px;background:#3c1917;border:1px solid #080b08;margin:3px 0}.hp-track span{display:block;height:100%;background:linear-gradient(#a2d250,#488323)}.foe .hp-track span{background:linear-gradient(#e97a67,#a92f25)}
.ally-0{left:4%;top:13%;z-index:2}.ally-1{left:20%;top:30%;z-index:4}.ally-2{left:5%;top:48%;z-index:5}.foe-0{right:4%;top:13%;z-index:2}.foe-1{right:19%;top:30%;z-index:4}.foe-2{right:4%;top:48%;z-index:5}.battle-caption{z-index:8}.scene-label{z-index:7}.party{grid-template-columns:repeat(3,minmax(0,1fr))}.portrait{height:150px}.hero-body{padding-top:0}
@media(max-width:600px){.battlefield{height:460px}.unit{width:24%;height:35%}.unit-health{min-width:74px;font-size:9px}.unit-health small{font-size:9px}.ally-0{left:1%;top:15%}.ally-1{left:17%;top:32%}.ally-2{left:1%;top:49%}.foe-0{right:1%;top:15%}.foe-1{right:17%;top:32%}.foe-2{right:1%;top:49%}.party{grid-template-columns:1fr}.hero{display:grid;grid-template-columns:110px 1fr}.portrait{height:100%;min-height:175px}.hero-body{padding:12px}}

/* Compact segmented health above each figure */
.unit{height:auto;justify-content:start}.unit img{width:100%;height:auto;object-fit:contain;object-position:center top}.unit-health{min-width:0;width:100px;max-width:none;padding:0;background:none;border:0;box-shadow:none;font-size:12px}.unit-health b{display:block;margin-bottom:3px;text-shadow:0 1px 4px #000,0 1px 3px #000}.hp-track{position:relative;height:21px;margin:0;border:3px solid #171b13;border-radius:12px;background:#4c1713;box-shadow:0 0 0 1px #a79567,0 2px 4px #0009;overflow:hidden}.hp-track .hp-fill{position:absolute;left:0;top:0;height:100%;background:linear-gradient(#b3f25c 0%,#5cba24 48%,#327b1a 100%)}.foe .hp-track .hp-fill{background:linear-gradient(#fa9b6a,#cc4729 50%,#8a231b)}.hp-track:after{content:'';position:absolute;inset:0;z-index:1;background:repeating-linear-gradient(90deg,transparent 0,transparent calc(20% - 2px),#102409a6 calc(20% - 2px),#102409a6 20%);pointer-events:none}.hp-track .hp-value{position:absolute;z-index:2;inset:0;width:auto;height:auto;background:none!important;color:white;font:700 10px/15px system-ui;text-align:center;text-shadow:0 1px 2px #000,1px 0 2px #000}.foe-0{right:3%;top:16%;width:40%;z-index:3}.foe-0 .unit-health{width:120px}.ally-0{left:5%;top:11%}.ally-1{left:20%;top:30%}.ally-2{left:5%;top:50%}
.hero{display:flex;align-items:flex-start;gap:12px;padding:14px}.portrait{flex:0 0 72px;width:72px;height:72px;min-height:0;border-radius:50%;border:2px solid #a18f62;background-color:#455049;background-size:180%;background-position:center 8%;box-shadow:0 2px 10px #0008}.portrait:after{display:none}.hero-body{padding:0;min-width:0;flex:1}.hero h3{margin-top:0}
@media(max-width:600px){.unit{width:24%;height:auto}.unit-health{width:82px;font-size:10px}.hp-track{height:19px}.hp-track .hp-value{font-size:9px;line-height:13px}.ally-0{left:1%;top:16%}.ally-1{left:16%;top:34%}.ally-2{left:1%;top:53%}.foe-0{right:1%;top:27%;width:47%}.foe-0 .unit-health{width:105px}.hero{display:flex;grid-template-columns:none}.portrait{height:64px;min-height:0;width:64px;flex-basis:64px}.hero-body{padding:0}}

/* Close portraits and formations on the clearing */
.portrait{background-size:450%}.portrait-sheila{background-position:40% 3%}.portrait-lessage{background-position:55% 3%}.portrait-izmail{background-position:57% 12%}
.hp-track{height:15px}.ally-0{left:7%;top:9%}.ally-1{left:21%;top:23%}.ally-2{left:9%;top:38%}.foe-0{top:13%}.shade{left:27%;top:41%;z-index:5;opacity:.65}.shade img{filter:sepia(.5) hue-rotate(210deg) saturate(2) drop-shadow(0 5px 5px #12052f)}.unit-status{max-width:150px;padding:2px 4px;background:#1c1b32d9;color:#eee;font:10px system-ui;text-align:center}.unit-status:empty{display:none}
@media(max-width:600px){.hp-track{height:14px}.ally-0{left:2%;top:14%}.ally-1{left:17%;top:28%}.ally-2{left:3%;top:43%}.shade{left:22%;top:45%}.foe-0{top:23%}}
.skill-info{font:12px/1.4 system-ui;color:#bdc8b8;margin:6px 0;min-height:2.8em}

/* Battle motion */
.unit img{transform-origin:50% 90%;animation:idle-breathe 3.1s ease-in-out infinite}.ally-1 img{animation-delay:-.9s}.ally-2 img{animation-delay:-1.8s}.foe img{animation-duration:4s}.shade img{animation-delay:-1.2s}
.unit.attacking img{animation:hero-swing .56s ease-in-out both}.foe.attacking img{animation:foe-swing .56s ease-in-out both}.unit.taking-hit img{animation:hit-flash .85s ease-out both}.weapon-trail{position:absolute;pointer-events:none;top:33%;right:-3%;width:58%;height:35%;border-right:4px solid transparent;border-top:5px solid transparent;border-radius:50%;opacity:0;transform:rotate(35deg);filter:drop-shadow(0 0 5px #ffe8b2)}.attacking .weapon-trail{animation:weapon-sweep .56s ease-out both}.foe .weapon-trail{left:-3%;right:auto;transform:scaleX(-1) rotate(35deg)}
.hit-slash{position:absolute;pointer-events:none;left:35%;top:46%;width:42%;height:5px;border-radius:50%;transform:rotate(-40deg);background:#fff2e2;box-shadow:0 0 5px 2px #fff,0 0 12px 5px #ff633d;animation:slash-impact .8s ease-out both}.damage-number{position:absolute;z-index:12;left:50%;top:26%;transform:translateX(-50%);pointer-events:none;color:#fff0ce;font:900 clamp(22px,2.4vw,34px)/1 system-ui;text-shadow:-2px -2px #37110e,2px -2px #37110e,-2px 2px #37110e,2px 2px #37110e,0 3px 6px #000;white-space:nowrap;animation:damage-float .9s ease-out both}
@keyframes idle-breathe{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-3px) scale(1.012)}}
@keyframes hero-swing{0%{transform:translateX(0) rotate(0)}25%{transform:translateX(-6%) rotate(-6deg)}55%{transform:translateX(14%) rotate(9deg)}100%{transform:translateX(0) rotate(0)}}
@keyframes foe-swing{0%{transform:translateX(0) rotate(0)}25%{transform:translateX(4%) rotate(3deg)}55%{transform:translateX(-12%) rotate(-6deg)}100%{transform:translateX(0) rotate(0)}}
@keyframes weapon-sweep{0%,25%{opacity:0;transform:rotate(-40deg) scale(.6)}50%{opacity:1;border-color:#fff5d4;transform:rotate(35deg) scale(1)}100%{opacity:0;transform:rotate(85deg) scale(1.1)}}
@keyframes hit-flash{0%,24%,52%{filter:brightness(0) saturate(100%) invert(20%) sepia(100%) saturate(6500%) hue-rotate(345deg) brightness(1.2)}12%,38%,70%,100%{filter:drop-shadow(0 8px 5px #07110acc)}}
@keyframes slash-impact{0%{opacity:0;transform:rotate(-40deg) scaleX(.15)}20%{opacity:1;transform:rotate(-40deg) scaleX(1)}70%{opacity:.8}100%{opacity:0;transform:rotate(-40deg) scaleX(1.15)}}
@keyframes damage-float{0%{opacity:0;transform:translate(-50%,8px) scale(.8)}20%{opacity:1;transform:translate(-50%,-5px) scale(1.15)}70%{opacity:1}100%{opacity:0;transform:translate(-50%,-55px) scale(1)}}
@media(prefers-reduced-motion:reduce){.unit img{animation:none}.unit.attacking img,.unit.taking-hit img,.weapon-trail,.hit-slash,.damage-number{animation-duration:.01ms!important}}

/* Separated formation and grounded breathing. */
.actions [hidden]{display:none!important}.ally-0{left:2%;top:8%}.ally-1{left:24%;top:25%}.ally-2{left:3%;top:48%}.shade{left:25%;top:53%}
.figure{display:block;position:relative;width:100%;transform-origin:50% 95%}.unit .figure img{display:block;width:100%;height:auto;animation:none;transform:none;filter:none}.figure-base{clip-path:inset(47% 0 0)}.unit .figure .figure-upper{position:absolute;inset:0;clip-path:inset(0 0 53%);transform-origin:50% 47%;animation:upper-breathe 3.1s ease-in-out infinite}.ally-1 .figure-upper{animation-delay:-.9s!important}.ally-2 .figure-upper{animation-delay:-1.8s!important}.foe .figure-upper{animation-duration:4s!important}.shade .figure{filter:sepia(.5) hue-rotate(210deg) saturate(2)}
.unit.attacking .figure{animation:hero-swing .56s ease-in-out both}.foe.attacking .figure{animation:foe-swing .56s ease-in-out both}.unit.taking-hit .figure{animation:hit-flash .85s ease-out both}@keyframes upper-breathe{0%,100%{transform:scale(1) rotate(0)}50%{transform:scale(1.012,1.016) rotate(.4deg)}}
.unit-health{position:relative;z-index:9}.status-icons{position:absolute;left:calc(100% + 4px);bottom:-2px;display:flex;gap:3px;align-items:center}.status-icon{display:grid;place-items:center;width:22px;height:22px;border:1px solid #cbb37c;border-radius:4px;background:#171b20eF;color:#e9d8b0;font:16px/1 system-ui;box-shadow:0 2px 4px #0008}.status-icon svg{width:17px;height:17px;fill:none;stroke:#f0d3a5;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.shield-icon{color:#d7e6f0}
.veil-field{position:absolute;z-index:6;inset:0 0 8% 50%;pointer-events:none;opacity:.72;background:radial-gradient(ellipse at 65% 65%,#222038d9 0%,#181522b5 34%,transparent 73%),radial-gradient(ellipse at 15% 40%,#3f3553a0,transparent 70%);animation:veil-drift 4s ease-in-out infinite alternate}
.spell-particles{position:absolute;z-index:10;inset:17% 0 0;pointer-events:none}.spell-particles i{position:absolute;left:calc(10% + var(--i)*10%);bottom:12%;color:#fff5d2;font:normal 16px system-ui;text-shadow:0 0 7px #fff,0 0 14px #ffdc75;animation:particle-rise 1.2s ease-out both;animation-delay:calc(var(--i)*45ms)}.heal-particles i{color:#83ff92;text-shadow:0 0 7px #4bff81,0 0 14px #32cf68;font-size:19px}.heal-particles:before{content:'';position:absolute;inset:25% 10% 5%;border-radius:50%;background:radial-gradient(ellipse,#63ff7944,transparent 70%);animation:particle-glow 1.2s ease-out both}
.flame-stream{position:absolute;z-index:8;width:75px;height:35px;border-radius:50%;pointer-events:none;background:radial-gradient(ellipse at center,#fff6aa 0%,#ffb324 28%,#ed420d 56%,transparent 75%);box-shadow:0 0 25px #ff701a;animation:flame-travel 1.2s ease-in both}
.day-fire{position:absolute;z-index:7;right:0;top:12%;bottom:9%;width:50%;pointer-events:none;overflow:hidden;background:radial-gradient(ellipse at 50% 90%,#ff9b2855,transparent 70%);animation:particle-glow 1.2s ease-out both}.day-fire i{position:absolute;bottom:-20%;width:28%;height:72%;border-radius:65% 20% 55% 30%;background:radial-gradient(ellipse at 50% 78%,#fff4a8,#ffa728 25%,#e93c108c 53%,transparent 72%);filter:blur(4px);animation:fire-rise 1.15s ease-out both}.day-fire i:nth-child(1){left:0}.day-fire i:nth-child(2){left:15%;animation-delay:.08s}.day-fire i:nth-child(3){left:30%;animation-delay:.13s}.day-fire i:nth-child(4){left:45%;animation-delay:.06s}.day-fire i:nth-child(5){left:60%;animation-delay:.16s}.day-fire i:nth-child(6){left:75%;animation-delay:.1s}
@keyframes veil-drift{from{transform:translateX(0);opacity:.58}to{transform:translateX(-2%);opacity:.78}}@keyframes particle-rise{0%{opacity:0;transform:translateY(8px) scale(.6)}20%{opacity:1}100%{opacity:0;transform:translateY(-90px) scale(1.2)}}@keyframes particle-glow{0%,100%{opacity:0}30%,75%{opacity:1}}@keyframes flame-travel{0%{opacity:0;transform:translate(0,0) scale(.4)}20%{opacity:1}75%{opacity:1}100%{opacity:0;transform:translate(var(--dx),var(--dy)) scale(1.5)}}@keyframes fire-rise{0%{opacity:0;transform:translateY(25%) scale(.6)}25%{opacity:1}100%{opacity:0;transform:translateY(-55%) scale(1.4)}}
@media(max-width:600px){.ally-0{left:0;top:12%}.ally-1{left:22%;top:29%}.ally-2{left:1%;top:49%}.shade{left:23%;top:55%}}
@media(prefers-reduced-motion:reduce){.unit .figure .figure-upper,.veil-field{animation:none}.spell-particles i,.flame-stream,.day-fire,.day-fire i{animation-duration:.01ms!important}}

.battlefield{background:linear-gradient(0deg,#111b1777,transparent 25%),url('assets/battle-mountain-arena-v1.png') center/cover}
.shadow-rounds{display:inline-block;padding:2px 7px;border:1px solid #a996cf;border-radius:9px;background:#21182dcf;color:#ede1ff;font:700 11px system-ui;white-space:nowrap}.stun-icon{color:#ffe776;text-shadow:0 0 6px #ffcb36}
.veil-field{overflow:hidden;background:none;opacity:1;animation:none}
.veil-field i{position:absolute;width:80%;height:65%;border-radius:50%;opacity:.72;filter:blur(16px);background:radial-gradient(ellipse at 45% 50%,#130f25dc 0%,#282139b5 35%,#40364a60 55%,transparent 75%);animation:cloud-roil 4.5s ease-in-out infinite alternate}
.veil-field i:nth-child(1){left:-20%;top:30%;animation-delay:-1s}.veil-field i:nth-child(2){left:15%;top:2%;animation-delay:-2.2s;animation-duration:6s}.veil-field i:nth-child(3){left:40%;top:28%;animation-delay:-.2s;animation-duration:5s}.veil-field i:nth-child(4){left:0;top:52%;animation-delay:-3s;animation-duration:5.5s}.veil-field i:nth-child(5){left:34%;top:50%;animation-delay:-1.5s;animation-duration:6.5s}
@keyframes cloud-roil{0%{transform:translate(-10%,-5%) scale(.9,.88);opacity:.45}50%{transform:translate(6%,4%) scale(1.15,1);opacity:.75}100%{transform:translate(16%,-6%) scale(1,1.18);opacity:.55}}
@media(prefers-reduced-motion:reduce){.veil-field i{animation:none}}

/* Soft, dispersed veil without a hard boundary at the centre. */
.veil-field{inset:0;width:100%;height:92%;mask-image:radial-gradient(ellipse at 83% 51%,#000 28%,#000a 50%,transparent 75%);-webkit-mask-image:radial-gradient(ellipse at 83% 51%,#000 28%,#000a 50%,transparent 75%)}
.veil-field i{width:52%;height:65%;filter:blur(24px);opacity:.62;background:radial-gradient(ellipse,#171125bf 0%,#30253f89 40%,#46345140 55%,transparent 76%)}
.veil-field i:nth-child(1){left:39%;top:31%}.veil-field i:nth-child(2){left:53%;top:0}.veil-field i:nth-child(3){left:69%;top:26%}.veil-field i:nth-child(4){left:48%;top:51%}.veil-field i:nth-child(5){left:70%;top:50%}

/* Frontal portraits, speed and ability descriptions. */
.portrait{background-size:500% auto;background-repeat:no-repeat}.portrait-izmail{background-position:4% 98%}.portrait-sheila{background-position:6% 99%}.portrait-lessage{background-position:7% 99%}
.unit-speed{display:inline-block;margin:0 0 3px;padding:1px 5px;border:1px solid #887b59;border-radius:4px;background:#171b18da;color:#f3dfaa;font:700 10px/1.3 system-ui;white-space:nowrap}
.action-label{display:block;font:11px system-ui;color:#a5ad9f;margin:9px 0 4px}.action-menu{position:relative;font:13px system-ui}.action-menu summary{list-style:none;cursor:pointer;position:relative;border:1px solid #56604e;background:#101916;color:#e7e4d6;padding:8px 25px 8px 8px;min-height:34px}.action-menu summary::-webkit-details-marker{display:none}.action-menu summary:after{content:'';position:absolute;right:10px;top:12px;width:7px;height:7px;border-right:1px solid currentColor;border-bottom:1px solid currentColor;transform:rotate(45deg)}.action-menu.locked{opacity:.45;pointer-events:none}.action-list{position:absolute;z-index:30;left:0;right:0;top:calc(100% + 2px);background:#111b17;border:1px solid #9e8a5a;box-shadow:0 8px 22px #000c}.action-choice{position:relative;display:block;width:100%;border:0;border-bottom:1px solid #344237;background:#18251f;color:#f1e6ce;text-align:left;padding:9px 8px;font:13px system-ui;cursor:pointer}.action-choice:last-child{border:0}.action-choice:hover,.action-choice:focus-visible{background:#38483a;outline:1px solid #c7b27b}.action-choice.unavailable{color:#a5aaa3;opacity:.48;cursor:not-allowed}.action-tooltip{visibility:hidden;position:absolute;z-index:50;bottom:calc(100% + 5px);left:0;min-width:200px;max-width:260px;padding:9px 11px;background:#0d1714;border:1px solid #bdab7d;color:#eee5d2;box-shadow:0 4px 14px #000b;font:12px/1.45 system-ui;pointer-events:none}.action-choice:hover .action-tooltip,.action-choice:focus-visible .action-tooltip{visibility:visible}.hero:has(.action-menu[open]){position:relative;z-index:15}
.action-menu summary.unavailable{color:#a5aaa3;opacity:.55}

/* Battle formation: leave room for full figures and the shadow. */
.unit.ally{width:12%}.ally-0{left:3%;top:8%}.ally-1{left:18%;top:32%}.ally-2{left:3%;top:53%}.unit.shade{left:31%;top:9%;width:11%;z-index:5}.foe-0{right:5%;top:24%;width:30%}.foe-1{right:31%;top:10%;width:12%;z-index:3}.foe-2{right:5%;top:56%;width:12%;z-index:5}.foe-1 .unit-health,.foe-2 .unit-health{width:95px}
@media(max-width:600px){.unit.ally{width:17%}.ally-0{left:1%;top:12%}.ally-1{left:19%;top:31%}.ally-2{left:1%;top:50%}.unit.shade{left:34%;top:10%;width:15%}.foe-0{right:1%;top:24%;width:31%}.foe-1{right:28%;top:11%;width:14%}.foe-2{right:2%;top:55%;width:14%}.foe-1 .unit-health,.foe-2 .unit-health{width:76px}}

/* Inquisitors form a front line before Obernax. */
.foe-0{right:2%;top:22%;width:30%;z-index:2}.foe-1{right:35%;top:9%;width:11%;z-index:4}.foe-2{right:35%;top:47%;width:11%;z-index:5}
@media(max-width:600px){.foe-0{right:0;top:24%;width:30%}.foe-1{right:34%;top:10%;width:14%}.foe-2{right:34%;top:45%;width:14%}}

.result-overlay[hidden]{display:none}.result-overlay{position:absolute;inset:0;z-index:50;display:grid;place-items:center;background:#080d0bd9;padding:20px}.result-card{text-align:center;padding:30px 48px;border:1px solid #b59e69;background:linear-gradient(160deg,#27352c,#111916);box-shadow:0 15px 60px #000b;min-width:min(330px,100%)}.result-icon{font:64px/1.2 system-ui}.result-card h2{margin:12px 0 22px;font:400 clamp(36px,5vw,54px) Georgia;color:#f4ddb0}.result-overlay.defeat .result-card{border-color:#a66e62;background:linear-gradient(160deg,#352523,#181313)}.result-overlay.defeat h2{color:#edc3ae}.result-card button{padding:12px 20px;border:1px solid #d3b57e;background:#c4a672;color:#151d19;font:700 14px system-ui;cursor:pointer}

.header-controls{display:flex;align-items:center;gap:20px}#music-toggle,.recruit-start,.dark-exit{border:1px solid #897a59;background:#1c2821;color:#e8dfcb;padding:10px 12px;font:600 13px system-ui;cursor:pointer}.recruit-start:disabled{opacity:.45;cursor:not-allowed}.recruit-section{margin:0 0 28px}.roster{display:flex;gap:10px;overflow-x:auto;padding:5px 0 12px}.roster-unit{flex:0 0 92px;border:1px solid #515e4d;background:#18211f;color:#c7cdbc;padding:6px;cursor:pointer;font:12px system-ui}.roster-unit.selected{border:2px solid #dcc088;color:#fff4da;background:#334130}.roster-unit:disabled{opacity:.65}.roster-portrait,.battle-token{display:block;width:70px;height:70px;margin:0 auto 5px;border:1px solid #ab9466;border-radius:50%;background-color:#313c32;background-repeat:no-repeat}.original-portrait{background-size:500% auto;background-repeat:no-repeat}.atlas-portrait{background-image:url('assets/new-heroes-atlas-v1.png');background-size:300% 200%;background-repeat:no-repeat}.portrait-ellian{background-position:0 0}.portrait-settra{background-position:50% 0}.portrait-kai{background-position:100% 0}.portrait-mira{background-position:0 100%}.portrait-rei{background-position:50% 100%}.portrait-ptusilian{background-position:100% 100%}.battle-token{width:min(100%,100px);height:auto;aspect-ratio:1;margin:20px auto;background-size:300% 200%;box-shadow:0 4px 12px #000b}.mirror{left:31%;top:9%;width:11%;z-index:5;opacity:.7}.mirror .battle-token{filter:sepia(.4) hue-rotate(210deg)}.dark-sphere{width:50px;height:50px;margin:35px auto;border-radius:50%;background:radial-gradient(circle at 35% 30%,#9179bc,#32204b 45%,#09040f 75%);box-shadow:0 0 20px #7f47acaa}.barrier-track{height:5px;margin:1px 0;background:#292b2d;border:1px solid #111}.barrier-track span{display:block;height:100%;background:#c9cdd0}.green-eye{color:#8cff7c;text-shadow:0 0 5px #5fe75c}
.dice-overlay[hidden]{display:none}.dice-overlay{position:absolute;z-index:30;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:14px;background:#070b0aa3;pointer-events:none}.dice-title,.dice-result{color:#f4e3bf;text-shadow:0 2px 6px #000;font:700 16px system-ui}.dice-tray{display:flex;gap:18px}.die{display:grid;place-items:center;width:104px;height:104px;color:#fff2cf;background:linear-gradient(135deg,#a58148,#30291e 55%,#bf9659);clip-path:polygon(50% 0,95% 25%,100% 70%,50% 100%,0 70%,5% 25%);filter:drop-shadow(0 5px 9px #000);font:700 40px Georgia;position:relative}.die:before{content:'';position:absolute;inset:8px;clip-path:polygon(50% 0,95% 25%,100% 70%,50% 100%,0 70%,5% 25%);border:2px solid #f4d29366}.die.rolling{animation:dice-spin .22s linear infinite}.die.settled.chosen{color:#fff;border:3px solid #f7d893;filter:drop-shadow(0 0 9px #e9bd64)}@keyframes dice-spin{from{transform:rotate(0) scale(.8)}50%{transform:rotate(180deg) scale(1.13)}to{transform:rotate(360deg) scale(.8)}}
@media(max-width:600px){.header-controls{gap:8px}.roster-unit{flex-basis:80px}.roster-portrait{width:60px;height:60px}.mirror{left:34%;top:12%;width:15%}.die{width:70px;height:70px;font-size:30px}}
.reference-portrait{background-size:190% auto;background-position:50% 9%;background-repeat:no-repeat}.portrait-rei.reference-portrait{background-position:49% 3%}.portrait-kai.reference-portrait{background-position:49% 5%}.portrait-mira.reference-portrait{background-position:51% 12%}.portrait-settra.reference-portrait{background-position:52% 12%}.portrait-ellian.reference-portrait{background-position:50% 9%}.mirror .figure{filter:sepia(.4) hue-rotate(210deg) saturate(1.5)}
.music-controls{width:205px;display:grid;grid-template-columns:1fr;gap:3px;font:12px system-ui;color:#d4d8c8}.music-controls label{margin-top:4px}.music-controls input{width:100%;margin:0;accent-color:#c4a672}.volume-labels{display:flex;justify-content:space-between;font:9px system-ui;color:#aab2a4}.recruit-section[hidden],.edit-party[hidden]{display:none}.edit-party{margin-bottom:20px}.updated-portrait{background-size:180% auto;background-position:50% 7%;background-repeat:no-repeat}.unit.ally .figure{height:clamp(125px,14vw,195px);width:100%}.unit.ally .figure img{height:100%;width:100%;object-fit:contain;object-position:center bottom}.unit.shade,.unit.mirror{width:12%}
@media(max-width:600px){.music-controls{width:150px}.unit.ally .figure{height:clamp(95px,23vw,120px)}.unit.shade,.unit.mirror{width:17%}.ally-2{top:48%}}

/* A modest depth scale, keeping feet above the bottom caption. */
.ally-0{top:9%;width:10.8%!important}.ally-1{top:29%;width:11.6%!important}.ally-2{top:47%;width:12.4%!important}.shade,.mirror{top:8%;width:10.8%!important}.unit.ally-0 .figure,.unit.shade .figure,.unit.mirror .figure{height:clamp(105px,12vw,165px)}.unit.ally-1 .figure{height:clamp(115px,13vw,180px)}.unit.ally-2 .figure{height:clamp(125px,14vw,195px)}
.foe-1{top:10%;width:10.3%}.foe-2{top:45%;width:11.5%}.foe-1 .figure{height:clamp(105px,12vw,165px)}.foe-2 .figure{height:clamp(125px,14vw,195px)}.foe-1 .figure img,.foe-2 .figure img{height:100%;width:100%;object-fit:contain;object-position:center bottom}
@media(max-width:600px){.ally-0{top:11%;width:15%!important}.ally-1{top:28%;width:16%!important}.ally-2{top:45%;width:17%!important}.shade,.mirror{top:8%;width:15%!important}.unit.ally-0 .figure,.unit.shade .figure,.unit.mirror .figure,.foe-1 .figure{height:clamp(82px,20vw,100px)}.unit.ally-1 .figure{height:clamp(90px,22vw,110px)}.unit.ally-2 .figure,.foe-2 .figure{height:clamp(98px,24vw,120px)}.foe-1{top:11%;width:13%}.foe-2{top:44%;width:15%}}
.critical-only .dice-result{padding:10px 24px;border:1px solid #d5b77b;background:#1a1712e8;box-shadow:0 6px 25px #000b;font:700 clamp(20px,3vw,32px) Georgia;letter-spacing:.02em}
/* Героические портреты и симметричные отряды */
.portrait.portrait-standard,.roster-portrait.portrait-standard{background-size:cover;background-position:center 34%;background-repeat:no-repeat}
.unit.foe{width:12%}.foe-0{right:3%;top:8%;z-index:2}.foe-1{right:18%;top:32%;z-index:4}.foe-2{right:3%;top:53%;z-index:5}.foe-0 .unit-health,.foe-1 .unit-health,.foe-2 .unit-health{width:100px}.foe .figure{transform:scaleX(-1)}
.unit.player-summon,.unit.enemy-summon{width:10%;opacity:.72;z-index:5}.unit.player-summon.summon-0{left:29%;top:9%}.unit.player-summon.summon-1{left:29%;top:40%}.unit.enemy-summon.summon-0{right:29%;top:9%}.unit.enemy-summon.summon-1{right:29%;top:40%}.summon-0 img,.summon-1 img{filter:sepia(.4) hue-rotate(210deg) saturate(1.6) drop-shadow(0 3px 4px #12052f)}
.day-fire.enemy-cast{left:0;right:auto}
.ultimate-overlay{position:absolute;inset:0;z-index:40;display:grid;place-items:center;pointer-events:none;background:#100814a8}.ultimate-overlay[hidden]{display:none}.ultimate-overlay>div{text-align:center;width:100%;padding:20px 10px;background:linear-gradient(90deg,transparent,#251628ed 18%,#562822f2 50%,#251628ed 82%,transparent);border-top:1px solid #e8c077;border-bottom:1px solid #e8c077;box-shadow:0 0 35px #ff8c4766;animation:ultimate-flash 1.4s both}.ultimate-overlay strong,.ultimate-overlay small{display:block;color:#ffdf9a;text-shadow:0 0 12px #f58b3b}.ultimate-overlay strong{font:700 clamp(20px,3vw,38px) Georgia,serif}.ultimate-overlay small{margin-top:8px;letter-spacing:.13em}.ultimate-overlay span{color:#fff3b1;font-size:26px}@keyframes ultimate-flash{0%{opacity:0;transform:scaleX(.4)}20%,75%{opacity:1;transform:scaleX(1)}100%{opacity:0}}
.heal-particles{inset:0 -25% -5%;overflow:visible}.heal-particles:before{inset:4% 12% 0;border-radius:48%;background:linear-gradient(90deg,transparent,#38e95a40,#c5ffb780,#38e95a40,transparent);filter:blur(5px)}.heal-particles:after{content:'';position:absolute;left:8%;right:8%;bottom:0;height:20%;border-radius:50%;border:3px solid #9aff9d;box-shadow:0 0 13px #40ff67,inset 0 0 14px #4cff61;animation:particle-glow 1.2s ease-out both}.heal-particles i{font-size:clamp(15px,2vw,28px);color:#afffa0;text-shadow:0 0 5px #fff,0 0 13px #33ff53,0 0 22px #1cff64}
.lightning-bolt{position:absolute;height:20px;z-index:12;transform-origin:0 50%;pointer-events:none;clip-path:polygon(0 42%,16% 26%,26% 47%,42% 14%,51% 42%,67% 12%,74% 40%,100% 44%,75% 62%,67% 35%,52% 82%,42% 42%,27% 75%,16% 48%,0 58%);background:linear-gradient(#38a6ff,#e2faff,#51b2ff);filter:drop-shadow(0 0 7px #65caff);animation:lightning-flash 1.1s steps(2) both}@keyframes lightning-flash{0%,30%,65%,100%{opacity:0}10%,40%,80%{opacity:1}}
.meteor-fx{position:absolute;z-index:14;width:11%;aspect-ratio:1;pointer-events:none}.meteor-fx i{position:absolute;width:60%;height:60%;border-radius:50%;background:radial-gradient(circle,#fff6ac 4%,#ffc044 28%,#e74310 60%,transparent 73%);box-shadow:-25px -30px 20px #f9501488;animation:meteor-fall .6s ease-in both}.meteor-fx b{position:absolute;inset:-30%;border-radius:50%;background:radial-gradient(circle,#fffbc0 0,#ffbf40 18%,#e83a0eb5 40%,transparent 70%);animation:meteor-explosion .5s .55s ease-out both}@keyframes meteor-fall{from{transform:translate(200%,-500%) scale(.6);opacity:0}20%{opacity:1}to{transform:translate(0,0) scale(1.1);opacity:1}}@keyframes meteor-explosion{from{transform:scale(.15);opacity:1}to{transform:scale(1.2);opacity:0}}
@media(max-width:600px){.unit.foe{width:17%}.foe-0{right:1%;top:12%}.foe-1{right:19%;top:31%}.foe-2{right:1%;top:50%}.foe-0 .unit-health,.foe-1 .unit-health,.foe-2 .unit-health{width:76px}.unit.player-summon,.unit.enemy-summon{width:14%}.unit.player-summon.summon-0,.unit.player-summon.summon-1{left:35%}.unit.enemy-summon.summon-0,.unit.enemy-summon.summon-1{right:35%}}
/* Заголовок ульты над плашкой с названием способности */
.ultimate-overlay>.ultimate-content{width:100%;padding:0;background:none;border:0;box-shadow:none}.ultimate-content .ultimate-kicker{display:block;color:#ffdf9a;font:700 clamp(13px,1.5vw,19px) Georgia,serif;letter-spacing:.14em;text-transform:uppercase;text-shadow:0 2px 6px #000,0 0 12px #f58b3b;margin-bottom:12px}.ultimate-content #ultimate-name{display:block;padding:20px 10px;background:linear-gradient(90deg,transparent,#251628ed 18%,#562822f2 50%,#251628ed 82%,transparent);border-top:1px solid #e8c077;border-bottom:1px solid #e8c077;box-shadow:0 0 35px #ff8c4766;font:700 clamp(24px,4vw,48px) Georgia,serif;color:#ffdf9a;text-shadow:0 0 12px #f58b3b}
/* Единый размер персонажей и копий на обеих сторонах арены. */
.unit.ally,.unit.foe{width:11.6%!important}.unit.ally .figure,.unit.foe .figure,.unit.ally-0 .figure,.unit.ally-1 .figure,.unit.ally-2 .figure,.unit.foe-0 .figure,.unit.foe-1 .figure,.unit.foe-2 .figure{height:clamp(115px,13vw,180px)!important;width:100%}.unit.ally .figure img,.unit.foe .figure img{height:100%;width:100%;object-fit:contain;object-position:center bottom}
@media(max-width:600px){.unit.ally,.unit.foe{width:16%!important}.unit.ally .figure,.unit.foe .figure,.unit.ally-0 .figure,.unit.ally-1 .figure,.unit.ally-2 .figure,.unit.foe-0 .figure,.unit.foe-1 .figure,.unit.foe-2 .figure{height:clamp(90px,22vw,110px)!important}}
/* Зеркальная формация: первый боец в центре, остальные напротив друг друга. */
.foe-0{right:3%;top:9%}.foe-1{right:18%;top:29%}.foe-2{right:3%;top:47%}
@media(max-width:600px){.foe-0{right:1%;top:11%}.foe-1{right:19%;top:28%}.foe-2{right:1%;top:45%}}
.fireball-projectile{position:absolute;width:34px;height:34px;z-index:16;pointer-events:none;transform:translate(-50%,-50%)}.fireball-projectile i{position:absolute;inset:0;border-radius:50%;background:radial-gradient(circle at 35% 35%,#fffbe1 0,#ffe178 18%,#ff7b12 48%,#da2600 75%,transparent 80%);box-shadow:0 0 15px 7px #ff6a1a99;animation:fireball-flight .7s ease-in both}.fireball-projectile b{position:absolute;inset:-40px;border-radius:50%;background:radial-gradient(circle,#fff7a4 0,#ffb62e 23%,#eb3a08b8 45%,transparent 72%);animation:fireball-impact .6s .65s ease-out both}@keyframes fireball-flight{0%{transform:translate(0,0) scale(.5);opacity:1}95%{opacity:1}100%{transform:translate(var(--dx),var(--dy)) scale(1.2);opacity:0}}@keyframes fireball-impact{0%{transform:translate(var(--dx),var(--dy)) scale(.15);opacity:1}100%{transform:translate(var(--dx),var(--dy)) scale(1.1);opacity:0}}
/* Во время взмаха противник всегда остаётся обращён к левой стороне. */
.foe.attacking .figure{animation:foe-facing-swing .56s ease-in-out both}@keyframes foe-facing-swing{0%,100%{transform:scaleX(-1) translateX(0) rotate(0)}25%{transform:scaleX(-1) translateX(4%) rotate(3deg)}55%{transform:scaleX(-1) translateX(12%) rotate(6deg)}}
.dodge-number{color:#bcecff;text-shadow:0 2px 3px #051e2a,0 0 10px #63d8ff}
.battlefield{background:linear-gradient(0deg,#111b1744,transparent 25%),url('assets/battle-knights-arena-v1.png') center/cover}
/* Без изображения кубика; критические исходы сообщаются только текстом. */
.dice-overlay.critical-only #dice-tray{display:none}.ultimate-overlay>.ultimate-content{animation-duration:2.8s}
/* Центральные позиции дуэлянтов строго напротив друг друга. */
.ally-1{left:18%;top:29%}.foe-1{right:18%;top:29%}
@media(max-width:600px){.ally-1{left:19%;top:28%}.foe-1{right:19%;top:28%}}
/* Критический результат: видимый статичный двадцатигранник. */
.dice-overlay.critical-only #dice-tray{display:flex}.critical-d20{width:clamp(90px,9vw,120px);height:auto;overflow:visible;filter:drop-shadow(0 0 10px #d9b66799)}.critical-d20 .d20-edge{fill:#4a3421;stroke:#e6c286;stroke-width:3}.critical-d20 .d20-facet{fill:#825f35;stroke:#e4c28a;stroke-width:2}.critical-d20 .d20-lines{fill:none;stroke:#e2c28f;stroke-width:2}.critical-d20 text{fill:#fff6dd;font:700 40px Georgia,serif;paint-order:stroke;stroke:#382718;stroke-width:3px}.critical-d20-fail .d20-edge{fill:#482129;stroke:#ef9c91}.critical-d20-fail .d20-facet{fill:#773338;stroke:#f2b2a1}.critical-d20-fail .d20-lines{stroke:#f2b2a1}
/* Начальный экран игры. */
.game[hidden],.title-screen[hidden]{display:none!important}.title-screen{position:relative;isolation:isolate;width:100%;min-height:100vh;min-height:100svh;overflow:hidden;background:#13121b url('assets/title-dungeon-v1.png') center/cover no-repeat;display:flex;flex-direction:column;align-items:center;color:#f8e9c2}.title-shade{position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,#0b0b16b8 0%,#0b0b1655 30%,#100e1866 65%,#08090fe8 100%)}.title-heading{position:relative;z-index:3;display:block;text-align:center;margin:clamp(35px,8vh,80px) 20px 0}.title-heading p{margin:0 0 10px;color:#d4bd85;font:600 clamp(10px,1vw,13px) system-ui;letter-spacing:.3em;text-transform:uppercase;text-shadow:0 2px 6px #000}.title-heading h1{margin:0;color:#f8e5b3;font:700 clamp(38px,6.6vw,92px)/1.05 Georgia,serif;letter-spacing:.02em;text-shadow:0 3px 4px #000,0 0 24px #a16d36aa}.title-cast{position:absolute;bottom:15%;left:4%;right:4%;height:min(50vh,520px);display:flex;align-items:flex-end;justify-content:center;filter:drop-shadow(0 10px 7px #000a)}.title-cast img{display:block;width:12%;height:100%;object-fit:contain;object-position:center bottom;min-width:0;margin:0 -.8%;filter:drop-shadow(0 2px 3px #000a)}.title-cast img:nth-child(4),.title-cast img:nth-child(6){height:92%}.title-cast img:nth-child(5){height:106%;z-index:2}.title-start{position:absolute;bottom:clamp(32px,6vh,70px);left:50%;transform:translateX(-50%);z-index:4;min-width:200px;padding:15px 40px;color:#231609;background:linear-gradient(#eed29a,#b78c4e);border:1px solid #f5d697;box-shadow:0 4px 18px #000c,0 0 24px #d99b3a44;font:700 19px Georgia,serif;letter-spacing:.12em;cursor:pointer}.title-start:hover,.title-start:focus-visible{background:linear-gradient(#ffe5af,#d9af6b);outline:2px solid #fff4d0;outline-offset:3px}
/* Завеса направлена на сторону поражённых ею целей. */
.veil-field.player-veil{transform:scaleX(-1);transform-origin:center}
/* Обе формации сдвинуты к центру с сохранением зеркальности. */
.ally-0,.ally-2{left:8%}.ally-1{left:25%}.foe-0,.foe-2{right:8%}.foe-1{right:25%}.unit.player-summon.summon-0,.unit.player-summon.summon-1{left:34%}.unit.enemy-summon.summon-0,.unit.enemy-summon.summon-1{right:34%}
@media(max-width:600px){.title-heading{margin-top:8vh}.title-heading h1{font-size:clamp(35px,9vw,54px)}.title-cast{left:1%;right:1%;height:44vh;bottom:20%}.title-cast img{width:13%;margin:0 -1%}.title-start{bottom:8vh;min-width:170px}.ally-0,.ally-2{left:5%}.ally-1{left:23%}.foe-0,.foe-2{right:5%}.foe-1{right:23%}.unit.player-summon.summon-0,.unit.player-summon.summon-1{left:35%}.unit.enemy-summon.summon-0,.unit.enemy-summon.summon-1{right:35%}}
/* Профиль героя раскрывается поверх экрана, вне прокручиваемого ряда. */
.roster-profile[hidden]{display:none!important}.roster-profile{position:fixed;z-index:90;overflow:auto;overscroll-behavior:contain;color:#efe9dd;background:linear-gradient(145deg,#202925fa,#111a1afa);border:1px solid #aa9566;box-shadow:0 12px 30px #000c;padding:15px 16px;font:13px/1.45 system-ui}.roster-profile h3{margin:0 0 10px;color:#f1d39a;font:700 21px Georgia,serif}.roster-profile h4{margin:12px 0 7px;color:#d9bd80;font:700 12px system-ui;letter-spacing:.1em;text-transform:uppercase}.profile-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 10px;color:#c5ccbe}.profile-stats span{display:flex;justify-content:space-between;gap:4px}.profile-stats b{color:#f5e8c9;white-space:nowrap}.roster-profile ul{padding:0;margin:0;list-style:none}.roster-profile li{padding:7px 0;border-top:1px solid #ffffff1a}.roster-profile li strong,.roster-profile li span{display:block}.roster-profile li strong{color:#eee0bf}.roster-profile li span{color:#bfc7ba;margin-top:3px}
/* Защитная сфера и живой чёрный огонь остаются, пока действует защита. */
.magic-bubble,.black-flame{position:absolute;pointer-events:none;z-index:6;left:-18%;right:-18%;top:32px;bottom:0}.magic-bubble{border:2px solid #bcefffbb;border-radius:49% 49% 45% 45%;background:radial-gradient(ellipse at 35% 20%,#fff5 0,#a8ebff12 22%,#53a7c61c 63%,#b1e6ff55 100%);box-shadow:inset 0 0 18px #90d9ff99,0 0 15px #8cd9ff88;animation:bubble-pulse 2.4s ease-in-out infinite}.magic-bubble:after{content:'';position:absolute;left:9%;top:12%;width:17%;height:34%;border-left:3px solid #ffffff99;border-radius:50%;transform:rotate(25deg);filter:blur(1px)}@keyframes bubble-pulse{0%,100%{opacity:.68;transform:scale(.97)}50%{opacity:.95;transform:scale(1.025)}}
.black-flame{z-index:5;overflow:visible;filter:drop-shadow(0 0 7px #aa8ccc99)}.black-flame i{position:absolute;bottom:-2%;height:65%;width:34%;border-radius:55% 20% 60% 35%;background:radial-gradient(ellipse at 50% 80%,#17121dee 10%,#201827dd 34%,#594565aa 48%,transparent 72%);filter:blur(3px);animation:blackfire-rise 1.5s ease-in-out infinite alternate}.black-flame i:nth-child(1){left:0;animation-delay:-.2s}.black-flame i:nth-child(2){left:15%;height:85%;animation-delay:-.8s}.black-flame i:nth-child(3){left:33%;height:74%;animation-delay:-.35s}.black-flame i:nth-child(4){left:52%;height:88%;animation-delay:-1s}.black-flame i:nth-child(5){left:70%;animation-delay:-.55s}@keyframes blackfire-rise{0%{opacity:.58;transform:translateY(4%) scale(.8,.85) rotate(-5deg)}100%{opacity:.9;transform:translateY(-13%) scale(1,1.14) rotate(5deg)}}
@media(prefers-reduced-motion:reduce){.magic-bubble,.black-flame i{animation:none}}
/* Групповой портрет героев крупным планом. */
.title-screen{background:radial-gradient(ellipse at 50% 48%,#533d36 0,#1d2027 40%,#0a0d14 100%)}.title-shade{background:linear-gradient(180deg,#0b0b16aa 0%,transparent 34%,#08090e55 70%,#08090fed 100%)}.title-cast{position:absolute;inset:13% 0 5%;height:auto;display:block;filter:drop-shadow(0 10px 7px #000b)}.title-cast img,.title-cast img:nth-child(4),.title-cast img:nth-child(5),.title-cast img:nth-child(6){position:absolute;width:24%;height:62%;margin:0;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 5px 5px #000b)}.title-cast img:nth-child(1){left:-2%;top:0;z-index:1}.title-cast img:nth-child(2){left:18%;top:0;z-index:1}.title-cast img:nth-child(3){left:38%;top:0;z-index:1}.title-cast img:nth-child(4){left:58%;top:0;z-index:1}.title-cast img:nth-child(7){left:78%;top:0;z-index:1}.title-cast img:nth-child(6){left:7%;top:34%;z-index:2}.title-cast img:nth-child(5){left:28%;top:34%;z-index:3}.title-cast img:nth-child(8){left:49%;top:34%;z-index:2}.title-cast img:nth-child(9){left:70%;top:34%;z-index:2}.title-heading{z-index:4}.title-start{z-index:5}
@media(max-width:600px){.title-cast{inset:17% -10% 12%;height:auto}.title-cast img,.title-cast img:nth-child(4),.title-cast img:nth-child(5),.title-cast img:nth-child(6){width:25%;height:55%}.title-cast img:nth-child(6),.title-cast img:nth-child(5),.title-cast img:nth-child(8),.title-cast img:nth-child(9){top:40%}}
/* Арт и описание героя вместе в профиле выбора. */
.profile-layout{display:grid;grid-template-columns:minmax(145px,36%) minmax(0,1fr);gap:16px;align-items:start}.profile-art{position:sticky;top:0;min-width:0;background:radial-gradient(ellipse at 50% 32%,#8d775c4a,transparent 70%);border-right:1px solid #d5bd8433}.profile-art img{display:block;width:100%;height:auto;max-height:min(360px,55vh);object-fit:contain;object-position:center top;filter:drop-shadow(0 6px 6px #000b)}.profile-details{min-width:0}.result-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.result-actions #result-new{background:transparent;color:#f4ddb0}
@media(max-width:600px){.profile-layout{grid-template-columns:minmax(95px,34%) minmax(0,1fr);gap:10px}.profile-stats{grid-template-columns:1fr}.profile-art img{max-height:42vh}.result-card{padding:24px 18px}}
/* Хронологическая лента боя: старые записи сверху, новые снизу. */
#log{display:flex;flex-direction:column;flex-wrap:nowrap;gap:6px;max-height:360px;overflow-y:auto;scrollbar-color:#88754e #17211d}#log li{display:block;width:100%;margin:0}
/* Чумной барьер и защитные перья различаются по форме и цвету. */
.magic-bubble.plague-bubble{border-color:#a6f1a9c9;background:radial-gradient(ellipse at 35% 20%,#f2fff466 0,#87e79920 22%,#39a75c2c 63%,#8fe6a45e 100%);box-shadow:inset 0 0 18px #76e497aa,0 0 15px #65d98288}
.feather-shield{position:absolute;z-index:8;pointer-events:none;left:55%;top:35%;width:48%;height:57%;filter:drop-shadow(0 0 8px #bceeffaa);animation:feather-float 2.4s ease-in-out infinite}.feather-shield svg{display:block;width:100%;height:100%;overflow:visible}.feather-silhouette{fill:url(#feather-sheen);fill-opacity:.86;stroke:#e6faff;stroke-width:2.5;stroke-linejoin:round}.feather-vein{fill:none;stroke:#f9fff9;stroke-width:2.2;stroke-linecap:round}.foe .feather-shield{left:-3%;right:auto}@keyframes feather-float{0%,100%{transform:translateY(0) rotate(-5deg)}50%{transform:translateY(-8px) rotate(3deg)}}@media(prefers-reduced-motion:reduce){.feather-shield{animation:none}}
/* Полупрозрачным становится сам персонаж, а его показатели остаются читаемыми. */
.unit.invisible .figure{opacity:.4;filter:drop-shadow(0 0 7px #c7d8ffaa)}
.hit-slash.varied-slash{animation:slash-varied .8s ease-out both}@keyframes slash-varied{0%{opacity:0;transform:rotate(var(--slash-angle)) scaleX(.15)}20%{opacity:1;transform:rotate(var(--slash-angle)) scaleX(1)}70%{opacity:.8}100%{opacity:0;transform:rotate(var(--slash-angle)) scaleX(1.15)}}@media(prefers-reduced-motion:reduce){.hit-slash.varied-slash{animation-duration:.01ms!important}}

.mode-select{display:flex;align-items:center;gap:12px;margin:12px 0;color:#e8d2a3;font-weight:700}.mode-select select{background:#24212a;color:#f5e6bf;border:1px solid #9a7b49;border-radius:5px;padding:8px}.unit.foe.boss-leader{right:3%;top:14%;width:26%!important;z-index:2}.unit.foe.boss-leader .figure{height:clamp(190px,23vw,300px)!important}.unit.foe.boss-guard-1{right:25%;top:12%;z-index:4}.unit.foe.boss-guard-2{right:25%;top:48%;z-index:5}@media(max-width:600px){.unit.foe.boss-leader{right:0;top:19%;width:31%!important}.unit.foe.boss-leader .figure{height:clamp(145px,36vw,190px)!important}.unit.foe.boss-guard-1,.unit.foe.boss-guard-2{right:27%}}

/* Горящее ядро и длинный огненный шлейф, направленные по траектории падения. */
.meteor-fx{width:12%;overflow:visible}
.meteor-fx i{width:63%;height:63%;border-radius:50%;background:radial-gradient(circle at 65% 68%,#fffed0 0 15%,#ffe366 33%,#ff981f 58%,#e7430a 78%,transparent 84%);box-shadow:0 0 12px 5px #ff8e1c,0 0 30px 12px #fb411280;animation:meteor-streak .62s cubic-bezier(.45,0,.9,.8) both}
.meteor-fx i:before,.meteor-fx i:after,.meteor-fx em,.meteor-fx s{content:'';position:absolute;display:block;pointer-events:none;transform-origin:100% 100%}
.meteor-fx i:before{width:270%;height:210%;right:27%;bottom:27%;background:linear-gradient(135deg,transparent 4%,#e6340822 21%,#ff6200a8 53%,#ffd048ed 83%,#fffbc8 100%);clip-path:polygon(0 0,38% 13%,65% 37%,89% 52%,100% 100%,52% 89%,37% 65%,13% 38%);filter:blur(1px)}
.meteor-fx i:after{width:190%;height:160%;right:36%;bottom:36%;background:linear-gradient(135deg,transparent 8%,#ff9b17aa 48%,#fff9a3 100%);clip-path:polygon(0 0,50% 24%,74% 49%,100% 100%,49% 74%,24% 50%)}
.meteor-fx em,.meteor-fx s{width:145%;height:110%;right:40%;bottom:37%;background:linear-gradient(135deg,transparent,#ffc23e,#fff7ac);clip-path:polygon(0 0,58% 30%,85% 43%,100% 100%,49% 81%,29% 56%)}
.meteor-fx s{right:21%;bottom:58%;opacity:.65;transform:rotate(12deg) scale(.8)}
@keyframes meteor-streak{from{transform:translate(-260%,-420%) scale(.55);opacity:0}18%{opacity:1}to{transform:translate(0,0) scale(1.05);opacity:1}}

/* Золотой свет и песочные часы для возвращения во времени. */
.time-escape-fx{position:absolute;z-index:12;inset:5% -18% 0;pointer-events:none;overflow:visible}
.time-glow{position:absolute;inset:15% 5% 0;border-radius:50%;background:radial-gradient(ellipse,#fff5bfaa 0,#e6a92855 38%,transparent 72%);animation:time-glow 1.8s ease-out both}
.time-hourglass{position:absolute;z-index:2;left:40%;top:8%;width:30%;height:42%;filter:drop-shadow(0 0 5px #fff3a1) drop-shadow(0 0 12px #e6a829);animation:time-hourglass 1.8s ease-in-out both}
.time-hourglass svg{width:100%;height:100%;overflow:visible;fill:#fff6bd70;stroke:#ffe287;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}.time-hourglass .time-sand{fill:#ffce47;stroke:none}
.time-escape-fx i{position:absolute;left:calc(8% + var(--i)*7%);bottom:4%;color:#fff1a0;font:normal 16px system-ui;text-shadow:0 0 8px #ffc632,0 0 16px #f7a80e;animation:time-spark 1.5s ease-out both;animation-delay:calc(var(--i)*35ms)}
@keyframes time-glow{0%,100%{opacity:0;transform:scale(.7)}25%,65%{opacity:1;transform:scale(1)}}@keyframes time-hourglass{0%{opacity:0;transform:translateY(12px) rotate(-35deg) scale(.7)}25%{opacity:1;transform:translateY(0) rotate(0) scale(1)}70%{opacity:1}100%{opacity:0;transform:translateY(-18px) rotate(180deg) scale(.8)}}@keyframes time-spark{from{opacity:0;transform:translateY(0) scale(.4)}25%{opacity:1}to{opacity:0;transform:translateY(-100px) scale(1.1)}}
@media(prefers-reduced-motion:reduce){.time-glow,.time-hourglass,.time-escape-fx i,.meteor-fx i{animation-duration:.01ms!important}}
.hypnotic-circle{position:absolute;z-index:20;left:50%;top:48%;width:clamp(150px,24vw,300px);aspect-ratio:1;border:3px solid #e8c1ff;border-radius:50%;transform:translate(-50%,-50%);background:repeating-conic-gradient(from 0deg,#a65ce1d9 0deg 12deg,#151040d9 12deg 24deg);box-shadow:0 0 25px #c46aff,0 0 70px #7849ea;animation:hypnotic-spin 1.9s ease-in-out both;pointer-events:none}.hypnotic-circle i{position:absolute;inset:23%;border:5px solid #f5d7ff;border-radius:50%;background:repeating-conic-gradient(#2c175c 0 20deg,#f3b4ff 20deg 40deg);box-shadow:0 0 20px #fff}.hypnotic-status{color:#f2a4ff;text-shadow:0 0 6px #b15fff}.boomerang-fx{position:absolute;z-index:18;width:45px;height:45px;pointer-events:none;transition:left .45s linear,top .45s linear;filter:drop-shadow(0 0 6px #6fffe0)}.boomerang-fx svg{width:100%;height:100%;fill:#98643c;stroke:#adf9dc;stroke-width:3;animation:boomerang-spin .25s linear infinite}@keyframes hypnotic-spin{0%{opacity:0;transform:translate(-50%,-50%) scale(.3) rotate(0)}20%,75%{opacity:.9}100%{opacity:0;transform:translate(-50%,-50%) scale(1.05) rotate(540deg)}}@keyframes boomerang-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.hypnotic-circle,.boomerang-fx svg{animation-duration:.01ms!important}}
.online-mode #roster,.online-mode #new-party{display:none}.online-lobby{margin:18px 0;padding:20px;background:#151d1c;border:1px solid #8e7646;border-radius:10px;color:#f1e4c5}.online-lobby h3{margin:0 0 8px}.online-lobby small{color:#cdbb92}.online-lobby label{display:flex;align-items:center;gap:10px;margin:12px 0;flex-wrap:wrap}.online-lobby input,.online-lobby select{padding:9px;background:#252723;color:#f5e6bf;border:1px solid #947b50;border-radius:5px}.online-lobby button{padding:9px 14px;border:1px solid #b6985b;border-radius:5px;background:#423c2c;color:#fff4d8;cursor:pointer}.online-teams{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.online-teams>div{padding:12px;background:#262821;border-radius:6px}.online-teams h4{margin:0}.online-teams ol{min-height:72px;padding-left:22px}.online-buttons{display:flex;gap:10px}.online-lobby ul{display:flex;gap:10px;flex-wrap:wrap;padding:0;list-style:none}.online-lobby ul li{background:#33372b;padding:4px 8px;border-radius:4px}@media(max-width:600px){.online-teams{grid-template-columns:1fr}}
