/* «НА МЕЛИ» v0.2: интерфейс на нарисованных элементах (жесть, картон, доска), шрифт Rubik. */
:root {
  --out: #2b1a10; --ink: #2b1a10; --paper: #f3e3bf; --accent: #ffc22e; --red: #c8432f;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  font-family: "Balsamiq Sans", "Rubik", "Trebuchet MS", system-ui, sans-serif;
  --line: #1a1009; --shadow: 0 4px 0 #1a1009;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; min-width: 0; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1c120a; overscroll-behavior: none; touch-action: none; }
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
button { font-family: inherit; cursor: pointer; }
.ic { width: 22px; height: 22px; object-fit: contain; display: inline-block; vertical-align: middle; }
.ic.sm { width: 17px; height: 17px; }
.ic.lg { width: 44px; height: 44px; }
.outline { -webkit-text-stroke: 1px var(--out); }

/* ---------- загрузка ---------- */
#loading { position: fixed; inset: 0; z-index: 60; background: #2a1830; transition: opacity .5s; overflow: hidden; }
#loading.off { opacity: 0; pointer-events: none; }
.lbg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; }
.llogo { position: absolute; left: 50%; top: calc(var(--sat) + 5vh); width: min(86vw, 520px); transform: translateX(-50%) rotate(-2deg);
  filter: drop-shadow(0 6px 0 rgba(43,26,16,.6)); animation: logo 2.4s ease-in-out infinite; }
@keyframes logo { 50% { transform: translateX(-50%) rotate(1deg) scale(1.02); } }
.lbottom { position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 6vh); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ltrack { position: relative; width: min(78vw, 460px); padding-top: 92px; }
.lbar { width: 100%; height: 26px; border: 4px solid var(--line); border-radius: 14px; background: #3b2618; padding: 3px; box-shadow: var(--shadow); box-sizing: border-box; }
.lcart { position: absolute; left: 0; bottom: 18px; height: 100px; transform: translateX(-62%); transition: left .25s linear; filter: drop-shadow(0 3px 0 rgba(0,0,0,.35)); }
.lbottle { position: absolute; bottom: 24px; height: 34px; transform: translateX(-50%) rotate(-70deg); transition: transform .35s, opacity .35s; }
.lbottle.got { transform: translate(-50%, -60px) rotate(200deg) scale(.6); opacity: 0; }
.lbar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .2s; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
.lmsg { color: #fff1d0; font-weight: 800; font-size: 16px; text-shadow: 0 2px 0 var(--out), 0 0 8px var(--out); }

/* ---------- кнопки из жести ---------- */
.tin { border: 3.5px solid var(--line); border-radius: 16px; background: #ffc22e; box-shadow: var(--shadow), inset 0 -5px 0 rgba(0,0,0,.14), inset 0 3px 0 rgba(255,255,255,.45);
  min-height: 52px; padding: 4px 12px; color: var(--ink); font-weight: 700; font-size: 18px; letter-spacing: .2px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-direction: row; transition: transform .06s; width: 100%; }
.tin.grey { background: #d9cfbd; }
.tin small { display: block; font-weight: 600; font-size: 12px; opacity: .8; }
.tin.small { width: auto; min-height: 48px; font-size: 15px; flex: 0 0 auto; padding: 0 4px; }
.tin:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line), inset 0 -3px 0 rgba(0,0,0,.14); }
.tin:disabled { filter: grayscale(.7) brightness(.85); opacity: .7; }
.tin.glowing { animation: glow 1.2s ease-in-out infinite; }
@keyframes glow { 50% { filter: brightness(1.15) drop-shadow(0 0 8px #ffd25a); } }
.btn-row { display: flex; gap: 8px; }
.btn-col { display: flex; flex-direction: column; gap: 6px; }
.btn-col .tin { flex-direction: column; gap: 0; min-height: 62px; }

/* ---------- HUD ---------- */
.hud { position: absolute; top: calc(var(--sat) + 6px); left: calc(var(--sal) + 6px); right: calc(var(--sar) + 6px); display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-row { display: flex; align-items: center; gap: 6px; }
.who { position: relative; width: 56px; height: 56px; border-radius: 50%; border: 4px solid var(--out); background: #c9a36a; overflow: hidden; padding: 0; flex: none; box-shadow: 0 3px 0 rgba(43,26,16,.6); }
.who img { width: 120%; margin-left: -10%; margin-top: 2px; }
.who .lvl { position: absolute; right: -2px; bottom: -2px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--accent); border: 3px solid var(--out); font-size: 12px; line-height: 16px; color: var(--ink); }
.who-txt { display: flex; flex-direction: column; color: #fff3d6; text-shadow: 0 2px 0 var(--out), 0 0 4px var(--out); line-height: 1.1; flex: 1; overflow: hidden; }
.who-txt b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-txt span { font-size: 12px; font-weight: 700; color: var(--accent); }
.cash { display: flex; gap: 5px; }
.chip { display: flex; align-items: center; gap: 3px; height: 34px; padding: 0 10px 0 6px; border-radius: 17px; background: #3a2618; border: 3px solid var(--line);
  color: #fff3d6; font-weight: 700; font-size: 16px; box-shadow: 0 3px 0 var(--line); font-family: Rubik, sans-serif; }
.chip.bump { animation: bump .35s; } @keyframes bump { 40% { transform: scale(1.18); } }
.flyer { position: fixed; width: 30px; height: 30px; z-index: 45; pointer-events: none; transition: left .55s cubic-bezier(.5,-0.3,.7,1), top .55s cubic-bezier(.3,.6,.5,1), transform .55s; }
.chip .ic { width: 24px; height: 24px; }
.chip .plus { margin-left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #5bb03a; border: 2px solid var(--out); font-size: 13px; line-height: 13px; text-align: center; }
.tal { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 16px; font-style: normal; font-weight: 900; font-size: 11px; color: var(--ink);
  background: #d9c79a; border: 2px dashed #7a5a2c; border-radius: 3px; transform: rotate(-6deg); vertical-align: middle; }
.tal.big { width: 46px; height: 32px; font-size: 20px; }
.stats { gap: 3px; flex-wrap: nowrap; }
.st { display: flex; align-items: center; gap: 1px; padding: 2px 5px 2px 2px; border-radius: 12px; background: #3a2618; border: 2.5px solid var(--line); flex: 1; max-width: 76px; box-shadow: 0 2px 0 var(--line); }
.st .ic { width: 22px; height: 22px; flex: none; }
.st .bar { flex: 1; height: 7px; border-radius: 4px; background: #1c120a; overflow: hidden; }
.st .bar i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.st[data-k=health] i { background: #e2513d; } .st[data-k=satiety] i { background: #e39a3b; } .st[data-k=hygiene] i { background: #6fb7e6; } .st[data-k=mood] i { background: #8cc152; }
.st.low { animation: low .8s infinite; } @keyframes low { 50% { background: #8a2216; } }
.chip.bot { height: 28px; font-size: 13px; flex: none; }
.chip.bot .ic { width: 20px; height: 20px; }

/* ---------- сцена ---------- */
.scene-name { position: absolute; top: calc(var(--sat) + 104px); left: 50%; transform: translateX(-50%); height: 40px; min-width: 120px; padding: 0 22px;
  border: 3.5px solid var(--line); border-radius: 12px; background: #b5763f; color: #fff3d6; font-weight: 700; font-size: 17px;
  text-shadow: 0 2px 0 var(--line); box-shadow: var(--shadow); }
.edge { position: absolute; top: 46%; height: 40px; padding: 0 12px; border: 3px solid var(--line); border-radius: 10px; background: #b5763f;
  color: #fff3d6; font-weight: 700; font-size: 14px; text-shadow: 0 2px 0 var(--line); box-shadow: 0 3px 0 var(--line); opacity: .95; }
.edge.l { left: calc(var(--sal) + 2px); } .edge.r { right: calc(var(--sar) + 2px); }
.edge.glow { animation: edgeglow 1s ease-in-out infinite; opacity: 1; }
@keyframes edgeglow { 50% { filter: brightness(1.3) drop-shadow(0 0 10px #ffd25a); transform: scale(1.08); } }
.hint { position: absolute; top: calc(var(--sat) + 150px); left: 50%; transform: translate(-50%, -10px); opacity: 0; transition: .3s; pointer-events: none;
  background: #fff6df; color: var(--ink); padding: 7px 14px; border-radius: 14px; border: 3px solid var(--line); box-shadow: 0 3px 0 var(--line); font-size: 15px; font-weight: 700; line-height: 1.25; text-align: center; width: max-content; max-width: min(560px, calc(100vw - 260px)); }
.hint.on { opacity: 1; transform: translate(-50%, 0); }
.hint.big { top: auto; bottom: calc(var(--sab) + 170px); background: none; border: none; font-size: 17px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-shadow: 0 2px 0 var(--out), 0 0 6px var(--out); }
.hand { width: 48px; height: 48px; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 0 0 3px var(--out); animation: swipe 1.6s infinite ease-in-out; }
@keyframes swipe { 0%,100% { transform: translateX(-46px); } 50% { transform: translateX(46px); } }
.joy-base { position: fixed; width: 116px; height: 116px; margin: -58px 0 0 -58px; border-radius: 50%; border: 4px solid rgba(43,26,16,.6); background: rgba(255,240,200,.16); opacity: 0; transition: opacity .1s; pointer-events: none; z-index: 5; }
.joy-base.on { opacity: 1; }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: var(--accent); border: 4px solid var(--out); box-shadow: 0 3px 0 rgba(43,26,16,.7); }
.action { position: absolute; right: calc(var(--sar) + 10px); bottom: calc(var(--sab) + 96px); width: auto; min-width: 150px; min-height: 64px; font-size: 19px; transform: scale(0); transition: transform .15s; }
.action.on { transform: scale(1); }
.nav { position: absolute; left: calc(var(--sal) + 6px); right: calc(var(--sar) + 6px); bottom: calc(var(--sab) + 6px); display: flex; gap: 4px; padding: 6px 6px 4px;
  border: 3.5px solid var(--line); border-radius: 18px; background: #b5763f; box-shadow: var(--shadow), inset 0 3px 0 rgba(255,255,255,.18); }
.nav-b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0; background: none; border: none; color: #fff3d6; font-weight: 800; font-size: 11px;
  text-shadow: 0 1px 0 var(--out), 0 0 3px var(--out); padding: 0; }
.nav-b .ic { width: 38px; height: 38px; filter: drop-shadow(0 2px 0 rgba(43,26,16,.6)); transition: transform .1s; }
.nav-b:active .ic { transform: scale(.9) translateY(2px); }

/* ---------- окна: картон + доска ---------- */
.modal-back { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(15,8,4,.6); opacity: 0; transition: opacity .18s;
  padding: calc(var(--sat) + 16px) 10px calc(var(--sab) + 12px); }
.modal-back.on { opacity: 1; }
.modal { position: relative; width: min(430px, 100%); max-height: 100%; display: flex; flex-direction: column; border: 4px solid var(--line); border-radius: 22px;
  background: #f6e7c4; box-shadow: 0 7px 0 var(--line); color: var(--ink); transform: translateY(16px) scale(.97); transition: transform .18s; padding: 34px 14px 14px; margin-top: 26px; }
.modal.wide { width: min(480px, 100%); }
.modal-back.on .modal { transform: none; }
.plank { position: absolute; top: -26px; left: 50%; transform: translateX(-50%) rotate(-1.5deg); max-width: 86%; height: 50px; padding: 0 22px; border: 4px solid var(--line); border-radius: 12px;
  background: #d9542b; box-shadow: 0 4px 0 var(--line), inset 0 3px 0 rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; }
.plank h2 { margin: 0; font-size: 20px; font-weight: 700; color: #fff6e2; text-shadow: 0 2px 0 var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x { position: absolute; top: -20px; right: -14px; width: 44px; height: 44px; border: 4px solid var(--line); border-radius: 50%; background: #e04a32; box-shadow: 0 3px 0 var(--line); }
.x::before, .x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 5px; border-radius: 3px; background: #fff6e2; transform: translate(-50%,-50%) rotate(45deg); }
.x::after { transform: translate(-50%,-50%) rotate(-45deg); }
.modal-body { overflow: auto; padding: 4px 2px; touch-action: pan-y; }
.modal-body p { margin: 4px 0 10px; font-size: 16px; line-height: 1.35; font-weight: 600; }
.modal-body h3 { margin: 2px 0 4px; font-size: 19px; }
.muted { opacity: .72; font-size: 14px !important; }
.rows { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 14px; background: #fff6df; border: 3px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.rn { flex: 1; } .rn b { font-size: 15px; }
.eff { display: inline-flex; align-items: center; gap: 1px; margin-right: 8px; font-size: 13px; font-weight: 800; }
.row.hot { background: rgba(255,194,46,.3); border-color: #b4851e; }
.tag { background: #7a5a2c; color: #fff3d6; border-radius: 6px; padding: 0 5px; font-size: 11px; }
.dlg { display: flex; flex-direction: column; }
.dlg-face { width: 140px; height: 140px; object-fit: contain; object-position: top; align-self: center; margin-top: -6px; }
.result { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.big { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 42px; font-weight: 900; }
.stamp { display: inline-block; align-self: center; padding: 4px 14px; border: 4px solid #3f8a2a; color: #3f8a2a; border-radius: 8px; transform: rotate(-4deg); font-weight: 900; font-size: 24px !important; }
.stamp.bad { border-color: var(--red); color: var(--red); }
.stamp.sm { font-size: 14px !important; padding: 1px 8px; border-width: 3px; }
.rew { display: flex; justify-content: center; gap: 14px; font-weight: 900; font-size: 18px; margin: 6px 0 12px; }
.rew span { display: flex; align-items: center; gap: 3px; }
.meter { height: 20px; border: 3.5px solid var(--line); border-radius: 10px; background: #3b2618; padding: 2px; margin: 6px 0; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.meter.red i { background: #e2513d; }
.inv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; background: rgba(120,80,40,.14); font-weight: 800; }
.cell span { font-size: 12px; opacity: .75; }
.prof { display: flex; gap: 10px; align-items: center; }
.prof img { width: 92px; }
.kv { display: flex; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px dashed rgba(90,60,30,.3); font-weight: 700; }
.kv b { margin-left: auto; }
.ak { width: 34px; font-size: 11px; font-weight: 900; color: #7a5a2c; text-align: center; }
.prep .vs { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 6px; text-align: center; }
.prep .vs img { height: 90px; max-width: 100%; object-fit: contain; }
.prep .vs > i { font-style: normal; font-weight: 900; font-size: 26px; color: var(--red); }
.prep .vs b { display: block; font-size: 13px; }
.at { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; margin-top: 4px; }
.at span { background: rgba(120,80,40,.15); border-radius: 6px; font-size: 13px; font-weight: 900; }
.at small { display: block; font-size: 10px; font-weight: 600; opacity: .7; }
.fade { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity .38s; z-index: 30; }
.fade.on { opacity: 1; }
.toast { position: absolute; left: 50%; bottom: calc(var(--sab) + 18px); transform: translateX(-50%); z-index: 40; background: #fff6df; color: var(--ink); border: 4px solid var(--line); box-shadow: var(--shadow); border-radius: 16px;
  padding: 10px 18px; font-weight: 800; font-size: 16px; transition: opacity .4s, transform .4s; text-align: center; max-width: 90vw; }
.toast.off { opacity: 0; transform: translate(-50%, -20px); }

/* ---------- разборка ---------- */
.fight { position: absolute; inset: 0; z-index: 26; background: #000; opacity: 0; transition: opacity .25s; }
.fight.on { opacity: 1; }
.fight canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.fhud { position: absolute; top: calc(var(--sat) + 10px); left: 8px; right: 8px; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 6px; }
.fbar b { color: #fff3d6; font-size: 14px; text-shadow: 0 2px 0 var(--out), 0 0 4px var(--out); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.fbar.r { text-align: right; }
.fbar.r .meter i { margin-left: auto; }
.round { width: 54px; height: 54px; border-radius: 50%; background: var(--accent); border: 4px solid var(--out); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 18px; }
.fight .skip { position: absolute; bottom: calc(var(--sab) + 16px); left: 50%; transform: translateX(-50%); width: 180px; }

/* ---------- мини-игры ---------- */
.mg { position: absolute; inset: 0; background: #23160c; z-index: 25; display: flex; flex-direction: column; opacity: 0; transition: opacity .2s;
  padding: calc(var(--sat) + 8px) calc(var(--sar) + 8px) calc(var(--sab) + 8px) calc(var(--sal) + 8px); }
.mg.on { opacity: 1; }
.mg-head { display: flex; align-items: center; justify-content: space-between; }
.mg-head h2 { margin: 4px 0; font-size: 20px; color: var(--accent); text-shadow: 0 2px 0 #000; }
.mg-timer { min-width: 48px; height: 48px; border-radius: 50%; border: 4px solid var(--out); background: var(--paper); color: var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 20px; }
.mg-hint { color: #e9d4a6; font-size: 14px; padding: 2px 4px 8px; }
.mg canvas { flex: 1; width: 100%; min-height: 0; border: 4px solid #000; border-radius: 12px; touch-action: none; }
.mg-foot { display: flex; gap: 10px; align-items: center; padding-top: 8px; min-height: 64px; }
.mg-foot .tin, .mg-foot .btn { width: auto; flex: 0 0 auto; padding: 0 10px; }
.mg-pct { flex: 1; color: #fff3d6; font-weight: 900; font-size: 18px; }
.mg-msg { color: var(--accent); font-weight: 900; font-size: 18px; margin: 0; text-align: center; width: 100%; }

/* ---------- горизонтально ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  .nav { left: auto; right: calc(var(--sar) + 4px); top: calc(var(--sat) + 70px); bottom: calc(var(--sab) + 4px); width: 78px; flex-direction: column; }
  .nav-b .ic { width: 30px; height: 30px; }
  .action { right: calc(var(--sar) + 92px); bottom: calc(var(--sab) + 14px); }
  .hud { right: calc(var(--sar) + 90px); flex-direction: row; align-items: center; }
  .scene-name { top: calc(var(--sat) + 70px); }
  .hint { top: calc(var(--sat) + 116px); }
  .edge.r { right: calc(var(--sar) + 88px); }
  .hint.big { bottom: calc(var(--sab) + 40px); }
}

/* ---------- разборка с управлением ---------- */
.arena { position: absolute; inset: 0; z-index: 26; background: #000; opacity: 0; transition: opacity .25s; touch-action: none; }
.arena.on { opacity: 1; }
.arena canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ahud { position: absolute; top: calc(var(--sat) + 8px); left: calc(var(--sal) + 10px); right: calc(var(--sar) + 10px); display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: start; gap: 8px; pointer-events: none; }
.ahud .meter { height: 22px; margin: 2px 0; }
.kur { height: 10px; border: 2.5px solid var(--line); border-radius: 6px; background: #2a1a10; overflow: hidden; width: 70%; }
.fbar.r .kur { margin-left: auto; }
.kur i { display: block; height: 100%; width: 0; background: #39b6ff; transition: width .15s; }
.fbar.r .kur i { margin-left: auto; }
.ahud .round { width: 50px; height: 50px; font-family: Rubik, sans-serif; }
.pad { position: absolute; bottom: calc(var(--sab) + 12px); }
.pad.l { left: calc(var(--sal) + 14px); display: flex; gap: 12px; align-items: flex-end; }
.pad.r { right: calc(var(--sar) + 14px); width: 236px; height: 200px; }
.abtn { position: absolute; width: 84px; height: 84px; border-radius: 50%; border: 4px solid var(--line); padding: 0; color: var(--ink);
  box-shadow: 0 6px 0 var(--line), inset 0 -8px 0 rgba(0,0,0,.18), inset 0 5px 0 rgba(255,255,255,.45);
  display: flex; align-items: center; justify-content: center; touch-action: none; -webkit-user-select: none; user-select: none; transition: transform .05s; }
.abtn .gl { width: 58%; height: 58%; display: block; filter: drop-shadow(0 2px 0 rgba(26,16,9,.35)); pointer-events: none; }
.abtn .gl svg { width: 100%; height: 100%; display: block; }
.abtn em { position: absolute; bottom: -13px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 13px; font-weight: 700; color: #fff6e2;
  background: var(--line); border-radius: 9px; padding: 1px 8px 2px; white-space: nowrap; pointer-events: none; }
.abtn .ring { position: absolute; inset: -9px; border-radius: 50%; pointer-events: none; display: none; }
.pad.l .abtn { position: relative; width: 82px; height: 82px; background: radial-gradient(circle at 50% 35%, #a8774a, #6e4527); }
.pad.l .abtn .gl { width: 62%; height: 62%; }
.abtn.light { right: 0; bottom: 10px; width: 100px; height: 100px; background: radial-gradient(circle at 50% 32%, #ffe07a, #ffb21e 70%); }
.abtn.heavy { right: 112px; bottom: 0; background: radial-gradient(circle at 50% 32%, #ffb07a, #f2672a 70%); }
.abtn.block { right: 112px; bottom: 104px; width: 74px; height: 74px; background: radial-gradient(circle at 50% 32%, #c7e6ff, #5aa7e6 70%); }
.abtn.super { right: 12px; bottom: 122px; width: 76px; height: 76px; background: radial-gradient(circle at 50% 32%, #d6cfc2, #9a9182 70%); }
.abtn.super .gl { filter: grayscale(.8) brightness(.9); }
.abtn.super .ring { display: block; background: conic-gradient(#39b6ff calc(var(--k, 0) * 1%), rgba(26,16,9,.35) 0); -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%); }
.abtn.super.ready { background: radial-gradient(circle at 50% 32%, #ffe07a, #ff5a2c 70%); animation: superpulse .7s ease-in-out infinite; }
.abtn.super.ready .gl { filter: drop-shadow(0 0 6px #fff3a0); }
@keyframes superpulse { 50% { transform: scale(1.08); box-shadow: 0 6px 0 var(--line), 0 0 22px 6px rgba(255,140,40,.8); } }
.abtn.down { transform: translateY(5px) scale(.96); box-shadow: 0 1px 0 var(--line), inset 0 -4px 0 rgba(0,0,0,.18); filter: brightness(.93); }
.pad.l .abtn.down, .abtn.light.down { transform: translateY(5px) scale(.96); }
.banner { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(.6); opacity: 0; transition: .2s; pointer-events: none;
  font-size: 54px; font-weight: 700; color: #ffd23c; -webkit-text-stroke: 3px var(--line); text-shadow: 0 6px 0 var(--line); white-space: nowrap; }
.banner.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
@media (orientation: portrait) { .pad.r { transform: scale(.82); transform-origin: right bottom; } .pad.l { transform: scale(.85); transform-origin: left bottom; } .banner { font-size: 40px; } }
@media (max-height: 360px) { .pad.r { transform: scale(.82); transform-origin: right bottom; } .pad.l { transform: scale(.85); transform-origin: left bottom; } }
.svgi { display: inline-block; width: 36px; height: 36px; } .svgi svg { width: 100%; height: 100%; display: block; }

/* ---------- поверни телефон ---------- */
.rotate { position: fixed; inset: 0; z-index: 55; background: #2a1830; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  color: #fff3d6; text-align: center; padding: 30px; }
.rotate.on { display: flex; }
.rotate img { width: 150px; animation: tilt 2.2s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(0,0,0,.4)); }
@keyframes tilt { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
.rotate h2 { margin: 0; font-size: 26px; color: #ffd23c; text-shadow: 0 3px 0 #000; }
.rotate p { margin: 0; font-size: 16px; }
.rotate .tin { width: auto; padding: 0 20px; margin-top: 10px; }
.ic.face { border-radius: 50%; background: #c9a36a; border: 2px solid var(--line); object-fit: cover; object-position: top; }

/* ---------- v0.4: задания, вещи, жильё, бригады ---------- */
.ic.svgi svg { width: 100%; height: 100%; display: block; }
.nav-b { position: relative; }
.nav-b .svgi { width: 38px; height: 38px; filter: drop-shadow(0 2px 0 rgba(43,26,16,.6)); }
.nav-b .dot { position: absolute; top: 0; right: 18%; width: 13px; height: 13px; border-radius: 50%; background: #e04a32; border: 2.5px solid var(--line); display: none; }
.nav-b .dot.on { display: block; animation: bump 1s infinite; }
.svgi.sm { width: 22px; height: 22px; vertical-align: middle; }
.tabs { display: flex; gap: 4px; margin: 2px 0 8px; }
.tabs button { flex: 1; height: 36px; border: 3px solid var(--line); border-radius: 10px; background: #e3cfa4; font-weight: 700; font-size: 13px; color: var(--ink); padding: 0 2px; box-shadow: 0 3px 0 var(--line); }
.tabs button.on { background: #ffc22e; transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.tabbox { display: flex; flex-direction: column; gap: 6px; }
.qcard { background: #fff6df; border: 3px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: 0 3px 0 var(--line); margin: 6px 0 4px; display: flex; flex-direction: column; gap: 4px; }
.qch { font-size: 12px; font-weight: 900; color: #b4441f; text-transform: uppercase; letter-spacing: .5px; }
.qnpc { font-size: 15px; line-height: 1.3; font-weight: 600; }
.qgoal { font-size: 17px; font-weight: 800; }
.qrow { display: flex; justify-content: space-between; align-items: center; }
.rewl { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; font-size: 13px; margin-left: auto; }
.meter.sm { height: 13px; padding: 1px; border-width: 2.5px; margin: 4px 0 0; }
.row.done { opacity: .6; }
.row.locked { opacity: .55; filter: grayscale(.4); }
.row.worn { background: #fdf0c4; }
.row.empty { opacity: .65; border-style: dashed; }
.chk { font-size: 24px; font-weight: 900; color: #3f8a2a; width: 40px; text-align: center; }
.plusg { color: #3f8a2a; font-weight: 900; }
.gi { position: relative; width: 50px; height: 50px; flex: none; border: 3px solid var(--line); border-radius: 12px; background: #d9cfbd; display: flex; align-items: center; justify-content: center; }
.gi .svgi { width: 36px; height: 36px; }
.gi .pl { position: absolute; right: -6px; bottom: -7px; background: #3f8a2a; color: #fff; border: 2px solid var(--line); border-radius: 8px; font-size: 11px; padding: 0 4px; }
.gi.t1 { background: #d9cfbd; } .gi.t2 { background: #c7dca8; } .gi.t3 { background: #a8d0e6; } .gi.t4 { background: #c7b0e6; }
.gi.t5 { background: #f2c27a; } .gi.t6 { background: #f29a7a; } .gi.t7 { background: #ffd23c; } .gi.t8 { background: linear-gradient(135deg, #ffd23c, #ff7a2e, #c7b0e6); }
.btn-col.sm { gap: 4px; } .btn-col.sm .tin { min-height: 36px; font-size: 13px; padding: 0 8px; }
.effrow { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 4px; text-align: center; margin-bottom: 2px; }
.effrow span { background: rgba(120,80,40,.15); border-radius: 8px; padding: 3px 0; font-weight: 900; font-size: 17px; }
.effrow small { display: block; font-size: 10px; opacity: .7; }
.coll { background: #fff6df; border: 3px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: 0 3px 0 var(--line); display: flex; flex-direction: column; gap: 6px; }
.coll.ready { background: #fdf0c4; }
.coll .ch { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.fgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.fc { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 2px; border-radius: 10px; background: rgba(60,40,20,.12); filter: grayscale(1) brightness(.6) opacity(.5); text-align: center; }
.fc.have { filter: none; background: rgba(255,194,46,.25); }
.fc.rare.have { background: rgba(255,120,40,.35); }
.fc .svgi { width: 34px; height: 34px; }
.fc small { font-size: 9.5px; line-height: 1.1; font-weight: 700; }
.fc b { position: absolute; top: 0; right: 3px; font-size: 11px; }
.fc .sell { margin-top: 2px; border: 2px solid var(--line); border-radius: 6px; background: #ffc22e; font-size: 9px; font-weight: 800; padding: 1px 3px; }
.brform { display: flex; gap: 6px; margin-bottom: 6px; }
.inp { flex: 1; height: 44px; border: 3px solid var(--line); border-radius: 12px; background: #fff; padding: 0 10px; font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); user-select: text; -webkit-user-select: text; }
.inp.btag { flex: 0 0 104px; text-transform: uppercase; }
.inp.btag::placeholder { text-transform: none; }
.brhead { display: flex; gap: 10px; align-items: center; } .brhead .svgi { width: 52px; height: 52px; } .brhead h3 { margin: 0; }
.chat { height: 210px; overflow-y: auto; background: #fff6df; border: 3px solid var(--line); border-radius: 12px; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; touch-action: pan-y; }
.msg { font-size: 14px; font-weight: 600; line-height: 1.25; } .msg b { color: #b4441f; } .msg.me b { color: #3f8a2a; }
.chatin { display: flex; gap: 6px; align-items: center; } .chatin .tin { width: 52px; }
.row.rt .pos { width: 26px; text-align: center; font-size: 17px; } .row.rt > span { display: flex; align-items: center; gap: 2px; font-weight: 900; }
.tin.live { background: #6cc24a; margin-bottom: 2px; }
.pbtns { margin-top: 10px; } .pbtns .tin { font-size: 15px; }
.spin { display: flex; justify-content: center; } .spin .svgi { width: 80px; height: 80px; animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (orientation: landscape) and (max-height: 520px) {
  .nav-b .svgi { width: 28px; height: 28px; }
  .nav { gap: 0; padding: 4px 2px; }
  .nav-b span { font-size: 10px; }
}
/* ---------- внешность ---------- */
.look { display: grid; grid-template-columns: 34% 1fr; gap: 10px; align-items: start; }
.lprev { background: radial-gradient(circle at 50% 70%, #fff6df, #e8d3a6); border: 3px solid var(--line); border-radius: 14px; height: 230px; display: flex; position: sticky; top: 0; }
.lprev canvas { width: 100%; height: 100%; display: block; }
.lopts { display: flex; flex-direction: column; gap: 6px; }
.lrow b { display: block; font-size: 14px; margin-bottom: 3px; }
.lrow small { display: block; margin-top: 2px; font-size: 11px !important; }
.swatches { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.sw { aspect-ratio: 1; min-height: 20px; border: 3px solid var(--line); border-radius: 9px; padding: 0; box-shadow: 0 2px 0 var(--line); }
.sw.on { outline: 3px solid #ffc22e; outline-offset: 1px; transform: scale(1.08); }
.lrow.chars { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; } .lrow.chars b { width: 100%; }
.look .lopts > .tin { min-height: 46px; margin-top: 2px; }
.sw { border-width: 2.5px; border-radius: 7px; }
@media (orientation: portrait) { .look { grid-template-columns: 1fr; } .lprev { height: 190px; position: static; } .swatches { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.gi .tdot { position: absolute; left: -6px; top: -6px; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--line); }
.chgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; width: 100%; }
.chb { border: 3px solid var(--line); border-radius: 10px; background: #e3cfa4; padding: 2px 1px 3px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 2px 0 var(--line); }
.chb img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: top; border-radius: 6px; }
.chb span { font-size: 10px; font-weight: 800; line-height: 1.05; text-align: center; color: var(--ink); }
.chb.on { background: #ffc22e; outline: 3px solid #ff7a2e; outline-offset: 1px; }
.chb span { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; } .chb { min-width: 0; overflow: hidden; }
.swatches { grid-template-columns: repeat(13, minmax(0, 1fr)); }
.sw.native { background: repeating-linear-gradient(45deg, #e3cfa4 0 4px, #cdb487 4px 8px); font-size: 11px; font-weight: 900; color: var(--line); }
@media (orientation: portrait) { .swatches { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
/* ---------- магазин талонов ---------- */
.shop { display: flex; flex-direction: column; gap: 10px; }
.shop-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.offer { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 8px; border: 3px solid var(--line); border-radius: 16px;
  background: linear-gradient(135deg, #ffe7a8, #ffc65a); box-shadow: 0 4px 0 var(--line); }
.offer.blat { background: linear-gradient(135deg, #d9c7ff, #a98be8); }
.offer .ob { width: 54px; height: 54px; flex: none; border-radius: 14px; border: 3px solid var(--line); background: #fff6df; display: flex; align-items: center; justify-content: center; }
.offer .ob .svgi { width: 40px; height: 40px; }
.offer .ot { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.offer .ot b { font-size: 16px; } .offer .ot small { font-size: 11.5px; line-height: 1.2; font-weight: 600; } .offer .ot small.on { color: #2f6b1f; font-weight: 800; }
.otal { display: inline-flex; align-items: center; gap: 3px; font-weight: 900; font-size: 15px; }
.tin.buy { min-height: 42px; padding: 0 12px; font-size: 16px; white-space: nowrap; width: auto; flex: none; }
.tin.buy .star { color: #ff9d00; margin-right: 3px; text-shadow: 0 1px 0 var(--line); }
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (orientation: landscape) { .shop-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.pk { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 6px 8px; border: 3px solid var(--line); border-radius: 14px;
  background: #fff6df; box-shadow: 0 4px 0 var(--line); text-align: center; }
.pk.best { background: #fff0b8; }
.pki { display: flex; justify-content: center; height: 36px; } .pki .ic { width: 30px; height: 30px; margin: 0 -7px; filter: drop-shadow(0 2px 0 rgba(26,16,9,.4)); }
.pkn { font-size: 19px; font-weight: 900; } .pkn s { font-size: 12px; opacity: .55; font-weight: 700; }
.pk small { font-size: 11px; font-weight: 700; opacity: .75; margin-bottom: 4px; }
.pk .tin.buy { width: 100%; padding: 0 4px; font-size: 14px; min-height: 38px; }
.rib { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10.5px; font-weight: 900; white-space: nowrap;
  background: #3f8a2a; color: #fff; border: 2.5px solid var(--line); border-radius: 8px; padding: 0 6px; }
.rib.x2 { background: #e0432c; } .rib.best { background: #ff9d00; left: auto; right: 6px; transform: none; }
.pk .rib.x2 { left: 8px; transform: none; }
.offer .rib { left: auto; right: 10px; transform: none; }
.x2note { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.x2note .rib { position: static; transform: none; flex: none; font-size: 13px; }
.pki { overflow: hidden; max-width: 100%; padding: 0 8px; }
@media (orientation: landscape) and (max-width: 760px) { .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.center { text-align: center; }
/* ---------- обучение ---------- */
body.tut .nav, body.tut .chip.talons .plus { display: none !important; }
.hint.coach { padding-top: 16px; border-color: #ff9d00; box-shadow: 0 4px 0 var(--line), 0 0 0 4px rgba(255,157,0,.35); }
.hint .chap { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; font-weight: 900; white-space: nowrap;
  background: #ff9d00; color: #fff; border: 2.5px solid var(--line); border-radius: 8px; padding: 0 8px; text-transform: uppercase; letter-spacing: .4px; }
.tourveil { position: absolute; inset: 0; background: rgba(20,12,6,.55); z-index: 60; }
.spot { position: relative; z-index: 61 !important; animation: spotpulse 1s ease-in-out infinite; }
@keyframes spotpulse { 50% { filter: drop-shadow(0 0 10px #ffd23c) brightness(1.15); } }
.tourtip { position: absolute; z-index: 62; color: var(--ink); background: #fff6df; border: 3px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: 0 4px 0 var(--line);
  display: flex; flex-direction: column; gap: 8px; }
.tourtip p { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.tourtip .tin { align-self: flex-end; }
.rew { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 20px; margin: 4px 0 8px; }
body.touring .nav, body.touring .hud { z-index: 61; }
body.touring .nav-b:not(.spot), body.touring .hud > *:not(.spot):not(.cash), body.touring .cash > * { opacity: .3; transition: opacity .2s; }
body.touring .spot { opacity: 1 !important; }
.tourtip p { font-size: 13px; }
/* ---------- друзья ---------- */
.friends { display: flex; flex-direction: column; gap: 8px; }
.frhead { display: flex; gap: 10px; align-items: center; background: linear-gradient(135deg, #ffe0d6, #ffb49e); border: 3px solid var(--line); border-radius: 16px; padding: 8px 10px; box-shadow: 0 4px 0 var(--line); }
.frhead .svgi { width: 52px; height: 52px; flex: none; } .frhead b { display: block; font-size: 15px; line-height: 1.2; } .frhead small { font-size: 12px; font-weight: 700; }
.frlink { background: #fff; border: 3px dashed var(--line); border-radius: 12px; padding: 8px 10px; text-align: center; }
.frlink code { font-family: Rubik, sans-serif; font-weight: 800; font-size: 14px; word-break: break-all; user-select: all; -webkit-user-select: all; }
.frbtns { display: grid; grid-template-columns: 2fr 1fr; gap: 6px; } .frbtns .tin { min-height: 44px; }
.frstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; text-align: center; }
.frstats span { background: rgba(120,80,40,.13); border-radius: 10px; padding: 5px 2px; }
.frstats b { display: flex; justify-content: center; align-items: center; gap: 2px; font-size: 18px; } .frstats small { font-size: 10.5px; font-weight: 700; opacity: .75; }
.lvlbadge { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 3px solid var(--line); background: #ffc22e; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 16px; }
.lvlbadge.pct { background: #6cc24a; color: #fff; }
.frprog small { display: block; text-align: center; font-weight: 700; font-size: 12px; margin-top: 2px; }
.row.tier.hot { background: #fff0b8; } .tag.on { background: #6cc24a; color: #fff; }
.frbtns { grid-template-columns: 3fr 2fr; } .frbtns .tin { font-size: clamp(13px, 3.9vw, 17px); padding: 0 8px; white-space: nowrap; }

/* ---------- погода ---------- */
.chip.wx { height: 28px; font-size: 13px; flex: none; padding: 0 9px 0 4px; color: #fff3d6; }
.chip.wx .ic { width: 22px; height: 22px; }
.chip.wx.cold { background: #2c4766; animation: shiver 2.4s infinite; }
@keyframes shiver { 0%, 90%, 100% { transform: none; } 92% { transform: translateX(-1.5px); } 94% { transform: translateX(1.5px); } 96% { transform: translateX(-1px); } }
.wxp .wxnow { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.wxp .wxnow b { font-size: 20px; }
.wxp .svgi.big { width: 64px; height: 64px; flex: none; }
.wxp .svgi.big svg { width: 100%; height: 100%; }
.wxfx { background: #fff8e6; border: 3px solid var(--line); border-radius: 12px; padding: 4px 12px; margin-bottom: 8px; }
.wxfx p { margin: 6px 0; }
.wxfc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.wxd { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff8e6; border: 3px solid var(--line); border-radius: 12px; padding: 6px 2px; }
.wxd span { font-size: 13px; opacity: .75; }
.wxd .svgi { width: 34px; height: 34px; } .wxd .svgi svg { width: 100%; height: 100%; }
.result .wxbonus { display: flex; align-items: center; justify-content: center; gap: 6px; color: #2c6db0; font-weight: 700; }
.result .wxbonus .ic { width: 24px; height: 24px; }
.wxp h3 { margin: 4px 0 6px; }
@media (orientation: landscape) {
  .modal.wxmodal { width: min(720px, 94vw); }
  .wxp { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; align-items: start; }
  .wxp .wxfc { grid-template-columns: 1fr; gap: 5px; }
  .wxfx { font-size: 15px; } .wxfx p { margin: 5px 0; }
  .wxp .wxnow b { font-size: 18px; }
  .wxp .wxd { flex-direction: row; justify-content: space-between; padding: 2px 12px; }
  .wxp .wxd .svgi { width: 30px; height: 30px; }
  .wxp .svgi.big { width: 52px; height: 52px; }
}
/* шапка в одну строку: полоска под иконкой, чтобы всегда была видна */
@media (orientation: landscape) and (max-height: 520px) {
  .stats { flex: none; }
  .cash, .cash .chip, .chip .ic, .chip .plus { flex: none; }
  .st { margin: 0; }
  .st { flex: none; flex-direction: column; gap: 2px; padding: 3px 5px 4px; max-width: none; border-radius: 10px; }
  .st .ic { width: 20px; height: 20px; }
  .st .bar { flex: none; width: 26px; height: 5px; }
}
/* узкий горизонтальный экран (iPhone SE и т.п.): шапка в две строки, ничего не налезает */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 760px) {
  .hud { flex-direction: column; align-items: flex-start; gap: 2px; }
  .hud-row.stats { margin-left: 4px; }
  .who-txt { flex: none; max-width: 150px; }
  .scene-name { top: calc(var(--sat) + 104px); height: 36px; font-size: 16px; }
  .hint { top: calc(var(--sat) + 146px); }
}
.prep .prep-help { font-size: 13px; line-height: 1.3; margin: 8px 0; text-align: center; }
@media (max-height: 420px) { .prep .vs img { height: 76px; } .prep .at span { padding: 1px 2px; } }
@media (orientation: landscape) and (max-height: 420px) {
  .lrow b { font-size: 13px; margin-bottom: 2px; }
  .sw { min-height: 17px; border-radius: 6px; }
  .look .lopts { gap: 4px; }
}
.lrow b .chname { font-style: normal; color: #b5462b; }
@media (orientation: landscape) and (max-height: 420px) { .chb span { display: none; } .chb { padding: 2px; } }
@media (orientation: landscape) and (max-height: 520px) {
  .hint { left: calc(50% - 44px); max-width: max(260px, calc(100vw - 380px)); }
  .hint.big { left: calc(50% - 110px); max-width: max(200px, calc(100vw - 520px)); }
}
/* меню справа помещается на любой высоте: начинается от верха (шапка до него не доходит), пункты сжимаются */
@media (orientation: landscape) and (max-height: 520px) {
  .nav { top: calc(var(--sat) + 6px); overflow: hidden; justify-content: space-between; }
  .nav-b { flex: 1 1 0; min-height: 0; justify-content: center; }
  .nav-b .svgi, .nav-b .ic { width: clamp(20px, calc((100dvh - var(--sat) - var(--sab)) / 7 - 18px), 30px); height: clamp(20px, calc((100dvh - var(--sat) - var(--sab)) / 7 - 18px), 30px); }
  .nav-b .nl { line-height: 1.1; white-space: nowrap; }
}
@media (orientation: landscape) and (max-height: 330px) {
  .nav-b .nl { display: none; }
  .nav-b .svgi, .nav-b .ic { width: clamp(22px, calc((100dvh - var(--sat) - var(--sab)) / 7 - 8px), 30px); height: clamp(22px, calc((100dvh - var(--sat) - var(--sab)) / 7 - 8px), 30px); }
}

/* ---------- достижения и профили ---------- */
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.ach { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 3px solid var(--line); border-radius: 14px; background: #fff6df; box-shadow: 0 3px 0 var(--line); }
.ach.ready { background: #fff0b8; }
.ach .rn { flex: 1; min-width: 0; } .ach .rn b { font-size: 14px; } .ach .muted { font-size: 12px; }
.ach small.gold { color: #b07a10; font-weight: 800; }
.achi { position: relative; width: 50px; height: 50px; flex: none; border-radius: 12px; border: 3px solid var(--line); background: #e3cfa4; display: flex; align-items: center; justify-content: center; }
.ach.t1 .achi { background: #e7b07a; } .ach.t2 .achi { background: #d6dde3; } .ach.t3 .achi { background: #ffd54a; }
.achi .svgi { width: 34px; height: 34px; } .achi .svgi svg { width: 100%; height: 100%; }
.achi .medals { position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; }
.achi .medals b { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); background: #8a7a62; }
.achi .medals b.on.m0 { background: #cd7f32; } .achi .medals b.on.m1 { background: #c0c8cf; } .achi .medals b.on.m2 { background: #ffc22e; }
.pphead { display: flex; gap: 12px; align-items: center; }
.pphead img { width: 96px; height: 120px; object-fit: contain; flex: none; background: #e3cfa4; border: 3px solid var(--line); border-radius: 14px; }
.pphead h3 { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; } .pphead p { margin: 3px 0; }
.btagx { color: #b5462b; }
.online { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: #5bb03a; border: 2px solid var(--line); flex: none; }
.online.off { background: #9a8f80; }
.pat { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 8px 0; }
.ppach { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ppach .pa { width: 40px; height: 40px; border-radius: 10px; border: 3px solid var(--line); display: flex; align-items: center; justify-content: center; }
.ppach .pa.t1 { background: #e7b07a; } .ppach .pa.t2 { background: #d6dde3; } .ppach .pa.t3 { background: #ffd54a; }
.ppach .pa .svgi { width: 26px; height: 26px; } .ppach .pa .svgi svg { width: 100%; height: 100%; }
.row.tap, .kv.tap { cursor: pointer; } .kv.tap { width: 100%; border: none; background: none; font: inherit; color: inherit; text-align: left; padding: 0; }
.row .chev { font-size: 22px; font-weight: 900; opacity: .5; }
.pat span { display: flex; flex-direction: column; align-items: center; padding: 3px 2px; }
.pat span small { font-size: 11px; font-weight: 700; opacity: .75; } .pat span b { font-size: 16px; }
.barber .groomed { background: #e3f3d6; border: 3px solid var(--line); border-radius: 12px; padding: 6px 10px; font-weight: 800; margin: 0 0 6px; }
.barber .lprev { max-height: 46vh; }
@media (max-height: 420px) { .barber .row .muted { font-size: 12px; } .barber .row { padding: 4px 8px; } }

/* цирюльня: бороды */
.barber .beards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.barber .bd { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 10px; border: 3px solid var(--line); background: #fff6df; color: var(--ink); font: inherit; font-weight: 700; font-size: 11px; min-height: 64px; justify-content: center; }
.barber .bd img { width: 44px; height: 40px; object-fit: contain; }
.barber .bd.on { background: #ffd34d; box-shadow: 0 3px 0 var(--line); }
.gi.acc { background: rgba(255,255,255,.06); }
.gi.acc img { width: 100%; height: 100%; object-fit: contain; padding: 3px; box-sizing: border-box; }
.work .how { font-size: 12px; font-weight: 700; color: #8a5a2b; }
.mg-foot .sortbtn { flex: 1; min-width: 0; color: #2b1a10; text-shadow: none; }

/* ---------- мультик-вступление ---------- */
.intro { position: fixed; inset: 0; z-index: 80; background: #000; transition: opacity .7s; cursor: pointer; }
.intro.off { opacity: 0; pointer-events: none; }
.intro canvas { position: absolute; inset: 0; }
.intro .isub { position: absolute; left: 0; right: 0; bottom: 0; height: 8vh; min-height: 44px; display: flex; align-items: center; justify-content: center; padding: 0 6vw; }
.intro .isub p { margin: 0; color: #fff1d0; font: 700 clamp(15px, 2.4vw, 22px)/1.25 'Balsamiq Sans', Rubik, sans-serif; text-align: center; text-shadow: 0 2px 0 #000; }
.intro .iskip { position: absolute; top: calc(var(--sat) + 1.5vh); right: calc(var(--sar, 0px) + 14px); background: rgba(0,0,0,.45); color: #fff1d0; border: 2px solid rgba(255,241,208,.5); border-radius: 18px; padding: 6px 14px; font: 700 14px Rubik, sans-serif; }

/* ---------- оформление из рисованного набора: бумага, доски, картон, скотч ---------- */
.modal { border: 30px solid transparent; border-image: url(assets/v2/ui/kit/paper.png) 80 fill / 30px stretch; background: none; border-radius: 0;
  box-shadow: none; filter: drop-shadow(0 6px 0 rgba(43,26,16,.55)); padding: 18px 4px 2px; }
.modal::before { content: ""; position: absolute; top: -40px; left: -34px; width: 96px; height: 30px; background: url(assets/v2/ui/kit/tape.png) center/100% 100% no-repeat; transform: rotate(-28deg); pointer-events: none; }
.plank { top: -54px; height: 54px; border: 16px solid transparent; border-image: url(assets/v2/ui/kit/plank.png) 40 70 fill / 16px 28px stretch; background: none; box-shadow: none; border-radius: 0;
  padding: 0 10px; filter: drop-shadow(0 4px 0 rgba(43,26,16,.5)); box-sizing: border-box; }
.plank h2 { color: #fff6e2; text-shadow: 0 2px 0 var(--line), 0 0 6px rgba(43,26,16,.6); }
.x { top: -52px; right: -40px; width: 50px; height: 50px; border: none; border-radius: 0; background: url(assets/v2/ui/kit/close.png) center/contain no-repeat; box-shadow: none; filter: drop-shadow(0 2px 0 rgba(43,26,16,.6)); }
.x::before, .x::after { display: none; }
.tin { border: 14px solid transparent; border-image: url(assets/v2/ui/kit/plank.png) 40 70 fill / 14px 24px stretch; background: none; border-radius: 0; box-shadow: none;
  filter: drop-shadow(0 4px 0 rgba(43,26,16,.55)); padding: 0 6px; min-height: 52px; color: #2b1a10; text-shadow: 0 1px 0 rgba(255,240,200,.6); }
.tin:active { transform: translateY(3px); border-image-source: url(assets/v2/ui/kit/plank_down.png); filter: drop-shadow(0 1px 0 rgba(43,26,16,.55)); box-shadow: none; color: #fff1d0; text-shadow: 0 1px 0 #2b1a10; }
.tin.grey { filter: drop-shadow(0 4px 0 rgba(43,26,16,.55)) saturate(.25) brightness(1.08); background: none; }
.tin.live { filter: drop-shadow(0 4px 0 rgba(43,26,16,.55)) hue-rotate(55deg) saturate(1.3); background: none; }
.tabs button { border: 10px solid transparent; border-image: url(assets/v2/ui/kit/tab.png) 30 50 fill / 10px 14px stretch; background: none; border-radius: 0; box-shadow: none; height: 40px; padding: 0; }
.tabs button.on { background: none; filter: brightness(1.12) drop-shadow(0 0 0 #2b1a10); transform: translateY(-3px); border-image-source: url(assets/v2/ui/kit/cardboard.png); }

/* ---------- верхняя панель из рисованного набора: жесть, пробка, эмалированная табличка ---------- */
.who { border: none; background: #c9a36a; box-shadow: none; overflow: visible; border-radius: 50%; }
.who img { border-radius: 50%; width: 100%; margin: 0; clip-path: circle(46%); }
.who::after { content: ""; position: absolute; inset: -6px; background: url(assets/v2/ui/kit/ring.png) center/100% 100% no-repeat; pointer-events: none; filter: drop-shadow(0 2px 0 rgba(43,26,16,.6)); }
.who .lvl { z-index: 2; right: -8px; bottom: -8px; width: 28px; height: 28px; min-width: 0; border: none; border-radius: 0; background: url(assets/v2/ui/kit/cap.png) center/100% 100% no-repeat;
  line-height: 28px; font-size: 13px; color: #2b1a10; text-shadow: 0 1px 0 rgba(255,240,200,.7); }
.chip { border: 9px solid transparent; border-image: url(assets/v2/ui/kit/plate.png) 30 60 fill / 9px 16px stretch; background: none; border-radius: 0; box-shadow: none;
  color: #2b1a10; text-shadow: 0 1px 0 rgba(255,240,200,.6); padding: 0 4px; filter: drop-shadow(0 2px 0 rgba(43,26,16,.55)); }
.chip.wx.cold { background: none; filter: drop-shadow(0 2px 0 rgba(43,26,16,.55)) hue-rotate(190deg); }
.chip .plus { background: #5bb03a; color: #fff; }
.st { border: 7px solid transparent; border-image: url(assets/v2/ui/kit/plate.png) 30 60 fill / 7px 12px stretch; background: none; border-radius: 0; box-shadow: none; padding: 0 2px 0 0;
  filter: drop-shadow(0 2px 0 rgba(43,26,16,.5)); }
.st .bar { background: #3a332c; border: 1.5px solid #2b1a10; height: 8px; }
.st.low { animation: lowf .8s infinite; } @keyframes lowf { 50% { filter: drop-shadow(0 0 6px #e2513d) brightness(1.15); } }
.scene-name { border: 12px solid transparent; border-image: url(assets/v2/ui/kit/sign.png) 60 90 fill / 12px 22px stretch; background: none; border-radius: 0; box-shadow: none;
  height: 46px; padding: 0 8px; color: #fff; text-shadow: 0 1px 0 #10225a; filter: drop-shadow(0 3px 0 rgba(43,26,16,.55)); box-sizing: border-box; display: flex; align-items: center; justify-content: center; }
.edge { border: 10px solid transparent; border-image: url(assets/v2/ui/kit/plank.png) 40 70 fill / 10px 18px stretch; background: none; border-radius: 0; box-shadow: none; padding: 0 4px;
  color: #2b1a10; text-shadow: 0 1px 0 rgba(255,240,200,.6); filter: drop-shadow(0 3px 0 rgba(43,26,16,.55)); }

/* ---------- магазин: прилавок с ценниками ---------- */
.store { display: grid; grid-template-columns: 34% 1fr; gap: 10px; align-items: start; }
.store .zina { position: sticky; top: 0; display: flex; flex-direction: column; align-items: center; }
.store .zina img { width: 100%; max-height: 190px; object-fit: contain; object-position: top; transform: scaleX(-1); }
.store .zsay { margin: 4px 0 0; background: #fff8e6; border: 3px solid var(--line); border-radius: 14px; padding: 6px 9px; font-size: 13px; font-weight: 700; line-height: 1.25; position: relative; }
.store .zsay::before { content: ""; position: absolute; top: -12px; left: 50%; border: 6px solid transparent; border-bottom-color: var(--line); }
.store .zsay.pop { animation: bump .35s; }
.store .tags { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.store .tag { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 8px 9px 34px; min-height: 92px; text-align: left; color: #2b1a10;
  border: 10px solid transparent; border-image: url(assets/v2/ui/kit/cardboard.png) 40 60 fill / 10px 14px stretch; background: none; filter: drop-shadow(0 3px 0 rgba(43,26,16,.5)); transition: transform .08s; }
.store .tag:nth-child(odd) { transform: rotate(-1.2deg); } .store .tag:nth-child(even) { transform: rotate(1deg); }
.store .tag:active { transform: scale(.96); }
.store .tag .tn { font-size: 14px; line-height: 1.15; }
.store .tag .te { display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: 12px; font-weight: 700; }
.store .tag .tp { position: absolute; right: -4px; bottom: -2px; padding: 3px 12px; font-weight: 900; font-size: 17px; color: #2b1a10;
  border: 8px solid transparent; border-image: url(assets/v2/ui/kit/tin.png) 30 40 fill / 8px 10px stretch; transform: rotate(-4deg); }
.store .tag.poor { filter: drop-shadow(0 3px 0 rgba(43,26,16,.5)) grayscale(.6) brightness(.92); }
.store .tag.bought { animation: bump .35s; }
.store .tag.shake { animation: shake .35s; } @keyframes shake { 25% { translate: -5px 0; } 75% { translate: 5px 0; } }
@media (orientation: portrait) { .store { grid-template-columns: 1fr; } .store .zina { position: static; flex-direction: row; gap: 8px; } .store .zina img { width: 90px; } }

/* ---------- меню: картон; кнопка паузы - крышка от кастрюли ---------- */
.nav { border: 14px solid transparent; border-image: url(assets/v2/ui/kit/cardboard.png) 40 60 fill / 14px 16px stretch; background: none; border-radius: 0; box-shadow: none; filter: drop-shadow(0 4px 0 rgba(43,26,16,.5)); padding: 0 2px; }
.nav-b { color: #2b1a10; text-shadow: 0 1px 0 rgba(255,240,200,.6); }
.lid { flex: none; width: 46px; height: 40px; margin-left: 4px; border: none; background: url(assets/v2/ui/kit/lid.png) center/contain no-repeat; filter: drop-shadow(0 2px 0 rgba(43,26,16,.6)); padding: 0; }
.lid:active { transform: translateY(2px) rotate(-8deg); }
.pausem { display: flex; flex-direction: column; gap: 8px; }
.pausem .tog b { margin-left: 4px; }
.pausem .tog:not(.on) { filter: drop-shadow(0 4px 0 rgba(43,26,16,.55)) saturate(.25) brightness(1.05); }
.prof + .docs, .docs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 6px 0; }
.docs img { width: 34px; height: 34px; object-fit: contain; filter: grayscale(1) opacity(.35); }
.docs img.on { filter: drop-shadow(0 2px 0 rgba(43,26,16,.4)); }
.docs .muted { flex-basis: 100%; font-size: 12px; }
.flash { position: fixed; inset: 0; background: #fff; z-index: 90; pointer-events: none; animation: flash .6s forwards; } @keyframes flash { to { opacity: 0; } }

.btn-row.stack { flex-direction: column; align-items: stretch; gap: 6px; }
.btn-row.stack .tin { width: 100%; min-height: 0; padding: 8px 18px; font-size: 15px; white-space: normal; }

.taxi { display: flex; flex-direction: column; gap: 8px; }
.taxi .tx-car { width: 160px; align-self: center; margin-top: -6px; }
.tx-m { display: grid; grid-template-columns: 70px 1fr 56px; align-items: center; gap: 8px; font-weight: 700; }
.tx-m i { height: 12px; border: 2px solid #2b1a10; border-radius: 7px; background: #e9dcc0; overflow: hidden; }
.tx-m i b { display: block; height: 100%; }
.tx-m i.fuel b { background: #f2b33d; } .tx-m i.wear b { background: #c9512a; }
.tx-m em { font-style: normal; text-align: right; }
.tx-day { margin: 2px 0; opacity: .8; }
.tx-list { display: flex; flex-direction: column; gap: 6px; }
.tx-o { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; text-align: left; gap: 0 10px; padding: 8px 12px; border: 3px solid #2b1a10; border-radius: 10px; background: #fff6e2; font: inherit; cursor: pointer; }
.tx-o b { grid-column: 1; } .tx-o span { grid-column: 1; font-size: 13px; opacity: .8; } .tx-o em { grid-column: 2; grid-row: 1 / 3; align-self: center; font-style: normal; font-weight: 800; }
.tx-o:disabled { opacity: .45; cursor: default; }

.kent-now { font-weight: 800; font-size: 16px; margin: 4px 0 8px; }
.kent-why .rn b { font-size: 15px; }
.prem { color: #b8860b; font-size: 12px; font-weight: 800; }

.dlg-card { display: block; width: 100%; max-width: 420px; margin: 0 auto 10px; border: 3px solid #2b1a10; border-radius: 10px; }
