@font-face{font-family:'Forum';src:url(fonts/forum.woff) format('woff');font-display:swap}
@font-face{font-family:'Golos Text';src:url(fonts/golos.woff) format('woff');font-weight:400 900;font-display:swap}
:root{--bg:#0e0908;--top:#140d0c;--panel:#160f0e;--card:#1e1513;--card2:#251a14;--chip:#2a1d1a;--line:rgba(255,214,170,.08);--line2:rgba(255,214,170,.14);
 --tx:#f3e9df;--tx2:#d7c6b8;--mut:#b8a79a;--mut2:#9c8b7e;--gold:#e8b04a;--gold2:#f6cf7e;--ink:#1a0f08;--red:#d9472a;--soul:#a98bff;--ember:#f2a07a;
 --serif:'Forum',Georgia,'Palatino Linotype',serif;--sans:'Golos Text',system-ui,-apple-system,'Segoe UI',sans-serif;--dock:118px}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none}
html,body{margin:0;height:100%;background:var(--bg);color:var(--tx);font-family:var(--sans);overflow:hidden}
b,strong{font-weight:700}
#app{height:100%;display:flex;flex-direction:column;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);background:radial-gradient(circle at 50% 25%,#3a0d14,#0b0507 70%)}
button{font:inherit;color:var(--tx);background:var(--card);border:1px solid var(--line2);border-radius:10px;padding:8px 12px;cursor:pointer;font-weight:600}
button:hover:not(:disabled){border-color:rgba(232,176,74,.5)}
button:disabled{opacity:.45;cursor:default}button:active:not(:disabled){transform:scale(.97)}
button:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
/* клик всегда попадает в саму кнопку, даже если её надпись обновилась посреди нажатия */
button *{pointer-events:none}
.ico{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.num,#gold,#souls,#nec,#cd,#dps,#hptxt,#timer,.buy{font-variant-numeric:tabular-nums}
i.coin,i.soul,i.nectar{display:inline-block;width:12px;height:12px;border-radius:50%;flex:none;vertical-align:-1px}
i.coin{background:var(--gold);box-shadow:inset 0 0 0 2px #9a6a1c}
i.soul{background:var(--soul);box-shadow:inset 0 0 0 2px #6448c9}
i.nectar{width:10px;height:10px;border-radius:3px;background:#e07a3f;box-shadow:inset 0 0 0 2px #9b4519;transform:rotate(45deg)}

/* ---------- верхняя панель ---------- */
#top{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;padding:8px 10px;background:var(--top);border-bottom:1px solid var(--line);flex:none}
.brand{display:none;font-family:var(--serif);font-size:22px;letter-spacing:.02em;white-space:nowrap}
.actbox{order:3;flex:1 1 100%;display:flex;flex-direction:column;gap:4px;min-width:0}
.actl{display:flex;justify-content:space-between;gap:8px;font-size:12px;color:var(--mut);white-space:nowrap}
.actl b{color:var(--gold);font-weight:600}.actl #act{color:var(--gold);font-weight:600;cursor:default}
#actf{font-variant-numeric:tabular-nums}
.actbar{height:5px;border-radius:3px;background:var(--chip);overflow:hidden}
#actp{display:block;height:100%;width:0;background:var(--gold);border-radius:3px;transition:width .3s}
.curs{display:flex;gap:6px;flex:1 1 auto;min-width:0}
.cur{display:flex;align-items:center;gap:7px;height:34px;padding:0 10px;border-radius:9px;background:var(--card);min-width:0}
.cur div{display:flex;flex-direction:column;line-height:1.1;min-width:0}
.cur small{display:none;font-size:11px;color:var(--mut2)}
.cur b{font-size:13px;white-space:nowrap}
.tbtns{display:flex;gap:6px}
.ib{width:40px;height:40px;padding:0;display:flex;align-items:center;justify-content:center;color:var(--tx2)}
#snd .i-off,#snd[data-on="0"] .i-on{display:none}#snd[data-on="0"] .i-off{display:block}

/* ---------- арена ---------- */
#arena{position:relative;flex:0 0 auto;height:clamp(220px,33vh,330px);overflow:hidden;cursor:pointer;background-color:rgba(0,0,0,.15)}
#arena[data-act="0"]{background:linear-gradient(rgba(14,9,8,.6),rgba(14,9,8,0) 30%,rgba(14,9,8,0) 70%,rgba(14,9,8,.8)),url(img/act1_bg.webp) center 65%/cover no-repeat}
#arena[data-act="1"]{background:linear-gradient(rgba(14,9,8,.6),rgba(14,9,8,0) 30%,rgba(14,9,8,0) 70%,rgba(14,9,8,.8)),url(img/act2_bg.webp) center 70%/cover no-repeat}
#arena[data-act="2"]{background:linear-gradient(rgba(14,9,8,.6),rgba(14,9,8,0) 30%,rgba(14,9,8,0) 70%,rgba(14,9,8,.8)),url(img/act3_bg.webp) center 60%/cover no-repeat}
#arena[data-act="3"]{background:linear-gradient(rgba(14,9,8,.6),rgba(14,9,8,0) 30%,rgba(14,9,8,0) 70%,rgba(14,9,8,.8)),url(img/act4_bg.webp) center 92%/cover no-repeat}
#arena[data-act="4"]{background:linear-gradient(rgba(14,9,8,.6),rgba(14,9,8,0) 30%,rgba(14,9,8,0) 70%,rgba(14,9,8,.8)),url(img/act5_bg.webp) center 88%/cover no-repeat}
#arena[data-act="5"]{background:linear-gradient(rgba(14,9,8,.6),rgba(14,9,8,0) 30%,rgba(14,9,8,0) 70%,rgba(14,9,8,.8)),url(img/act6_bg.webp) center 75%/cover no-repeat}
#foe{position:absolute;top:10px;left:12px;right:12px;z-index:4;display:flex;flex-direction:column;gap:5px;pointer-events:none}
#mname{font-family:var(--serif);font-size:22px;line-height:1.1;text-shadow:0 2px 10px rgba(0,0,0,.85)}
.meta{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;font-size:12px;color:var(--tx2);text-shadow:0 1px 3px #000}
#floor{font-weight:600;color:var(--tx)}
#pips{display:flex;gap:3px}#pips i{width:14px;height:5px;border-radius:3px;background:rgba(243,233,223,.25)}
#pips i.d{background:var(--gold)}#pips i.c{background:var(--tx)}#pips[hidden]{display:none}
#nextb{color:var(--ember)}#nextb:empty{display:none}
#hpbar{position:relative;height:18px;border-radius:9px;background:rgba(20,12,10,.85);box-shadow:inset 0 0 0 1px var(--line2);overflow:hidden}
#hp{display:block;height:100%;width:100%;background:linear-gradient(#e55536,#b33a20);transition:width .1s}
#hptxt{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:11px;font-style:normal;font-weight:700;text-shadow:0 1px 2px rgba(0,0,0,.9)}
#timer{align-self:center;font-size:13px;font-weight:700;padding:3px 12px;border-radius:999px;background:rgba(20,12,10,.85);color:var(--gold2);box-shadow:inset 0 0 0 1px rgba(232,176,74,.4)}
#timer.boss{color:#fff;background:rgba(170,40,20,.9);box-shadow:none}
#timer:empty{display:none}
#monster{position:absolute;right:10%;bottom:14px;font-size:min(18vh,96px);animation:sway 1.6s ease-in-out infinite;filter:drop-shadow(0 0 14px #c0202f);transition:opacity .15s,transform .15s}
#monster.hit{animation:none;transform:scale(.9)}
#monster.img{width:200px;height:200px;font-size:0;background:center bottom/contain no-repeat;filter:drop-shadow(0 6px 10px #000) drop-shadow(0 0 18px rgba(255,90,40,.35));transform-origin:50% 100%}
#monster.img.boss{width:230px;height:230px;filter:drop-shadow(0 6px 10px #000) drop-shadow(0 0 16px #ff3a2a)}
#monster.img.boss:not(.named){filter:drop-shadow(0 6px 10px #000) drop-shadow(0 0 16px #ff3a2a) brightness(1.15) saturate(1.3)}
#monster.img.hit{transform:scale(.94)}
#monster.pop{animation:pop .25s ease-out}
@keyframes pop{0%{opacity:.4;transform:scale(.88)}100%{opacity:1;transform:scale(1)}}
#hero{position:absolute;left:4%;bottom:14px;font-size:2.6rem;animation:idle 2.2s ease-in-out infinite;filter:drop-shadow(0 0 8px #c9a24b);pointer-events:none;transition:transform .1s}
#hero.atk{animation:none;transform:translateX(28px) rotate(8deg)}
#hero.img{left:-4px;width:150px;height:150px;font-size:0;background:url(img/hero.webp) center bottom/contain no-repeat;filter:drop-shadow(0 0 8px #000);transform-origin:50% 100%}
#hero.img.atk{transform:translateX(22px) rotate(4deg)}
@keyframes idle{50%{transform:translateY(-4px) scale(1.04)}}
@keyframes sway{50%{transform:translateY(-8px) rotate(2deg)}}
.shake{animation:shk .25s}
@keyframes shk{25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
#chest{position:absolute;right:10px;top:96px;z-index:6;display:flex;align-items:center;gap:8px;height:40px;padding:0 10px;border-radius:12px;border:1px solid rgba(232,176,74,.5);background:rgba(20,12,10,.85);color:var(--gold);font-size:13px;font-weight:600;cursor:pointer;animation:bob 1.6s ease-in-out infinite}
#chest span{color:var(--tx)}
#chest b{min-width:20px;height:20px;border-radius:10px;background:var(--red);color:#fff;font-size:12px;display:flex;align-items:center;justify-content:center;padding:0 5px}
#chest[hidden],#fairy[hidden]{display:none}
@keyframes bob{50%{transform:translateY(-4px)}}
#fairy{position:absolute;left:-10%;top:30%;font-size:2.2rem;z-index:6;cursor:pointer;animation:fly 7s linear forwards;filter:drop-shadow(0 0 8px #ffd96b)}
@keyframes fly{0%{left:-10%;transform:translateY(0)}25%{transform:translateY(-25px)}50%{transform:translateY(15px)}75%{transform:translateY(-20px)}100%{left:105%;transform:translateY(0)}}
#toast{position:absolute;left:50%;top:44%;z-index:9;transform:translateX(-50%);pointer-events:none;font-weight:700;color:var(--gold2);text-shadow:0 0 6px #000;opacity:0;white-space:nowrap;animation:toast 1.8s ease-out both}
@keyframes toast{0%{opacity:0;top:48%}15%{opacity:1}80%{opacity:1}100%{opacity:0;top:34%}}
#fx{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:7}
.dn{position:absolute;font-weight:700;font-size:18px;color:#ffd27a;text-shadow:0 2px 6px rgba(0,0,0,.9);animation:fl .8s forwards;display:none;font-variant-numeric:tabular-nums}
.dn.c{color:#ff8a5b;font-size:26px}
.dn.g{color:#ffe08a;font-size:17px;white-space:nowrap}.dn.g.c{font-size:24px}.dn.g::before{content:'';display:inline-block;width:.95em;height:.95em;margin-right:4px;vertical-align:-.15em;background:url(img/icons/coin_s.webp) center/contain no-repeat}
#gold{display:inline-block;transform-origin:left center}#gold.bump{animation:gbump .35s ease-out}@keyframes gbump{40%{transform:scale(1.22);color:#ffe08a}}
@keyframes fl{to{transform:translateY(-70px);opacity:0}}
.pt{position:absolute;border-radius:50%;pointer-events:none;opacity:0;z-index:6}
.pt.go{animation:spk .55s cubic-bezier(.2,.7,.4,1) forwards}
@keyframes spk{0%{opacity:1;transform:translate(-50%,-50%) scale(1.2)}60%{opacity:1}100%{opacity:0;transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(.3)}}
#flash{position:absolute;inset:0;pointer-events:none;background:radial-gradient(circle,#fff6 0,#ffd96b22 40%,transparent 70%);opacity:0}
#flash.on{animation:fls .18s ease-out}
@keyframes fls{0%{opacity:1}100%{opacity:0}}
#bossban{position:absolute;left:0;right:0;top:40%;z-index:8;text-align:center;font-family:var(--serif);font-size:30px;letter-spacing:3px;color:var(--gold2);text-shadow:0 0 14px #c0202f,0 2px 4px #000;pointer-events:none;opacity:0}
#bossban.on{animation:ban 1.6s ease-out}
@keyframes ban{0%{opacity:0;transform:scale(1.6)}15%{opacity:1;transform:scale(1)}75%{opacity:1}100%{opacity:0;transform:translateY(-14px)}}
#arena.bossin::after{content:'';position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 70px 20px #c0202f;animation:vig 1.4s ease-out forwards}
@keyframes vig{0%{opacity:1}100%{opacity:0}}
#tip{position:absolute;left:10px;right:10px;bottom:10px;z-index:8;display:flex;align-items:center;gap:8px;background:rgba(26,15,12,.92);border:1px solid var(--gold);border-radius:12px;padding:8px 8px 8px 12px;font-size:13px;text-align:left;box-shadow:0 0 14px rgba(232,176,74,.35);animation:tipp 2s ease-in-out infinite}
#tip[hidden]{display:none}#tip span{flex:1}#tip button{padding:2px 10px;background:transparent}
@keyframes tipp{50%{box-shadow:0 0 20px rgba(232,176,74,.6)}}

/* ---------- док: статы, умения, бусты ---------- */
#dock{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:8px 8px;padding:8px 10px;background:var(--top);position:relative;z-index:5}
#stats{flex:1 1 100%;display:flex;align-items:center;gap:14px;font-size:12px;color:var(--mut)}
.st{display:flex;align-items:center;gap:6px}
.st .ico{width:16px;height:16px;color:var(--gold)}
.st div{display:flex;gap:5px;align-items:baseline}
.st b{color:var(--tx);font-size:13px}
.st small,.st b{white-space:nowrap}
.st.rg{flex:1;gap:8px;min-width:60px}
.st .rgi{display:none}
@media (max-width:430px){.st.rg small{display:none}.st .rgi{display:block;flex:none}#stats{gap:12px}}
#rage{flex:1;height:5px;border-radius:3px;background:var(--chip);overflow:hidden}
#rageb{display:block;height:100%;width:0;background:var(--gold)}
#rage.on #rageb{background:#ff5a2a;box-shadow:0 0 10px #ff5a2a}
#skills{display:flex;gap:6px}
#skills button{position:relative;width:56px;height:56px;padding:0;border-radius:14px;background:#241917;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;overflow:hidden}
#skills button .ico{width:24px;height:24px;color:var(--tx2)}
.sk-n{font-size:10px;font-weight:600;color:var(--mut);line-height:1;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 3px}
.sk-k{position:absolute;top:3px;left:6px;font-size:10px;color:var(--mut2);display:none}
.sk-c{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:700;color:var(--tx);background:conic-gradient(rgba(10,6,5,.78) var(--p,100%),rgba(10,6,5,.3) 0)}
#skills button[data-st="rdy"]{border-color:var(--gold);box-shadow:0 0 0 3px rgba(232,176,74,.2)}
#skills button[data-st="rdy"] .ico{color:var(--gold)}#skills button[data-st="rdy"] .sk-n{color:var(--tx)}
#skills button[data-st="on"]{border-color:#ff8a5b;background:#3a1d12;box-shadow:0 0 12px rgba(255,120,60,.5)}
#skills button[data-st="on"] .ico,#skills button[data-st="on"] .sk-n{color:#ffb38a}
#skills button[data-st="lock"]{opacity:.5}
#skills button[data-st="na"]{opacity:.55}
#skills button:disabled{opacity:1}#skills button[data-st="lock"]:disabled,#skills button[data-st="na"]:disabled{opacity:.5}
#ads{flex:1 1 120px;display:flex;flex-direction:column;gap:5px;min-width:0}
#ads button{height:26px;padding:0 8px;font-size:11px;border-radius:8px;display:flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
#ads button.ad::before{content:'';flex:none;width:14px;height:14px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='3'/%3E%3Cpath d='M10 9v6l5-3z' fill='black'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='3'/%3E%3Cpath d='M10 9v6l5-3z' fill='black'/%3E%3C/svg%3E") center/contain no-repeat;color:var(--gold)}
#ads button.act{opacity:1;color:var(--gold2);border-color:rgba(232,176,74,.55);background:linear-gradient(rgba(232,176,74,.28),rgba(232,176,74,.28)) left/var(--w,100%) 100% no-repeat,rgba(232,176,74,.1)}
#ads button.act::before{display:none}
#ads #bRetry{height:36px;font-size:13px;font-weight:700;background:var(--gold);color:var(--ink);border-color:var(--gold)}
#ads #bRetry[hidden],#ads #bSave[hidden]{display:none}
#ads:has(#bRetry:not([hidden])){flex-basis:100%;flex-direction:row}
#ads:has(#bRetry:not([hidden])) button{flex:1}
body.pf-cg #bHermes,body.pf-cg #bChest,body.pf-cg #bSave{display:none}
body.noads #bHermes,body.noads #bChest,body.noads #bSave{display:none}

/* ---------- панель прокачки ---------- */
#panel{flex:1;min-height:0;display:flex;flex-direction:column;background:var(--panel);border-radius:16px 16px 0 0;margin-top:-6px;position:relative;z-index:6}
main{flex:1;min-height:0;overflow-y:auto;padding:0 10px 12px;overscroll-behavior:contain}
.ph{position:sticky;top:0;z-index:3;background:var(--panel);display:flex;flex-direction:column;gap:10px;padding:12px 0 10px;margin-bottom:2px}
.pht{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.pht h2{margin:0;font-family:var(--serif);font-weight:400;font-size:26px;line-height:1}
.pht span{font-size:12px;color:var(--mut);text-align:right}
.seg{display:flex;padding:3px;border-radius:11px;background:var(--card)}
.seg button{flex:1;height:34px;border:0;border-radius:8px;background:transparent;color:var(--mut);font-size:13px;display:flex;align-items:center;justify-content:center;gap:6px}
.seg button.on{background:#3a2a25;color:var(--tx)}
.seg .dot{width:7px;height:7px;border-radius:50%;background:var(--soul)}
.qs{display:flex;align-items:center;gap:5px}
.qs span{font-size:12px;color:var(--mut);margin-right:2px}
.qs button{flex:1;height:30px;padding:0 4px;font-size:12px;border-radius:8px;background:transparent}
.qs .on{background:var(--gold);border-color:var(--gold);color:var(--ink)}
.row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;margin-bottom:7px;background:var(--card);border:1px solid var(--line);border-radius:12px;font-size:13px}
.row b{font-weight:600}
.row small{color:var(--mut);display:block;font-size:12px;margin-top:2px;line-height:1.35}
.row > div{min-width:0}
.row button{flex:none;min-height:40px}
.row.done{opacity:.55}
.row.up{padding:10px}
.ut{width:42px;height:42px;border-radius:10px;background:var(--chip);display:flex;align-items:center;justify-content:center;color:var(--gold);flex:none;font-family:var(--serif);font-size:22px}
.ut .ico{width:22px;height:22px}
.ub{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.un{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.un b{font-size:14px}
.lv{font-size:11px;font-weight:600;color:var(--tx2);background:#2e2220;padding:1px 7px;border-radius:999px;white-space:nowrap}
.best{display:none;font-size:10px;font-weight:700;letter-spacing:.04em;color:var(--ink);background:var(--gold);padding:2px 6px;border-radius:999px;text-transform:uppercase;white-space:nowrap}
.row.isbest{border-color:rgba(232,176,74,.55);background:var(--card2)}.row.isbest .best{display:inline-block}
.row.dim{opacity:.6}
.ub small{margin:0}.ub small em{font-style:normal;color:var(--tx)}
.m2{display:flex;align-items:center;gap:8px}
.m2 span{flex:1;height:3px;border-radius:2px;background:#33251f;overflow:hidden}.m2 span i{display:block;height:100%;background:var(--gold)}
.m2 small{white-space:nowrap;font-size:11px;color:var(--mut2)}
small.ps{color:var(--mut2)}small.ps.on{color:#c9b98a}
.buy{width:96px;min-height:48px;padding:4px;border:0;border-radius:10px;background:var(--gold);color:var(--ink);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px}
.buy b{font-size:13px}.buy span{font-size:11px;display:flex;align-items:center;gap:4px;font-weight:600}
.buy:disabled{background:#3a2c22;color:var(--mut);opacity:1}
.buy i.coin{background:#7a5212;box-shadow:inset 0 0 0 2px #5a3a0a}
.buy:disabled i.coin{background:var(--gold);box-shadow:inset 0 0 0 2px #9a6a1c;opacity:.6}
.row button:not(.buy):not(:disabled){border-color:rgba(232,176,74,.45)}


/* ---------- разделы ---------- */
nav{flex:none;display:flex;background:#120b0a;border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
nav button{position:relative;flex:1 1 0;min-width:0;height:58px;padding:0;border:0;border-radius:0;background:transparent;color:var(--mut2);font-size:11px;font-weight:500;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}
nav button .lb{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 2px}
nav button.on{color:var(--gold)}
nav button.x{display:none}
nav.open{flex-wrap:wrap}nav.open button{flex:1 0 20%}
nav.open button.x{display:flex;order:-1;flex:1 0 25%;border-bottom:1px solid var(--line)}
nav .bd{position:absolute;top:7px;left:calc(50% + 6px);min-width:16px;height:16px;border-radius:8px;background:var(--red);color:#fff;font-size:10px;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 4px}
nav .bd:empty:not(.dot){display:none}nav .bd.dot{min-width:8px;width:8px;height:8px;padding:0;top:9px}
#adwait[hidden],nav button[hidden]{display:none}

/* ---------- окна ---------- */
#modal{position:fixed;inset:0;z-index:50;background:rgba(5,3,3,.78);display:flex;align-items:center;justify-content:center;padding:20px}
#modal[hidden]{display:none}
#mbox{background:var(--panel);border:1px solid rgba(232,176,74,.4);border-radius:16px;padding:20px;text-align:center;max-width:360px;width:100%;box-shadow:0 20px 60px rgba(0,0,0,.6);max-height:90vh;overflow:auto}
#mbox h3{font-family:var(--serif);font-weight:400;font-size:26px;margin:0 0 10px}
#mbox p{color:var(--tx2);line-height:1.45}
#mbox button{margin:6px 3px;min-height:40px}
#mbox input[type=range]{width:100%;accent-color:var(--gold)}
#adwait{position:fixed;inset:0;z-index:9999;background:#000b;display:flex;align-items:center;justify-content:center;font-size:2rem}
#dev{position:fixed;left:0;right:0;top:0;z-index:99999;display:flex;flex-direction:column;background:#000e;color:#9f9;font:12px/1.35 monospace;padding:6px;padding-top:calc(6px + env(safe-area-inset-top));user-select:text}
#dev[hidden]{display:none}
#devq{display:flex;flex-wrap:wrap;gap:3px;margin-bottom:4px}
#devout{overflow-y:auto;white-space:pre-wrap;min-height:60px;max-height:34vh;margin-bottom:4px}
#devrow{display:flex;gap:4px}#devin{flex:1;min-width:0;background:#111;color:#9f9;border:1px solid #3a3;padding:5px;font:inherit}
#dev button{font:inherit;padding:3px 7px;background:#132;border:1px solid #3a3;border-radius:4px;color:#9f9}

/* ---------- широкий экран (ПК, 16:9): бой слева, прокачка справа, разделы — рейка с краю ---------- */
@media (min-aspect-ratio:5/4) and (min-width:600px){
 #app{display:grid;grid-template-columns:minmax(0,1fr) clamp(340px,34vw,480px) 80px;grid-template-rows:auto minmax(0,1fr) auto;grid-template-areas:"top top top" "arena panel nav" "dock panel nav"}
 #top{grid-area:top;flex-wrap:nowrap;gap:20px;padding:0 14px 0 20px;height:60px}
 .brand{display:block}
 .actbox{order:0;flex:0 1 380px}
 .actl{font-size:13px}
 .curs{flex:none;margin-left:auto}
 .cur{height:40px;padding:0 12px}.cur small{display:block}.cur b{font-size:15px}
 #arena{grid-area:arena;grid-row:2/4;height:auto;min-height:0}
 #foe{top:20px;left:50%;right:auto;transform:translateX(-50%);width:min(520px,calc(100% - 40px));align-items:center;gap:8px}
 #mname{font-size:30px}.meta{font-size:13px;justify-content:center}
 #hpbar{width:100%;height:22px;border-radius:11px}#hptxt{font-size:12px}
 #monster{right:14%;bottom:calc(var(--dock) + 10px)}
 #monster.img{width:min(320px,44vh);height:min(320px,44vh)}#monster.img.boss{width:min(350px,50vh);height:min(350px,50vh)}
 #hero{bottom:calc(var(--dock) + 6px)}#hero.img{left:16px;width:min(230px,32vh);height:min(230px,32vh)}
 #chest{top:132px;right:20px}
 #tip{left:50%;right:auto;transform:translateX(-50%);width:min(520px,calc(100% - 40px));bottom:calc(var(--dock) + 12px)}
 #dock{grid-area:dock;align-self:end;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:10px 16px;padding:0 20px 16px;background:linear-gradient(rgba(14,9,8,0),rgba(14,9,8,.7) 40%)}
 #stats{flex:0 0 auto;flex-direction:column;align-items:flex-start;gap:8px;width:170px}
 .st .ico{width:20px;height:20px}.st div{flex-direction:column;gap:0;line-height:1.15}.st small{font-size:11px;color:var(--mut)}.st b{font-size:16px}
 .st.rg{flex-direction:column;align-items:stretch;gap:5px;width:100%}.st.rg small{font-size:11px}
 #rage{flex:none;width:100%}
 #skills{gap:10px}
 #skills button{width:68px;height:68px;border-radius:16px}
 #skills button .ico{width:28px;height:28px}.sk-n{font-size:11px}.sk-k{display:block}.sk-c{font-size:16px}
 #ads{flex:0 1 230px;gap:8px}
 #ads button{height:36px;font-size:13px;border-radius:10px;background:rgba(20,12,10,.85)}
 #ads button.act{background:linear-gradient(rgba(232,176,74,.3),rgba(232,176,74,.3)) left/var(--w,100%) 100% no-repeat,rgba(20,12,10,.85)}
 #ads #bRetry{height:44px;background:var(--gold)}
 #panel{grid-area:panel;border-radius:0;margin:0;border-left:1px solid var(--line)}
 main{padding:0 18px 18px}
 .ph{padding:18px 0 12px}.pht h2{font-size:32px}.pht span{font-size:13px}
 .row{font-size:14px}.un b{font-size:15px}.ub small{font-size:13px}
 .buy{width:124px;min-height:52px}.buy b{font-size:14px}.buy span{font-size:12px}
 .ut{width:44px;height:44px}
 nav{grid-area:nav;flex-direction:column;align-items:center;gap:4px;padding:12px 0;border-top:0;border-left:1px solid var(--line)}
 nav button,nav button.x{display:flex;order:0;flex:none;width:70px;height:62px;border-radius:12px;border:0}
 nav button:hover{background:#221816;color:var(--tx)}
 nav button.on{background:var(--chip);color:var(--tx)}nav button.on .ico{color:var(--gold)}
 nav button.on::before{content:'';position:absolute;left:-5px;top:15px;width:3px;height:32px;border-radius:2px;background:var(--gold)}
 nav [data-t="pres"]{margin-bottom:14px}nav [data-t="pres"]::after{content:'';position:absolute;bottom:-9px;left:15px;right:15px;height:1px;background:var(--line2)}
 nav #more{display:none}
 nav .bd{top:6px;left:auto;right:12px}nav .bd.dot{top:9px;right:16px}
}
@media (min-aspect-ratio:5/4) and (min-width:600px) and (max-height:620px){
 :root{--dock:96px}
 #top{height:52px}.cur{height:36px}.cur small{display:none}
 #foe{top:12px;gap:5px}#mname{font-size:24px}
 #skills button{width:58px;height:58px}#skills button .ico{width:24px;height:24px}.sk-n{font-size:10px}
 #stats{gap:5px}.st b{font-size:14px}
 #ads button{height:30px;font-size:12px}
 nav button,nav button.x{height:52px}
 .pht h2{font-size:26px}.ph{padding:12px 0 8px}
}
/* низкое окно (встраивание 800×450): рейка разделов плотнее, подсказка под полоской здоровья, чтобы не закрывать умения */
@media (min-aspect-ratio:5/4) and (min-width:600px) and (max-height:520px){
 #top{height:48px}
 nav{gap:2px;padding:5px 0}
 nav button,nav button.x{height:40px;width:66px;font-size:9.5px;gap:2px}
 nav button .ico{width:18px;height:18px}
 nav [data-t="pres"]{margin-bottom:7px}nav [data-t="pres"]::after{bottom:-5px}
 nav button.on::before{top:8px;height:24px}
 nav .bd{top:1px;right:10px}nav .bd.dot{top:4px;right:14px}
 #tip{top:84px;bottom:auto;font-size:12px;padding:6px 6px 6px 10px}
 #foe{top:8px}#mname{font-size:21px}
}
/* ПК поуже (окно игры на площадке ~960×540): бой — в две строки, статы полосой снизу, строки прокачки компактнее */
@media (min-aspect-ratio:5/4) and (min-width:600px) and (max-width:1279px){
 :root{--dock:124px}
 #dock{padding:0 14px 12px;gap:8px 12px;justify-content:center}
 #stats{order:3;flex:1 1 100%;width:auto;flex-direction:row;align-items:center;gap:14px}
 .st div{flex-direction:row;gap:5px;align-items:baseline}.st b{font-size:13px}.st .ico{width:16px;height:16px}
 .st.rg{flex:1;flex-direction:row;align-items:center;gap:8px;width:auto}#rage{flex:1;width:auto}
 #skills{gap:8px}#skills button{width:58px;height:58px}#skills button .ico{width:24px;height:24px}.sk-n{font-size:10px}
 #ads{flex:1 1 150px;max-width:230px;gap:6px}#ads button{height:28px;font-size:12px}
 #monster.img{width:min(300px,40vh);height:min(300px,40vh)}#monster.img.boss{width:min(320px,44vh);height:min(320px,44vh)}
 #hero.img{width:min(200px,30vh);height:min(200px,30vh)}
 #chest{top:108px;right:12px}
 main{padding:0 12px 12px}
 .row.up{gap:8px;padding:9px}.ut{width:36px;height:36px;font-size:19px}.ut .ico{width:19px;height:19px}
 .buy{width:94px;min-height:46px}.buy b{font-size:13px}.buy span{font-size:11px}
 .un b{font-size:14px}.ub small{font-size:12px}
 .pht span{display:none}
}
@media (max-width:360px){.cur{padding:0 7px}.cur b{font-size:12px}#skills button{width:50px;height:50px}}
/* ---------- вещи: цвет и свечение по редкости ---------- */
.r0{--rc:#a3968a;--rg:rgba(163,150,138,.16)}
.r1{--rc:#4fa3ff;--rg:rgba(79,163,255,.24)}
.r2{--rc:#b27bff;--rg:rgba(178,123,255,.26)}
.r3{--rc:#ffb340;--rg:rgba(255,179,64,.3)}
.r4{--rc:#ff5f52;--rg:rgba(255,95,82,.32)}
.r5{--rc:#fff0a6;--rg:rgba(255,240,166,.34)}
.r6{--rc:#3fd8a0;--rg:rgba(63,216,160,.34)}
.r7{--rc:#ff8ad8;--rg:rgba(255,138,216,.38)}
.it{position:relative;flex:none;width:44px;height:44px;border-radius:11px;display:inline-flex;align-items:center;justify-content:center;color:var(--rc);
 border:1.5px solid var(--rc);background:radial-gradient(circle at 50% 35%,var(--rg),rgba(20,13,11,.95) 72%);overflow:hidden}
.it .ico{width:24px;height:24px;stroke-width:1.7}
.it.r3,.it.r4{box-shadow:0 0 10px var(--rg)}
.it.r5,.it.r6{box-shadow:0 0 14px var(--rg),inset 0 0 8px var(--rg)}
.it.r7{border-color:transparent;box-shadow:0 0 16px var(--rg);background:radial-gradient(circle at 50% 35%,var(--rg),rgba(20,13,11,.95) 72%) padding-box,conic-gradient(from var(--a,0deg),#ff8ad8,#ffd36a,#6ff2c2,#6fb8ff,#c58aff,#ff8ad8) border-box;animation:prim 4s linear infinite}
.it.r5::after,.it.r6::after,.it.r7::after{content:'';position:absolute;inset:-40%;background:linear-gradient(115deg,transparent 42%,rgba(255,255,255,.28) 50%,transparent 58%);animation:sheen 3.2s ease-in-out infinite}
@property --a{syntax:'<angle>';inherits:false;initial-value:0deg}
@keyframes prim{to{--a:360deg}}
@keyframes sheen{0%,55%{transform:translateX(-60%)}100%{transform:translateX(60%)}}
.it.none{--rc:#4a3a33;--rg:transparent;border-style:dashed;color:#5e4c43}
.it.sm{width:22px;height:22px;border-radius:6px;vertical-align:-6px;border-width:1px;box-shadow:none}.it.sm .ico{width:14px;height:14px}.it.sm::after{display:none}
.eqc{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px;margin-bottom:7px}
.eqh{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:10px;font-size:13px}
.eqh span{color:var(--mut)}.eqh em{font-style:normal;color:var(--gold);font-weight:700;font-variant-numeric:tabular-nums}
.eqg{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.slot{display:flex;flex-direction:column;align-items:center;text-align:center;gap:2px;padding:8px 4px;border-radius:10px;background:#1a1210;min-width:0}
.slot .it{margin-bottom:4px}
.slot b{font-size:12px;font-weight:600}.slot small{font-size:11px;color:var(--mut);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
small.rt{color:var(--rc)!important}
.slot.empty b{color:var(--mut)}
.row.mrg{align-items:center}
.lad{display:flex;align-items:center;flex-wrap:wrap;gap:3px 4px;margin-top:8px;font-size:10px;color:var(--mut2)}
.gem{display:inline-block;width:10px;height:10px;border-radius:3px;transform:rotate(45deg);background:var(--rc);box-shadow:0 0 6px var(--rg);flex:none}
.gem.r7,.rh.r7 .gem{background:conic-gradient(#ff8ad8,#ffd36a,#6ff2c2,#6fb8ff,#c58aff,#ff8ad8)}
.rh{display:flex;align-items:center;gap:8px;margin:14px 2px 7px;font-size:12px;color:var(--mut)}
.rh b{color:var(--rc);font-size:13px;font-weight:700;letter-spacing:.02em}
.rh em{margin-left:auto;font-style:normal;color:var(--mut2)}
.rh::after{content:'';order:2;flex:1;height:1px;background:linear-gradient(90deg,var(--rc),transparent);opacity:.35}
.rh em{order:3}
.row.itr{gap:10px;padding:10px;border-color:color-mix(in srgb,var(--rc) 22%,transparent)}
.rn{font-size:12px;font-weight:600;color:var(--rc)}
.cnt{font-size:12px;font-weight:700;color:var(--tx);background:#2e2220;padding:1px 7px;border-radius:999px}
.bt{font-size:10px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--ink);background:#7fdc8f;padding:2px 6px;border-radius:999px;white-space:nowrap}
.itr .m2 span i{background:var(--rc)}
.ia{display:flex;flex-direction:column;gap:5px;flex:none}
.ia button{min-height:34px;padding:4px 10px;font-size:12px}
.ia button.pri{background:var(--gold);border-color:var(--gold);color:var(--ink)}
@media (min-aspect-ratio:5/4) and (min-width:600px) and (min-height:621px){.it{width:48px;height:48px}.it .ico{width:26px;height:26px}.it.sm{width:22px;height:22px}.it.sm .ico{width:14px;height:14px}}
/* ---------- дары и дом ---------- */
.it.sl{--rc:#a98bff;--rg:rgba(169,139,255,.26)}
.hb.h0{--rc:#ff9a52;--rg:rgba(255,154,82,.28)}.hb.h1{--rc:#6fd28a;--rg:rgba(111,210,138,.26)}.hb.h2{--rc:#6fb8ff;--rg:rgba(111,184,255,.26)}
.it.big{width:52px;height:52px;border-radius:13px}.it.big .ico{width:28px;height:28px}
.alt{position:relative;overflow:hidden;background:radial-gradient(120% 90% at 0% 0%,rgba(169,139,255,.18),transparent 60%),var(--card);border:1px solid rgba(169,139,255,.35);border-radius:14px;padding:14px;margin-bottom:7px;display:flex;flex-direction:column;gap:12px}
.alt-h{display:flex;align-items:center;gap:12px}.alt-h b{font-family:var(--serif);font-weight:400;font-size:22px;display:block;line-height:1.1}.alt-h small{color:var(--mut);font-size:12px}
.alt-s,.alt-g{display:flex;gap:8px}
.alt-s > div,.alt-g > div:not(.arr){flex:1;display:flex;flex-direction:column;gap:2px;padding:9px 11px;border-radius:10px;background:rgba(10,6,5,.35)}
.alt small{color:var(--mut);font-size:11px;margin:0}
.alt-s b,.alt-g b{font-size:18px;font-variant-numeric:tabular-nums;display:flex;align-items:center;gap:6px}
.alt-g b{color:#cbb8ff}.alt-g .arr{align-self:center;color:var(--soul);font-size:18px}
.alt-n{line-height:1.4}
.cyc{display:flex;flex-direction:column;gap:6px;width:100%}.cyc .seg{flex-wrap:wrap}.cyc .seg{background:rgba(10,6,5,.35)}.cyc .seg button{min-width:44px;font-family:var(--serif);font-size:16px}.cyc .seg button.on{background:#b79bff;color:#160d2e}.alt-c{color:var(--ember)!important}.alt-c:empty{display:none}
.soulb{height:46px;border:0;border-radius:11px;background:linear-gradient(180deg,#b79bff,#8d6cf0);color:#160d2e;font-size:15px;font-weight:700}
.soulb:disabled{background:#2e2540;color:var(--mut);opacity:1}
.sech{display:flex;align-items:baseline;justify-content:space-between;margin:14px 2px 8px;font-size:12px;color:var(--mut)}.sech b{font-size:13px;color:var(--tx)}
.row.tal .m2 span i{background:var(--soul)}
.row.tal.mx{border-color:rgba(169,139,255,.3)}
.buy.soul{background:linear-gradient(180deg,#b79bff,#9476f2);color:#160d2e}
.buy.soul:disabled{background:#2e2540;color:var(--mut)}
.buy.nec{background:linear-gradient(180deg,#f0995a,#d9773a);color:#2a1206}.buy.nec:disabled{background:#3a2a22;color:var(--mut)}
.buy i.soul{background:#3b2780;box-shadow:inset 0 0 0 2px #241654}.buy:disabled i.soul{background:var(--soul);box-shadow:inset 0 0 0 2px #6448c9;opacity:.6}
.buy i.nectar{background:#7a3410;box-shadow:none}
.ub small.nowv{color:var(--mut2)}.ub small.nowv em{font-weight:700}
.hnote{font-size:12px;color:var(--mut);margin:0 2px 8px}
.row.hb{gap:12px;padding:12px;border-color:color-mix(in srgb,var(--rc) 25%,transparent);background:radial-gradient(90% 120% at 0% 50%,var(--rg),transparent 55%),var(--card)}
.hb .it{color:var(--rc);border-color:var(--rc);box-shadow:0 0 12px var(--rg)}
.hb .m2 span i{background:var(--rc);transition:width .2s}
.m2.bld{gap:8px}.m2.bld span{height:5px}.m2.bld small{color:var(--tx2)}
/* ---------- задания, награды, подвиги ---------- */
.it.c0{--rc:#ffcf4a;--rg:rgba(255,207,74,.26)}.it.c1{--rc:#d68b4f;--rg:rgba(214,139,79,.28)}.it.c2{--rc:#cdd6e3;--rg:rgba(205,214,227,.24)}.it.c3{--rc:#ffcc4d;--rg:rgba(255,204,77,.32)}
.it.nc{--rc:#f0995a;--rg:rgba(240,153,90,.28)}.it.h0{--rc:#ff9a52;--rg:rgba(255,154,82,.28)}
.it.q{--rc:#c9b9a8;--rg:rgba(201,185,168,.14)}.it.fd{--rc:#7fdc8f;--rg:rgba(127,220,143,.14)}.it.fl{--rc:#6f5f55;--rg:transparent}
.it.c3,.it.c0{box-shadow:0 0 10px var(--rg)}
.dly{background:radial-gradient(110% 90% at 0% 0%,rgba(255,204,77,.14),transparent 60%),var(--card);border:1px solid rgba(255,204,77,.3);border-radius:14px;padding:12px;margin-bottom:7px;display:flex;flex-direction:column;gap:12px}
.dly-h{display:flex;align-items:center;gap:12px}.dly-h .ub b{font-size:15px}.dly-h .ub small{margin:0}
.days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}
.day{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:58px;padding:6px 2px;border-radius:9px;background:rgba(10,6,5,.35);border:1px solid var(--line);text-align:center}
.day small{font-size:10px;color:var(--mut2);margin:0}.day b{font-size:10px;font-weight:700;display:flex;align-items:center;gap:3px;font-variant-numeric:tabular-nums}
.day b i.coin{width:9px;height:9px}.day span{font-size:9px;display:flex;align-items:center;gap:2px;color:var(--tx2)}.day span i{width:8px;height:8px}
.day .ico{width:18px;height:18px;color:#7fdc8f}
.day.got{opacity:.55}.day.cur{border-color:var(--gold);background:rgba(255,204,77,.12);box-shadow:0 0 10px rgba(255,204,77,.25)}.day.cur small{color:var(--gold2)}
.day.big{border-color:rgba(169,139,255,.45)}
.buy .ico{width:20px;height:20px}
.row.qr .m2 span i{background:var(--gold)}.row.qr.rdy{border-color:rgba(255,204,77,.5);background:var(--card2)}
.row.qr.done,.row.fr.done{opacity:.6}
small.rw{display:flex!important;align-items:center;gap:4px;flex-wrap:wrap}small.rw i{width:10px;height:10px}
.row.qb{display:block}.row.qb .ub{gap:6px}.row.qb .m2 span i{background:#f0995a}
.note{font-size:12px;color:var(--ember);background:rgba(242,160,122,.08);border:1px solid rgba(242,160,122,.25);border-radius:10px;padding:9px 12px;margin-bottom:7px}
.necc{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:6px 12px;background:radial-gradient(110% 90% at 0% 0%,rgba(240,153,90,.16),transparent 60%),var(--card);border:1px solid rgba(240,153,90,.32);border-radius:14px;padding:12px;margin:14px 0 2px}
.necc div{display:flex;flex-direction:column}.necc small{font-size:11px;color:var(--mut)}.necc b{font-size:22px;font-variant-numeric:tabular-nums}
.necc p{grid-column:1/-1;margin:0;font-size:12px;color:var(--mut);line-height:1.4}
.row.shp{gap:10px}
.cosg{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:7px}
.cos{display:flex;flex-direction:column;align-items:center;gap:5px;padding:10px 6px;border-radius:12px;background:var(--card);border:1px solid var(--line);min-height:92px}
.cos.on{border-color:var(--gold);box-shadow:0 0 0 2px rgba(232,176,74,.2)}
.cos small{font-size:11px;color:var(--mut);display:flex;align-items:center;gap:4px}.cos.on small{color:var(--gold2)}
.cos b{font-size:12px;font-weight:600}
.cos .sk{width:44px;height:44px;border-radius:11px;background:#1a1210;display:flex;align-items:center;justify-content:center;font-size:26px}
.cos .hi{width:40px;height:40px;background:url(img/hero.webp) center/contain no-repeat}
.cos .sw{width:100%;height:30px;border-radius:8px;box-shadow:inset 0 0 0 1px var(--line2)}
.cos:disabled{opacity:.55}
.row.fr.rdy{border-color:rgba(255,204,77,.5);background:var(--card2)}
.row.fr.lock .m2 span i{background:#8a7868}

/* ---- превью рисованных иконок ---- */
.pi{width:100%;height:100%;object-fit:contain;display:block;pointer-events:none}
.it.pic{padding:0;background:radial-gradient(circle at 50% 45%,var(--rg),rgba(20,13,11,.9) 70%)}
.it.pic .pi{width:118%;height:118%;margin:-9%}
.it.pic.sm .pi{width:120%;height:120%}
.it.none.pic .pi{opacity:.22;filter:grayscale(1)}
.ut.pic{background:none;width:46px;height:46px}.ut.pic .pi{width:120%;height:120%;margin:-10%}
#skills button .pi{width:44px;height:44px;margin-top:-2px}
@media (min-aspect-ratio:5/4) and (min-width:600px){#skills button .pi{width:52px;height:52px}}
#skills button[data-st="cd"] .pi,#skills button[data-st="na"] .pi{filter:saturate(.5) brightness(.8)}
#chest .ci{width:30px;height:30px;margin:-4px 0 -4px -4px}
/* валюта — картинки везде */
i.coin,i.soul,i.nectar,.buy i.coin,.buy:disabled i.coin,.buy i.soul,.buy i.nectar,.buy:disabled i.soul{width:16px;height:16px;border-radius:0;box-shadow:none;transform:none;opacity:1;background:center/contain no-repeat;vertical-align:-3px;filter:drop-shadow(0 1px 1px rgba(0,0,0,.45))}
i.coin,.buy i.coin,.buy:disabled i.coin{background-image:url(img/icons/coin_s.webp)}
i.soul,.buy i.soul,.buy:disabled i.soul{background-image:url(img/icons/icon_souls_s.webp)}
i.nectar,.buy i.nectar{background-image:url(img/icons/icon_nectar_s.webp)}
.buy:disabled i.coin,.buy:disabled i.soul,.buy:disabled i.nectar{opacity:.7}
.day b i.coin{width:12px;height:12px}.day span i.soul,.day span i.nectar{width:11px;height:11px}
.cur i.coin,.cur i.soul,.cur i.nectar{width:26px;height:26px;vertical-align:middle}
.cur i.coin{background-image:url(img/icons/coin.webp)}.cur i.soul{background-image:url(img/icons/icon_souls.webp)}.cur i.nectar{background-image:url(img/icons/icon_nectar.webp)}
#fairy{font-size:0;filter:none;mix-blend-mode:screen}#fairy img{width:96px;height:96px;animation:flut .5s ease-in-out infinite alternate}
@keyframes flut{to{transform:translateY(-4px) scale(1.04);filter:brightness(1.25)}}
@media (prefers-reduced-motion:reduce){#monster,#hero,#chest,#tip,#bossban.on,.shake,.it,.it::after{animation:none!important}}

small.rw i.coin,small.rw i.nectar{width:14px;height:14px}

#toast{display:flex;align-items:center;gap:6px}#toast .tfi{width:48px;height:48px;margin:-12px 0;filter:drop-shadow(0 0 6px rgba(255,210,120,.6))}#toast i.coin,#toast i.nectar{width:20px;height:20px}

.cosoff .soon{flex:none;width:40px;height:40px;display:flex;align-items:center;justify-content:center;color:var(--mut)}.cosoff .soon .ico{width:20px;height:20px}

/* крупнее область касания у феи и сундука добычи */
#fairy::before,#chest::before{content:'';position:absolute;inset:-14px}
#fairy{touch-action:manipulation}#chest{touch-action:manipulation}

/* подсказка не перехватывает касания: сквозь неё можно бить монстра, ловить фею и открывать добычу; нажимается только крестик */
#tip{pointer-events:none}#tip button{pointer-events:auto}

/* умения: картинка на всю кнопку, подпись — полоской поверх низа (раньше подпись не помещалась и обрезалась) */
#skills button .pi{position:absolute;inset:1px;width:calc(100% - 2px);height:calc(100% - 2px);margin:0;object-fit:contain}
#skills button .sk-n{position:absolute;left:0;right:0;bottom:0;z-index:2;padding:6px 2px 3px;text-align:center;background:linear-gradient(rgba(10,6,5,0),rgba(10,6,5,.9) 55%);text-shadow:0 1px 2px #000}
#skills button .sk-k{z-index:2;text-shadow:0 1px 2px #000}
#skills button[data-st="lock"] .ico{margin-top:-12px}
/* подсказки начала: пульсирующая подсветка нужной кнопки и кольцо «нажмите сюда» на монстре */
.hl{position:relative;z-index:3;animation:hlp 1.1s ease-in-out infinite!important}
@keyframes hlp{0%,100%{box-shadow:0 0 0 2px rgba(255,217,107,.75),0 0 8px 1px rgba(255,190,80,.3)}50%{box-shadow:0 0 0 3px #ffd96b,0 0 22px 7px rgba(255,190,80,.7)}}
#tapr{position:absolute;z-index:7;width:74px;height:74px;margin:-37px 0 0 -37px;border-radius:50%;border:3px solid #ffd96b;box-shadow:0 0 18px rgba(255,200,90,.8);pointer-events:none;animation:tapr 1.2s ease-out infinite}
#tapr[hidden]{display:none}
@keyframes tapr{0%{transform:scale(.55);opacity:1}100%{transform:scale(1.35);opacity:0}}
@media (prefers-reduced-motion:reduce){.hl{animation:none!important;box-shadow:0 0 0 3px #ffd96b!important}#tapr{animation:none}}
/* телефон боком и узкие окна (600–1000 px): широкая раскладка поуже, шапка без названия игры, статы в одну строку без переполнения */
@media (min-aspect-ratio:5/4) and (min-width:600px) and (max-width:1000px){
 .brand{display:none}
 .actbox{flex:1 1 auto;min-width:0}
 .curs{flex:none;margin-left:auto}
 .cur{padding:0 9px}.cur b{font-size:13px}
 #stats{min-width:0;justify-content:flex-start;gap:10px}
 .st.rg{min-width:34px}.st.rg small{display:none}.st .rgi{display:block;flex:none}
}
@media (min-aspect-ratio:5/4) and (min-width:600px) and (max-width:759px){
 #app{grid-template-columns:minmax(0,1fr) 272px 62px}
 nav button,nav button.x{width:58px;font-size:9px}
 #top{gap:10px;padding:0 10px}
 .cur small{display:none}.cur{height:34px;gap:5px;padding:0 7px}.cur b{font-size:12px}
 .st small{display:none}
 #mname{font-size:19px}
 #monster.img{width:min(220px,40vh);height:min(220px,40vh)}#monster.img.boss{width:min(240px,44vh);height:min(240px,44vh)}
 #hero.img{left:6px;width:min(150px,30vh);height:min(150px,30vh)}
 #skills{gap:6px}#skills button{width:50px;height:50px}
 .buy{width:84px}.row.up{padding:8px;gap:6px}.ut{width:30px;height:30px}
}
/* узкий телефон: полоска «Гнева Олимпа» не вылезает за экран */
@media (max-width:380px){#stats{gap:10px}.st.rg{min-width:30px}.st small{font-size:11px}}
/* низкие горизонтальные экраны (телефон боком, встраивание 800×450): монстр не уходит под полоску здоровья, подсказка — внизу поверх строки статов */
@media (min-aspect-ratio:5/4) and (min-width:600px) and (max-height:520px){
 :root{--dock:96px}
 #tip{top:auto;bottom:6px;font-size:12px;padding:5px 6px 5px 10px}
}
/* очень низкие экраны (телефон боком, высота до 400): все пункты рейки помещаются */
@media (min-aspect-ratio:5/4) and (min-width:600px) and (max-height:400px){
 nav{gap:1px;padding:4px 0;overflow-y:auto}
 nav button,nav button.x{height:35px;font-size:9px;gap:1px}
 nav button .ico{width:16px;height:16px}
 nav [data-t="pres"]{margin-bottom:5px}nav [data-t="pres"]::after{bottom:-3px}
 nav button.on::before{top:6px;height:22px}
}
/* короткий телефон вертикально (360×640, 375×667): арена и док компактнее, чтобы под список прокачки оставалось 2+ строки */
@media (max-aspect-ratio:5/4) and (max-height:700px){
 #arena{height:clamp(190px,30vh,220px)}
 #foe{top:6px;gap:3px}#mname{font-size:18px}.meta{font-size:11px}#hpbar{height:15px}
 #monster.img{width:150px;height:150px;bottom:8px}#monster.img.boss{width:166px;height:166px}
 #tip{font-size:12px;padding:5px 6px 5px 10px;bottom:6px}
 #hero.img{width:124px;height:124px}
 #dock{padding:6px 10px;gap:6px}
 #skills button{width:46px;height:46px;border-radius:12px}#skills button .pi{width:calc(100% - 2px);height:calc(100% - 2px)}.sk-n{font-size:9px}
 .ph{gap:6px;padding:8px 0 6px}.pht h2{font-size:21px}.pht span{display:none}
 .seg button{height:30px}.qs button{height:28px}
 nav button{height:50px}
}
/* пункт меню подсвечивается изнутри: внешнее свечение у рейки перекрывает панель */
nav button.hl{animation:hlpi 1.1s ease-in-out infinite!important}
@keyframes hlpi{0%,100%{box-shadow:inset 0 0 0 2px rgba(255,217,107,.75);background:rgba(255,204,77,.06)}50%{box-shadow:inset 0 0 0 3px #ffd96b,inset 0 0 18px rgba(255,190,80,.45);background:rgba(255,204,77,.14)}}
@media (prefers-reduced-motion:reduce){nav button.hl{animation:none!important;box-shadow:inset 0 0 0 3px #ffd96b!important}}
/* узкая панель (телефон боком): дни входа в две строки 4+3, карточка входа компактнее */
@media (min-aspect-ratio:5/4) and (min-width:600px) and (max-width:759px){
 .days{grid-template-columns:repeat(4,minmax(0,1fr))}
 .dly{padding:10px;gap:10px}.dly-h{gap:8px}.dly-h .it{display:none}.dly-h .ub b{font-size:14px}
 .day{min-height:48px}
}
/* рисованные портреты богов и иконки оружия в строках прокачки (img/gods/g_NN.webp, img/weapons/w_NN.webp, 112 px) */
.ut.pic{width:50px;height:50px;padding:0;overflow:hidden;border-radius:11px;background:#120b0a;box-shadow:inset 0 0 0 1px rgba(232,176,74,.35)}
.ut.pic .pi{width:100%;height:100%;object-fit:cover;border-radius:inherit}
.row.dim .ut.pic .pi{filter:grayscale(.6) brightness(.7)}
@media (min-aspect-ratio:5/4) and (min-width:600px){.ut.pic{width:54px;height:54px}}
@media (min-aspect-ratio:5/4) and (min-width:600px) and (max-width:1279px){.ut.pic{width:46px;height:46px}}
@media (min-aspect-ratio:5/4) and (min-width:600px) and (max-width:759px){.ut.pic{width:40px;height:40px;border-radius:9px}}
/* спрайты вписываются в место под заголовком арены (переменные ставит fitArena() в game.js) */
#monster.img,#monster.img.boss{max-width:var(--mmax,none);max-height:var(--mmax,none)}
#hero.img{max-width:var(--hmax,none);max-height:var(--hmax,none)}
/* телефон вертикально: таймер босса справа в строке этажа, а не отдельной строкой под здоровьем — заголовок ниже, босс крупнее */
@media (max-aspect-ratio:5/4){
 #foe{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:8px}
 #mname{grid-column:1/-1;grid-row:1}
 #foe .meta{grid-column:1;grid-row:2;min-width:0}
 #timer{grid-column:2;grid-row:2;align-self:center;justify-self:end;font-size:12px;padding:2px 10px;white-space:nowrap}
 #hpbar{grid-column:1/-1;grid-row:3}
}
/* иконки в уведомлениях и заголовках окон вместо эмодзи */
#toast .ico{width:1.15em;height:1.15em;vertical-align:-.2em;color:var(--gold)}
#toast i.nectar,#toast i.coin,#toast i.soul{vertical-align:-.15em}
#mbox h3 .ico{width:.95em;height:.95em;vertical-align:-.1em;color:var(--gold)}
#mbox p i.coin,#mbox p i.soul,#mbox p i.nectar{vertical-align:-.15em;margin-right:2px}
/* рисованные иконки вкладок Дом/Дары/Награды/Задания/Подвиги (img/ui/*.webp) */
.it.art{padding:0;overflow:hidden;background:#120b0a;box-shadow:inset 0 0 0 1px rgba(232,176,74,.3)}
.it.art .pi{width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block}
.it.art.big{width:52px;height:52px;border-radius:13px}
.it.art.rdy{box-shadow:0 0 0 2px var(--gold),0 0 12px rgba(255,204,77,.45)}
.it.art.done .pi{filter:saturate(.6) brightness(.8)}
.it.art.off .pi{filter:grayscale(.55) brightness(.62)}
.row.qb{display:flex;align-items:center;gap:10px}
/* строка «Ещё оружия / богов: N» под списком прокачки */
.row.more{opacity:.7;border-style:dashed}.row.more .it{color:var(--mut2)}
/* статистика: плитки в 2 колонки (на широкой панели — по ширине) */
.stg{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:6px}
.stt{display:flex;align-items:center;gap:9px;padding:8px 10px;border-radius:12px;background:var(--card);border:1px solid var(--line);min-width:0}
.stt .it{width:36px;height:36px;border-radius:9px;flex:none}
.stt div{display:flex;flex-direction:column;min-width:0;line-height:1.2}
.stt small{font-size:11px;color:var(--mut);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stt b{font-size:15px;font-variant-numeric:tabular-nums;white-space:nowrap}
@media (max-width:380px){.stg{grid-template-columns:1fr 1fr}.stt{padding:7px 8px;gap:7px}.stt .it{width:30px;height:30px}.stt small{font-size:10px}}
/* справка «Как играть» (кнопка «?» в шапке) */
#mbox:has(.help){max-width:520px;text-align:left}
.help h3{text-align:center;margin:0 0 12px}.help h3 .ico{color:var(--gold)}
.hrow{display:flex;align-items:center;gap:11px;padding:9px 10px;margin-bottom:6px;border-radius:12px;background:var(--card);border:1px solid var(--line)}
.hrow .it{width:44px;height:44px;flex:none}
.hrow div{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.hrow b{font-size:14px}.hrow small{font-size:12.5px;line-height:1.35;color:var(--tx2)}
.hrow>.ico{width:18px;height:18px;flex:none;color:var(--gold);transform:rotate(90deg);opacity:.8}
.hrow.go{cursor:pointer}.hrow.go:hover{border-color:rgba(232,176,74,.45)}
.help>button{display:block;margin:12px auto 0}
@media (max-width:420px){.hrow{gap:9px;padding:8px}.hrow .it{width:38px;height:38px}.hrow small{font-size:12px}}
/* Широкая раскладка (окно VK ~900×650 и похожие): после проигрыша боссу «Перейти к битве» — отдельной строкой во всю ширину,
   кнопки за видео — строкой ниже; раньше все четыре сжимались в 230px и налезали друг на друга */
@media (min-aspect-ratio:5/4) and (min-width:600px){
 #ads:has(#bRetry:not([hidden])){flex:1 1 100%;max-width:none;flex-direction:row;flex-wrap:wrap}
 #ads:has(#bRetry:not([hidden])) button{flex:1 1 0;min-width:0}
 #ads:has(#bRetry:not([hidden])) #bRetry{flex:1 1 100%;order:-1}
 body:has(#bRetry:not([hidden])) #tip{bottom:calc(var(--dockh,var(--dock)) + 8px)}
}

.diag{font-size:10px;color:var(--mut);opacity:.6;margin:4px 0 0}
/* длинные уведомления (покупки в лавке Нектара) переносятся, а не вылезают за край на телефоне */
#toast{display:block;white-space:normal;width:max-content;max-width:calc(100% - 24px);text-align:center;line-height:1.3}
#toast .tfi{vertical-align:middle}

/* Шторка списка (телефон и узкие окна): стрелка над списком раскрывает его на весь экран */
#grip{display:none}
@media not all and (min-aspect-ratio:5/4) and (min-width:600px){
 #grip{flex:none;display:flex;align-items:center;justify-content:center;gap:10px;width:100%;height:24px;margin:0;padding:0;border:0;border-radius:16px 16px 0 0;background:none;color:var(--mut2);touch-action:none;cursor:grab;-webkit-tap-highlight-color:transparent}
 #grip::before,#grip::after{content:'';width:26px;height:3px;border-radius:2px;background:var(--line2)}
 #grip .ico{width:18px;height:18px;transition:transform .25s}
 #grip:active{color:var(--gold)}
 body.sheet #grip .ico{transform:rotate(180deg)}
 #arena{transition:height .25s ease}
 body.sheet #arena{height:0!important;min-height:0!important}
 body.sheet #dock{display:none}
 body.sheet #panel{margin-top:0}
 body.sheet #tip{display:none}
}

/* подсветка обучения внутри списка не должна вылезать поверх закреплённой шапки раздела («Покупать ×1 ×5…») при прокрутке */
#list .hl{z-index:1}

/* Дар Харона: бесплатный сундук по таймеру (CrazyGames Basic Launch / блокировщик рекламы) */
.fcrow.rdy{border-color:rgba(232,176,74,.7);box-shadow:0 0 0 1px rgba(232,176,74,.25),0 0 18px rgba(232,176,74,.18);animation:fcp 2.4s ease-in-out infinite}@keyframes fcp{50%{box-shadow:0 0 0 1px rgba(232,176,74,.45),0 0 26px rgba(232,176,74,.32)}}
.fcr{display:flex;flex-direction:column;gap:6px;margin:6px 0 10px}.fcr p{display:flex;align-items:center;justify-content:center;gap:8px;margin:0;flex-wrap:wrap}.fcn{color:var(--mut);font-size:13px;line-height:1.5}
@media (prefers-reduced-motion:reduce){.fcrow.rdy{animation:none}}
