:root { --ui: #141a2b; --ui2: #1e2742; --line: #3a4a7a; --txt: #e8eefc; --acc: #ffd24a; --safe-t: env(safe-area-inset-top); --safe-b: env(safe-area-inset-bottom); --safe-l: env(safe-area-inset-left); --safe-r: env(safe-area-inset-right); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html, body { margin: 0; height: 100%; background: #05070d; overflow: hidden; overscroll-behavior: none; touch-action: none; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--txt); }
canvas#c { position: fixed; inset: 0; image-rendering: pixelated; touch-action: none; }
.hidden { display: none !important; }
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
#topleft { position: absolute; left: calc(8px + var(--safe-l)); top: calc(6px + var(--safe-t)); width: 150px; pointer-events: none; }
.bar { height: 14px; background: #0008; border: 2px solid #000a; border-radius: 3px; position: relative; margin-bottom: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; transition: width .1s; }
.bar.hp i { background: linear-gradient(#ff6a7a, #c01838); } .bar.mp i { background: linear-gradient(#6aa8ff, #2a46c0); } .bar.boss i { background: linear-gradient(#ffb04a, #c04010); }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 10px; line-height: 12px; text-shadow: 1px 1px 0 #000; }
#coins { font-size: 11px; color: var(--acc); text-shadow: 1px 1px 0 #000; }
.slot { width: 38px; height: 38px; background: #10162bcc; border: 2px solid var(--line); border-radius: 4px; position: relative; display: flex; align-items: center; justify-content: center; }
.slot.sel { border-color: var(--acc); background: #2a3560cc; }
.slot canvas { width: 28px; height: 28px; image-rendering: pixelated; pointer-events: none; }
.slot .n { position: absolute; right: 2px; bottom: 0; font-size: 10px; text-shadow: 1px 1px 0 #000; pointer-events: none; }
.slot .k { position: absolute; left: 2px; top: 0; font-size: 8px; opacity: .6; pointer-events: none; }
.slot.pick { outline: 2px solid #5cff7a; }
#btns { position: absolute; right: calc(8px + var(--safe-r)); top: calc(6px + var(--safe-t)); display: flex; gap: 6px; }
button { font: inherit; color: var(--txt); background: var(--ui2); border: 2px solid var(--line); border-radius: 6px; padding: 8px 12px; min-height: 44px; min-width: 44px; cursor: pointer; }
button:active { background: #33427a; } button.primary { background: #2f6a3a; border-color: #5cff7a; } button:disabled { opacity: .4; }
#btns button { font-size: 17px; padding: 2px; width: 36px; height: 36px; min-width: 36px; min-height: 36px; background: #10162bcc; }
#mini { position: absolute; right: calc(8px + var(--safe-r)); top: calc(48px + var(--safe-t)); width: 128px; height: 80px; border: 2px solid var(--line); border-radius: 4px; background: #000a; image-rendering: pixelated; }
#bossbar { position: absolute; left: 50%; transform: translateX(-50%); top: calc(52px + var(--safe-t)); width: min(60vw, 420px); text-align: center; font-size: 12px; pointer-events: none; }
#banner { position: absolute; left: 50%; transform: translateX(-50%); top: 30%; font-size: 18px; text-shadow: 2px 2px 0 #000; text-align: center; padding: 6px 14px; opacity: 0; transition: opacity .4s; pointer-events: none; color: var(--acc); max-width: 90vw; }
#banner.on { opacity: 1; }
#interactHint { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); }
#panel, #menu, #loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #000a; z-index: 10; padding: calc(8px + var(--safe-t)) 8px calc(8px + var(--safe-b)); touch-action: pan-y; }
#menu { background: radial-gradient(ellipse at 50% 20%, #1c3a6a 0%, #07101f 70%); z-index: 20; }
#loading { z-index: 30; background: #05070dee; }
.card { zoom: var(--ms, .78); background: var(--ui); border: 2px solid var(--line); border-radius: 10px; padding: 16px; width: min(calc(94vw / var(--ms, .78)), 760px); max-height: 100%; overflow: auto; -webkit-overflow-scrolling: touch; }
#menu .card { width: min(calc(92vw / var(--ms, .78)), 460px); text-align: center; background: #0e1530dd; }
h1 { margin: 0; letter-spacing: 6px; color: var(--acc); text-shadow: 3px 3px 0 #000; } .sub { margin: 4px 0 16px; opacity: .8; font-size: 12px; } .hint { font-size: 10px; opacity: .6; margin-top: 14px; text-align: left; line-height: 1.4; }
#menuBtns button, #menuNew button { display: block; width: 100%; margin: 8px 0; font-size: 16px; }
label { display: block; text-align: left; font-size: 12px; margin: 8px 0; } select, input[type=text], input[type=search] { width: 100%; font: inherit; padding: 10px; background: #0a0f20; color: var(--txt); border: 2px solid var(--line); border-radius: 6px; -webkit-user-select: text; user-select: text; }
.grid { display: grid; gap: 3px; } .grid.g10 { grid-template-columns: repeat(10, 1fr); } .grid.g5 { grid-template-columns: repeat(5, 1fr); }
.grid .slot { width: 100%; aspect-ratio: 1; height: auto; max-height: 52px; }
/* сундук: у каждой вещи подпись с названием */
.grid.lab .slot { aspect-ratio: auto; max-height: none; min-height: 54px; flex-direction: column; justify-content: flex-start; padding: 3px 2px 2px; }
.grid.lab .slot .nm { display: block; font-size: 9px; line-height: 1.1; text-align: center; margin-top: 2px; word-break: normal; overflow-wrap: break-word; padding: 0 1px; color: #fff; text-shadow: 1px 1px 0 #000; pointer-events: none; }
.grid.lab .slot .n { right: 3px; top: 1px; bottom: auto; font-weight: bold; color: var(--acc); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; } .panel-head h2 { margin: 0; font-size: 16px; }
.row { display: flex; align-items: center; gap: 8px; padding: 6px; border: 2px solid #26335c; border-radius: 6px; margin-bottom: 4px; background: #101830; }
.row.ok { border-color: #3c8a4a; } .row.no { opacity: .55; } .row canvas { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.row .t { flex: 1; font-size: 12px; } .row .t small { display: block; opacity: .75; font-size: 10px; } .row .bad { color: #ff7a7a; } .row .good { color: #7aff9a; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } @media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
.tip { font-size: 11px; opacity: .8; margin: 6px 0; line-height: 1.4; }
.equip { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.equip .slot { width: 46px; height: 46px; }
.sel-bar { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
@media (max-height: 430px) { .slot { width: 34px; height: 34px; } }
/* ---- M0: старт, поворот, safe-area ---- */
#start { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; text-align: center; background: radial-gradient(ellipse at 50% 30%, #1c3a6a 0%, #060b18 75%); cursor: pointer; }
#start h1 { font-size: 40px; } #start p { font-size: 18px; animation: pulse 1.4s infinite; margin: 14px 0; } #start small { opacity: .6; font-size: 11px; display: block; max-width: 80vw; }
@keyframes pulse { 50% { opacity: .35; } }
#rotate { position: fixed; inset: 0; z-index: 60; background: #05070d; color: var(--txt); display: none; align-items: center; justify-content: center; text-align: center; font-size: 18px; }
#rotate .rot { font-size: 64px; animation: spin 2s infinite linear; display: inline-block; } @keyframes spin { to { transform: rotate(360deg); } }
@media (orientation: portrait) and (max-width: 900px) { #rotate { display: flex; } }
#updateBar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 70; background: var(--ui); border: 2px solid var(--acc); border-radius: 8px; padding: 6px 10px; display: flex; gap: 10px; align-items: center; font-size: 13px; }
#updateBar button { min-height: 36px; }
#fps { position: absolute; left: calc(8px + var(--safe-l)); bottom: calc(150px + var(--safe-b)); font-size: 10px; background: #000a; padding: 2px 4px; pointer-events: none; }
body { padding: 0; }

/* ---- M2: управление (масштаб --uis, прозрачность --uop, лефти) ---- */
:root { --uis: 1; --uop: .55; --slot: 38px; --sox: 0px; --soy: 0px; }
#hotbar { position: absolute; bottom: calc(8px + var(--safe-b)); left: var(--hbl, 50%); transform: translateX(-50%); display: flex; gap: 3px; touch-action: none; }
#hotbar .slot { width: calc(var(--slot) * var(--uis)); height: calc(var(--slot) * var(--uis)); }
/* зона стика = только сам круг (+ запас 14px): остальная часть экрана принадлежит миру (копание/стройка удержанием) */
#tut { position: absolute; top: calc(58px + var(--safe-t)); left: calc(8px + var(--safe-l)); max-width: min(40vw, 360px); background: #141a2bdd; border: 2px solid var(--acc); border-radius: 8px; padding: 6px 28px 6px 8px; font-size: clamp(11px, 3.2vh, 14px); line-height: 1.25; z-index: 4; display: flex; gap: 6px; align-items: flex-start; pointer-events: auto; }
#tut #tutN { color: var(--acc); font-weight: bold; white-space: nowrap; } #tut button { position: absolute; top: 2px; right: 2px; min-width: 24px; min-height: 24px; padding: 0 4px; font-size: 12px; background: transparent; border: 0; color: #fff; }
#stickZone { position: absolute; left: calc(10px + var(--safe-l) + var(--sox)); bottom: calc(10px + var(--safe-b) + var(--soy)); width: calc(100px * var(--uis) + 28px); height: calc(100px * var(--uis) + 28px); touch-action: none; }
body.lefty #stickZone { left: auto; right: calc(10px + var(--safe-r) + var(--sox)); }
body.floatstick #stickZone { left: 0; bottom: 0; width: calc(34vw + var(--safe-l)); height: 58vh; } body.floatstick.lefty #stickZone { left: auto; right: 0; }
#stick { position: absolute; left: calc(24px + var(--safe-l) + var(--sox)); bottom: calc(24px + var(--safe-b) + var(--soy)); width: calc(100px * var(--uis)); height: calc(100px * var(--uis)); border-radius: 50%; background: rgba(255,255,255,calc(var(--uop) * .3)); border: 2px solid rgba(255,255,255,calc(var(--uop) * .8)); pointer-events: none; }
body.lefty #stick { left: auto; right: calc(24px + var(--safe-r) + var(--sox)); }
#knob { position: absolute; width: calc(42px * var(--uis)); height: calc(42px * var(--uis)); left: calc(29px * var(--uis)); top: calc(29px * var(--uis)); border-radius: 50%; background: rgba(255,255,255,calc(var(--uop) * .9)); }
#rbtns { position: absolute; right: 0; bottom: 0; width: 0; height: 0; touch-action: none; --bs: 1; }
#rbtns button { position: absolute; border-radius: 50%; border: 3px solid rgba(255,255,255,calc(var(--uop) + .1)); background: rgba(30,40,80,calc(var(--uop) * .8)); font-size: calc(19px * var(--uis) * var(--bs)); touch-action: none; padding: 0; width: calc(46px * var(--uis) * var(--bs)); height: calc(46px * var(--uis) * var(--bs)); min-width: 40px; min-height: 40px; }
#rbtns #jump { right: calc(14px + var(--safe-r) + var(--sox)); bottom: calc(14px + var(--safe-b) + var(--soy)); width: calc(68px * var(--uis) * var(--bs)); height: calc(68px * var(--uis) * var(--bs)); font-size: calc(28px * var(--uis) * var(--bs)); }
#rbtns #act { right: calc(92px * var(--uis) * var(--bs) + var(--safe-r) + var(--sox)); bottom: calc(14px + var(--safe-b) + var(--soy)); width: calc(76px * var(--uis) * var(--bs)); height: calc(76px * var(--uis) * var(--bs)); font-size: calc(32px * var(--uis) * var(--bs)); background: rgba(120,40,40,calc(var(--uop) * .9)); }
#rbtns #mode { right: calc(14px + var(--safe-r) + var(--sox)); bottom: calc(92px * var(--uis) * var(--bs) + var(--safe-b) + var(--soy)); }
#rbtns #potion { right: calc(14px + 54px * var(--uis) * var(--bs) + var(--safe-r) + var(--sox)); bottom: calc(98px * var(--uis) * var(--bs) + var(--safe-b) + var(--soy)); }
#rbtns #potion2 { right: calc(14px + 108px * var(--uis) * var(--bs) + var(--safe-r) + var(--sox)); bottom: calc(98px * var(--uis) * var(--bs) + var(--safe-b) + var(--soy)); }
body.lefty #rbtns button { right: auto; }
body.lefty #rbtns #jump { left: calc(14px + var(--safe-l) + var(--sox)); } body.lefty #rbtns #act { left: calc(92px * var(--uis) * var(--bs) + var(--safe-l) + var(--sox)); }
body.lefty #rbtns #mode { left: calc(14px + var(--safe-l) + var(--sox)); } body.lefty #rbtns #potion { left: calc(14px + 54px * var(--uis) * var(--bs) + var(--safe-l) + var(--sox)); } body.lefty #rbtns #potion2 { left: calc(14px + 108px * var(--uis) * var(--bs) + var(--safe-l) + var(--sox)); }
#rbtns #mode.build { background: rgba(40,120,60,.8); }
#btns button, #btns { transform-origin: top right; }
body.desktop #stickZone, body.desktop #stick, body.desktop #rbtns { display: none !important; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; font-size: 13px; } .set-row input[type=range] { width: 55%; }
#death { position: absolute; inset: 0; background: radial-gradient(#400a, #000d); display: flex; align-items: center; justify-content: center; z-index: 20; pointer-events: none; text-align: center; padding: 16px; }
#death h2 { margin: 0 0 8px; font-size: clamp(22px, 6vh, 40px); color: #ff6a7a; } #death .dcard { max-width: 90vw; } #deathWhy { font-size: clamp(13px, 3.4vh, 18px); } #deathT { margin-top: 10px; font-size: clamp(12px, 3vh, 16px); color: var(--acc); }
#panel .slot.goodpre { box-shadow: inset 0 0 0 2px #58d858; } #panel .slot.badpre { box-shadow: inset 0 0 0 2px #d85858; }
#stickZone { z-index: 1; } #hotbar, #rbtns, #btns, #mini { z-index: 3; } #stick { z-index: 2; }

.grid.g4 { grid-template-columns: repeat(4, 1fr); } .grid.g8 { grid-template-columns: repeat(8, 1fr); }
.chestwrap { display: flex; gap: 10px; align-items: flex-start; } .chestcol { flex: 1 1 50%; min-width: 0; } .chestcol.inv { flex-basis: 50%; }
.cbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; } .cbtn { min-height: 30px; min-width: 0; padding: 3px 8px; font-size: 11px; }
@media (max-width: 560px) { .chestwrap { flex-direction: column; } } .ammo-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; } .coin-row { display: flex; gap: 3px; } .coin-row .slot { width: 40px; height: 40px; text-align: center; font-size: 10px; line-height: 1.1; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; touch-action: pan-x; } .tab { white-space: nowrap; flex: none; min-height: 40px; padding: 6px 12px; } .tab.on { background: #2f6a3a; border-color: #5cff7a; }
#buffs { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px; pointer-events: none; } .buff { background: #0008; border-radius: 4px; padding: 1px 3px; font-size: 14px; } .buff small { font-size: 9px; margin-left: 1px; } .buff.bad { background: #5008; }
.slotrow { display: flex; gap: 6px; align-items: stretch; margin: 8px 0; } .slotrow > button { margin: 0 !important; width: auto !important; flex: 1; font-size: 12px !important; text-align: left; } .slotrow > button.mini { flex: none; width: 48px !important; text-align: center; font-size: 18px !important; }

/* ---- M20: оформление меню/загрузки, анимации ---- */
#titleBg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 4; image-rendering: pixelated; }
body.ingame #titleBg { display: none; }
#start, #menu { background: radial-gradient(ellipse at 50% 40%, rgba(5,10,30,.05) 0%, rgba(2,4,14,.55) 100%) !important; }
#loading { background: radial-gradient(ellipse at 50% 40%, rgba(5,10,30,.25) 0%, rgba(2,4,14,.7) 100%) !important; }
.logo { font-size: clamp(30px, 11vh, 64px); letter-spacing: 6px; margin: 0; background: linear-gradient(#fff4b8 0%, #ffd24a 45%, #e8861a 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; filter: drop-shadow(0 3px 0 #5a2a05) drop-shadow(0 0 12px rgba(255,190,60,.45)); animation: logoFloat 3.2s ease-in-out infinite; }
.logosub { font-size: clamp(10px, 3vh, 14px); letter-spacing: 4px; opacity: .85; margin: 2px 0 6px; text-shadow: 1px 1px 0 #000; }
@keyframes logoFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
#menu .card { background: linear-gradient(rgba(18,26,52,.88), rgba(10,14,32,.92)); border: 2px solid #4a5e98; box-shadow: 0 8px 30px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.06); }
#menu .card h1.logo { font-size: clamp(24px, 8vh, 40px); }
#menuBtns button, #menuNew button { background: linear-gradient(#2b3a68, #1b2547); border: 2px solid #4a5e98; border-radius: 8px; box-shadow: 0 3px 0 #0a0f22; transition: transform .08s, box-shadow .08s, filter .15s; }
#menuBtns button.primary, #menuNew button.primary, #menuBtns .slotrow button.primary { background: linear-gradient(#e9a62a, #b8700f); border-color: #ffd987; color: #1a0f02; font-weight: bold; text-shadow: 0 1px 0 rgba(255,255,255,.3); }
button:active { transform: translateY(2px) scale(.98); filter: brightness(1.15); }
#menuBtns button:active, #menuNew button:active { box-shadow: 0 1px 0 #0a0f22; }
.card { animation: cardIn .18s ease-out; } @keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
#death { animation: fadeIn .8s ease-out; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#start p { text-shadow: 0 2px 0 #000; } #start { background-blend-mode: normal; }
/* загрузка */
#loading .card.ld { width: min(80vw, 420px); text-align: center; background: rgba(8,12,28,.82); border: 2px solid #4a5e98; }
.ldico { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px; } .ldico i { width: 14px; height: 14px; background: #ffd24a; box-shadow: 0 2px 0 #7a4a08; animation: ldHop 0.9s ease-in-out infinite; } .ldico i:nth-child(2) { background: #6ad858; animation-delay: .15s; } .ldico i:nth-child(3) { background: #6ab0ff; animation-delay: .3s; }
@keyframes ldHop { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-10px) rotate(90deg); } }
.ldbar { position: relative; height: 18px; background: #070b18; border: 2px solid #4a5e98; border-radius: 4px; overflow: hidden; margin: 8px 0; } .ldbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3a9a3a, #8aff6a); transition: width .15s; position: relative; } .ldbar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); animation: shimmer 1.2s linear infinite; }
.ldbar b { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 14px; text-shadow: 1px 1px 0 #000; } @keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.ldtip { font-size: 11px; opacity: .85; min-height: 2.6em; margin: 8px 0 0; color: #cfe0ff; }
body.reduce *, body.reduce *::before, body.reduce *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
@media (max-height: 420px) { #menu .card { padding: 8px 12px; } #menu .sub:not(#menuVer), #menu .hint { display: none; } #menuBtns button, #menuNew button { margin: 4px 0; font-size: 14px; padding: 6px 10px; min-height: 36px; } .logo { animation: none; } }

/* ---- M22: HUD как в оригинале: хотбар слева сверху, сердца и звёзды маны справа сверху, баффы и миникарта под ними ---- */
#vitals { position: absolute; right: calc(8px + var(--safe-r)); top: calc(6px + var(--safe-t)); display: flex; flex-direction: column; align-items: flex-end; gap: 3px; pointer-events: none; z-index: 3; }
#hearts, #stars { image-rendering: pixelated; display: block; }
#vitals #buffs { display: flex; flex-wrap: wrap; justify-content: flex-end; max-width: 190px; gap: 2px; pointer-events: none; margin: 0; }
#vitals #mini { position: static; display: block; width: 120px; height: 75px; pointer-events: auto; border: 2px solid #6a7ab0; border-radius: 6px; box-shadow: 0 2px 0 #0008; }
body.nomini #mini { display: none !important; }
#hotbar { top: calc(6px + var(--safe-t)) !important; bottom: auto !important; left: calc(8px + var(--safe-l)) !important; transform: none !important; gap: 2px; align-items: flex-start; }
#hotbar .slot.sel { transform: scale(1.22); transform-origin: top left; border-color: #ffe070; background: #3a4a8acc; box-shadow: 0 0 10px #ffd24a99; z-index: 2; margin-right: 6px; }
#hotbar .slot { transition: transform .08s; }
#btns { right: calc(204px + var(--safe-r)) !important; top: calc(6px + var(--safe-t)) !important; }
#btns .xbtn { display: none; }
@media (max-height: 430px) { #mini { display: block !important; } }

/* ---- инвентарь как в оригинале: сетка 10×5 слева, экипировка/монеты/патроны/корзина справа ---- */
.invwrap { display: flex; gap: 12px; align-items: flex-start; } .invcol { flex: 1 1 58%; min-width: 0; } .invcol.right { flex: 1 1 42%; display: flex; flex-direction: column; gap: 6px; }
.invcol.right .equip { display: flex; gap: 4px; flex-wrap: wrap; align-items: flex-start; } .invcol.right .equip .slot { width: 40px; height: 40px; } .invcol .equip.acc .slot { width: 36px; height: 36px; }
.tipbox { margin-top: 8px; min-height: 84px; background: #0b1124cc; border: 2px solid #3a4a7a; border-radius: 6px; padding: 6px 8px; font-size: 12px; line-height: 1.35; } .tipbox .dim { opacity: .65; } .tipbox .price { color: #f4d23c; }
.slot { box-shadow: inset 0 -2px 0 var(--rar, transparent); } .slot.coin { width: 44px; height: 40px; flex-direction: column; font-size: 12px; line-height: 1.1; } .slot.coin small { font-size: 8px; opacity: .7; } .slot.trash { font-size: 22px; width: 40px; height: 40px; border-color: #8a4a4a; }
.invtools { display: flex; gap: 6px; align-items: center; } .ammo { display: flex; align-items: center; gap: 6px; } .ammo .grid { flex: 1; } .ammo .slot { max-height: 36px; }
@media (max-width: 560px) { .invwrap { flex-direction: column; } }
.grid.g10 { grid-template-columns: repeat(10, minmax(0, 1fr)); } .grid .slot canvas { max-width: 78%; height: auto; aspect-ratio: 1; }
@media (max-width: 700px) { .invwrap { flex-direction: column; } .invcol, .invcol.right { flex: 1 1 100%; width: 100%; } }

/* ---- меню «Игрок → Мир» ---- */
.mh { margin: 0 0 8px; font-size: 16px; color: var(--acc); } .charrow { display: flex; gap: 12px; align-items: flex-start; text-align: left; } #charPrev { image-rendering: pixelated; width: 84px; height: 108px; background: linear-gradient(#5a9ae0, #a8d4ff 60%, #3a8a3a 60%); border: 2px solid #4a5e98; border-radius: 6px; flex: none; }
.charform { flex: 1; min-width: 0; } .charform label { display: block; font-size: 12px; margin: 4px 0; } .charform input, .charform select { width: 100%; font: inherit; padding: 6px; background: #0b1124; color: #fff; border: 2px solid #3a4a7a; border-radius: 6px; }
.chlab { font-size: 10px; opacity: .7; margin-top: 4px; } .chips, .sw { display: flex; gap: 4px; flex-wrap: wrap; } .chips button { min-width: 0; min-height: 28px; padding: 2px 8px; font-size: 11px; margin: 0 !important; width: auto !important; display: inline-block !important; } .chips button.on { border-color: #ffd24a; background: #3a4a8a; }
.sw i { width: 26px; height: 26px; border-radius: 6px; border: 2px solid #3a4a7a; cursor: pointer; display: block; } .sw i.on { border-color: #fff; box-shadow: 0 0 0 2px #ffd24a; }
.slotrow .av { width: 34px; height: 44px; image-rendering: pixelated; flex: none; background: #0008; border-radius: 4px; }
@media (max-height: 430px) { #menu .card { max-height: 96vh; overflow: auto; } .charform label { margin: 2px 0; } .sw i { width: 22px; height: 22px; } }

.dragghost { position: fixed; z-index: 80; width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: none; background: #1e2742ee; border: 2px solid #ffd24a; border-radius: 6px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px #000a; } .dragghost canvas { width: 32px; height: 32px; image-rendering: pixelated; }
#btns #bComp { font-size: 17px; position: absolute; right: 0; top: 42px; }
#btns #bComp.hidden { display: none; }
/* компактные окна (1.10): кнопки ниже, отступы меньше — на iPhone в ландшафте всё помещается без прокрутки */
#panel .card { padding: 12px; } #panel .card button { min-height: 38px; padding: 4px 10px; } #panel .card button[class*="slot"], #panel .card .slot { min-height: 0; }

/* Плашка и окно хостинга (Netlify вставляет их в бесплатные проекты): не показывать и не перехватывать нажатия в углу экрана. Основная защита — CSP в netlify.toml. */
#nl-badge-frame, #nl-hud-frame { display: none !important; pointer-events: none !important; }
