:root{
  --bg:#0b0d11;
  --panel:#131720;
  --panel-2:#0f131b;
  --line:#232b38;
  --text:#c9d1d9;
  --dim:#8b94a1;
  --green:#3f7d4e;
  --acid:#8dff2e;
  --green-soft:rgba(63,125,78,.14);
  --red:#8a3b46;
  --radius:12px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg);color:var(--text);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  height:100vh;height:100dvh;overflow:hidden;overscroll-behavior:none;
  line-height:1.4;
  -webkit-tap-highlight-color:transparent;
}
h1,h2,p{margin:0}
button{font-family:inherit;touch-action:manipulation}
:focus-visible{outline:2px solid var(--acid);outline-offset:2px}
::selection{background:rgba(63,125,78,.35)}
::-webkit-scrollbar{width:8px}
::-webkit-scrollbar-thumb{background:#2a3342;border-radius:8px}

#app{max-width:1180px;margin:0 auto;padding:0 14px 8px;height:100vh;height:100dvh;
  display:flex;flex-direction:column;gap:8px;overflow:hidden}

/* Фон склепа: тёмные пятна, туман, дым снизу, пылинки, виньетка. Всё приглушено. */
.bgfx{position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden;background:#0b0d11}
.top,.steps,.stats-row,.layout,.foot{position:relative;z-index:1}
.bgfx .blob{position:absolute;width:40vmax;height:40vmax;border-radius:50%;filter:blur(90px);opacity:.1}
.bgfx .b1{background:#3a5f45;top:-14%;left:-12%;animation:drift1 38s ease-in-out infinite alternate}
.bgfx .b2{background:#2a3450;top:20%;right:-14%;animation:drift2 48s ease-in-out infinite alternate}
.bgfx .b3{background:#4a2530;bottom:-18%;left:22%;width:34vmax;height:34vmax;animation:drift1 55s ease-in-out infinite alternate-reverse}
@keyframes drift1{to{transform:translate(5vw,4vh) scale(1.07)}}
@keyframes drift2{to{transform:translate(-5vw,-3vh) scale(1.05)}}
.bgfx .fog{position:absolute;left:-15%;width:130%;height:20vh;filter:blur(26px);opacity:.5;
  background:linear-gradient(180deg,transparent,rgba(140,160,175,.07),transparent)}
.bgfx .f1{top:30%;animation:fogShift 32s ease-in-out infinite alternate}
.bgfx .f2{top:62%;animation:fogShift 44s ease-in-out infinite alternate-reverse;opacity:.35}
@keyframes fogShift{from{transform:translateX(-4%)}to{transform:translateX(4%)}}
.bgfx .smoke{position:absolute;bottom:-40px;width:130px;height:230px;filter:blur(20px);opacity:0;
  background:radial-gradient(ellipse at 50% 80%,rgba(150,160,175,.13),transparent 70%);
  animation:smokeUp 15s linear infinite}
.bgfx .s1{left:8%}
.bgfx .s2{left:32%;animation-duration:19s;animation-delay:-7s;width:170px}
.bgfx .s3{left:61%;animation-duration:13s;animation-delay:-4s;width:110px}
.bgfx .s4{left:83%;animation-duration:22s;animation-delay:-12s;width:150px}
@keyframes smokeUp{
  0%{opacity:0;transform:translate(0,30px) scale(.9)}
  25%{opacity:.8}
  60%{opacity:.5;transform:translate(24px,-120px) scale(1.1)}
  100%{opacity:0;transform:translate(-18px,-260px) scale(1.25)}
}
.bgfx .dot{position:absolute;bottom:-12px;width:3px;height:3px;border-radius:50%;
  background:#8fa895;opacity:.22;animation:rise linear infinite}
@keyframes rise{to{transform:translateY(-106vh)}}
.bgfx .vig{position:absolute;inset:0;
  background:radial-gradient(ellipse at 50% 38%,transparent 52%,rgba(0,0,0,.55) 100%)}
.no-bg .bgfx{display:none}

.ico{width:20px;height:20px;flex-shrink:0}
.ico.xs{width:14px;height:14px}
.ico.big{width:44px;height:44px}

/* Header */
.top{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 2px 0;flex-shrink:0}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brand-badge{width:40px;height:40px;border:1px solid #2f4a35;border-radius:10px;background:var(--panel);
  display:flex;align-items:center;justify-content:center;color:#b8d9b8;
  box-shadow:0 0 14px rgba(141,255,46,.2),inset 0 0 10px rgba(141,255,46,.07)}
.brand-title{font-size:19px;font-weight:700;letter-spacing:.2px;white-space:nowrap}
.brand-sub{color:var(--dim);font-weight:400;font-size:14px}
.brand-meta{font-size:12px;color:var(--dim)}
.top-btns{display:flex;gap:8px}
.tbtn{width:40px;height:40px;border:1px solid var(--line);background:var(--panel);color:var(--text);
  border-radius:10px;cursor:pointer;display:flex;align-items:center;justify-content:center}
.tbtn:hover{border-color:#3a465a;background:#182030}

/* Steps */
.steps{display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:var(--panel-2);
  border:1px solid var(--line);border-radius:var(--radius);padding:6px 12px;font-size:13px;color:var(--dim);flex-shrink:0}
.steps b{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;
  background:var(--green-soft);color:#b9cfbd;font-size:12px;margin-right:6px}
.steps-sep{opacity:.4}

/* Stats */
.stats-row{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:8px;flex-shrink:0}
.stat{display:flex;align-items:center;gap:8px;background:var(--panel);border:1px solid var(--line);
  border-radius:var(--radius);padding:6px 10px;min-width:0}
.stat .ico{color:#7d8b7f}
.main-stat{border-color:rgba(141,255,46,.3);box-shadow:inset 0 0 18px rgba(141,255,46,.06)}
.main-stat .stat-val{color:var(--acid);text-shadow:0 0 14px rgba(141,255,46,.45)}
.main-stat .ico{color:var(--acid)}
.up.ready .up-cost{color:var(--acid)}
.stat-val{font-size:17px;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.stat-label{font-size:11px;color:var(--dim);text-transform:uppercase;letter-spacing:.6px}

/* Layout: всё в высоту экрана, без прокрутки страницы */
.layout{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1.25fr) minmax(0,1fr);
  gap:10px;flex:1;min-height:0;align-items:stretch}
.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;
  display:flex;flex-direction:column;min-height:0;min-width:0}
.panel-title{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:700;padding:8px 12px;
  border-bottom:1px solid var(--line);color:#d6dce4;flex-shrink:0}
.panel-title .ico{color:#7d8b7f}
.muted{color:var(--dim);font-weight:400;font-size:12px}

/* Arena */
.arena{text-align:center;justify-content:flex-start}
.skull-wrap{position:relative;padding:2px 8px;cursor:pointer;user-select:none;flex-shrink:0}
.skull-wrap::before{content:"";position:absolute;left:50%;top:46%;width:78%;height:46%;
  transform:translate(-50%,-50%);filter:blur(34px);pointer-events:none;
  background:radial-gradient(ellipse,rgba(141,255,120,.17),transparent 70%)}
.skull-btn{width:clamp(160px,32vh,240px);aspect-ratio:1;border:1px solid #2f4a35;border-radius:50%;
  background:radial-gradient(circle at 50% 32%,#1a212d,#10141c 70%);cursor:pointer;padding:11%;transition:transform .08s ease;position:relative;z-index:1;
  box-shadow:0 0 22px rgba(141,255,46,.12),inset 0 0 24px rgba(141,255,46,.05)}
.skull-btn img{width:100%;height:100%;object-fit:contain;pointer-events:none;filter:saturate(.85) brightness(.96) drop-shadow(0 0 16px rgba(141,255,46,.25))}
.skull-btn:active,.skull-wrap:active .skull-btn{transform:scale(.95)}
.skull-btn.hit{transform:scale(.93);box-shadow:0 0 0 2px rgba(141,255,46,.5),0 0 26px rgba(141,255,46,.15)}
.hint{font-size:12.5px;color:var(--dim);padding:6px 12px}
.hint.small{font-size:12px}
.level{height:8px;background:var(--panel-2);border-top:1px solid var(--line)}
.level-fill{height:100%;width:0;background:linear-gradient(90deg,#3f7d4e,#6fae5f);transition:width .35s ease;box-shadow:0 0 8px rgba(141,255,46,.3)}
.level-fill.green{background:linear-gradient(90deg,var(--green),var(--acid));box-shadow:0 0 8px rgba(141,255,46,.5)}
#float-layer{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.float-num{position:absolute;font-weight:700;font-size:17px;color:#b9cfbd;animation:floatUp .9s ease-out forwards;white-space:nowrap}
.float-num.crit{font-size:22px;color:var(--acid)}
@keyframes floatUp{from{opacity:0;transform:translateY(6px)}20%{opacity:1}to{opacity:0;transform:translateY(-70px)}}

/* Shop */
.shop{display:flex;flex-direction:column;overflow-y:auto;min-height:0;flex:1}
.group-h{position:sticky;top:0;z-index:2;background:var(--panel);font-size:11px;font-weight:800;
  text-transform:uppercase;letter-spacing:1.2px;color:#7d8b7f;padding:7px 12px 5px;
  border-bottom:1px solid var(--line)}
.up{display:flex;gap:9px;padding:8px 10px;border-bottom:1px solid var(--line);align-items:center}
.up:last-child{border-bottom:0}
.up-ico{width:36px;height:36px;border:1px solid var(--line);border-radius:9px;background:var(--panel-2);
  display:flex;align-items:center;justify-content:center;color:#8b98a5;flex-shrink:0}
.up.ready .up-ico{color:#c4e3c4;border-color:#3f6b46;box-shadow:0 0 10px rgba(141,255,46,.2)}
.up-body{flex:1;min-width:0}
.up-head{display:flex;justify-content:space-between;gap:8px;font-size:14px}
.up-name{font-weight:700}
.up-lvl{font-size:12px;color:var(--dim);white-space:nowrap}
.up-eff{font-size:12px;color:#9fb3a5;margin:1px 0 6px}
.up.maxed{opacity:.65}
.up-foot{display:flex;justify-content:space-between;align-items:center;gap:8px}
.up-cost{display:inline-flex;align-items:center;gap:5px;font-weight:700;font-size:13px;font-variant-numeric:tabular-nums}
.buy{background:var(--green);border:1px solid #2c5636;color:#eef4ee;border-radius:9px;
  padding:7px 14px;min-height:36px;font-weight:700;font-size:13px;cursor:pointer}
.buy:hover:not(:disabled){background:#478a57}
.buy:not(:disabled){box-shadow:0 0 12px rgba(63,125,78,.55)}
.buy:disabled{background:#1c222c;border-color:var(--line);color:#5d6774;cursor:not-allowed}

/* Side */
.side{display:flex;flex-direction:column;gap:10px;min-height:0;min-width:0;overflow-y:auto}
.reb-body{padding:9px 12px;display:flex;flex-direction:column;gap:7px}
.reb-body .level{border:1px solid var(--line);border-radius:6px;overflow:hidden}
.reb-line{font-size:13.5px;display:flex;align-items:center;gap:6px}
.reb-line .ico{color:#8b98a5}
.reb-btn{display:flex;align-items:center;justify-content:center;gap:8px;background:var(--panel-2);
  border:1px solid #31402f;color:#cfdccf;border-radius:9px;padding:9px;min-height:42px;
  font-weight:700;font-size:14px;cursor:pointer}
.reb-btn:hover:not(:disabled){background:var(--green-soft)}
.reb-btn:disabled{opacity:.45;cursor:not-allowed}
.reb-btn:not(:disabled){box-shadow:0 0 14px rgba(63,125,78,.45)}
.mini-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:var(--line)}
.mini-grid>div{background:var(--panel);padding:7px 4px;text-align:center}
.mini-grid span{display:block;font-size:10px;color:var(--dim);text-transform:uppercase;letter-spacing:.5px}
.mini-grid b{font-size:14px;font-variant-numeric:tabular-nums}
.ach{list-style:none;margin:0;padding:6px;display:grid;grid-template-columns:1fr 1fr;gap:5px;overflow-y:auto;min-height:0}
.ach li{display:flex;align-items:center;gap:7px;background:var(--panel-2);border:1px solid var(--line);
  border-radius:8px;padding:6px 8px;font-size:12px;min-width:0}
.ach-dot{width:8px;height:8px;border-radius:50%;background:#39424f;flex-shrink:0}
.ach li.done{border-color:rgba(141,255,46,.32)}
.ach li.done .ach-dot{background:var(--acid);box-shadow:0 0 8px rgba(141,255,46,.9)}
.ach li.done .ach-name{color:#d6dce4}
.ach-name{flex:1;color:var(--dim);min-width:0}
.ach-rw{font-size:12px;color:var(--dim);font-variant-numeric:tabular-nums}

.foot{display:flex;justify-content:center;align-items:center;gap:6px 12px;flex-wrap:wrap;text-align:center;
  font-size:11px;color:var(--dim);padding:2px 0;flex-shrink:0}
.foot b{color:#a9b3c0;font-weight:600}
.save-state{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--dim)}
.save-dot{width:8px;height:8px;border-radius:50%;background:#39424f}
.save-dot.ok{background:var(--acid);animation:savePulse 2.4s ease-in-out infinite}
@keyframes savePulse{50%{opacity:.5}}

/* Toasts */
.toasts{position:fixed;left:50%;transform:translateX(-50%);bottom:18px;z-index:60;display:flex;
  flex-direction:column;gap:8px;align-items:center;width:min(92vw,420px);pointer-events:none}
.toast{background:#161c26;border:1px solid var(--line);border-radius:10px;padding:9px 14px;
  font-size:13.5px;animation:toastIn .2s ease-out;text-align:center;max-width:100%}
.toast.error{border-color:var(--red)}
@keyframes toastIn{from{opacity:0;transform:translateY(8px)}}

/* In-game confirm: replaces browser confirm() — styled like the game, not the browser */
.confirm-back{z-index:200}
.modal.confirm{text-align:center;padding-bottom:6px;animation:confirmPop .18s ease-out}
@keyframes confirmPop{from{opacity:0;transform:scale(.94) translateY(6px)}}
.confirm-ico{display:flex;justify-content:center;padding:16px 0 6px;color:var(--acid)}
.confirm-ico.danger{color:#c14b59}
.confirm-ico .ico{filter:drop-shadow(0 0 12px rgba(141,255,46,.3))}
.confirm-ico.danger .ico{filter:drop-shadow(0 0 12px rgba(255,60,80,.35))}
.confirm-title{font-size:19px;font-weight:800;letter-spacing:.3px;padding:0 16px}
.confirm-text{font-size:14px;color:var(--text);padding:8px 18px 4px;line-height:1.5}
.btn.ghost{background:transparent}
.btn.danger-solid{background:#6e2a33;border-color:#8a3b46;color:#ffe9ec}
.btn.danger-solid:hover{background:#7d333d}
.maxed-cost{color:var(--dim)}

/* Modal */
.mback{position:fixed;inset:0;background:rgba(0,0,0,.62);z-index:100;display:flex;
  align-items:center;justify-content:center;padding:16px}
.modal{background:#12161e;border:1px solid var(--line);border-radius:14px;width:min(94vw,430px);
  max-height:88vh;overflow:auto}
.mhead{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;
  border-bottom:1px solid var(--line);font-weight:700}
.row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px 14px;
  border-bottom:1px solid var(--line);font-size:14px}
.row input[type=range]{flex:1;max-width:180px;accent-color:var(--green)}
.langs{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.langs button{background:#1c222c;border:1px solid var(--line);color:var(--text);border-radius:8px;
  padding:7px 10px;min-height:34px;font-size:12px;font-weight:700;cursor:pointer}
.langs button.active{background:var(--green);border-color:#2c5636;color:#fff}
.switch{background:#1c222c;border:1px solid var(--line);color:var(--text);border-radius:18px;
  padding:7px 16px;min-height:36px;font-weight:700;font-size:12.5px;cursor:pointer}
.switch.on{background:var(--green);border-color:#2c5636;color:#fff}
.mfoot{display:flex;gap:8px;padding:12px 14px}
.btn{flex:1;border:1px solid var(--line);background:#1a212c;color:var(--text);border-radius:9px;
  padding:11px;min-height:44px;font-weight:700;cursor:pointer;font-size:14px}
.btn.primary{background:var(--green);border-color:#2c5636;color:#fff}
.btn.danger{border-color:var(--red);color:#d8a7ae;background:transparent}
.help{margin:0;padding:14px 14px 4px 34px;font-size:14px;display:flex;flex-direction:column;gap:8px}

/* Bot-check mini-game */
.ver-prog{font-weight:800;color:var(--acid);font-variant-numeric:tabular-nums}
.ver-box{position:relative;height:220px;background:#05080d;border:1px solid var(--line);
  border-radius:10px;margin:4px 14px 14px;overflow:hidden;cursor:crosshair;touch-action:manipulation}
.ver-soul{position:absolute;width:54px;height:54px;margin:-27px 0 0 -27px;border-radius:50%;
  background:radial-gradient(circle,#1c3a24,#0a140e 70%);border:1px solid #3f7d4e;color:var(--acid);
  cursor:pointer;animation:verPop .22s ease-out;box-shadow:0 0 18px rgba(141,255,46,.35)}
@keyframes verPop{from{transform:scale(.3);opacity:0}}

/* Hacker terminal: admin gate / console / panel */
.modal.term{background:#020604;border:1px solid #1d4a28;color:#7dff8a;
  font-family:ui-monospace,Consolas,Menlo,monospace;
  box-shadow:0 0 34px rgba(43,255,100,.12),inset 0 0 60px rgba(20,80,35,.08)}
.term-title{text-align:center;letter-spacing:3px;font-weight:800;padding:12px 12px 4px;
  color:#4dff6e;text-shadow:0 0 12px rgba(77,255,110,.5)}
.term-stage{text-align:center;font-size:12px;color:#2f7a3d}
.term-q{padding:10px 16px 0;font-size:14px}
.term-deny{text-align:center;color:#ff5b6a;font-weight:800;padding-top:8px;animation:denyBlink .15s 4}
@keyframes denyBlink{50%{opacity:.2}}
.term-log{min-height:110px;padding:12px 16px 0;font-size:13px;word-break:break-all}
.term-log .err{color:#ff5b6a}
.term-line{display:flex;gap:8px;align-items:center;padding:10px 16px 16px;color:#4dff6e}
.term-line input{flex:1;background:transparent;border:0;border-bottom:1px solid #1d4a28;
  color:#7dff8a;font:inherit;font-size:16px;caret-color:#4dff6e;border-radius:0}
.term-line input:focus{outline:none;border-color:#4dff6e}
.term-row{display:flex;gap:8px;align-items:center;padding:7px 16px;font-size:13px}
.term-row span{flex:1}
.term-row input{width:110px;background:#04120a;border:1px solid #1d4a28;color:#7dff8a;
  border-radius:6px;padding:7px;font:inherit}
.term-row input:focus{outline:none;border-color:#4dff6e}
.term-row button{background:#0a2a14;border:1px solid #2f7a3d;color:#7dff8a;border-radius:6px;
  padding:7px 12px;min-height:34px;cursor:pointer;font:inherit;font-size:12px}
.term-row button:hover{background:#123a1d}
.modal.term .mfoot .btn{background:#0a2a14;border-color:#2f7a3d;color:#7dff8a}

/* Ban modal: no close button, red on dark */
.banback{background:rgba(24,4,8,.78)}
.modal.ban{text-align:center;border-color:var(--red);padding-bottom:16px}
.ban-ico{color:#c14b59;padding-top:16px}
.ban-title{font-size:23px;font-weight:800;letter-spacing:1px;color:#ff7b88;padding:6px 12px;
  text-shadow:0 0 18px rgba(255,46,76,.4)}
.ban-reason{font-size:13.5px;color:var(--dim);padding:0 18px}
.ban-timer{font-size:36px;font-weight:800;color:var(--acid);font-variant-numeric:tabular-nums;
  padding:8px;text-shadow:0 0 18px rgba(141,255,46,.4)}

/* Нижние вкладки: только телефоны */
.mtabs{display:none}

/* Низкие экраны ПК: чуть компактнее */
@media(max-height:740px){
  .skull-btn{width:clamp(120px,26vh,180px)}
  .up{padding:6px 10px}
  .up-desc{display:none}
  .panel-title{padding:6px 12px}
}

/* Телефоны: один экран, переключение вкладками, без прокрутки страницы */
@media(max-width:860px){
  #app{padding:0 10px 8px;gap:8px}
  .steps,.foot{display:none}
  .brand-title{font-size:16px}
  .brand-meta{display:none}
  .brand-badge{width:34px;height:34px}
  .tbtn{width:38px;height:38px}
  .stat{padding:5px 8px}
  .stat-val{font-size:15px}
  .stat-label{font-size:10px}
  .layout{display:block;flex:1;min-height:0;position:relative}
  .layout .mview{display:none}
  .layout .mview.active{display:flex;max-height:100%}
  .arena.active{justify-content:flex-start}
  .skull-btn{width:clamp(160px,34vh,230px)}
  .side.mview.active{overflow-y:auto}
  .ach{grid-template-columns:1fr}
  .mini-grid{grid-template-columns:repeat(4,1fr)}
  .toasts{bottom:76px}
  .mtabs{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;flex-shrink:0;
    background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:6px}
  .mtabs button{position:relative;display:flex;align-items:center;justify-content:center;gap:7px;
    background:transparent;border:1px solid transparent;color:var(--dim);border-radius:10px;
    padding:10px 4px;min-height:46px;font-size:13px;font-weight:700;cursor:pointer}
  .mtabs button.active{background:var(--green-soft);border-color:#31402f;color:#dfe7df}
  .badge{position:absolute;top:2px;right:8px;min-width:18px;height:18px;border-radius:9px;
    background:var(--acid);color:#0b0d11;font-size:11px;font-weight:800;line-height:18px;padding:0 5px}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms !important;transition-duration:.01ms !important}
  .bgfx{display:none}
}
