@font-face { font-family: 'Pixelify Sans'; font-weight: 400; font-display: swap; src: url(../fonts/pixelify-sans-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Pixelify Sans'; font-weight: 400; font-display: swap; src: url(../fonts/pixelify-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Pixelify Sans'; font-weight: 700; font-display: swap; src: url(../fonts/pixelify-sans-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Pixelify Sans'; font-weight: 700; font-display: swap; src: url(../fonts/pixelify-sans-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #17121f; --bg2: #1d1628; --panel: #241c30; --panel2: #2e2440; --line: #4a3d63; --line2: #5d4e7a;
  --text: #efe6d8; --muted: #a596b8; --dim: #74688a;
  --gold: #f2c14e; --gold2: #d4a72c; --green: #5faf7a; --red: #e25c5c; --blue: #4a90c2; --violet: #8e6cc9;
  --E: #8fb0d4; --M: #f0a8c0; --B: #c9b5e8;
  --px: 'Pixelify Sans', ui-monospace, monospace;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
body { min-height: 100vh; overscroll-behavior-y: none; overflow-x: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  background: radial-gradient(1200px 600px at 50% -200px, #2b2046 0%, transparent 70%), var(--bg); }
.hidden { display: none !important; }
canvas.px, .px { image-rendering: pixelated; image-rendering: crisp-edges; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, .logo, .d20, .levelup .big { font-family: var(--px); letter-spacing: .02em; }
h3, .btn, .chip, .tag, .num, .nav button, .tabs button, .stepper button, .tri button { font-family: inherit; font-weight: 700; }
h2 { font-size: 22px; margin: 0 0 12px; color: var(--gold); text-shadow: 2px 2px 0 #000; }
h3 { font-size: 17px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.err { color: #ff8a8a; min-height: 1.4em; }

/* пиксельные панели */
.card { background: var(--panel); border: 3px solid var(--line); box-shadow: 0 0 0 3px #0e0a15, 6px 6px 0 0 rgba(0,0,0,.35); border-radius: 2px; padding: 14px; margin: 0 0 16px; position: relative; }
.card.gold { border-color: var(--gold2); }
.card.dark { background: var(--bg2); }
.card h3 { color: var(--gold); }
.btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center; border: 0; padding: 10px 16px; font-size: 16px; background: var(--panel2); color: var(--text);
  box-shadow: inset -3px -3px 0 rgba(0,0,0,.35), inset 3px 3px 0 rgba(255,255,255,.12), 0 0 0 3px #0e0a15; margin: 3px; min-height: 42px; transition: transform .06s; }
.btn:active { transform: translateY(2px); box-shadow: inset 3px 3px 0 rgba(0,0,0,.35), 0 0 0 3px #0e0a15; }
.btn.gold { background: var(--gold2); color: #2a1c08; }
.btn.green { background: #3f8a5a; } .btn.red { background: #a23b3b; } .btn.blue { background: #2f5d9b; }
.btn.small { padding: 6px 10px; font-size: 14px; min-height: 34px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { background: var(--panel2); border: 0; width: 36px; height: 36px; font-size: 18px; box-shadow: 0 0 0 2px #0e0a15, inset -2px -2px 0 rgba(0,0,0,.3); display: inline-flex; align-items: center; justify-content: center; }
input, textarea, select { font: inherit; color: var(--text); background: #120e1a; border: 3px solid var(--line); padding: 10px 12px; width: 100%; border-radius: 0; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--gold2); }
textarea { min-height: 90px; resize: vertical; }
input[type=range] { padding: 0; border: 0; background: none; accent-color: var(--gold); height: 32px; }
label.field { display: block; margin: 0 0 12px; } label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* вход */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px calc(24px + var(--safe-b)); text-align: center; }
.login-art { width: min(560px, 100%); aspect-ratio: 16/9; border: 3px solid var(--line); box-shadow: 0 0 0 3px #0e0a15; }
.logo { font-size: 34px; color: var(--gold); text-shadow: 3px 3px 0 #000; margin: 18px 0 4px; }
.login-sub { color: var(--muted); }
#login-form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
#login-code { text-align: center; font-family: var(--px); font-size: 22px; letter-spacing: .12em; }
.login-foot { color: var(--dim); font-size: 12px; max-width: 360px; margin-top: 18px; }

/* каркас */
.app { min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: calc(8px + var(--safe-t)) 10px 8px; min-width: 0;
  background: rgba(23,18,31,.94); backdrop-filter: blur(6px); border-bottom: 3px solid #0e0a15; }
.logo-btn { background: none; border: 0; font-family: var(--px); font-size: 19px; color: var(--gold); text-shadow: 2px 2px 0 #000; padding: 0; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; text-align: left; }
.top-chips { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.chip { background: var(--panel2); padding: 4px 8px; font-size: 13px; box-shadow: 0 0 0 2px #0e0a15; white-space: nowrap; }
.chip.coin { color: var(--gold); }
.net { width: 10px; height: 10px; background: var(--green); box-shadow: 0 0 0 2px #0e0a15; }
.net.off { background: var(--red); animation: blink 1s steps(2) infinite; }
.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; overflow-x: auto; scrollbar-width: none; background: #120e1a; border-top: 3px solid #0e0a15; padding: 4px 4px calc(4px + var(--safe-b)); }
.nav::-webkit-scrollbar { display: none; }
.nav button { flex: 1 1 0; min-width: 0; background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 1px; color: var(--muted); font-size: clamp(9px, 2.7vw, 12px); }
.nav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav button canvas { width: 22px; height: 22px; opacity: .7; }
.nav button.on { color: var(--gold); background: var(--panel); box-shadow: inset 0 -3px 0 var(--gold2); }
.nav button.on canvas { opacity: 1; transform: translateY(-1px); }
.view { padding: 14px 12px calc(96px + var(--safe-b)); max-width: 1180px; margin: 0 auto; animation: fadein .18s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: .2; } }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 200px 1fr; grid-template-rows: auto 1fr; }
  .top { grid-column: 1 / 3; }
  .nav { position: sticky; top: 56px; height: calc(100vh - 56px); flex-direction: column; border-top: 0; border-right: 3px solid #0e0a15; padding: 12px 8px; overflow: auto; }
  .nav button { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 10px; font-size: 16px; padding: 10px 12px; }
  .nav button canvas { width: 24px; height: 24px; }
  .nav button.on { box-shadow: inset 4px 0 0 var(--gold2); }
  .view { padding: 20px 24px 40px; width: 100%; }
  .cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
  .cols.even { grid-template-columns: 1fr 1fr; }
}

/* общие элементы */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.cols > *, .party > *, .grid2 > * { min-width: 0; }
.bar { height: 14px; background: #120e1a; box-shadow: 0 0 0 2px #0e0a15; position: relative; overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--gold); transition: width .5s steps(12); }
.bar > i::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(0,0,0,.18) 6px 8px); }
.bar.hp > i { background: var(--green); } .bar.hp.mid > i { background: var(--gold); } .bar.hp.low > i { background: var(--red); }
.bar.xp > i { background: linear-gradient(#b48cf0, #7d55c7); }
.bar.boss > i { background: linear-gradient(#ff7a6a, #b33a3a); }
.bar-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 6px 0 3px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 6px; box-shadow: 0 0 0 2px #0e0a15; background: var(--panel2); }
.tag.E { background: #2f4a6b; color: #d8e8f8; } .tag.M { background: #6b2f4a; color: #ffe0ea; } .tag.B { background: #4a3d63; color: #efe6ff; }
.stat { background: var(--bg2); padding: 10px; box-shadow: 0 0 0 2px #0e0a15; }
.stat b { display: block; font-size: 22px; color: var(--gold); }
.stat span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.empty { color: var(--dim); text-align: center; padding: 18px; }

/* лагерь */
.scene-wrap { position: relative; margin: 0 0 16px; }
.scene { display: block; width: 100%; aspect-ratio: 16/9; border: 3px solid var(--line); box-shadow: 0 0 0 3px #0e0a15, 6px 6px 0 rgba(0,0,0,.35); background: #110c22; cursor: pointer; touch-action: manipulation; }
.bubble { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); width: max-content; max-width: min(92%, 420px); background: #f3e2b8; color: #2a1c08; padding: 8px 12px 10px; font-weight: 600; font-size: 15px;
  box-shadow: 0 0 0 3px #0e0a15, 4px 4px 0 rgba(0,0,0,.4); animation: pop .2s ease-out; text-align: center; cursor: pointer; z-index: 2; }
.bubble .who { display: block; font-size: 12px; color: #7a5230; margin-bottom: 2px; }
.bubble .left { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: rgba(122,82,48,.45); transform-origin: left; animation: shrink linear forwards; }
@keyframes shrink { to { transform: scaleX(0); } }
@keyframes pop { from { transform: translateX(-50%) scale(.8); opacity: 0; } }
.names { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; margin-top: -8px; margin-bottom: 12px; padding: 0 4px; }
.party { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.mini-hero h3 { margin: 0; font-size: 16px; }
.mini-hero .t { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.event-card { display: flex; gap: 12px; align-items: center; }
.d20 { flex: 0 0 auto; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; font-family: var(--px); font-size: 26px; color: #fff;
  background: #2f5d9b; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); text-shadow: 2px 2px 0 #0e0a15; }
.d20.big { width: 96px; height: 96px; font-size: 40px; }
.d20.spin { animation: spin .12s linear infinite; }
.d20.crit { background: #d4a72c; } .d20.fail { background: #a23b3b; }
@keyframes spin { 50% { transform: rotate(20deg) scale(1.08); } }

/* неделя */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.week-nav .title { text-align: center; } .week-nav .title b { font-size: 22px; color: var(--gold); display: block; } .week-nav .title span { font-size: 13px; color: var(--muted); }
.sec { margin-bottom: 14px; border-left: 6px solid var(--c, var(--line)); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; user-select: none; }
.sec-head h3 { margin: 0; color: var(--text); }
.sec-head .cnt { font-weight: 700; color: var(--muted); font-size: 14px; }
.sec.closed .rules { display: none; }
.boss-hint { font-size: 12px; color: #ffb0a0; margin: 4px 0 0; }
.rule { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 2px dashed rgba(255,255,255,.07); }
.rule:first-child { border-top: 0; }
.rule .txt { font-size: 15px; overflow-wrap: anywhere; }
.rule .txt .tag { margin-right: 6px; font-size: 11px; vertical-align: 1px; }
.tri { display: flex; gap: 6px; }
.tri button { width: 40px; height: 40px; border: 0; background: #120e1a; box-shadow: 0 0 0 2px #0e0a15, inset -2px -2px 0 rgba(0,0,0,.4); font-size: 18px; color: var(--dim); }
.tri button.on[data-m=y] { background: #3f8a5a; color: #fff; } .tri button.on[data-m=h] { background: #b88a2a; color: #fff; } .tri button.on[data-m=n] { background: #a23b3b; color: #fff; }
.tri button.on { animation: stamp .18s ease-out; }
@keyframes stamp { from { transform: scale(1.35); } }
.numrow { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 2px dashed rgba(255,255,255,.07); }
.numrow:first-of-type { border-top: 0; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 38px; height: 38px; border: 0; background: var(--panel2); box-shadow: 0 0 0 2px #0e0a15; font-size: 20px; }
.stepper .num { min-width: 42px; text-align: center; font-size: 20px; color: var(--gold); }
.mood-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 34px; align-items: center; gap: 8px; }
.mood-row .num { text-align: right; color: var(--gold); font-size: 18px; }
.save-note { font-size: 12px; color: var(--green); min-height: 1.2em; }

/* квесты */
.quest { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 2px dashed rgba(255,255,255,.07); }
.quest:first-child { border-top: 0; }
.quest .check { width: 34px; height: 34px; border: 0; background: #120e1a; box-shadow: 0 0 0 2px #0e0a15; font-size: 20px; color: #fff; }
.quest.done .check { background: #3f8a5a; }
.quest.done .qt { text-decoration: line-through; color: var(--muted); }
.quest .xp { font-weight: 700; color: #c9a8ff; white-space: nowrap; }

/* арена */
.boss { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; }
.boss canvas.sprite { width: 96px; height: 96px; background: radial-gradient(#3a2d50, #1d1628 70%); box-shadow: 0 0 0 3px #0e0a15; animation: bob 1.2s steps(2) infinite; }
.boss.locked canvas.sprite { animation: none; }
.boss.dead canvas.sprite { filter: grayscale(1) brightness(.6); animation: none; }
.boss.dead h3::after { content: ' · ПОБЕЖДЁН'; color: var(--green); font-size: 13px; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.battle-cv { width: 100%; aspect-ratio: 16/9; border: 3px solid var(--line); background: #120e1a; }
.battle-cap { font-weight: 700; text-align: center; min-height: 1.5em; margin-top: 8px; color: var(--gold); }

/* карта */
.map-cv { width: 100%; aspect-ratio: 192/108; border: 3px solid var(--line); box-shadow: 0 0 0 3px #0e0a15, 6px 6px 0 rgba(0,0,0,.35); cursor: pointer; touch-action: manipulation; display: block; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 6px; }
.legend button { text-align: left; background: var(--bg2); border: 0; box-shadow: 0 0 0 2px #0e0a15; padding: 8px 10px; display: flex; gap: 8px; align-items: center; }
.legend button.on { background: var(--panel2); box-shadow: 0 0 0 2px var(--gold2); }
.legend .n { font-weight: 700; color: var(--gold); min-width: 22px; }
.legend .past { color: var(--muted); }

/* лавка */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { border: 0; background: var(--bg2); box-shadow: 0 0 0 2px #0e0a15; padding: 8px 12px; font-size: 15px; color: var(--muted); }
.tabs button.on { background: var(--panel2); color: var(--gold); box-shadow: 0 0 0 2px var(--gold2); }
.goods { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 12px; }
@media (max-width: 380px) { .goods { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; } }
.good { background: var(--bg2); box-shadow: 0 0 0 3px #0e0a15; padding: 12px 10px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; position: relative; }
.good .nm { font-size: 14px; min-height: 2.8em; display: flex; align-items: center; }
.good .pr { font-weight: 700; color: var(--gold); font-size: 18px; }
.good .pr s { color: var(--dim); font-size: 13px; margin-right: 4px; }
.good .own { position: absolute; top: 6px; right: 6px; }
.good.owned { opacity: .55; }
.purchase { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 2px dashed rgba(255,255,255,.07); }
.purchase:first-child { border-top: 0; }
.purchase.done .pn { text-decoration: line-through; color: var(--muted); }
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 6px; }
.icon-pick button { width: 44px; height: 44px; border: 0; background: #120e1a; box-shadow: 0 0 0 2px #0e0a15; padding: 4px; }
.icon-pick button.on { box-shadow: 0 0 0 3px var(--gold); }

/* герои */
.sheet-head { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 14px; align-items: center; }
.portrait { width: 128px; height: 128px; background: radial-gradient(#3a2d50, #1d1628 70%); box-shadow: 0 0 0 3px #0e0a15; }
.sheet-head h3 { font-size: 24px; margin: 0; } .sheet-head .cls { color: var(--muted); font-weight: 700; }
.skills { display: grid; gap: 10px; }
.tier { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: stretch; }
.tier .lv { font-weight: 700; color: var(--muted); display: flex; align-items: center; justify-content: center; background: #120e1a; box-shadow: 0 0 0 2px #0e0a15; }
.skill { background: #120e1a; border: 0; box-shadow: 0 0 0 2px #0e0a15; padding: 8px; text-align: left; display: grid; grid-template-columns: 28px 1fr; gap: 6px; align-items: start; font-size: 13px; color: var(--muted); }
.skill b { color: var(--text); display: block; font-size: 14px; }
.skill.chosen { background: #2c2445; box-shadow: 0 0 0 3px var(--gold2); color: var(--text); }
.skill.locked { opacity: .45; }
.skill.other { opacity: .35; }
.inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.slot { aspect-ratio: 1; background: #120e1a; box-shadow: 0 0 0 2px #0e0a15, inset 0 0 0 2px #2a2238; display: flex; align-items: center; justify-content: center; border: 0; padding: 6px; }
.slot.has { box-shadow: 0 0 0 2px #0e0a15, inset 0 0 0 2px var(--gold2); }
.slot canvas { width: 100%; height: 100%; }
.gear li { margin: 2px 0; } .gear li.off { color: var(--dim); }
.gear { margin: 0; padding-left: 18px; font-size: 14px; }

/* хроника */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); gap: 10px; }
.ach { background: var(--bg2); box-shadow: 0 0 0 2px #0e0a15; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; border: 0; }
.ach b { font-size: 14px; } .ach span { font-size: 12px; color: var(--muted); }
.ach.off { opacity: .45; } .ach.off canvas { filter: grayscale(1) brightness(.5); }
.ach.on { box-shadow: 0 0 0 2px var(--gold2); }
.chron-week { border-left: 4px solid var(--gold2); padding: 2px 0 2px 12px; margin-bottom: 14px; }
.chron-week h3 { font-size: 16px; margin-bottom: 4px; }
.chron-week p { margin: 0 0 3px; font-size: 14px; }
.chron-week .note { color: #f3e2b8; font-style: italic; }
.trophy { text-align: center; }
.trophy canvas { width: 96px; height: 96px; }

/* модалка и тосты */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(8,5,14,.75); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadein .15s; }
.modal-box { background: var(--panel); border: 3px solid var(--line2); box-shadow: 0 0 0 3px #0e0a15, 8px 8px 0 rgba(0,0,0,.4); width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; padding: 18px; }
.modal-box h2 { margin-right: 30px; }
.modal-x { position: sticky; top: 0; float: right; }
.toasts { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(64px + var(--safe-t)); display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 24px)); pointer-events: none; }
.toast { pointer-events: auto; cursor: pointer; background: #2c2445; border: 3px solid var(--gold2); box-shadow: 0 0 0 3px #0e0a15, 4px 4px 0 rgba(0,0,0,.4); padding: 10px 12px; display: flex; gap: 10px; align-items: center; animation: slidein .25s ease-out; font-size: 14px; }
.toast b { color: var(--gold); display: block; font-size: 16px; }
.toast.bad { border-color: var(--red); }
.toast canvas { width: 32px; height: 32px; flex: 0 0 auto; }
@keyframes slidein { from { transform: translateY(-20px); opacity: 0; } }
.levelup { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(8,5,14,.7); animation: fadein .2s; text-align: center; padding: 20px; }
.levelup .big { font-family: var(--px); font-size: 46px; color: var(--gold); text-shadow: 4px 4px 0 #000; animation: zoom .6s steps(6); }
@keyframes zoom { from { transform: scale(.3); } }

@media (max-width: 480px) { .names .hint { display: none; } .tier { grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr); } .skill { grid-template-columns: 1fr; } .stat b { font-size: 18px; }
  .stat { padding: 8px 6px; } .stat span { font-size: 11px; }
  .sheet-head { grid-template-columns: 88px minmax(0, 1fr); gap: 10px; } .portrait { width: 88px; height: 88px; } .sheet-head h3 { font-size: 20px; }
  .card { padding: 12px; } .view { padding-left: 10px; padding-right: 10px; } .mood-row { grid-template-columns: 92px minmax(0, 1fr) 30px; } }
@media (max-width: 380px) { .logo-btn { font-size: 16px; } .chip { padding: 3px 6px; font-size: 12px; } .icon-btn { width: 32px; height: 32px; font-size: 16px; } .top-chips { gap: 5px; }
  .tri button { width: 36px; height: 36px; } .tri { gap: 4px; } .party { gap: 8px; } .mini-hero { padding: 10px; } }

.update-bar { position: fixed; z-index: 65; left: 50%; transform: translateX(-50%); bottom: calc(84px + var(--safe-b)); display: flex; align-items: center; gap: 12px; max-width: calc(100% - 24px);
  background: #2c2445; border: 3px solid var(--gold2); box-shadow: 0 0 0 3px #0e0a15, 4px 4px 0 rgba(0,0,0,.4); padding: 8px 8px 8px 14px; font-weight: 700; animation: slidein .25s ease-out; }
@media (min-width: 900px) { .update-bar { bottom: 24px; } }

/* ---------- меню: 5 вкладок и «Ещё» на телефоне, всё сразу на компьютере ---------- */
.nav .more { display: none; }
@media (max-width: 899px) {
  .nav .sec { display: none; }
  .nav .more { display: flex; }
  .nav button { font-size: clamp(11px, 3.1vw, 13px); }
  .nav button canvas { width: 24px; height: 24px; }
}
@media (min-width: 900px) { .nav .desk { display: flex; } }
.icon-btn.bell { position: relative; font-size: 17px; }
.badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; background: var(--red); color: #fff; font: 700 11px/18px system-ui, sans-serif; text-align: center; box-shadow: 0 0 0 2px #0e0a15; }
.more-btn .badge { position: static; display: inline-block; margin-left: 4px; }
@media (max-width: 420px) { #chip-week { display: none; } }
.modal-box.sheet { align-self: flex-end; width: min(560px, 100%); margin-bottom: calc(env(safe-area-inset-bottom, 0px)); animation: sheetup .2s ease-out; }
@keyframes sheetup { from { transform: translateY(40px); opacity: 0; } }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.more-btn { background: var(--bg2); border: 0; box-shadow: 0 0 0 2px #0e0a15; padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; color: var(--text); min-width: 0; }
.more-btn.on { box-shadow: 0 0 0 3px var(--gold2); color: var(--gold); }

/* ---------- лагерь ---------- */
.wx-chip { position: absolute; left: 6px; top: 6px; background: rgba(14,10,21,.78); color: var(--text); border: 0; font: 13px/1.2 var(--px); padding: 4px 8px; box-shadow: 0 0 0 2px #0e0a15; max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.names #presence { min-width: 0; text-align: center; font-weight: 400; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; }
.pres.on { color: var(--green); font-weight: 700; }
.sign-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.sign-btn { display: flex; align-items: center; gap: 8px; text-align: left; background: var(--bg2); border: 0; box-shadow: 0 0 0 2px #0e0a15, inset -2px -2px 0 rgba(0,0,0,.3); padding: 8px; font-size: 14px; color: var(--text); min-width: 0; min-height: 42px; }
.sign-btn span { min-width: 0; overflow-wrap: anywhere; }
.sign-btn:active { transform: translateY(2px); }
.sign-btn[disabled] { opacity: .5; }
.q-text { font-size: 17px; font-weight: 600; color: #f3e2b8; }
.answer { background: var(--bg2); box-shadow: 0 0 0 2px #0e0a15; padding: 8px 10px; margin-bottom: 8px; overflow-wrap: anywhere; }
.answer b { display: block; font-size: 12px; color: var(--muted); }
.answer.me { border-left: 4px solid var(--gold2); } .answer.other { border-left: 4px solid var(--green); }
.meet .meet-n { font-size: 20px; color: var(--gold); }
.meet.today { border-color: var(--M); animation: glow 1.6s steps(4) infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 3px #0e0a15, 0 0 18px rgba(240,168,192,.6); } }
.bubble .ghost { visibility: hidden; }
.bubble.tail::after { content: ''; position: absolute; top: 100%; left: var(--tail, 50%); margin-left: -6px; border: 6px solid transparent; border-top-color: #f3e2b8; filter: drop-shadow(0 3px 0 #0e0a15); }

/* ---------- неделя ---------- */
.week-progress { margin: 0 0 14px; }
.rule .by { font-size: 12px; font-weight: 700; }

/* ---------- лента ---------- */
.feed-day { font-family: var(--px); color: var(--gold); margin: 12px 0 4px; }
.feed-day:first-child { margin-top: 0; }
.feed-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 0 8px 8px; border-left: 3px solid var(--c, var(--line)); margin-bottom: 4px; }
.feed-row.fresh { background: rgba(242,193,78,.08); }
.feed-row.sign { background: rgba(240,168,192,.07); }
.feed-note { color: #f3e2b8; font-style: italic; font-size: 14px; }

/* ---------- настройки ---------- */
.city-res { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.city-res .city { flex-direction: column; align-items: flex-start; text-align: left; }
.city-res .city small { color: var(--muted); font-weight: 400; font-size: 12px; }

/* ---------- отклик и анимации ---------- */
.view.swap { animation: swapin .22s ease-out; }
@keyframes swapin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fly-coin { position: fixed; z-index: 80; width: 12px; height: 12px; margin-left: -6px; background: var(--gold); box-shadow: inset -2px -2px 0 #b8861e, 0 0 0 2px #0e0a15; pointer-events: none; transition: transform .7s cubic-bezier(.4,-0.3,.6,1), opacity .7s; }
.confetti { position: fixed; z-index: 75; top: -12px; width: 7px; height: 10px; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); } }
.battle-cv.shake { animation: shake .3s steps(6); }
@keyframes shake { 20% { transform: translate(-3px, 1px); } 40% { transform: translate(3px, -1px); } 60% { transform: translate(-2px, 2px); } 80% { transform: translate(2px, 0); } }
@media (prefers-reduced-motion: reduce) { .view.swap, .meet.today, .battle-cv.shake { animation: none; } }
.skill span, .numrow > span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 380px) { .stepper button { width: 32px; height: 34px; } .stepper .num { min-width: 30px; font-size: 18px; } .numrow { gap: 6px; } }
