/* ===================== 2breath · APP SHELL (авторизованная платформа) ===================== */
/* Три колонки: левое меню (.side) · центр (.main) · правая панель (.rail). Гость видит старую шапку (см. platform.css). */

body.app-shell { overflow: hidden; height: 100vh; }

.app { height: 100vh; display: grid; grid-template-columns: 260px 1fr 340px; background: var(--bg); }

/* левое меню */
.side { border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 22px 16px; gap: 4px; background: var(--surface); overflow-y: auto; }
.side .logo { margin: 4px 8px 22px; display: block; }
.side .logo img { height: 28px; }
.nav-item {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 12px 14px; border-radius: var(--r-md); color: var(--text-2);
  font-size: 15.5px; font-weight: 500; text-align: left;
  transition: background .2s, color .2s; position: relative; text-decoration: none; border: none; background: none; cursor: pointer;
}
.nav-item svg { width: 20px; height: 20px; flex: none; }
.nav-item:hover { background: var(--bg-tint); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--accent); font-weight: 600; }
[data-theme="dark"] .nav-item.active { color: var(--accent-2); }
.nav-item .badge-n { margin-left: auto; background: var(--warm); color: #5a3925; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.side-sep { height: 1px; background: var(--border); margin: 14px 8px; }
.side-foot { margin-top: auto; }
.side-actions { display: flex; align-items: center; gap: 10px; padding: 0 6px 12px; }
.side-actions .btn { flex: 1; }
.logout-form { margin: 0; display: flex; }
.logout-btn {
  width: 36px; height: 36px; border-radius: var(--r-md); border: 1px solid var(--border);
  background: transparent; color: var(--text-2); cursor: pointer;
  display: grid; place-items: center; transition: border-color .2s, color .2s;
}
.logout-btn svg { width: 17px; height: 17px; }
.logout-btn:hover { border-color: #c0564a; color: #c0564a; }
.me-card { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-md); cursor: pointer; transition: background .2s; text-decoration: none; }
.me-card:hover { background: var(--bg-tint); }
.me-card .av { width: 40px; height: 40px; border-radius: 4px; flex: none; overflow: hidden; background: var(--brand-grad); display: grid; place-items: center; color: #fff; font-weight: 700; }
.me-card .av img, .me-card .av svg { width: 100%; height: 100%; object-fit: cover; }
.me-card b { font-size: 14.5px; display: flex; align-items: center; gap: 6px; color: var(--text); }
.me-card span { font-size: 13px; color: var(--text-2); }
.star { color: var(--gold); font-weight: 700; font-size: 13px; }

/* центральная колонка */
.main { overflow-y: auto; padding: 0; }
.main-inner { max-width: 660px; margin: 0 auto; padding: 28px 28px 80px; }
.greet { margin-bottom: 22px; }
.greet h2 { font-size: 27px; margin-bottom: 4px; }
.greet p { color: var(--text-2); font-size: 15.5px; }

.filters { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.chip {
  padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  transition: all .2s; white-space: nowrap; text-decoration: none; display: inline-block;
}
.chip:hover { border-color: var(--border-2); color: var(--text); }
.chip.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* открыть композер */
.composer-trigger {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 18px; margin-bottom: 22px; text-align: left; transition: border-color .2s, box-shadow .2s; cursor: pointer;
}
.composer-trigger:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.composer-trigger .av { width: 40px; height: 40px; border-radius: 4px; flex: none; }
.composer-trigger span { color: var(--text-3); font-size: 16px; }
.composer-trigger .go { margin-left: auto; background: var(--accent); color: var(--on-accent); padding: 9px 18px; border-radius: 3px; font-size: 14px; font-weight: 600; flex: none; }

/* карточка записки в новом шелле (не путать с общей .post — своя, изолированная разметка) */
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.post-card .pc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.post-card .pc-av { width: 46px; height: 46px; border-radius: 4px; flex: none; background: var(--brand-grad); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; overflow: hidden; }
.post-card .pc-av img, .post-card .pc-av svg { width: 100%; height: 100%; object-fit: cover; }
.post-card .pc-av.masked { background: var(--bg-tint); padding: 4px; }
.post-card .pc-meta { min-width: 0; }
.post-card .pc-name { font-weight: 600; font-size: 15.5px; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.post-card .pc-sub { font-size: 13.5px; color: var(--text-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.post-card .pc-top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.post-card .pc-time { color: var(--text-3); font-size: 12.5px; flex: none; }
.post-card .pc-body { font-size: 16px; line-height: 1.6; color: var(--text); margin: 0 0 4px; white-space: pre-wrap; }
.post-card .tag { color: var(--accent); font-weight: 500; font-size: 13px; } [data-theme="dark"] .post-card .tag { color: var(--accent-2); }

/* превью ссылки в записке (og:title/description/image) */
.link-card {
  display: flex; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
  text-decoration: none; color: inherit; margin: 2px 0 4px; transition: border-color .15s, box-shadow .15s;
}
.link-card:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.link-card-img { width: 120px; flex: none; background: var(--bg-tint); }
.link-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.link-card-body { padding: 12px 16px; min-width: 0; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.link-card-site { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
.link-card-title { font-size: 14.5px; font-weight: 600; color: var(--text); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.link-card-desc { font-size: 13px; color: var(--text-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-card-url { font-size: 12px; color: var(--text-3); }

/* кнопка «в избранное» — единый стиль под сайт */
.fav-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px;
  background: var(--bg-tint); border: 1px solid var(--border); font-size: 13px; font-weight: 500;
  color: var(--text-2); cursor: pointer; transition: color .18s, border-color .18s, background .18s; text-decoration: none;
}
.fav-btn:hover { color: var(--text); border-color: var(--border-2); }
.fav-btn svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.fav-btn.on { background: var(--brand-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.fav-btn.on svg { fill: currentColor; stroke: currentColor; }
[data-theme="dark"] .fav-btn.on { color: var(--accent-2); }
.fav-btn.compact { padding: 7px; gap: 0; }
.fav-btn.compact svg { width: 16px; height: 16px; }

/* страница «Избранное» */
.fav-empty { background: var(--bg-tint); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px 24px; color: var(--text-2); font-size: 15px; line-height: 1.6; }
.fav-hint-chip { display: inline-flex; align-items: center; background: var(--brand-soft); color: var(--accent); border-radius: 999px; padding: 1px 9px; font-size: 13px; font-weight: 600; }
[data-theme="dark"] .fav-hint-chip { color: var(--accent-2); }
.fav-sec { margin-bottom: 30px; }
.fav-sec-h { font-size: 14px; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.fav-sec-h span { background: var(--bg-tint); color: var(--text-2); border-radius: 999px; padding: 0 8px; font-size: 12px; }
.fav-users { display: flex; flex-direction: column; gap: 10px; }
.fav-user { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--shadow-sm); }
.fav-user .fu-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.fav-user .fu-av { width: 46px; height: 46px; border-radius: var(--r-sm); flex: none; background: var(--brand-grad); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; overflow: hidden; }
.fav-user .fu-av img, .fav-user .fu-av svg { width: 100%; height: 100%; object-fit: cover; }
.fav-user .fu-av.masked { background: var(--bg-tint); padding: 5px; }
.fav-user .fu-info { min-width: 0; }
.fav-user .fu-info b { display: block; font-size: 15px; color: var(--text); }
.fav-user .fu-info span { font-size: 13px; color: var(--text-2); }
.fav-post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.fav-post .fp-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fav-post .fp-author { font-weight: 600; font-size: 14.5px; color: var(--text); }
.fav-post .fp-date { color: var(--text-3); font-size: 12.5px; }
.fav-post .fp-top .fav-btn { margin-left: auto; }
.fav-post .fp-body { font-size: 15px; line-height: 1.55; color: var(--text); white-space: pre-wrap; }
.fav-blogs { display: flex; flex-direction: column; gap: 14px; }

.reaction-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--border); }
.reaction-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: var(--bg-tint); border: 1px solid transparent; font-size: 13.5px; font-weight: 500; color: var(--text-2);
  transition: all .2s; cursor: pointer; text-decoration: none;
}
.reaction-btn:hover { color: var(--text); transform: translateY(-1px); }
.reaction-btn.on { background: var(--brand-soft); color: var(--accent); border-color: var(--accent); box-shadow: var(--shadow-sm); font-weight: 600; }
[data-theme="dark"] .reaction-btn.on { color: var(--accent-2); border-color: var(--accent-2); }
.reaction-btn .rc-num { font-size: 12px; font-weight: 700; opacity: .85; }

/* кнопка "+ Реакция" и всплывающий выбор */
.reaction-picker { position: relative; }
.reaction-add-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 999px;
  background: transparent; border: 1px dashed var(--border-2); font-size: 13.5px; font-weight: 500; color: var(--text-3);
  transition: all .2s; cursor: pointer; text-decoration: none;
}
.reaction-add-btn:hover { color: var(--text-2); border-color: var(--text-3); border-style: solid; }
.reaction-popover {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 30;
  display: none; flex-wrap: wrap; gap: 6px; width: max-content; max-width: 260px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 10px; box-shadow: var(--shadow-lg);
}
.reaction-popover.show { display: flex; }
.reaction-pop-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px;
  background: var(--bg-tint); border: 1px solid transparent; font-size: 13px; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.reaction-pop-item:hover { background: var(--border); color: var(--text); }
.reaction-pop-item.on { background: var(--brand-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
[data-theme="dark"] .reaction-pop-item.on { color: var(--accent-2); border-color: var(--accent-2); }
.reply-count { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; color: var(--text-2); font-size: 14px; font-weight: 500; margin-left: auto; }

/* отклики (комментарии) в новом шелле */
.reply-list { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 16px; }
.reply-cta-btn {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 999px;
  background: var(--bg-tint); border: 1px solid var(--border); font-size: 13.5px; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: all .2s;
}
.reply-cta-btn:hover { border-color: var(--border-2); color: var(--text); }
.reply-form { display: flex; gap: 10px; align-items: center; margin: 0; }
.reply-form input { flex: 1; background: var(--bg-tint); border: 1px solid var(--border); border-radius: 999px; padding: 12px 18px; font-size: 14.5px; color: var(--text); }
.reply-form input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.reply-form label { flex: none; }
.reply-form button { width: 42px; height: 42px; border-radius: 999px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; border: none; cursor: pointer; font-size: 15px; transition: transform .15s var(--ease); }
.reply-form button:hover { transform: scale(1.06); }
.reply-item { display: flex; gap: 12px; align-items: flex-start; }
.reply-item .rp-av { width: 36px; height: 36px; border-radius: 4px; flex: none; background: var(--brand-grad); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; overflow: hidden; margin-top: 1px; }
.reply-item .rp-av img { width: 100%; height: 100%; object-fit: cover; }
.reply-item .rp-av.masked { background: var(--bg-tint); padding: 3px; }
.reply-item .rp-av.masked svg { width: 100%; height: 100%; image-rendering: pixelated; }
.reply-item .rp-body { background: var(--bg-tint); border-radius: var(--r-md); padding: 12px 16px; flex: 1; min-width: 0; }
.reply-item .rp-name { font-weight: 600; font-size: 13.5px; display: flex; gap: 7px; align-items: baseline; flex-wrap: wrap; margin-bottom: 5px; }
.reply-item .rp-name span { color: var(--text-3); font-weight: 400; font-size: 12px; }
.reply-item .rp-name a, .reply-item .rp-name button {
  color: var(--text); font: inherit; font-weight: 600; background: none; border: none; padding: 0; margin: 0;
  cursor: pointer; text-decoration: none;
}
.reply-item .rp-name a:hover, .reply-item .rp-name button:hover { text-decoration: underline; color: var(--accent); }
[data-theme="dark"] .reply-item .rp-name a:hover, [data-theme="dark"] .reply-item .rp-name button:hover { color: var(--accent-2); }
.reply-item .rp-text { color: var(--text); font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

.reply-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 4px; }
.rp-page-nav {
  background: var(--bg-tint); border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px;
  font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: all .2s;
}
.rp-page-nav:hover:not(:disabled) { border-color: var(--border-2); color: var(--text); }
.rp-page-nav:disabled { opacity: .4; cursor: default; }
.rp-page-info { font-size: 12.5px; color: var(--text-3); font-family: var(--mono); }

/* правая панель */
.rail { border-left: 1px solid var(--border); overflow-y: auto; padding: 24px 20px; display: flex; flex-direction: column; gap: 20px; background: var(--surface); }
.rail-card { background: var(--bg-tint); border: 1px solid transparent; border-radius: var(--r-lg); padding: 18px; }
[data-theme="dark"] .rail-card { background: var(--bg-tint); }
.rail-card h4 { font-family: var(--sans); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.rail-card h4 svg { width: 15px; height: 15px; }
.awake { display: flex; flex-direction: column; gap: 12px; }
.awake-row { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.awake-row .av { width: 34px; height: 34px; border-radius: 4px; flex: none; position: relative; background: var(--brand-grad); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; overflow: hidden; }
.awake-row .av img { width: 100%; height: 100%; object-fit: cover; }
.awake-row .av::after { content:""; position:absolute; right:-1px; bottom:-1px; width:11px; height:11px; border-radius:99px; background: var(--success); border: 2px solid var(--bg); }
[data-theme="dark"] .awake-row .av::after { border-color: var(--bg-tint); }
.awake-row b { font-size: 14px; color: var(--text); }
.awake-row span { font-size: 12px; color: var(--text-2); margin-left: auto; }
.rail-empty { font-size: 13.5px; color: var(--text-3); }

.breathe-mini { text-align: center; }
.breathe-mini h4 { justify-content: center; }
.bm-canvas { width: 112px; height: 112px; margin: 2px auto 14px; display: block; }

.room-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; text-decoration: none; }
.room-row .ri { width: 36px; height: 36px; border-radius: var(--r-sm); flex: none; display: grid; place-items: center; background: var(--brand-soft); color: var(--accent); font-size: 15px; }
[data-theme="dark"] .room-row .ri { color: var(--accent-2); }
.room-row b { font-size: 14px; display: block; color: var(--text); } .room-row span { font-size: 12px; color: var(--text-2); }

/* ---------- профиль (визитка) ---------- */
.prof-head { display: flex; align-items: center; gap: 20px; margin: 10px 0 20px; padding: 0; }
.pav-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.mask-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px;
  background: var(--bg-tint); border: 1px solid var(--border); font-size: 12px; font-weight: 500;
  color: var(--text-2); cursor: pointer; transition: color .15s, border-color .15s;
}
.mask-btn:hover { color: var(--text); border-color: var(--border-2); }
.mask-cur-face { width: 52px; height: 52px; flex: none; background: var(--bg-tint); border-radius: var(--r-sm); padding: 5px; }
.mask-cur-face svg { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.prof-head .pav { width: 88px; height: 88px; border-radius: var(--r-md); border: 1px solid var(--border); flex: none; background: var(--brand-grad); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 30px; overflow: hidden; box-shadow: var(--shadow-sm); }
.prof-head .pav img, .prof-head .pav svg { width: 100%; height: 100%; object-fit: cover; }
.prof-head .pav.masked { background: var(--bg-tint); padding: 8px; }
.prof-head .pinfo { flex: 1; min-width: 0; }
.prof-head .pinfo h2 { font-size: 25px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prof-head .pinfo .sub { color: var(--text-2); font-size: 15px; margin-top: 4px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.prof-actions { display: flex; gap: 10px; padding-bottom: 6px; flex-wrap: wrap; }
.bio { font-size: 16px; line-height: 1.6; color: var(--text); margin-bottom: 20px; max-width: 56ch; }

/* ---------- панели (редактирование анкеты / маска / настройки) ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px 28px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.panel-head { margin-bottom: 20px; }
.panel-head h3 { font-size: 19px; margin-bottom: 4px; }
.panel-head p { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.panel .pf-edit { gap: 18px; }

.mask-current { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding: 14px 16px; background: var(--bg-tint); border-radius: var(--r-md); }
.mask-current .avatar { width: 56px; height: 56px; flex: none; }
.mask-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 12px; }
.mask-cell { margin: 0; }
.mask-cell button { width: 100%; aspect-ratio: 1; background: var(--bg-tint); border: 1.5px solid var(--border); border-radius: var(--r-lg); cursor: pointer; padding: 10px; transition: border-color .15s, transform .12s var(--ease), background .15s; }
.mask-cell button:hover { border-color: var(--accent); background: var(--surface); transform: translateY(-3px); }
.mask-cell.active button { border-color: var(--accent); background: var(--brand-soft); }
.mask-cell svg { width: 100%; height: 100%; image-rendering: pixelated; display: block; }

/* фотогалерея */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.gallery .ph { aspect-ratio: 1; border-radius: var(--r-md); position: relative; overflow: hidden; }
.gallery .ph.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .ph.photo .ph-del { position: absolute; top: 6px; right: 6px; margin: 0; }
.gallery .ph.photo .ph-del button {
  width: 28px; height: 28px; border-radius: 99px; border: none; cursor: pointer;
  background: rgba(20,15,10,.55); color: #fff; font-size: 13px; display: grid; place-items: center;
  opacity: 0; transition: opacity .15s;
}
.gallery .ph.photo:hover .ph-del button { opacity: 1; }
.gallery .ph.locked { background: var(--bg-tint); display: grid; place-items: center; }
.gallery .ph.locked svg { width: 40px; height: 40px; image-rendering: pixelated; }
.gallery .ph.locked span { font-size: 22px; opacity: .5; }

/* люди (каталог участников) */
.people-search { display: flex; gap: 10px; margin-bottom: 22px; max-width: 420px; }
.people-search .field { flex: 1; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.person-card {
  display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px;
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s var(--ease);
}
.person-card:hover { border-color: var(--border-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.person-av {
  width: 48px; height: 48px; border-radius: 6px; flex: none; background: var(--brand-grad);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 19px; overflow: hidden;
}
.person-av img, .person-av svg { width: 100%; height: 100%; object-fit: cover; }
.person-av.masked { background: var(--bg-tint); padding: 4px; }
.person-av.masked svg { image-rendering: pixelated; }
.person-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.person-info b { font-size: 15px; color: var(--text); }
.person-sub { font-size: 13px; color: var(--text-2); }
.person-bio { font-size: 13px; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* настройки аккаунта */
.settings-list { display: flex; flex-direction: column; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 2px; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }
.settings-row .st-txt { flex: 1 1 auto; min-width: 160px; }
.settings-row .st-label { font-size: 15px; font-weight: 600; color: var(--text); display: block; }
.settings-row .st-desc { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.settings-row select.field { min-width: 190px; flex: none; }
.settings-row.toggle-row { cursor: pointer; }

/* ---------- модалки (композер / дыхание) ---------- */
.overlay { position: fixed; inset: 0; background: color-mix(in srgb, var(--bg) 40%, rgba(10,8,20,.5)); backdrop-filter: blur(6px); z-index: 200; display: grid; place-items: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .3s; }
.overlay.show { opacity: 1; pointer-events: auto; }
.overlay .modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.98); transition: transform .3s var(--ease); max-height: 88vh; overflow: auto; }
.overlay.show .modal { transform: none; }
.overlay .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.overlay .modal-head .x { width: 36px; height: 36px; border-radius: 99px; display: grid; place-items: center; color: var(--text-2); border: none; background: none; cursor: pointer; }
.overlay .modal-head .x:hover { background: var(--bg-tint); }
.overlay .modal-body { padding: 22px; }
.overlay .modal-body textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--r-md); background: transparent; resize: vertical; font-family: var(--sans); font-size: 17px; line-height: 1.55; color: var(--text); min-height: 120px; padding: 12px; }
.overlay .modal-body textarea:focus { outline: none; border-color: var(--accent); }
.opt-row { display: flex; align-items: center; gap: 12px; padding: 14px 2px; border-top: 1px solid var(--border); }
.opt-row .txt { flex: 1; } .opt-row .txt b { font-size: 14.5px; display: block; color: var(--text); } .opt-row .txt span { font-size: 13px; color: var(--text-2); }
.switch-toggle { width: 46px; height: 27px; border-radius: 99px; background: var(--border-2); position: relative; transition: background .25s; flex: none; border: none; cursor: pointer; }
.switch-toggle i { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 99px; background: #fff; transition: transform .25s; box-shadow: var(--shadow-sm); display: block; }
.switch-toggle.on { background: var(--accent); } .switch-toggle.on i { transform: translateX(19px); }

.breath-big { text-align: center; padding: 12px 0 4px; }
.bb-phase { font-family: var(--serif); font-size: 23px; font-weight: 600; color: var(--text); min-height: 28px; transition: color .4s; }
.bb-stage { width: 224px; height: 224px; margin: 8px auto 10px; display: grid; place-items: center; position: relative; }
.bb-canvas { width: 224px; height: 224px; display: block; }
.bb-count { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 36px; font-weight: 700; color: #fff; text-shadow: 0 1px 10px rgba(120,50,0,.5); pointer-events: none; }
.bb-cycles { font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); min-height: 15px; margin-bottom: 14px; }
.pattern-pick { display: flex; gap: 10px; justify-content: center; margin-bottom: 12px; }
.bb-hint { font-size: 12.5px; line-height: 1.5; color: var(--text-3); max-width: 300px; margin: 0 auto; }

/* адаптив: сворачиваем правую панель, потом левое меню */
@media (max-width: 1200px) { .app { grid-template-columns: 240px 1fr; } .rail { display: none; } }
@media (max-width: 880px) {
  body.app-shell { overflow: auto; height: auto; }
  .app { grid-template-columns: 1fr; height: auto; }
  .side { position: sticky; top: 0; z-index: 20; flex-direction: row; align-items: center; padding: 10px 14px; overflow-x: auto; gap: 2px; }
  .side .logo { margin: 0 10px 0 0; } .side .logo img { height: 22px; }
  .nav-item { flex-direction: column; gap: 2px; padding: 8px 10px; font-size: 11px; white-space: nowrap; }
  .nav-item .badge-n { position: absolute; top: 2px; right: 2px; margin: 0; }
  .side-sep { display: none; }
  .side-foot { display: none; }
  .main { overflow-y: visible; }
  .main-inner { padding: 20px 14px 60px; }
  .panel { padding: 18px 16px; }
  .settings-row { flex-wrap: wrap; }
  .settings-row select.field { min-width: 0; width: 100%; flex: 1 1 100%; }
  .prof-head { flex-wrap: wrap; }
  .greet h2 { font-size: 22px; }
  .link-card-img { width: 90px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ---------- игры ---------- */
.games-sec { margin-bottom: 28px; }
.game-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.game-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); padding: 18px 16px;
  text-align: left; cursor: pointer; transition: border-color .18s, transform .15s var(--ease), box-shadow .18s;
  display: flex; flex-direction: column; gap: 8px;
}
.game-card:hover { transform: translateY(-2px); border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.game-card.picked { border-color: #FB810E; box-shadow: 0 0 0 3px color-mix(in srgb, #FB810E 18%, transparent); }
.game-card svg { width: 64px; height: 64px; image-rendering: pixelated; }
.game-card b { font-size: 15.5px; color: var(--text); }
.game-card span { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.game-card .g1 { fill: #FB810E; } .game-card .g2 { fill: var(--accent); } .game-card .g3 { fill: #E8A862; }
.game-card .g4 { fill: var(--brand-soft); } .game-card .g5 { fill: var(--bg-tint); stroke: var(--border); stroke-width: .2; }

.game-opponents { display: flex; flex-wrap: wrap; gap: 8px; }
.game-opp {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px;
  background: var(--bg-tint); border: 1.5px solid var(--border); cursor: pointer; transition: all .15s;
}
.game-opp:hover { border-color: var(--border-2); }
.game-opp.picked { border-color: #FB810E; background: var(--brand-soft); }
.game-opp .go-av { width: 28px; height: 28px; border-radius: 99px; background: var(--brand-grad); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; overflow: hidden; flex: none; }
.game-opp .go-av img, .game-opp .go-av svg { width: 100%; height: 100%; object-fit: cover; }
.game-opp .go-av.masked { background: var(--bg-tint); padding: 2px; }
.game-opp .go-name { font-size: 13.5px; font-weight: 500; color: var(--text); }
.game-opp .go-online { width: 8px; height: 8px; border-radius: 99px; background: #5E8A5E; flex: none; }

.games-cta { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.game-sessions { display: flex; flex-direction: column; gap: 8px; }
.game-session-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); text-decoration: none; transition: border-color .15s;
}
.game-session-row:hover { border-color: var(--border-2); }
.game-session-row b { color: var(--text); font-size: 14.5px; }
.game-session-row .gs-opp { color: var(--text-2); font-size: 13.5px; }
.game-session-row .gs-status { margin-left: auto; font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.game-session-row.live .gs-status { color: #FB810E; }

/* страница партии */
.game-page { max-width: 720px; }
.game-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 10px 0 2px; }
.game-head h1 { font-size: 26px; }
.game-vs { color: var(--text-2); font-size: 14.5px; display: inline-flex; align-items: center; gap: 8px; }
.conn-dot { width: 9px; height: 9px; border-radius: 99px; background: var(--border-2); display: inline-block; }
.conn-dot.on { background: #5E8A5E; }
.game-statusline { font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 18px; min-height: 16px; }
.game-statusline.your-turn { color: #FB810E; }
.game-result { margin-bottom: 18px; }
.game-result .gr-inner { background: var(--brand-soft); border: 1.5px solid #FB810E; border-radius: var(--r-lg); padding: 18px 22px; text-align: center; }
.game-result .gr-title { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--text); }
.game-result .gr-sub { color: var(--text-2); font-size: 14px; margin: 4px 0 12px; }
.game-foot { margin-top: 18px; }
.game-board-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 20px; box-shadow: var(--shadow-sm); }

/* морской бой */
.bs-boards { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; }
.bs-caption { font-size: 13px; color: var(--text-2); margin-bottom: 8px; text-align: center; }
.bs-board { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; width: min(300px, 82vw); }
.bs-cell {
  aspect-ratio: 1; border: none; border-radius: 2px; background: var(--bg-tint); padding: 0;
  position: relative; transition: background .12s;
}
.bs-board.enemy .bs-cell { cursor: default; }
.bs-board.enemy.can-fire .bs-cell:not(.hit):not(.miss):not(:disabled) { cursor: crosshair; }
.bs-board.enemy.can-fire .bs-cell:not(.hit):not(.miss):not(:disabled):hover { background: var(--brand-soft); }
.bs-cell.ship { background: var(--accent); }
.bs-cell.miss::after { content: ""; position: absolute; inset: 38%; border-radius: 99px; background: var(--text-3); opacity: .7; }
.bs-cell.hit { background: #FB810E; }
.bs-cell.hit::after { content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; }
.bs-cell.ship.hit { background: #C0564A; }
.bs-cell.sunk { background: #C0564A; }
.bs-cell.sunk::after { content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; }
.bs-setup { text-align: center; margin-bottom: 16px; }

/* совместимость */
.match-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 22px; box-shadow: var(--shadow-sm); }
.match-progress { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.mp-row { display: flex; align-items: center; gap: 10px; }
.mp-row > span { font-size: 12.5px; color: var(--text-2); width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-strip { display: flex; gap: 4px; }
.mp-strip i { width: 16px; height: 16px; border-radius: 3px; background: var(--bg-tint); border: 1px solid var(--border); }
.mp-strip i.on { background: #FB810E; border-color: transparent; }
.match-question .mq-num { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.match-question .mq-text { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--text); line-height: 1.3; margin-bottom: 16px; }
.mq-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mq-opt {
  padding: 14px 16px; border-radius: var(--r-md); background: var(--bg-tint); border: 1.5px solid var(--border);
  font-size: 14.5px; color: var(--text); cursor: pointer; text-align: left; line-height: 1.35; transition: all .15s;
}
.mq-opt:hover:not(:disabled) { border-color: #FB810E; background: var(--brand-soft); transform: translateY(-1px); }
.mq-opt:disabled { opacity: .55; }
.match-waiting { text-align: center; padding: 26px 0 12px; }
.match-waiting p:first-child { font-size: 17px; margin-bottom: 6px; }
.mr-percent { text-align: center; margin-bottom: 20px; }
.mr-percent .mr-bar { display: inline-flex; gap: 5px; margin-bottom: 8px; }
.mr-percent .mr-bar i { width: 22px; height: 22px; border-radius: 4px; background: var(--bg-tint); border: 1px solid var(--border); }
.mr-percent .mr-bar i.on { background: #FB810E; border-color: transparent; }
.mr-percent b { display: block; font-family: var(--serif); font-size: 34px; color: var(--text); line-height: 1.1; }
.mr-percent span { font-size: 13px; color: var(--text-3); }
.mr-row { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 8px; }
.mr-row.match { border-color: color-mix(in srgb, #5E8A5E 45%, transparent); background: color-mix(in srgb, #5E8A5E 7%, transparent); }
.mr-row .mr-q { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.mr-answers { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.mr-a { flex: 1; padding: 6px 10px; border-radius: var(--r-sm); background: var(--bg-tint); color: var(--text-2); }
.mr-a.you { border-left: 3px solid #FB810E; }
.mr-a.opp { border-right: 3px solid var(--accent); text-align: right; }
.mr-mark { font-weight: 700; color: var(--text-3); flex: none; }
.mr-row.match .mr-mark { color: #5E8A5E; }

/* точки и квадраты */
.dots-score { display: flex; justify-content: center; gap: 26px; font-size: 14.5px; margin-bottom: 12px; }
.dots-score .ds-you b { color: #FB810E; }
.dots-score .ds-opp b { color: var(--accent); }
[data-theme="dark"] .dots-score .ds-opp b { color: var(--accent-2); }
.dots-board { width: min(460px, 88vw); display: block; margin: 0 auto; }
.dots-dot { fill: var(--text-3); }
.dots-edge { stroke: var(--border); stroke-width: 4; }
.dots-edge.on { stroke: var(--text-2); stroke-width: 8; }
.dots-hit { stroke: transparent; stroke-width: 26; }
.dots-board.can-move .dots-hit { cursor: pointer; }
.dots-board.can-move .dots-hit:hover + * {}
.dots-box { fill: transparent; }
.dots-box.mine { fill: color-mix(in srgb, #FB810E 30%, transparent); }
.dots-box.theirs { fill: color-mix(in srgb, var(--accent) 26%, transparent); }

/* кнопка «позвать сыграть» на карточке людей */
.person-wrap { position: relative; }
.person-wrap .person-card { height: 100%; }
.person-play {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 99px;
  display: grid; place-items: center; font-size: 15px; text-decoration: none;
  background: var(--bg-tint); border: 1px solid var(--border); opacity: 0; transition: opacity .15s, border-color .15s;
}
.person-wrap:hover .person-play { opacity: 1; }
.person-play:hover { border-color: #FB810E; }

@media (max-width: 720px) {
  .game-cards { grid-template-columns: 1fr; }
  .mq-options { grid-template-columns: 1fr; }
  .bs-boards { gap: 18px; }
  .person-play { opacity: 1; }
}

/* ---------- фотозаписка ---------- */
.note-photo {
  display: block; width: 100%; border: 1px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; padding: 0; margin: 0 0 12px; cursor: zoom-in; background: var(--bg-tint);
}
.note-photo img { display: block; width: 100%; height: 300px; object-fit: cover; transition: transform .25s var(--ease); }
.note-photo:hover img { transform: scale(1.015); }
.overlay.lightbox { padding: 40px; cursor: zoom-out; }
.overlay.lightbox img { max-width: 100%; max-height: calc(100vh - 80px); border-radius: var(--r-md); box-shadow: var(--shadow-lg); }

.photo-note-toggle { background: none; border: none; cursor: pointer; padding: 0; }
.photo-note-toggle.on { color: var(--accent); font-weight: 600; }
[data-theme="dark"] .photo-note-toggle.on { color: var(--accent-2); }
.char-count { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); text-align: right; margin-top: 4px; }
.char-count.near { color: #C0564A; }
.photo-note-zone { margin-top: 12px; }
.pnz-pick { display: block; border: 1.5px dashed var(--border-2); border-radius: var(--r-md); padding: 18px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.pnz-pick:hover { border-color: var(--accent); background: var(--bg-tint); }
.pnz-pick span { font-size: 14px; color: var(--text-2); }
.pnz-pick em { display: block; font-style: normal; font-size: 12px; color: var(--text-3); margin-top: 4px; }
.pnz-preview { position: relative; }
.pnz-preview img { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--border); }
.pnz-remove {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 99px;
  background: rgba(20,16,10,.6); color: #fff; border: none; cursor: pointer; font-size: 14px;
}

/* красная кнопка удаления своей записки */
.note-del-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 999px; background: none; border: 1px solid transparent; color: var(--text-3);
  cursor: pointer; transition: color .15s, border-color .15s, background .15s; margin-left: auto;
}
.note-del-btn svg { width: 16px; height: 16px; }
.note-del-btn:hover { color: #C0564A; border-color: #C0564A; background: color-mix(in srgb, #C0564A 8%, transparent); }
.note-del-btn + .reply-count { margin-left: 0; }

/* вкладки профиля */
.prof-tabs { display: flex; gap: 6px; margin: 4px 0 18px; border-bottom: 1px solid var(--border); }
.prof-tab {
  background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 10px 14px; font-size: 14.5px; font-weight: 500; color: var(--text-2); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.prof-tab:hover { color: var(--text); }
.prof-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
[data-theme="dark"] .prof-tab.active { color: var(--accent-2); border-bottom-color: var(--accent-2); }

/* визуальная совместимость */
.vm-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vm-opt {
  position: relative; aspect-ratio: 4 / 3; border: 2px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; cursor: pointer; padding: 0; background: var(--bg-tint);
  display: grid; place-items: center; transition: transform .15s var(--ease), border-color .15s, box-shadow .15s;
}
.vm-opt:hover { transform: translateY(-2px); border-color: #FB810E; box-shadow: var(--shadow-sm); }
.vm-opt.locked { pointer-events: none; opacity: .7; }
.vm-opt svg { width: 62%; height: 62%; }
.vm-opt canvas { width: 78%; height: 78%; image-rendering: pixelated; border-radius: 4px; }
.vm-row-picks { display: flex; align-items: center; gap: 14px; }
.vm-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.vm-pick i {
  display: grid; place-items: center; width: 74px; height: 58px; border-radius: var(--r-sm);
  border: 1.5px solid var(--border); overflow: hidden; background: var(--bg-tint);
}
.vm-pick i svg { width: 60%; height: 60%; }
.vm-pick i canvas { width: 76%; height: 76%; image-rendering: pixelated; border-radius: 3px; }
.vm-pick span { font-size: 11.5px; color: var(--text-3); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-pick.you i { border-color: #FB810E; }
.vm-pick.opp i { border-color: var(--accent); }
