:root {
  --bg: #0b0a1f;
  --bg2: #120f2e;
  --panel: #1a1740;
  --panel2: #241f55;
  --line: rgba(255, 255, 255, .08);
  --text: #f3f1ff;
  --muted: #a49fd3;
  --accent: #ff5d8f;
  --accent2: #7b5cff;
  --grad: linear-gradient(135deg, #ff5d8f, #7b5cff);
  --male: #6fbaff;
  --female: #ff86bd;
  --gold: #ffd54a;
  --ok: #4cd98a;
  --danger: #ff5d5d;
  --tg: #2aabee;
  --r: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --tab-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overscroll-behavior: none; }
body {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; line-height: 1.35;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(123, 92, 255, .25), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255, 93, 143, .18), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.center { text-align: center; }

#app {
  position: fixed; inset: 0; max-width: 560px; margin: 0 auto; overflow: hidden;
  background: rgba(11, 10, 31, .6);
  box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, .5);
}
.ic { width: 24px; height: 24px; display: block; }

/* ---------- экраны */
.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.active { display: flex; }
.screen.overlay { background: var(--bg); z-index: 20; animation: slideIn .22s ease-out; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px calc(16px + var(--safe-bot)); }

.bar {
  display: flex; align-items: center; gap: 8px; min-height: 56px;
  padding: calc(6px + var(--safe-top)) 10px 6px; background: rgba(18, 15, 46, .92);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: relative; z-index: 3;
}
.bar-title { flex: 1; font-weight: 900; font-size: 19px; padding-left: 6px; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: var(--text); }
.icon-btn:active { background: var(--panel2); }

/* ---------- splash */
#splash { align-items: center; justify-content: center; gap: 14px; }
.splash-logo svg { animation: float 3s ease-in-out infinite; filter: drop-shadow(0 10px 30px rgba(255, 93, 143, .4)); }
.splash-title { font-weight: 900; font-size: 34px; letter-spacing: .5px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--panel2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-8px) rotate(4deg); } }

/* ---------- auth */
#auth { overflow-y: auto; padding: calc(24px + var(--safe-top)) 18px calc(20px + var(--safe-bot)); gap: 16px; }
.auth-top { text-align: center; }
.auth-logo svg { animation: float 4s ease-in-out infinite; filter: drop-shadow(0 10px 30px rgba(123, 92, 255, .5)); }
.auth-top h1 { margin: 4px 0 2px; font-size: 38px; font-weight: 900;
  background: linear-gradient(90deg, #ffe08a, #ff7eb6, #9b87ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-top p { margin: 0; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg2); border-radius: 14px; padding: 4px; margin-bottom: 12px; }
.seg-btn { padding: 10px; border-radius: 11px; font-weight: 800; color: var(--muted); }
.seg-btn.active { background: var(--panel2); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: 13px; color: var(--muted); }
input, textarea {
  background: var(--bg2); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; outline: none;
  font-size: 16px; width: 100%;
}
input:focus, textarea:focus { border-color: var(--accent2); }
.row2 { display: flex; gap: 10px; align-items: flex-end; }
.row2 .age { width: 110px; }
.gender-pick { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gbtn { padding: 12px 6px; border-radius: 14px; background: var(--bg2); border: 1.5px solid var(--line); font-weight: 800; color: var(--muted); }
.gbtn.active[data-g="m"], .gbtn.active[data-sg="m"] { border-color: var(--male); color: var(--male); background: rgba(111, 186, 255, .1); }
.gbtn.active[data-g="f"], .gbtn.active[data-sg="f"] { border-color: var(--female); color: var(--female); background: rgba(255, 134, 189, .1); }
.form .check, .check { flex-direction: row; align-items: center; gap: 10px; font-weight: 700; color: var(--muted); font-size: 13px; display: flex; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: 14px; font-weight: 800; background: var(--panel2); text-decoration: none; color: var(--text); }
.btn.big { padding: 15px; font-size: 16px; width: 100%; }
.btn.primary { background: var(--grad); box-shadow: 0 8px 24px rgba(255, 93, 143, .3); }
.btn.primary:active { transform: scale(.98); }
.btn.tg { background: var(--tg); width: 100%; padding: 13px; }
.btn.danger { background: rgba(255, 93, 93, .15); color: #ff8a8a; }
.btn:disabled { opacity: .5; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0 10px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#tgWidget { display: flex; justify-content: center; margin-bottom: 8px; min-height: 0; }

/* ---------- конструктор */
.editor-stage { position: relative; height: 38vh; min-height: 230px; overflow: hidden; flex: none; }
.editor-bg, .stage-bg { position: absolute; inset: 0; }
.editor-bg svg, .stage-bg svg { width: 100%; height: 100%; display: block; }
.editor-hero { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); height: 92%; aspect-ratio: 120 / 200; }
.editor-hero .ava { width: 100%; height: 100%; animation: bob 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
.editor-nick { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-weight: 900; text-shadow: 0 2px 6px #000; }
@keyframes bob { 50% { transform: translateY(-4px) scaleY(1.01); } }
.editor-setup { display: flex; gap: 8px; padding: 10px 12px 0; align-items: center; flex-wrap: wrap; }
.editor-setup input { flex: 1; min-width: 150px; padding: 10px 12px; }
.gender-pick.small { flex: none; width: 96px; }
.gender-pick.small .gbtn { padding: 9px 0; }
.check.small { width: 100%; }
.part-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px; flex: none; scrollbar-width: none; }
.part-tabs::-webkit-scrollbar { display: none; }
.part-tabs button { white-space: nowrap; padding: 8px 13px; border-radius: 999px; background: var(--panel); color: var(--muted); font-weight: 800; font-size: 13px; border: 1px solid var(--line); }
.part-tabs button.active { background: var(--grad); color: #fff; border-color: transparent; }
.part-options { flex: 1; overflow-y: auto; padding: 4px 12px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; align-content: start; }
.opt { background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 4px; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--muted); overflow: hidden; }
.opt .ava { width: 100%; height: 76%; }
.opt.active { border-color: var(--accent); color: var(--text); background: var(--panel2); }
.opt.swatch { padding: 10px; }
.opt.swatch i { width: 100%; height: 100%; border-radius: 12px; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .2); }
.editor-foot { padding: 10px 12px calc(10px + var(--safe-bot)); border-top: 1px solid var(--line); background: var(--bg2); }

/* ---------- основное */
#main { padding-bottom: calc(var(--tab-h) + var(--safe-bot)); }
.view { position: absolute; inset: 0 0 calc(var(--tab-h) + var(--safe-bot)); display: none; flex-direction: column; }
.view.active { display: flex; }
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + var(--safe-bot)); padding-bottom: var(--safe-bot);
  display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(18, 15, 46, .96); backdrop-filter: blur(14px); border-top: 1px solid var(--line); z-index: 5;
}
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 800; position: relative; }
.tabbar button.active { color: var(--text); }
.tabbar button.active i { background: var(--grad); color: #fff; }
.tabbar i { width: 44px; height: 30px; border-radius: 12px; display: grid; place-items: center; transition: .15s; }
.tabbar i .ic { width: 22px; height: 22px; }
.badge { position: absolute; top: 5px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; font-style: normal; box-shadow: 0 0 0 2px var(--bg2); }

/* планета */
.planet-bar { padding-right: 12px; }
.planet-chip { display: flex; align-items: center; gap: 10px; flex: 1; text-align: left; padding: 2px 4px; border-radius: 14px; }
.planet-chip b { display: block; font-size: 18px; font-weight: 900; }
.planet-chip small { color: var(--muted); font-weight: 700; }
.planet-mini svg { width: 40px; height: 40px; display: block; }
.me-chip { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 3px; padding: 4px 9px 4px 5px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.pill .ic { width: 16px; height: 16px; }

.stage { position: relative; height: 168px; flex: none; overflow: hidden; border-bottom: 1px solid var(--line); }
.stage.small { height: 112px; }
.stage-people { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; overflow-x: auto; padding: 0 10px 4px; scrollbar-width: none; }
.stage-people::-webkit-scrollbar { display: none; }
.person { flex: none; width: 66px; display: flex; flex-direction: column; align-items: center; position: relative; animation: pop .3s ease-out; }
.stage.small .person { width: 50px; }
.person .ava { width: 66px; height: 110px; }
.stage.small .person .ava { width: 50px; height: 80px; }
.person:nth-child(3n) .ava { animation: bob 3s ease-in-out infinite; }
.person:nth-child(3n+1) .ava { animation: bob 3.4s ease-in-out infinite .4s; }
.person:nth-child(3n+2) .ava { animation: bob 2.8s ease-in-out infinite .8s; }
.person .tag { margin-top: -4px; max-width: 70px; font-size: 10.5px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(0, 0, 0, .55); padding: 1px 6px; border-radius: 8px; }
.person .lvl { position: absolute; top: 4px; right: 2px; font-size: 10px; font-weight: 900; background: var(--gold); color: #3a2a00; border-radius: 8px; padding: 0 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.person.me .tag { background: var(--grad); }
.person.f .tag { color: #ffd0e6; }
.person.m .tag { color: #d4eaff; }
.person.me .tag { color: #fff; }
.person.staff .tag::before { content: '🛡 '; }
@keyframes pop { from { transform: scale(.6) translateY(20px); opacity: 0; } }
.fx { position: absolute; inset: 0; pointer-events: none; }
.fx .flygift { position: absolute; bottom: 30px; animation: flyup 2.4s ease-out forwards; }
@keyframes flyup { 0% { transform: translateY(20px) scale(.4); opacity: 0; } 20% { opacity: 1; transform: translateY(0) scale(1.2); } 100% { transform: translateY(-120px) scale(1); opacity: 0; } }

.feed { flex: 1; overflow-y: auto; padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 4px; -webkit-overflow-scrolling: touch; }
.msg { display: flex; gap: 8px; align-items: flex-start; padding: 4px 6px; border-radius: 14px; }
.msg .face { width: 34px; height: 34px; border-radius: 12px; overflow: hidden; flex: none; background: var(--panel2); }
.msg .face .ava { width: 100%; height: 100%; }
.msg .body { min-width: 0; flex: 1; }
.msg .who { font-weight: 900; font-size: 13px; }
.msg .who.m { color: var(--male); }
.msg .who.f { color: var(--female); }
.msg .who .lv { font-size: 10px; color: var(--gold); margin-left: 3px; }
.msg .who .to { color: var(--muted); font-weight: 800; }
.msg .text { word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg .time { font-size: 10px; color: var(--muted); margin-left: 6px; font-weight: 700; }
.msg.tome { background: linear-gradient(90deg, rgba(255, 93, 143, .18), rgba(123, 92, 255, .08)); }
.msg.mine .who { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .2); }
.msg.sys { justify-content: center; text-align: center; color: var(--muted); font-size: 13px; font-weight: 700; padding: 6px 10px; }
.msg.sys .text { background: rgba(255, 255, 255, .05); padding: 4px 12px; border-radius: 12px; }
.composer { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: var(--bg2); border-top: 1px solid var(--line); flex-wrap: wrap; }
.composer input { flex: 1; border-radius: 22px; padding: 11px 16px; min-width: 0; }
.send { width: 46px; height: 46px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; flex: none; color: #fff; box-shadow: 0 6px 18px rgba(255, 93, 143, .35); }
.send:active { transform: scale(.94); }
.to-chip { width: 100%; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--accent); }
.to-chip button { width: 22px; height: 22px; border-radius: 50%; background: var(--panel2); font-weight: 900; }
#conv .composer { padding-bottom: calc(8px + var(--safe-bot)); }

/* карта */
.map { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pcard { position: relative; border-radius: 22px; padding: 12px 12px 14px; background: var(--panel); border: 1.5px solid var(--line); text-align: left; overflow: hidden; display: flex; flex-direction: column; gap: 2px; min-height: 176px; }
.pcard::before { content: ''; position: absolute; inset: 0; background: var(--pc, transparent); opacity: .22; }
.pcard > * { position: relative; }
.pcard.here { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 93, 143, .18); }
.pcard .planet-svg { margin: -4px auto 2px; display: block; transition: transform .3s; }
.pcard:active .planet-svg { transform: scale(.94) rotate(-8deg); }
.pcard b { font-size: 17px; font-weight: 900; }
.pcard small { color: var(--muted); font-size: 12px; line-height: 1.2; }
.pcard .cnt { position: absolute; top: 10px; right: 10px; font-size: 12px; font-weight: 900; background: rgba(0, 0, 0, .4); padding: 2px 8px; border-radius: 999px; }
.pcard .cnt::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 5px; vertical-align: 1px; }
.pcard.locked { opacity: .55; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 14px; margin-top: 12px; }
.card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 900; }
.hint ul { margin: 0; padding-left: 18px; color: var(--muted); }
.hint li { margin: 4px 0; }

/* приват */
.dialog { display: flex; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.face-lg { width: 52px; height: 52px; border-radius: 18px; overflow: hidden; background: var(--panel2); position: relative; flex: none; }
.face-lg .ava { width: 100%; height: 100%; }
.face-lg.on::after, .face-sm.on::after { content: ''; position: absolute; right: 3px; bottom: 3px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--bg); }
.dialog .d-body { flex: 1; min-width: 0; }
.dialog .d-top { display: flex; justify-content: space-between; gap: 8px; }
.dialog b { font-weight: 900; }
.dialog .d-last { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.dialog .d-unread { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; font-weight: 900; }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.empty .big-emoji { font-size: 46px; display: block; margin-bottom: 8px; }

.conv-who { display: flex; align-items: center; gap: 10px; flex: 1; text-align: left; font-weight: 900; font-size: 17px; }
.face-sm { width: 40px; height: 40px; border-radius: 14px; overflow: hidden; background: var(--panel2); position: relative; flex: none; }
.face-sm .ava { width: 100%; height: 100%; }
.conv-who small { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.conv-feed { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 80%; padding: 8px 12px; border-radius: 18px; background: var(--panel2); align-self: flex-start; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; border-bottom-left-radius: 6px; }
.bubble.mine { align-self: flex-end; background: var(--grad); border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; }
.bubble time { display: block; font-size: 10px; opacity: .65; text-align: right; margin-top: 2px; }
.day { align-self: center; font-size: 12px; color: var(--muted); font-weight: 800; padding: 6px; }

/* профиль */
.hero { position: relative; height: 250px; border-radius: 24px; overflow: hidden; margin-bottom: 12px; }
.hero .stage-bg { position: absolute; inset: 0; }
.hero .hero-ava { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); height: 88%; aspect-ratio: 120/200; }
.hero .hero-ava .ava { width: 100%; height: 100%; animation: bob 2.6s ease-in-out infinite; }
.hero .hero-badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; }
.p-name { font-size: 24px; font-weight: 900; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.p-name .g { font-size: 18px; }
.p-sub { color: var(--muted); font-weight: 700; margin: 2px 0 10px; }
.role-tag { font-size: 11px; padding: 2px 8px; border-radius: 8px; background: var(--gold); color: #3a2a00; font-weight: 900; }
.lvl-card { display: flex; align-items: center; gap: 12px; }
.lvl-num { width: 56px; height: 56px; flex: none; border-radius: 18px; display: grid; place-items: center; font-size: 24px; font-weight: 900; color: #3a2a00;
  background: radial-gradient(circle at 30% 30%, #fff3b0, var(--gold) 50%, #e0a400); box-shadow: 0 6px 18px rgba(255, 213, 74, .3); }
.lvl-info { flex: 1; }
.lvl-info b { font-size: 15px; }
.progress { height: 10px; border-radius: 6px; background: var(--bg2); overflow: hidden; margin: 6px 0 3px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ff9f43); border-radius: 6px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px 6px; text-align: center; }
.stat b { display: flex; justify-content: center; align-items: center; gap: 4px; font-size: 19px; font-weight: 900; }
.stat b .ic { width: 18px; height: 18px; }
.stat small { color: var(--muted); font-weight: 700; font-size: 12px; }
.about { white-space: pre-wrap; color: #ddd9ff; }
.gift-shelf { display: flex; flex-wrap: wrap; gap: 6px; }
.gift-shelf .g { width: 52px; height: 52px; border-radius: 14px; background: var(--bg2); display: grid; place-items: center; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.actions .btn { padding: 13px 10px; }
.actions .btn.wide { grid-column: 1 / -1; }
.menu { display: flex; flex-direction: column; margin-top: 12px; background: var(--panel); border-radius: 20px; border: 1px solid var(--line); overflow: hidden; }
.menu button, .menu a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-align: left; font-weight: 800; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.menu button:last-child, .menu a:last-child { border-bottom: 0; }
.menu .ic { color: var(--muted); }
.menu .danger-t { color: #ff8a8a; }
.edit-form { display: flex; flex-direction: column; gap: 10px; }
.edit-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.edit-form textarea { min-height: 80px; resize: vertical; }

/* список */
.list-search { padding: 10px 14px 0; }
.urow { display: flex; align-items: center; gap: 12px; padding: 8px 4px; width: 100%; text-align: left; border-bottom: 1px solid var(--line); }
.urow .rank { width: 26px; text-align: center; font-weight: 900; color: var(--muted); }
.urow:nth-child(1) .rank { color: var(--gold); }
.urow .u-body { flex: 1; min-width: 0; }
.urow b { font-weight: 900; }
.urow small { display: block; color: var(--muted); font-weight: 700; }

/* лист действий */
.sheet-wrap { position: absolute; inset: 0; z-index: 40; background: rgba(5, 4, 15, .55); display: none; align-items: flex-end; backdrop-filter: blur(3px); }
.sheet-wrap.open { display: flex; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-height: 85%; overflow-y: auto; background: var(--panel); border-radius: 26px 26px 0 0; padding: 8px 14px calc(16px + var(--safe-bot)); animation: up .22s ease-out; border-top: 1px solid var(--line); }
@keyframes up { from { transform: translateY(40%); } }
.sheet::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--panel2); margin: 0 auto 12px; }
.sheet-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.sheet-head .face-lg { width: 62px; height: 62px; }
.sheet-head b { font-size: 19px; font-weight: 900; }
.sheet-head small { display: block; color: var(--muted); font-weight: 700; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 16px; background: var(--bg2); font-weight: 800; font-size: 12.5px; }
.sheet-grid button .ic { width: 26px; height: 26px; }
.sheet-grid button.locked { opacity: .45; }
.sheet-grid button.red { color: #ff8a8a; }
.sheet h3 { margin: 4px 0 12px; font-weight: 900; }
.gifts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gifts button { background: var(--bg2); border-radius: 16px; padding: 8px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; }
.gifts button span { display: flex; align-items: center; gap: 2px; color: #9fe9ff; }
.gifts button span .ic { width: 14px; height: 14px; }
.gifts button:disabled { opacity: .4; }

/* тосты */
.toasts { position: absolute; top: calc(64px + var(--safe-top)); left: 12px; right: 12px; z-index: 60; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { background: rgba(36, 31, 85, .97); border: 1px solid var(--line); border-radius: 16px; padding: 11px 14px; font-weight: 800; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: toastIn .25s ease-out; pointer-events: auto; }
.toast.err { border-color: rgba(255, 93, 93, .5); }
.toast.pm { display: flex; gap: 10px; align-items: center; cursor: pointer; }
@keyframes toastIn { from { transform: translateY(-14px); opacity: 0; } }

.conn { position: absolute; left: 50%; top: calc(62px + var(--safe-top)); transform: translateX(-50%); z-index: 30; background: var(--danger); padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 900; }

@media (min-width: 561px) {
  body { padding: 0; }
}
