/* =====================================================================
   Страницы: настройки, профиль, сообщество, библиотека, авторизация
   ===================================================================== */

.center-pad { display: grid; place-items: center; padding: 40px 0; }
.small { font-size: 0.82rem; }
.grow { flex: 1; min-width: 200px; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 2px 12px; flex: none; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.info-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: rgba(var(--accent-rgb), 0.14); border: 1px solid rgba(var(--accent-rgb), 0.4); color: var(--text); margin-bottom: 12px; flex-wrap: wrap; }
.info-banner.slim { padding: 8px 12px; font-size: 0.88rem; }
.issue-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--text-2); }
.issue-list li { display: flex; align-items: center; gap: 10px; }
.issue-list .ic { color: var(--bad); }
.published { color: var(--good); }

.tabs-row { display: flex; gap: 6px; padding: 14px 0 12px; overflow-x: auto; scrollbar-width: none; }
.tabs-row::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--text-2); font-weight: 700; transition: all 0.25s var(--ease); }
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.active { background: rgba(var(--accent-rgb), 0.2); border-color: rgba(var(--accent-rgb), 0.55); color: var(--text); }

/* ---------- настройки ---------- */
.settings-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
.set-nav { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; }
.set-tab { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--text-2); font-weight: 700; text-align: left; transition: all 0.25s var(--ease); }
.set-tab:hover { background: var(--surface-2); color: var(--text); }
.set-tab.active { background: linear-gradient(120deg, rgba(var(--accent-rgb), 0.28), rgba(var(--accent-2-rgb), 0.12)); border-color: rgba(var(--accent-rgb), 0.5); color: var(--text); }
.set-content { overflow: auto; padding: 4px 8px 30px 4px; display: grid; gap: 4px; align-content: start; }
.set-group-title { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); margin: 14px 4px 8px; }
.set-card { padding: 4px 16px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row.wide { flex-direction: column; align-items: stretch; }
.set-label { font-weight: 700; }
.set-desc { color: var(--muted); font-size: 0.83rem; margin-top: 2px; }
.set-control { flex: none; display: flex; align-items: center; gap: 8px; }
.set-row.wide .set-control { flex: 1; }
.set-about { padding: 20px 6px; color: var(--muted); text-align: center; }
.accent-row { display: flex; gap: 10px; }
.accent-sw { width: 36px; height: 36px; border-radius: 12px; border: 2px solid transparent; color: transparent; display: grid; place-items: center; transition: all 0.3s var(--spring); }
.accent-sw:hover { transform: scale(1.12) rotate(-4deg); }
.accent-sw.active { border-color: var(--text); color: #fff; transform: scale(1.08); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); }
.keys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.key-cell { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-weight: 600; }
.key-btn { min-width: 72px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-3); color: var(--text); font-family: var(--font-mono); font-weight: 700; transition: all 0.2s; }
.key-btn:hover { border-color: var(--accent); }
.key-btn.listening { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.25); animation: keyPulse 1s ease-in-out infinite; font-family: var(--font); }
@keyframes keyPulse { 50% { box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0.25); } }
.toggle-inline { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 0.86rem; color: var(--text-2); cursor: pointer; }
.modal-settings .modal-body { padding: 0 20px 18px; }
.modal-settings .settings-layout { height: min(66vh, 620px); }

/* ---------- профиль ---------- */
.profile-hero { display: grid; grid-template-columns: 240px 1fr; gap: 20px; padding: 18px 24px 18px 8px; align-items: center; overflow: hidden; position: relative; }
.profile-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 15% 50%, rgba(var(--accent-rgb), 0.3), transparent 60%); pointer-events: none; }
.hero-stage { position: relative; display: grid; place-items: center; }
.stage-glow.small { width: 200px; }
.hero-avatar { position: relative; width: 190px; height: 190px; }
.hero-info { position: relative; display: grid; gap: 10px; }
.hero-name { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; flex-wrap: wrap; }
.hero-title { color: var(--accent-2); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.8rem; }
.hero-meta { display: flex; gap: 18px; color: var(--text-2); }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ach-card { display: flex; gap: 14px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); opacity: 0.8; transition: all 0.3s var(--ease); }
.ach-card.earned { opacity: 1; border-color: rgba(251, 191, 36, 0.45); background: linear-gradient(120deg, rgba(251, 191, 36, 0.1), var(--surface) 60%); }
.ach-ic { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.ach-card.earned .ach-ic { background: linear-gradient(135deg, #fbbf24, #f97316); color: #2a1500; box-shadow: 0 6px 20px rgba(251, 191, 36, 0.35); }
.ach-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ach-title { font-weight: 800; }
.ach-desc { color: var(--muted); font-size: 0.85rem; }
.ach-bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.ach-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.8s var(--ease); }
.ach-foot { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-2); }
.quest-list { display: grid; gap: 10px; }
.quest { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.quest.done { border-color: rgba(52, 211, 153, 0.5); background: linear-gradient(120deg, rgba(52, 211, 153, 0.1), var(--surface) 60%); }
.quest-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-3); flex: none; }
.quest.done .quest-ic { background: rgba(52, 211, 153, 0.25); color: var(--good); }
.quest-body { flex: 1; display: grid; gap: 4px; min-width: 0; }
.quest-title { font-weight: 800; }
.quest-desc { color: var(--muted); font-size: 0.85rem; }
.quest-side { display: grid; gap: 4px; justify-items: end; font-weight: 800; }
.quest-side .gem { display: inline-flex; align-items: center; gap: 4px; }
.people { display: grid; gap: 8px; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.person-name { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; font-weight: 700; padding: 0; }
.person-name:hover { color: var(--accent-2); }
.promo-card { display: flex; gap: 18px; align-items: center; padding: 22px; }
.promo-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; flex: none; }
.promo-title { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }
.user-head { display: flex; align-items: center; gap: 16px; }

/* ---------- сообщество ---------- */
.lm-grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr); gap: 20px; }
.lm-left, .lm-right { display: grid; gap: 14px; align-content: start; min-width: 0; }
.lm-thumb { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); line-height: 0; }
.lm-thumb .thumb { width: 100%; height: auto; display: block; }
.lm-desc { color: var(--text-2); margin: 0; }
.lm-best { display: flex; align-items: center; gap: 10px; color: #fbbf24; font-weight: 700; }
.lvl-chip.big { padding: 4px 10px; font-size: 0.8rem; }
.like-btn.on { color: #fb7185; border-color: rgba(251, 113, 133, 0.6); background: rgba(251, 113, 133, 0.15); }
.like-btn.on svg { fill: currentColor; }
.btn.on { color: var(--accent-2); }
.lm-tab { min-height: 200px; }
.lb { display: grid; gap: 6px; }
.lb-row { display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; transition: all 0.2s; }
.lb-row:hover { border-color: var(--line-strong); transform: translateX(3px); }
.lb-row.me { border-color: rgba(var(--accent-rgb), 0.7); background: rgba(var(--accent-rgb), 0.15); }
.lb-rank { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; background: var(--surface-3); font-size: 0.85rem; }
.lb-rank.r1 { background: linear-gradient(135deg, #fbbf24, #f97316); color: #2a1500; }
.lb-rank.r2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #111; }
.lb-rank.r3 { background: linear-gradient(135deg, #f59e0b, #b45309); color: #1c0f00; }
.lb-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lb-fails { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 0.8rem; }
.lb-time { font-weight: 800; color: #fbbf24; }
.comments { display: grid; gap: 8px; max-height: 320px; overflow: auto; }
.comment { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); display: grid; gap: 4px; }
.comment-user { border: 0; background: transparent; padding: 0; font-weight: 800; color: var(--accent-2); margin-right: 8px; }
.comment-text { color: var(--text-2); overflow-wrap: anywhere; }

/* ---------- библиотека / шаблоны ---------- */
.welcome-editor { display: grid; gap: 26px; padding: 20px 0; }
.we-hero { display: grid; justify-items: center; text-align: center; gap: 10px; }
.we-hero h2 { font-family: var(--font-display); font-size: 2rem; }
.we-icon { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 40px rgba(var(--accent-rgb), 0.45); animation: stageFloat 4s ease-in-out infinite; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tpl-grid.compact { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tpl-card { display: grid; gap: 6px; justify-items: start; text-align: left; padding: 18px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); transition: all 0.35s var(--ease); backdrop-filter: blur(var(--blur)); }
.tpl-grid.compact .tpl-card { padding: 12px; border-radius: 16px; background: var(--surface-2); }
.tpl-card:hover { transform: translateY(-5px); border-color: rgba(var(--accent-rgb), 0.7); box-shadow: 0 16px 40px rgba(var(--accent-rgb), 0.22); }
.tpl-card.active { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.2); }
.tpl-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.8), rgba(var(--accent-2-rgb), 0.7)); color: #fff; margin-bottom: 4px; }
.tpl-name { font-weight: 800; font-size: 1.05rem; }
.tpl-desc { color: var(--muted); font-size: 0.85rem; }

/* ---------- авторизация ---------- */
.auth-form .segmented { justify-self: stretch; }
.auth-form .segmented .seg-btn { flex: 1; }
.auth-perks { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--text-2); font-size: 0.88rem; }
.auth-perks li { display: flex; align-items: center; gap: 10px; }
.auth-perks .ic { color: var(--accent-2); }
.auth-submit { width: 100%; }

@media (max-width: 860px) {
    .settings-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .set-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
    .set-tab { flex: none; height: 38px; }
    .set-row { flex-direction: column; align-items: stretch; gap: 10px; }
    .set-control { justify-content: flex-start; flex-wrap: wrap; }
    .profile-hero { grid-template-columns: 1fr; padding: 16px; justify-items: center; text-align: center; }
    .hero-info { justify-items: center; }
    .lm-grid { grid-template-columns: 1fr; }
    .promo-card { flex-direction: column; text-align: center; }
}
