:root{
  --bg:#0b0910; --panel:#14111b; --panel-2:#1c1826; --panel-3:#241f31; --edge:#3a3150; --edge-2:#544870;
  --text:#f4f0e8; --text-2:#d8d2e4; --muted:#a39cb4; --dim:#6f6882;
  --yellow:#ffd23f; --yellow-d:#c99a12; --red:#ff3b2f; --green:#5ee08a; --tg:#2aabee; --violet:#7c5cff; --pink:#ff5fa2; --teal:#2fd3c1;
  --px:'Press Start 2P',ui-monospace,monospace;
  --body:'Onest',system-ui,-apple-system,'Segoe UI',sans-serif;
  --safe-b:env(safe-area-inset-bottom,0px);
  color-scheme:dark;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--text);font-family:var(--body);overflow:hidden;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;overscroll-behavior:none}
button,input{font:inherit;color:inherit}
a{color:inherit}
:focus-visible{outline:2px solid var(--yellow);outline-offset:2px}
[hidden]{display:none!important}
#screen{position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;display:block;image-rendering:pixelated;touch-action:none}

/* пиксельная рамка */
.pf,.pf>.pi{clip-path:polygon(0 var(--n),var(--n) var(--n),var(--n) 0,calc(100% - var(--n)) 0,calc(100% - var(--n)) var(--n),100% var(--n),100% calc(100% - var(--n)),calc(100% - var(--n)) calc(100% - var(--n)),calc(100% - var(--n)) 100%,var(--n) 100%,var(--n) calc(100% - var(--n)),0 calc(100% - var(--n)))}
.pf{--n:6px;padding:3px;background:var(--edge)}
.pf>.pi{--n:4px;background:var(--panel)}

/* пиксельные иконки */
.ic-coin,.ic-subs,.ic-floppy,.ic-phone,.ic-chat,.ic-star,.ic-lock{display:inline-block;width:16px;height:16px;flex:none;background-size:100% 100%;image-rendering:pixelated;vertical-align:-3px}
.ic-coin{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath fill='%23c99a12' d='M2 0h4v1h1v1h1v4h-1v1h-1v1h-4v-1h-1v-1h-1v-4h1v-1h1z'/%3E%3Cpath fill='%23ffd23f' d='M2 1h4v1h1v4h-1v1h-4v-1h-1v-4h1z'/%3E%3Cpath fill='%23fff1a8' d='M3 2h1v1h-1zM2 3h1v2h-1z'/%3E%3Cpath fill='%23c99a12' d='M4 2h1v4h-1z'/%3E%3C/svg%3E")}
.ic-subs{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath fill='%23ff3b2f' d='M0 1h8v6h-8z'/%3E%3Cpath fill='%23fff' d='M3 2h1v1h1v1h1v1h-1v1h-1v1h-1z'/%3E%3C/svg%3E")}
.ic-floppy{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath fill='%234c8dff' d='M0 0h7l1 1v7h-8z'/%3E%3Cpath fill='%23dfe7ff' d='M2 0h4v3h-4z'/%3E%3Cpath fill='%231b2a55' d='M4 1h1v1h-1z'/%3E%3Cpath fill='%23f4f0e8' d='M1 5h6v3h-6z'/%3E%3C/svg%3E")}
.ic-phone{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath fill='%23d8d2e4' d='M2 0h4v8h-4z'/%3E%3Cpath fill='%237c5cff' d='M2 1h4v5h-4z'/%3E%3Cpath fill='%23ff5fa2' d='M3 2h2v2h-2z'/%3E%3Cpath fill='%2314111b' d='M3 7h2v1h-2z'/%3E%3C/svg%3E")}
.ic-chat{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath fill='%23f4f0e8' d='M0 1h8v5h-5l-2 2v-2h-1z'/%3E%3Cpath fill='%2314111b' d='M2 3h1v1h-1zM4 3h1v1h-1zM6 3h1v1h-1z'/%3E%3C/svg%3E")}
.ic-star{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath fill='%23ffd23f' d='M3 0h2v2h3v2h-1v1h1v3h-2v-1h-2v1h-2v-3h1v-1h-1v-2h3z'/%3E%3C/svg%3E")}
.ic-lock{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath fill='%23a39cb4' d='M2 0h4v1h1v3h-1v-3h-4v3h-1v-3h1z'/%3E%3Cpath fill='%23ffd23f' d='M1 4h6v4h-6z'/%3E%3Cpath fill='%2314111b' d='M3 5h2v2h-2z'/%3E%3C/svg%3E")}

/* кнопки */
.pbtn{--n:4px;display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:48px;padding:0 18px;font-family:var(--px);font-size:12px;line-height:1.4;color:#1a1300;background:var(--yellow);border:0;text-decoration:none;cursor:pointer;box-shadow:inset 0 -5px 0 var(--yellow-d);clip-path:polygon(0 var(--n),var(--n) var(--n),var(--n) 0,calc(100% - var(--n)) 0,calc(100% - var(--n)) var(--n),100% var(--n),100% calc(100% - var(--n)),calc(100% - var(--n)) calc(100% - var(--n)),calc(100% - var(--n)) 100%,var(--n) 100%,var(--n) calc(100% - var(--n)),0 calc(100% - var(--n)));user-select:none;-webkit-user-select:none;text-align:center}
.pbtn:hover{background:#ffdb5c}
.pbtn:active{transform:translateY(2px);box-shadow:inset 0 -2px 0 var(--yellow-d)}
.pbtn[disabled]{opacity:.45;cursor:not-allowed;transform:none}
.pbtn.wide{display:flex;width:100%}
.pbtn.sm{min-height:36px;padding:0 12px;font-size:10px}
.pbtn.ghost{background:#2a2438;color:var(--text);box-shadow:inset 0 -5px 0 #16121f}
.pbtn.ghost:hover{background:#342d45}
.pbtn.tg{background:var(--tg);color:#fff;box-shadow:inset 0 -5px 0 #1b86bd}
.pbtn.red{background:var(--red);color:#fff;box-shadow:inset 0 -5px 0 #a81d14}
.pbtn.green{background:var(--green);color:#0d2416;box-shadow:inset 0 -5px 0 #2f9c58}
.pbtn.go::after{content:"";flex:none;width:8px;height:14px;background:currentColor;clip-path:polygon(0 0,25% 0,25% 14.3%,50% 14.3%,50% 28.6%,75% 28.6%,75% 42.9%,100% 42.9%,100% 57.1%,75% 57.1%,75% 71.4%,50% 71.4%,50% 85.7%,25% 85.7%,25% 100%,0 100%)}
.hbtn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:40px;min-width:40px;padding:0 10px;font-family:var(--px);font-size:11px;color:var(--text);background:rgba(20,17,27,.88);border:0;box-shadow:inset 0 0 0 2px var(--edge);text-decoration:none;cursor:pointer;position:relative}
.hbtn:hover{box-shadow:inset 0 0 0 2px var(--edge-2);background:var(--panel-2)}
.hbtn kbd{font-family:var(--px);font-size:8px;color:var(--muted)}
kbd.k{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 5px;margin-right:4px;font-family:var(--px);font-size:9px;color:var(--text);background:#2a2438;box-shadow:inset 0 -2px 0 #120f18}

/* ---------- HUD ---------- */
.hud{position:fixed;inset:0;z-index:10;pointer-events:none}
.hud>*{pointer-events:auto}
.hud-tl{position:absolute;cursor:pointer}
.hud-tl .pi{padding:10px 12px}
.h-chan{display:flex;justify-content:space-between;align-items:baseline;gap:8px;font-family:var(--px);font-size:10px;line-height:1.4}
.h-chan span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.h-lvl{flex:none;color:var(--yellow)}
.h-xp{height:6px;margin-top:8px;background:#2a2438}
.h-xp i{display:block;height:100%;width:0;background:var(--yellow);transition:width .4s}
.h-stats{display:flex;gap:16px;margin-top:9px;font-family:var(--px);font-size:11px}
.h-stats span{display:inline-flex;align-items:center;gap:6px}
.h-stats em{font-style:normal}
.h-stats em.bump{animation:bump .5s}
@keyframes bump{30%{color:var(--yellow);transform:scale(1.15)}}
.hud-quest{display:flex;flex-direction:column;gap:4px;padding:8px 12px;background:rgba(20,17,27,.82);box-shadow:inset 0 0 0 2px var(--edge);font-size:13px;line-height:1.35;color:var(--text-2)}
.q-k{font-family:var(--px);font-size:8px;color:var(--yellow)}
.hud-tr{position:absolute;display:flex;align-items:center;gap:6px}
.net-chip{display:inline-flex;align-items:center;gap:7px;height:40px;padding:0 10px;font-family:var(--px);font-size:9px;color:var(--muted);background:rgba(20,17,27,.88);box-shadow:inset 0 0 0 2px var(--edge)}
.net-chip i{width:8px;height:8px;background:var(--dim)}
.net-chip.on{color:var(--text-2)}
.net-chip.on i{background:var(--green)}
.net-chip.wait i{background:var(--yellow);animation:blink 1s steps(1) infinite}
.hud-hint{position:absolute;display:flex;gap:14px;align-items:center;padding:9px 14px;font-family:var(--px);font-size:9px;color:var(--text-2);background:rgba(20,17,27,.85);box-shadow:inset 0 0 0 2px var(--edge);white-space:nowrap;transition:opacity .6s}
.hud-hint.fade{opacity:0;pointer-events:none}
.chat-btn{width:52px;height:52px}
.badge{position:absolute;top:-6px;right:-6px;min-width:20px;height:20px;padding:0 5px;display:grid;place-items:center;font-family:var(--px);font-size:8px;background:var(--red);color:#fff}
@keyframes blink{50%{opacity:.15}}

/* подсказка над объектом */
.prompt{position:fixed;z-index:11;transform:translate(-50%,-100%);display:flex;align-items:center;gap:8px;padding:6px 10px 6px 6px;font-family:var(--px);font-size:10px;white-space:nowrap;background:var(--panel);box-shadow:inset 0 0 0 2px var(--yellow);cursor:pointer;animation:bob 1.2s ease-in-out infinite}
.prompt kbd.k{margin:0;background:var(--yellow);color:#1a1300;box-shadow:inset 0 -2px 0 var(--yellow-d)}
.prompt::after{content:"";position:absolute;left:50%;bottom:-6px;margin-left:-6px;border:6px solid transparent;border-bottom:0;border-top-color:var(--yellow)}
@keyframes bob{50%{margin-top:-3px}}

/* баннер «МИССИЯ ВЫПОЛНЕНА» */
.banner{position:fixed;z-index:45;left:0;right:0;top:34%;text-align:center;pointer-events:none;animation:bannerIn .5s cubic-bezier(.2,.9,.3,1.3)}
.b-big{font-family:var(--px);font-size:clamp(20px,4.6vw,46px);line-height:1.2;color:var(--yellow);text-shadow:3px 3px 0 #3a1a00,6px 6px 0 rgba(0,0,0,.45);text-transform:uppercase;letter-spacing:.02em}
.b-small{margin-top:14px;font-family:var(--px);font-size:clamp(10px,1.8vw,16px);color:var(--text);text-shadow:2px 2px 0 #000}
@keyframes bannerIn{from{transform:scale(1.6);opacity:0}}

/* тосты */
.toasts{position:fixed;z-index:44;display:flex;flex-direction:column;align-items:center;gap:6px;pointer-events:none}
.toast{display:flex;align-items:center;gap:10px;max-width:min(520px,calc(100vw - 24px));padding:9px 14px 9px 10px;background:var(--panel);box-shadow:inset 0 0 0 2px var(--edge-2),0 8px 24px rgba(0,0,0,.4);animation:toastIn .35s cubic-bezier(.2,.9,.3,1.2)}
.toast.out{animation:toastOut .3s forwards}
.toast .t-ic{flex:none;display:grid;place-items:center;width:28px;height:28px;background:var(--yellow);color:#1a1300;font-family:var(--px);font-size:12px}
.toast b{display:block;font-family:var(--px);font-size:10px;line-height:1.4;font-weight:400}
.toast small{display:block;margin-top:2px;font-size:12.5px;color:var(--muted)}
@keyframes toastIn{from{transform:translateY(-30px);opacity:0}}
@keyframes toastOut{to{transform:translateY(-20px);opacity:0}}

.announce{position:fixed;z-index:46;padding:12px 18px;font-size:15px;line-height:1.45;text-align:center;background:#2a1f05;color:#ffe9a3;box-shadow:inset 0 0 0 2px var(--yellow)}
.fade{position:fixed;inset:0;z-index:60;background:#000;opacity:0;pointer-events:none;transition:opacity .25s}
.fade.on{opacity:1}
.zoom{position:fixed;inset:0;z-index:70;display:grid;place-items:center;padding:24px;background:rgba(5,4,8,.92);cursor:zoom-out}
.zoom img{max-width:min(1100px,100%);max-height:100%;box-shadow:0 0 0 3px var(--edge)}

/* ---------- титул ---------- */
.title{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:20px;overflow-y:auto;text-align:center;background:radial-gradient(70% 60% at 50% 45%,rgba(11,9,16,.5),rgba(11,9,16,.95))}
.title-in{width:min(560px,100%)}
.title-kick{font-family:var(--px);font-size:10px;color:var(--muted);letter-spacing:.08em}
.title h1{margin:14px 0 0;font-family:var(--px);font-weight:400;font-size:clamp(26px,6vw,52px);line-height:1.25;text-transform:uppercase;color:var(--text);text-shadow:4px 4px 0 #2a0705,8px 8px 0 rgba(0,0,0,.4)}
.title h1 span{display:block;color:var(--yellow)}
.title-lead{margin:18px auto 0;max-width:470px;font-size:15.5px;line-height:1.55;color:var(--text-2)}
.title-menu{display:grid;gap:10px;margin:26px auto 0;max-width:360px}
.title-menu .pbtn{width:100%}
.title-online{margin-top:16px;font-family:var(--px);font-size:9px;color:var(--muted);min-height:12px}
.title-alt{display:inline-block;margin-top:18px;font-size:14px;color:var(--muted)}
.title-warn{margin:16px auto 0;max-width:420px;padding:10px 12px;font-size:13px;line-height:1.45;color:#ffe9a3;background:#2a1f05;box-shadow:inset 0 0 0 2px #6b5210}
.slots{display:grid;gap:8px;text-align:left}
.slot{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;width:100%;padding:12px;background:var(--panel-2);border:0;box-shadow:inset 0 0 0 2px var(--edge);cursor:pointer;text-align:left}
.slot:hover{box-shadow:inset 0 0 0 2px var(--yellow)}
.slot .s-n{font-family:var(--px);font-size:16px;color:var(--yellow)}
.slot b{display:block;font-family:var(--px);font-size:10px;font-weight:400;line-height:1.5}
.slot span{display:block;font-size:12.5px;color:var(--muted)}
.slot.empty b{color:var(--dim)}
.slot canvas{width:32px;height:64px;image-rendering:pixelated}

@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
