@font-face{font-family:ClubPen;src:url('fonts/Caveat.ttf') format('truetype');font-weight:400 700;font-display:swap}
*{box-sizing:border-box;margin:0;-webkit-tap-highlight-color:transparent}
html,body{width:100%;height:100%;overflow:hidden;background:#0b0907;color:#f2e6d8;font-family:ClubPen,"Segoe Print",cursive;font-weight:700;user-select:none}  /* правило: любой текст — от руки (ручка, краска, мел) */
#app{position:fixed;inset:0;--h:min(100dvh,100vh)}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;touch-action:manipulation}
html,body{-webkit-user-select:none;overscroll-behavior:none}
button:disabled{cursor:default}
img{display:block}
.hand{font-family:ClubPen,"Segoe Print",cursive;font-weight:700}  /* ручкой по бумаге */
.paint{font-family:ClubPen,"Segoe Print",cursive;font-weight:700;color:rgba(238,226,200,.88);text-shadow:0 0 .08cqw rgba(238,226,200,.6),0 .08cqw .1cqw rgba(0,0,0,.7)}  /* краской от руки по дереву/бетону */
.stencil{font-family:ClubPen,"Segoe Print",cursive;font-weight:700;line-height:1;text-align:center}  /* бывший трафарет — теперь краской от руки */

/* ---------- сцена: фон 3:2, растянут как cover; всё внутри — в процентах кадра ---------- */
.screen{position:absolute;inset:0;display:none;overflow:hidden;background:#0b0907}
.screen.on{display:block}
.stage{position:absolute;left:50%;top:50%;width:max(100vw,calc(var(--h)*1.5));aspect-ratio:3/2;transform:translate(-50%,-50%);background:center/100% 100% no-repeat;container-type:inline-size}
/* широкие фоны 2:1 (2048×1024): сцена накрывает экран, интерфейс — в .frame, центральной зоне 3:2 (x 256…1792 = 12.5%…87.5%) */
.stage.wide{width:max(100vw,calc(var(--h)*2));aspect-ratio:2/1;container-type:normal}
.frame{position:absolute;top:0;bottom:0;left:12.5%;width:75%;container-type:inline-size}
.z{position:absolute}
/* «горячее» место на картинке: подсветка только при касании/наведении */
.hot{cursor:pointer;border-radius:1cqw;transition:box-shadow .15s,background .15s}
.hot:active{background:rgba(255,190,90,.07);box-shadow:0 0 2.2cqw .4cqw rgba(255,170,60,.35),inset 0 0 1.5cqw rgba(255,190,90,.18)}
.hot:disabled{box-shadow:none;background:none}
.ava{display:block;background:#2a2018 no-repeat;background-size:var(--portrait-zoom,240%) auto;background-position:var(--portrait-x,50%) 0%}
[data-portrait="mark"]{--portrait-zoom:370%;--portrait-x:50%}

/* ---------- жетон бойца (fighter-plate 768×402) ---------- */
.tag{position:absolute;z-index:5;left:calc(1vh + env(safe-area-inset-left));bottom:calc(.6vh + env(safe-area-inset-bottom));width:calc(var(--h)*.6);aspect-ratio:768/402;background:center/100% 100% no-repeat;filter:drop-shadow(0 .6vh .8vh rgba(0,0,0,.6));font-size:calc(var(--h)*.03)}
.tag[hidden]{display:none}
.tag>*{position:absolute}
.tag .p-ava{left:11.5%;top:36.6%;width:22.9%;height:47.7%;background-color:#1a1410}
.tag .p-nm{left:40%;top:39%;width:51%;height:21%;display:flex;align-items:center;color:#172a42;font-family:ClubPen,cursive;font-weight:600;font-size:calc(var(--h)*.041);line-height:1;white-space:nowrap;overflow:hidden;transform:rotate(-1.5deg)}
.tag .p-bar{left:38.5%;top:73.1%;width:42.8%;height:10%;overflow:hidden;border-radius:.3vh}
.tag .p-bar i{position:absolute;inset:0 auto 0 0;background:linear-gradient(#ffcf4a,#e1541b 55%,#8e1a0c)}
.tag .p-bar em{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-style:normal;font-size:calc(var(--h)*.019);color:#fff;text-shadow:0 0 .4vh #000,0 .1vh 0 #000;font-family:ClubPen,"Segoe Print",cursive;font-weight:700;font-size:calc(var(--h)*.024)}
.money{display:inline-flex;align-items:center;justify-content:center;gap:.35em;white-space:nowrap;vertical-align:middle}
.money .denom{display:inline-flex;align-items:center;gap:.1em}
.money .denom img{position:static;height:1.4em;width:auto;max-width:none;object-fit:contain}
.money b{font-size:inherit}
.tag .p-teeth{left:40%;top:64%;width:53%;height:8%;display:flex;align-items:center;justify-content:flex-start;font-size:calc(var(--h)*.019);line-height:1;color:#241d15}
.tag .p-teeth .money{gap:.45em}
.tag .p-teeth .money img{height:1.2em}
.tag .exit{left:102%;top:30%;width:42%;height:56%;background:center/100% 100% no-repeat;display:grid;place-items:center;padding:0 0 0 12%}

/* ---------- вход ---------- */
.guests{padding:2.9cqw 1.3cqw 0 1.9cqw;color:#2b2218;display:flex;flex-direction:column;gap:0;transform:rotate(-1deg)}
.guests h3{font-size:.95cqw;text-align:center;margin-bottom:.2cqw;letter-spacing:.06em}
.guests button{display:flex;justify-content:space-between;font-size:1.02cqw;padding:.12cqw .2cqw;border-bottom:.1cqw dashed rgba(60,45,30,.45);text-align:left}
.guests button:active{background:rgba(160,110,40,.22)}
.guests small{font-size:.9cqw;color:#6a5a44}
.lamp{pointer-events:none;object-fit:contain}
.wallname{pointer-events:none;object-fit:fill}  /* имя краской на стене входа: спрайт пиксель в пиксель с фоном */
.knock{background:none;border:0;cursor:default}  /* дверь: вход разработчика, без подсветки */
.devpw{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.3cqw;transform:rotate(-2deg)}
.chalk{font-family:ClubPen,"Segoe Print",cursive;font-weight:700;color:rgba(236,232,220,.9);text-shadow:0 0 .12cqw rgba(236,232,220,.5);font-size:2.2cqw;line-height:1}  /* мелом по двери */
.devpw input{width:100%;background:none;border:0;border-bottom:.15cqw dashed rgba(236,232,220,.55);outline:0;text-align:center;letter-spacing:.2em;caret-color:#ece8dc}
.camscreen{position:fixed;inset:0;background:#000;z-index:5}  /* экран камеры: во весь кадр поверх входа */
.cam{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.camaim{position:absolute;left:20%;right:20%;top:38%;bottom:38%;border:.35cqw dashed rgba(236,232,220,.75);border-radius:1cqw;box-shadow:0 0 0 100vmax rgba(0,0,0,.35);pointer-events:none}  /* рамка: штрихкод сюда */
.camexit{position:absolute;left:3vw;top:5vh;width:26vh;aspect-ratio:2/1;background:center/100% 100% no-repeat;filter:drop-shadow(.2cqw .3cqw .2cqw rgba(0,0,0,.55))}

/* ---------- зал ---------- */
.note{background:var(--note) center/100% 100% no-repeat;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.1cqw;padding:.8cqw .6cqw .5cqw;color:#2b2218;font-size:1.3cqw;line-height:1.1;filter:drop-shadow(0 .4cqw .5cqw rgba(0,0,0,.45))}
.note .ava{width:4.6cqw;height:4.6cqw;flex-shrink:0;border-radius:.3cqw;filter:sepia(.35)}
.note small{font-size:.78cqw;color:#5a4a36;white-space:nowrap}
.note:active{filter:drop-shadow(0 0 1.4cqw rgba(255,180,70,.85))}
.note:disabled{filter:grayscale(.6) brightness(.8) drop-shadow(0 .4cqw .5cqw rgba(0,0,0,.45))}
.ring{display:grid;place-items:center;padding-bottom:5cqw}
/* на мате над «В БОЙ» краской (под буквами низ кадра на телефоне обрезан): поиск соперника или почему нельзя в бой */
.ring{position:relative;clip-path:polygon(26.9% 0,73.7% 0,100% 100%,0 100%);border-radius:0}
.ring.hot:active{box-shadow:inset 0 0 3cqw .6cqw rgba(255,170,60,.45);background:rgba(255,190,90,.1)}
/* краской от руки на полу под «В БОЙ» — тот же стиль, что «Купить» в ларьке (.paint + scrawl) */
.ring-note{position:absolute;z-index:2;height:auto;transform:translateX(-50%);pointer-events:none;animation:paintIn .3s ease-out}
@keyframes paintIn{from{opacity:0}to{opacity:1}}
/* таблички над проходами нарисованы на фоне; кнопка — прозрачная зона касания, кладётся на табличку onQuad */
.sign{background:none}

/* ---------- раздевалка ---------- */
.shelfitem{display:flex;align-items:flex-end;justify-content:center;padding:0 .3cqw .2cqw;touch-action:none}
.shelfitem img{max-height:100%;max-width:100%;object-fit:contain;object-position:bottom;filter:drop-shadow(0 .3cqw .25cqw rgba(0,0,0,.8)) brightness(.88)}
.shelfitem b{position:absolute;right:-.4cqw;bottom:.2cqw;font-size:1.1cqw;text-shadow:0 .15cqw 0 #000}
.shelfitem.dragging{opacity:.35}
.hero{display:flex;align-items:flex-end;justify-content:center;pointer-events:none}
.hero img{max-height:100%;max-width:100%;filter:drop-shadow(1.2cqw .4cqw .9cqw rgba(0,0,0,.55)) brightness(.9) sepia(.12)}
/* мел на доске: фиксированный холст 300×400, кладётся в перспективе (onQuad); шершавость — svg-фильтр #chalk.
   Мел от руки: Caveat, строки по центру доски, чуть вкривь. */
.chalk{padding:16px 22px 12px;display:flex;flex-direction:column;justify-content:center;gap:5px;color:rgba(236,232,222,.86);font-family:ClubPen,"Segoe Print",casual,cursive;font-weight:700;filter:url(#chalk);text-shadow:0 0 1.5px rgba(255,255,255,.45)}
.chalk .lvl{font-size:40px;text-align:center;white-space:nowrap}
.chalk .xp{height:9px;border:2px solid rgba(236,232,222,.75);border-radius:5px}
.chalk .xp i{display:block;height:100%;background:rgba(190,235,160,.7)}
.chalk .small{font-size:22px;text-align:center;opacity:.85}
.chalk .stat{display:flex;align-items:center;justify-content:center;gap:12px;font-size:37px;line-height:1;height:38px}
.chalk .stat:nth-of-type(odd){transform:rotate(-1.6deg) translateX(-6px)}.chalk .stat:nth-of-type(even){transform:rotate(1.1deg) translateX(5px)}
.chalk .stat .n{flex:0 0 auto}
.chalk .stat .v{min-width:0;text-align:right;font-size:40px;line-height:1}
.chalk .stat .v small{font-size:.75em;color:#c9f0a4}.chalk .stat .v small.neg{color:#ffb3a3}
/* травма — третий ряд: отдельно от бустов предметов, красным мелом с подчёркиванием */
.chalk .stat .v small.inj{color:#ff6b57;margin-left:.25em;text-decoration:underline wavy;text-underline-offset:3px}.chalk .inj-left{color:#ff6b57}
.crutches{pointer-events:none}.crutches img{width:100%;height:100%;object-fit:contain;object-position:bottom}
.chalk .plus{width:26px;height:26px;border-radius:50%;border:2px solid rgba(236,232,222,.85);font-size:20px;line-height:1;display:grid;place-items:center;color:#ffe9a8;font-family:inherit}
.chalk .plus[hidden]{display:grid;visibility:hidden}
.chalk .hp{margin-top:6px;font-size:32px;text-align:center;padding-top:3px;transform:rotate(-2deg)}
.chalk .respec{margin-top:auto;font-family:inherit;font-size:14px;color:rgba(255,190,170,.95);border:2px dashed rgba(255,190,170,.6);padding:3px;border-radius:5px}
.chalk .respec .money img{height:20px}
/* вторая доска: модификаторы боя; крупный боец заходит рукой на её левый край — текст правее */
.chalk2{padding:6px 12px 6px 165px;gap:0}
.chalk2 .lvl{text-align:center;transform:rotate(-3deg);font-size:38px;line-height:1}
.chalk2 .stat{height:50px;font-size:48px}.chalk2 .stat .v{font-size:52px}
.chalk.chalk2 .respec{margin-top:4px;align-self:center;font-size:28px;padding:0;border:none;text-decoration:underline wavy rgba(255,190,170,.5);transform:rotate(2deg)}

.locker-spr{pointer-events:none}.locker-spr img{width:100%;height:100%;display:block}
.locker-label{pointer-events:none}.locker-label img{width:100%;height:100%;display:block}
.worn-slot img{filter:drop-shadow(0 .3cqw .25cqw rgba(0,0,0,.8)) drop-shadow(0 0 .6cqw rgba(255,200,110,.7))}

/* ---------- ларёк v3 (assets/ui/shop-v3) ---------- */
/* таблички нарисованы в фоне; подсветка выбранной и зоны касания — svg по sign_quads */
.shop-signs{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}
.sign-hit{fill:transparent;pointer-events:all;cursor:pointer}
/* товар + ценник поворачиваются вместе вокруг крючка */
.hookset{position:absolute;inset:0;pointer-events:none}
.hookset>*{pointer-events:auto}
.ware{display:flex;align-items:center;justify-content:center}
.ware img{max-height:100%;max-width:100%;object-fit:contain;filter:drop-shadow(.26cqw .33cqw .15cqw rgba(0,0,0,.45))}
.ware.on img{filter:drop-shadow(.26cqw .33cqw .15cqw rgba(0,0,0,.45)) drop-shadow(0 0 .7cqw rgba(255,210,120,.9))}
/* стрелки листания страниц вкладки — та же жестяная табличка, что «выход»; «дальше» зеркально */
.page-arrow{background:center/100% 100% no-repeat;filter:drop-shadow(.2cqw .3cqw .2cqw rgba(0,0,0,.55))}
.page-arrow.next{transform:scaleX(-1)}
/* крупная бирка при тапе: цена в окошке сверху, ниже — буст и описание */
.bigtag{background:center/100% 100% no-repeat;filter:drop-shadow(.4cqw .6cqw .5cqw rgba(0,0,0,.55));transform:rotate(3deg);transform-origin:50% 3%;color:#2b2218;cursor:pointer}
.bigtag>div{position:absolute;display:flex;flex-direction:column;align-items:center;text-align:center}
.bt-price{justify-content:center;gap:.4cqw}
.bt-price .money{flex-wrap:wrap;justify-content:center;gap:.3cqw .6cqw}
.bt-price .money img{height:3.2cqw}
.bt-price .money b{font-size:3.1cqw;transform:rotate(-4deg)}
.bt-price small{font-size:1.7cqw;color:#5a4a36}
.bt-desc{justify-content:flex-start;gap:.5cqw;padding-top:0;transform:rotate(-1.5deg)}
.bt-desc b{font-size:2.3cqw;line-height:1}
.bt-desc .fx{font-size:2.1cqw;color:#7a1d10;line-height:1.1;transform:rotate(2deg)}
.bt-desc i{font-style:normal;font-size:1.85cqw;line-height:1.05;color:#3a2e22}
.scr{display:inline-block;transform-origin:50% 70%}
/* кнопка стоит на прилавке: контактная тень под основанием, нажатие — второй спрайт */
.buy{background:var(--b0) center bottom/contain no-repeat;overflow:visible}
.buy::before{content:"";position:absolute;left:-3%;right:-5%;bottom:-3%;height:22%;border-radius:50%;background:rgba(0,0,0,.47);filter:blur(.33cqw);z-index:-1}
.buy:active:not([disabled]){background-image:var(--b1)}
.buy.no,.buy.idle{filter:saturate(.35) brightness(.7)}
/* надпись трафаретом на кромке прилавка под кнопкой */
.buylabel{position:absolute;left:-20%;right:-20%;top:calc(100% + .1cqw);display:flex;justify-content:center;gap:.4em;font-size:2cqw;transform:rotate(-3deg);pointer-events:none;white-space:nowrap}
.buy.no .buylabel{color:rgba(200,120,100,.9)}
.tagcard{background:var(--tag) center/100% 100% no-repeat;padding:.5cqw 2.4cqw .5cqw 1.1cqw;display:flex;flex-direction:column;justify-content:center;gap:0;line-height:1.05;color:#2b2218;transform:perspective(35cqw) rotateY(-12deg) rotateZ(4deg);transform-origin:90% 50%;filter:drop-shadow(0 .4cqw .5cqw rgba(0,0,0,.5))}
.tagcard>b{font-size:1.2cqw;line-height:1.1;white-space:normal}
.tagcard .fx{font-size:1.1cqw;color:#7a1d10;white-space:normal;line-height:1.15}
.tagcard em{display:flex;align-items:center;gap:.3cqw;font-style:normal;font-size:1.45cqw}
.tagcard em img{height:1.9cqw}
.tagcard em small{margin-left:.6cqw;font-size:.85cqw;color:#5a4a36}
.tagcard .money img{height:1.65cqw}
.tagcard .money b{font-size:1.25cqw}
.board-enlarged{position:absolute;inset:0;background:center/133.3334% 100% no-repeat;clip-path:polygon(82.2% 33%,98.2% 27%,98.2% 62%,82.2% 58%);transform:translate(-7.92%, -4.55%) scale(1.1);transform-origin:0 0;pointer-events:none}

.arena{position:absolute;inset:0;width:100%;height:100%;border:0;z-index:20;background:#0b0907}
#rotate{position:fixed;inset:0;display:none;place-items:center;text-align:center;background:#0b0907;font-size:6vw;padding:8vw;z-index:40}
@media (orientation:portrait){body:not(.in-smoke) #rotate{display:grid}}
body.in-smoke.dev-landscape #rotate{display:grid;font-size:0}body.in-smoke.dev-landscape #rotate::after{content:"Поверните телефон вертикально";font-size:1.4rem}
#start{position:fixed;inset:0;z-index:50;display:none;place-items:center;background:#0b0907 center/cover no-repeat}
#start.show{display:grid}
#start .enter{position:absolute;left:40%;top:18%;width:22%;height:70%;background:transparent;border:0}
#start .enter:active{background:rgba(255,190,90,.06);box-shadow:inset 0 0 3vh rgba(255,190,90,.2)}
/* в раздевалке жетона нет (имя, уровень, здоровье — мелом на доске), остаётся только табличка-стрелка справа внизу */
.tag.right{left:auto;right:calc(1vh + env(safe-area-inset-right) + var(--h)*.26);background-image:none!important;filter:none}
.tag.right>*:not(.exit){display:none}
/* корзинки на дверце: магнит при перетаскивании */
.basket{border-radius:.4cqw;transition:box-shadow .12s}.basket.near{box-shadow:0 0 1.2cqw .3cqw rgba(255,210,120,.65)}
.basket .shelfitem{position:absolute;inset:0;width:100%;height:100%}
.drag-ghost{position:fixed;z-index:50;pointer-events:none;object-fit:contain;transform:translate(-50%,-50%) scale(1.15);filter:drop-shadow(0 .6cqw .5cqw rgba(0,0,0,.7))}
.basket-front{pointer-events:none}.basket-front img{width:100%;height:100%;display:block}
.basket .shelfitem img{object-position:bottom}
.hold-tag{position:absolute;width:18%;height:15%;z-index:20;pointer-events:none}
/* места на полках: предмет внутри места, низ на полке; на верхней полке — крупнее; --sc — размер предмета (items.json shelf_scale) */
.cell{border-radius:.4cqw;transition:box-shadow .12s}.cell.near{box-shadow:0 0 1.2cqw .3cqw rgba(255,210,120,.55)}
.cell .shelfitem{position:absolute;inset:0;width:100%;height:100%}
.cell .shelfitem img{max-height:calc(64% * var(--sc,1));max-width:calc(92% * var(--sc,1))}
.cell.top .shelfitem img{max-height:calc(86% * var(--sc,1));max-width:calc(80% * var(--sc,1))}

/* чистые фоны Gemini 2:1: центр слегка масштабирован (~1.1%); рамка интерфейса подогнана по замеру (аффинная подгонка, медиана 0.6 px) */
.screen[data-screen="hall"] .frame{left:11.867%;width:75.825%;top:-0.522%;height:101.070%;bottom:auto}
.screen[data-screen="inventory"] .frame{left:12.114%;width:75.817%;top:-0.536%;height:101.110%;bottom:auto}
.screen[data-screen="shop"] .frame{left:11.996%;width:75.802%;top:-0.544%;height:101.100%;bottom:auto}
.screen[data-screen="inventory"] .board-enlarged{background-size:131.896cqw 65.935cqw;background-position:-15.978cqw 0.353cqw}
.doorwho{pointer-events:none;object-fit:fill}  /* «кто там?» краской на двери: спрайт точно по своему месту в фоне */

/* ---------- курилка (smoke.js): вертикальный экран, доска мелом, строка ввода над клавиатурой ---------- */
.screen[data-screen="smoke"]{background:#14110e}
.smoke{position:fixed;left:0;right:0;top:0;height:100dvh;display:flex;flex-direction:column;overflow:hidden;user-select:text;-webkit-user-select:text;font-size:clamp(17px,4.6vw,24px)}
.sm-bg{position:fixed;inset:0;height:100lvh;background:#1c1814 center top/cover no-repeat;z-index:-1}
.smoke:not(:has(.sm-bg[style]))::before{content:'';position:fixed;left:4%;right:4%;top:7%;height:56%;background:#1f2a24;border:10px solid #5b3f26;border-radius:4px;z-index:-1}
.sm-top{display:flex;justify-content:space-between;align-items:center;padding:calc(6px + env(safe-area-inset-top)) 12px 2px;color:rgba(240,234,220,.85)}
.sm-top button{font-size:.85em;padding:6px 4px;text-shadow:0 1px 2px #000}
.sm-people{display:flex;flex-wrap:wrap;gap:4px 12px;padding:2px 14px 6px;font-size:.8em}
.sm-people[hidden]{display:none}
.sm-list{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:4px 8% 8px;-webkit-overflow-scrolling:touch;mask-image:linear-gradient(transparent,#000 18px)}
.msg{color:rgba(244,240,228,.92);text-shadow:0 0 1px rgba(255,255,255,.35);line-height:1.2;padding:5px 0 1px;word-wrap:break-word;-webkit-touch-callout:none}
.msg.cont{padding-top:0}
.msg .who{font-weight:700;margin-right:6px;cursor:pointer}
.msg .who i{font-weight:400;opacity:.75}
.msg small{font-size:.6em;opacity:.45}
.msg .tx{display:block}
.msg q{display:block;font-size:.75em;opacity:.55;border-left:2px solid rgba(255,255,255,.35);padding-left:6px;quotes:none}
.msg.whisper .tx{color:#c9b8f2;font-style:italic}
.msg.sys{font-size:.72em;opacity:.5;text-align:center;padding:4px 0}
.msg.reported{opacity:.35}
.sm{display:inline;height:1.5em;vertical-align:-.25em;image-rendering:pixelated}
.sm-new{position:absolute;right:12px;bottom:calc(60px + env(safe-area-inset-bottom));background:rgba(30,26,22,.9);color:#f6d77a;padding:6px 12px;border-radius:16px;font-size:.8em}
.sm-new[hidden],.sm-chip[hidden],.sm-menu[hidden],.sm-tray[hidden],.sm-count[hidden]{display:none}
.sm-menu{position:absolute;left:8%;right:8%;top:35%;display:flex;flex-wrap:wrap;gap:6px;align-items:center;background:rgba(36,30,24,.96);border:2px solid #6b4b2c;border-radius:6px;padding:10px;z-index:3}
.sm-menu b{width:100%;color:#f6d77a}
.sm-menu button{flex:1;padding:10px 6px;background:rgba(255,255,255,.06);border-radius:4px;font-size:.9em}
.sm-chip{display:flex;align-items:center;gap:8px;margin:0 10px;padding:4px 10px;background:rgba(30,26,22,.85);border-radius:6px 6px 0 0;font-size:.75em;color:#f6d77a}
.sm-chip span{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.sm-chip button{font-size:1.4em;line-height:1;padding:0 6px}
.sm-bar{display:flex;align-items:center;gap:6px;padding:6px 8px calc(6px + env(safe-area-inset-bottom));background:linear-gradient(rgba(20,17,14,.55),rgba(20,17,14,.9))}
.sm-pack{width:42px;height:42px;flex:none;background:url(media/smiles/smoke.gif) center/34px no-repeat;image-rendering:pixelated}
.sm-in{flex:1;min-width:0;resize:none;height:44px;line-height:1.3;overflow:hidden;font:inherit;font-size:max(16px,1em);color:#f4f0e4;background:rgba(255,255,255,.07);border:0;border-bottom:2px dashed rgba(244,240,228,.45);padding:8px 6px;outline:none}
.sm-in::placeholder{color:rgba(244,240,228,.4)}
.sm-count{font-size:.7em;opacity:.6}
.sm-say{flex:none;padding:8px 10px;color:#f6d77a;font-size:.95em}
.sm-say:disabled{opacity:.35}
.sm-tray{display:grid;grid-template-columns:repeat(auto-fill,minmax(46px,1fr));gap:4px;max-height:38vh;overflow-y:auto;padding:6px 8px calc(6px + env(safe-area-inset-bottom));background:rgba(20,17,14,.95)}
.sm-tray button{height:46px;display:flex;align-items:center;justify-content:center}
.sm-tray img{zoom:1.6;max-width:30px;max-height:28px;image-rendering:pixelated}
.shop-smoke{border-radius:1cqw}
.sm-say{width:42px;height:42px;padding:0;background:center/30px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11.5 21 3l-6.5 18-3-7.5z' fill='none' stroke='%23f6d77a' stroke-width='2.2' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E")}
/* фон bg-smoke 1536×2752 растянут на экран; доска (внутри рамки) — x 8.8…91.4%, y 19.4…91.5% */
.sm-bg{background-size:100% 100%}
.sm-top{min-height:19.4lvh;align-items:flex-start;padding-top:calc(10px + env(safe-area-inset-top))}
.sm-people{position:absolute;top:calc(6lvh + env(safe-area-inset-top));left:0;right:0;justify-content:center;z-index:2}
.sm-list{padding:6px 12% 10px;mask-image:linear-gradient(transparent,#000 14px)}
.sm-bar{background:linear-gradient(rgba(20,17,14,0),rgba(20,17,14,.75) 40%)}
/* фон неподвижен: высота = экран без клавиатуры (--H из smoke.js), клавиатура закрывает низ */
.sm-bg{position:fixed;top:0;left:0;right:0;bottom:auto;height:var(--H,100lvh)}
.sm-top{min-height:calc(var(--H,100lvh)*.194)}
.sm-people{top:calc(var(--H,100lvh)*.06 + env(safe-area-inset-top))}
/* строка ввода — низ доски: мел по доске, под ним деревянная полочка (спрайт), слева пачка сигарет (смайлики), справа стрелка мелом */
.sm-bar{position:relative;align-items:flex-end;gap:4px;padding:4px 10px calc(10.5vw + env(safe-area-inset-bottom));background:linear-gradient(transparent,rgba(28,38,32,.92) 30%)}
.sm-bar::after{content:'';position:absolute;left:0;right:0;bottom:env(safe-area-inset-bottom);height:7.6vw;background:var(--ledge) center bottom/100% 100% no-repeat;pointer-events:none}
.sm-pack{width:34px;height:52px;background:var(--pack) center/contain no-repeat;image-rendering:auto;margin-bottom:-2px}
.sm-in{background:none;border:0;border-bottom:1px dashed rgba(244,240,228,.25);color:rgba(246,243,232,.95);text-shadow:0 0 1px rgba(255,255,255,.5);height:40px;padding:8px 4px 4px}
.sm-say{width:54px;height:38px;background:var(--send) center/contain no-repeat}
.sm-say:disabled{opacity:.3}
/* строка ввода = вырезка из самого фона (низ доски + полочка, y 85…95.5% кадра): без клавиатуры стоит точно на своём месте в фоне, с клавиатурой — та же вырезка поднимается на клавиатуру */
.sm-bar{height:calc(var(--H,100lvh)*.105);padding:0 10% calc(var(--H,100lvh)*.035) 9%;align-items:center;background:var(--bgimg) 0 calc(var(--H,100lvh)*-.85)/100% var(--H,100lvh) no-repeat;margin-bottom:calc(var(--H,100lvh)*.045)}
.smoke.kb .sm-bar{margin-bottom:0}
.sm-bar::after{display:none}
.sm-in{height:calc(var(--H,100lvh)*.055);padding:4px}
.smoke.kb .sm-bar{-webkit-mask-image:linear-gradient(transparent,#000 20%);mask-image:linear-gradient(transparent,#000 20%)}
.sm-tray.full{animation:sm-shake .3s}@keyframes sm-shake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}
.sm-top .sm-exit{width:92px;height:44px;padding:0;background:center/100% 100% no-repeat;filter:drop-shadow(0 2px 3px rgba(0,0,0,.6))}
/* кнопка «кто в курилке» — пепельница, число мелом; список — крупная бирка (price-tag-big 512×1266), ручкой */
.sm-top .sm-here{position:relative;width:56px;height:56px;padding:0;background:center/contain no-repeat;filter:drop-shadow(0 2px 3px rgba(0,0,0,.6))}
.sm-here i{position:absolute;right:-8px;bottom:-4px;font-style:normal;font-size:1.05em;color:#f4f0e4;text-shadow:0 0 2px #000,0 1px 2px #000}
.sm-people{position:absolute;top:calc(env(safe-area-inset-top) + 64px);right:4%;left:auto;width:46%;aspect-ratio:512/1266;max-height:70%;display:block;background:center/100% 100% no-repeat;padding:34% 10% 8%;color:#2a2018;z-index:4;filter:drop-shadow(0 4px 6px rgba(0,0,0,.6))}
.sm-people b{display:block;text-align:center;font-size:1.05em;margin-bottom:6px;color:#3a2a1c}
.sm-people ul{list-style:none;padding:0;margin:0;font-size:.95em;line-height:1.35}
.sm-people li{text-shadow:none;filter:brightness(.55) saturate(1.6)}
/* кнопка «кто в курилке» — отрывной блок стикеров (notes.png), число ручкой на листке */
.sm-top .sm-here{width:50px;height:56px}
.sm-here i{right:0;left:0;bottom:auto;top:34%;text-align:center;font-size:1.2em;color:#2a2018;text-shadow:none}
/* бирка: «в курилке» в рамке сверху, имена — по линейкам (шаг линеек ~5.35% высоты бирки) */
.sm-people{padding:0;container-type:size}
.sm-people b{position:absolute;left:10%;right:10%;top:23%;font-size:7cqw;margin:0}
.sm-people ul{position:absolute;left:12%;right:8%;top:45.6%;font-size:min(7cqw,4.6cqh);line-height:5.35cqh;max-height:46%;overflow:hidden}
.sm-people b{top:31%;font-size:10cqw}.sm-people ul{top:49%;line-height:4.76cqh;font-size:min(8cqw,4.2cqh);max-height:42%}
/* ---- курилка v2: стрелка выхода и дощечка «кто тут» нарисованы в фоне (bg-smoke-v2), кнопки — прозрачные зоны по их месту (px фона 1536×2752) ---- */
.sm-top{min-height:calc(var(--H,100lvh)*.31);padding:0}
.smoke .sm-exit,.smoke .sm-here{position:absolute;z-index:2;background:none;filter:none;padding:0;border-radius:10px}
.smoke .sm-exit{left:10.3%;top:calc(var(--H,100lvh)*.115);width:28.3%;height:calc(var(--H,100lvh)*.06)}
.smoke .sm-here{left:64.1%;top:calc(var(--H,100lvh)*.125);width:28.3%;height:calc(var(--H,100lvh)*.183)}
.smoke .sm-exit:active,.smoke .sm-here:active{background:rgba(255,230,180,.12);box-shadow:0 0 18px rgba(255,200,120,.35)}
.smoke .sm-here i{position:absolute;inset:auto 0 0 0;top:auto;bottom:22%;right:auto;left:0;width:100%;text-align:center;transform:rotate(9deg);font-size:1.6em;color:rgba(240,236,224,.9);text-shadow:0 0 1px #fff}
/* список: затемнение + крупная грифельная дощечка, имена мелом */
.sm-people{position:fixed;inset:0;top:0;left:0;right:0;width:auto;max-height:none;aspect-ratio:auto;background:rgba(0,0,0,.45);padding:0;z-index:5;filter:none;container-type:normal}
.sm-slate{position:absolute;left:11%;width:78%;top:calc(var(--H,100lvh)*.11);aspect-ratio:855/1200;background:center/100% 100% no-repeat;container-type:size}
.sm-slate b{position:absolute;left:18%;right:14%;top:22%;font-size:9cqw;color:rgba(240,236,224,.92);text-align:left}
.sm-slate ul{position:absolute;left:18%;right:14%;top:33%;bottom:14%;font-size:8.5cqw;line-height:1.35;overflow:hidden;list-style:none;padding:0;margin:0}
.sm-slate li{filter:none;text-shadow:0 0 1px rgba(255,255,255,.4)}

/* ---------- доска зала: кто в клубе — маркером вразброс по пробке (плоскость 1000×700 в перспективе, onQuad) ---------- */
.marker{font-family:ClubPen,"Segoe Print",cursive;font-weight:700}
.club-board{pointer-events:none}
.cb-name{position:absolute;pointer-events:auto;font-size:64px;line-height:1;text-align:left;white-space:nowrap;opacity:.9;mix-blend-mode:multiply;padding:6px 10px}
.cb-name small{display:block;font-size:38px;opacity:.85;margin-top:2px;padding-left:18px}
.cb-name.can{text-decoration:underline wavy rgba(150,30,20,.55) 3px;text-underline-offset:10px}
.cb-name.can:active{filter:drop-shadow(0 0 12px rgba(255,170,60,.9))}
.cb-name:disabled{cursor:default}
/* ---------- диалог вызова: картонка + две доски-кнопки (assets/ui/challenge-v1) ---------- */
.dlg{position:fixed;inset:0;z-index:60;display:grid;place-items:center;background:rgba(0,0,0,.5)}
.dlg-card{position:relative;width:min(70vw,120vh);aspect-ratio:16/10;background:#b89a70 center/100% 100% no-repeat;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2%;padding:7% 9% 6%;color:#1d1a17;container-type:inline-size;filter:drop-shadow(0 1vh 2vh rgba(0,0,0,.6))}
.dlg-card p{font-size:6.2cqw;line-height:1.05;text-align:center}
.dlg-card small{font-size:3.6cqw;opacity:.75}
.dlg-btns{display:flex;gap:6%;width:100%;justify-content:center;margin-top:5%}
.dlg-btns button{width:40%;aspect-ratio:3/1;background:#5a4030 center/100% 100% no-repeat;font-size:4.8cqw;color:rgba(246,240,228,.95);text-shadow:0 2px 3px rgba(0,0,0,.7)}
.dlg-btns button:active{transform:translateY(2px);filter:brightness(1.15)}
.cb-name{font-size:100px;opacity:1;mix-blend-mode:normal;text-shadow:0 0 1px rgba(0,0,0,.4)}.cb-name small{font-size:52px}
/* имена на доске — светлой краской с подтёком-тенью (как «В БОЙ»); вызов — тёплое свечение под краской */
.cb-name{color:rgba(240,230,206,.95);text-shadow:0 3px 0 rgba(60,40,25,.55),0 0 2px rgba(240,230,206,.6);text-decoration:none;font-size:104px}
.cb-name small{font-size:58px;opacity:.8}
.cb-name.can{text-decoration:none;filter:drop-shadow(0 0 14px rgba(255,170,70,.55))}
.cb-name:disabled{opacity:.82}
/* диалог: картонка (2464×1062) + доски под ней */
.dlg-card{width:min(78vw,140vh);aspect-ratio:2464/1062;background-color:transparent;padding:6% 12% 7%;justify-content:center}
.dlg-btns{position:absolute;left:0;right:0;bottom:-15%;margin:0;gap:5%}
.dlg-btns button{width:34%;aspect-ratio:1090/334;background-color:transparent;font-size:4.2cqw}
.dlg-card p{font-size:5.6cqw;margin-top:-4%}
.cb-name small{font-size:.62em}
.cb-name small{font-size:.62em}.cb-more{pointer-events:none}
.dlg-card p{font-size:7.6cqw}.dlg-card small{font-size:4.6cqw}.dlg-btns button{font-size:5.8cqw}
/* подсветка по форме нарисованного: вместо прямоугольника — вырезка из фона ярче и с тёплым ореолом по контуру */
.hot.hot-img,.hot.hot-img:active{background:none;box-shadow:none;border-radius:0}
.hot-img .hl{display:block;width:100%;height:100%;opacity:0;pointer-events:none;transition:opacity .15s;filter:brightness(1.35) drop-shadow(0 0 .6cqw rgba(255,180,80,.95)) drop-shadow(0 0 1.4cqw rgba(255,150,50,.55))}
.hot-img:active .hl{opacity:1}
/* кнопка-спрайт: вырезанный из фона предмет лежит на своём месте; при нажатии под ним — тёплое свечение по контуру, сам предмет чуть вдавливается */
.hot.sprite-btn,.hot.sprite-btn:active{background:none;box-shadow:none;border-radius:0}
.sprite-btn img{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.sprite-btn .glow{opacity:0;filter:brightness(0) drop-shadow(0 0 .5cqw rgba(255,180,80,1)) drop-shadow(0 0 1.3cqw rgba(255,150,50,.75));transition:opacity .12s}
.sprite-btn .top{transition:transform .08s}
.sprite-btn:active .glow{opacity:1}
.sprite-btn:active .top{transform:translateY(.15cqw) scale(.985)}

/* наведение — только где есть мышь: на телефоне :hover «залипает» после касания */
@media (hover:hover){.hot:hover{background:rgba(255,190,90,.07);box-shadow:0 0 2.2cqw .4cqw rgba(255,170,60,.35),inset 0 0 1.5cqw rgba(255,190,90,.18)}.guests button:hover{background:rgba(160,110,40,.22)}.note:hover{filter:drop-shadow(0 0 1.4cqw rgba(255,180,70,.85))}.ring.hot:hover{box-shadow:inset 0 0 3cqw .6cqw rgba(255,170,60,.45);background:rgba(255,190,90,.1)}.hot.hot-img:hover{background:none;box-shadow:none;border-radius:0}.hot-img:hover .hl{opacity:1}.hot.sprite-btn:hover{background:none;box-shadow:none;border-radius:0}.sprite-btn:hover .glow{opacity:1}}
/* считыватель без ореола (не принят 02.12): при нажатии просто чуть вдавливается и темнеет, как настоящая кнопка */
.sprite-btn .glow{display:none}
.sprite-btn:active .top{transform:translate(.08cqw,.12cqw) scale(.985);filter:brightness(.88)}
.hot.zone,.hot.zone:hover,.hot.zone:active{background:none;box-shadow:none}
/* родная лампочка считывателя: цветной свет поверх нарисованного купола (screen), ореол на стене */
.bulb{pointer-events:none;border-radius:50% 50% 30% 30%;mix-blend-mode:screen;transition:opacity .12s;opacity:0}
.bulb.red{opacity:1;background:radial-gradient(circle at 50% 55%,#ffb0a0 0,#ff3a20 35%,rgba(255,40,20,.35) 60%,transparent 72%);box-shadow:0 0 1.2cqw .3cqw rgba(255,50,30,.45)}
.bulb.green{opacity:1;background:radial-gradient(circle at 50% 55%,#d8ffd0 0,#3cff5a 35%,rgba(40,255,80,.35) 60%,transparent 72%);box-shadow:0 0 1.2cqw .3cqw rgba(40,255,80,.45)}
