/* Aniprisma — чёрный, белый и (в первую очередь) серый */
:root {
  --bg: #1f1f22;
  --bg-2: #18181b;
  --panel: #2a2a2e;
  --panel-2: #333338;
  --border: #3f3f46;
  --text: #f4f4f5;
  --text-2: #d4d4d8;
  --muted: #a1a1aa;
  --accent: #e4e4e7;
  --accent-ink: #18181b;
  --ok: #a3e6b4;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
h1 { font-size: 26px; margin: 0 0 16px; }
h2 { font-size: 20px; margin: 0; }
h3 { font-size: 16px; margin: 0 0 12px; }
img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.inline { display: inline; margin: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.page { flex: 1; padding-top: 24px; padding-bottom: 40px; }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 9px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: .15s;
}
.btn:hover { background: #fff; color: var(--accent-ink); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--panel-2); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.wide { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.link-btn:hover { color: var(--text); text-decoration: underline; }
.round-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer;
}
.round-btn:hover:not(:disabled) { background: var(--panel-2); }
.round-btn:disabled { opacity: .35; cursor: default; }

input, textarea, select {
  width: 100%; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font: inherit; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--muted); }
textarea { resize: vertical; }
input[type=file] { padding: 6px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); }
.inline-form { display: flex; gap: 8px; }
.inline-form input { width: 260px; }

.alert { background: #3b2a2a; border: 1px solid #5c3b3b; color: #fecaca; padding: 10px 14px; border-radius: 9px; margin-bottom: 14px; }
.alert.ok { background: #263329; border-color: #3b5c43; color: var(--ok); }
.empty { background: var(--panel); border: 1px dashed var(--border); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); }
.empty a { color: var(--text); text-decoration: underline; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.panel + .panel { margin-top: 16px; }

/* ---------- шапка ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(24, 24, 27, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 22px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 21px; letter-spacing: .3px; flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo b { color: var(--muted); font-weight: 600; }
.tabs { display: flex; gap: 4px; }
.tab { padding: 8px 14px; border-radius: 9px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.tab.active { color: var(--accent-ink); background: var(--accent); }

.search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.search input { padding-left: 38px; background: var(--panel); border-radius: 20px; }
.search-drop {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.search-drop a { display: flex; gap: 10px; padding: 8px 10px; align-items: center; }
.search-drop a:hover, .search-drop a.focus { background: var(--panel-2); text-decoration: none; }
.search-drop img { width: 38px; height: 54px; object-fit: cover; border-radius: 5px; background: var(--border); flex-shrink: 0; }
.search-drop .t { font-weight: 600; }
.search-drop .s { font-size: 12px; color: var(--muted); }
.search-drop .all { justify-content: center; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); }
.search-drop .none { padding: 14px; color: var(--muted); text-align: center; }

.userbar { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--panel); color: #fff; }
.badge {
  position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
}
.badge.static { position: static; display: inline-block; }
.me { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 22px; background: var(--panel); margin: 0 4px; }
.me:hover { background: var(--panel-2); text-decoration: none; }
.me-nick { font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--border); flex-shrink: 0; }
.me .avatar { width: 30px; height: 30px; }
.avatar.sm { width: 26px; height: 26px; }
.avatar.xl { width: 120px; height: 120px; }

/* ---------- секции ---------- */
.section { margin-bottom: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h1 { margin: 0; }
.more { color: var(--muted); font-size: 14px; }

/* карусель */
.carousel {
  display: grid; grid-auto-flow: column; grid-auto-columns: 172px; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: 6px; scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel-nav { display: flex; gap: 8px; }
.ong-card { position: relative; scroll-snap-align: start; border-radius: var(--radius); overflow: hidden; aspect-ratio: 2 / 3; background: var(--panel); }
.ong-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.ong-card:hover img { transform: scale(1.05); }
.ong-card:hover { text-decoration: none; }
.ong-info { position: absolute; inset: auto 0 0 0; padding: 40px 10px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .92)); }
.ong-title { font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ong-ep { font-size: 12px; color: var(--text-2); margin-top: 3px; }

.carousel { cursor: grab; user-select: none; }
.carousel.dragging { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; }
.carousel.dragging a { pointer-events: none; }

/* главная: топ + статистика */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.side-col { position: sticky; top: 88px; }

.grid { display: grid; gap: 18px 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.card { display: block; }
.card:hover { text-decoration: none; }
.card-cover { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--panel); box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s, filter .3s; }
.card:hover .card-cover img { transform: scale(1.05); filter: brightness(1.08); }
.card-rating, .card-rank {
  position: absolute; top: 8px; padding: 2px 8px; border-radius: 7px; font-size: 12.5px; font-weight: 700;
  background: rgba(24, 24, 27, .85); color: #fff; backdrop-filter: blur(4px);
}
.card-rating { left: 8px; }
.card-rank { right: 8px; background: rgba(228, 228, 231, .92); color: var(--accent-ink); }
.card-title { margin-top: 8px; font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.card-meta svg { width: 14px; height: 14px; }

.stats ul { list-style: none; margin: 0; padding: 0; }
.stats li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.stats li:last-child { border-bottom: 0; }
.stats li span { color: var(--text-2); }
.stats b { font-size: 16px; text-align: right; }
.online { color: var(--ok); font-weight: 500; font-size: 12px; white-space: nowrap; margin-left: 6px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 5px; vertical-align: 1px; }

.mini-comments { list-style: none; margin: 0; padding: 0; }
.mini-comments li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.mini-comments li:last-child { border-bottom: 0; }
.mini-comments p { margin: 3px 0 0; color: var(--text-2); word-break: break-word; }
.nick { font-weight: 600; }

/* ---------- страница аниме ---------- */
.anime-hero { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; margin-bottom: 28px; }
.anime-poster img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--panel); }
.rating-big { margin-top: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; display: flex; flex-direction: column; }
.rating-big span { font-size: 22px; font-weight: 700; }
.rating-big small { color: var(--muted); }
.anime-info h1 { font-size: 30px; line-height: 1.2; margin-bottom: 4px; }
.orig { color: var(--text-2); font-size: 16px; }
.others { font-size: 13px; margin-top: 2px; }
.facts { display: grid; grid-template-columns: 140px 1fr; gap: 7px 16px; margin: 20px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.status { padding: 1px 8px; border-radius: 6px; background: var(--panel-2); font-size: 13px; }
.status-ongoing { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 3px 10px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.desc { margin-top: 18px; color: var(--text-2); line-height: 1.65; white-space: pre-line; max-width: 860px; }
.desc.collapsed { max-height: 8.2em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.desc-toggle { margin-top: 6px; }
.actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.player { margin-bottom: 32px; }
.player-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); }
.player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.translations summary { cursor: pointer; color: var(--muted); }
.translations .chips { margin-top: 10px; max-width: 900px; }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.shots img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--panel); }

.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabbar button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 16px; padding: 10px 14px; cursor: pointer; margin-bottom: -1px; }
.tabbar button.active { color: var(--text); border-bottom-color: var(--accent); }
.count { font-size: 12px; background: var(--panel-2); border-radius: 8px; padding: 1px 7px; margin-left: 4px; }

.post-form { display: flex; gap: 12px; margin-bottom: 20px; }
.post-form .grow { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.comments { list-style: none; padding: 0; margin: 0; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.comment:target { background: var(--panel); border-radius: 10px; padding-left: 10px; }
.comment-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.comment-text, .review-text { margin-top: 5px; color: var(--text-2); word-break: break-word; line-height: 1.6; }
.mention { color: #fff; font-weight: 600; }
.role { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-transform: uppercase; }
.review-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; align-items: flex-start; }
.review-form textarea { width: 100%; }
.score-pick { display: flex; align-items: center; gap: 10px; }
.score-pick select { width: 90px; }
.score { font-weight: 700; padding: 1px 8px; border-radius: 6px; font-size: 13px; }
.score-hi { background: var(--accent); color: var(--accent-ink); }
.score-mid { background: #71717a; color: #fff; }
.score-lo { background: #3f3f46; color: var(--text-2); }
.review { margin-bottom: 12px; }

/* ---------- плеер и совместный просмотр ---------- */
.player-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.player-head .btn svg { width: 18px; height: 18px; }
.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; }
.room-notice .btn { margin-left: 10px; padding: 4px 12px; font-size: 13px; }
.make-host {
  padding: 2px 9px; border-radius: 6px; border: 0; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 700;
  background: #e5c66a; color: #1f1a0a; white-space: nowrap;
}
.make-host:hover { background: #f2d77f; }
.room-notice { margin-top: 10px; padding: 10px 14px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.room-panel { position: relative; min-height: 420px; }
.room-inner {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
}
.room-link { display: flex; gap: 6px; }
.room-link input { font-size: 12.5px; padding: 7px 10px; color: var(--muted); }
.room-link .btn { padding: 6px 10px; font-size: 13px; }
.room-status { font-size: 13px; color: var(--text-2); line-height: 1.4; }
.room-actions .btn { padding: 7px 12px; }
.room-section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }
.room-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 32%; overflow-y: auto; flex-shrink: 0; }
.room-members li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 6px 8px; border-radius: 8px; background: var(--bg-2); font-size: 13.5px; }
.room-members li.is-host { border: 1px solid var(--muted); }
.room-members .m-name { font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-members .tag { font-size: 10.5px; padding: 0 6px; border-radius: 5px; background: var(--panel-2); color: var(--muted); }
.room-members .m-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.ping { color: var(--muted); font-variant-numeric: tabular-nums; }
.ping.good { color: var(--ok); }
.ping.mid { color: #e5d38a; }
.ping.bad { color: #f0a0a0; }
.drift { color: var(--muted); }
.drift.off { color: #e5d38a; }
.room-chat { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 6px; background: var(--bg-2); border-radius: 8px; font-size: 13.5px; }
.room-chat .msg { word-break: break-word; line-height: 1.4; }
.room-chat .msg .time { color: var(--muted); font-size: 11px; margin-right: 6px; }
.room-chat .msg.system { color: var(--muted); font-style: italic; }
.room-chat-form { display: flex; gap: 6px; }
.room-chat-form input { padding: 7px 10px; }
.room-chat-form .btn { padding: 6px 12px; }

.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .7); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.modal-box p { margin: 0; font-size: 14px; }

/* ---------- формы входа ---------- */
.auth { max-width: 420px; margin: 30px auto; padding: 28px; }
.auth h1 { text-align: center; }

.btn-tg { background: var(--panel-2); color: var(--text); border-color: var(--border); gap: 10px; padding: 10px 16px; }
.btn-tg:hover { background: #3d3d44; color: #fff; }
.btn-tg .tg-icon { width: 20px; height: 20px; color: #54a9eb; }
.btn-tg[disabled] { opacity: .6; cursor: progress; }
.tg-new section h3 { margin: 18px 0 4px; }
.tg-new section p { margin: 0 0 12px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.small { font-size: 13px; }

/* ---------- профиль ---------- */
.profile { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.profile-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.profile-card h1 { margin: 6px 0 0; }
.about { color: var(--text-2); white-space: pre-line; margin: 4px 0; }
.profile-counts { display: flex; gap: 30px; margin: 8px 0; }
.profile-counts div { display: flex; flex-direction: column; }
.profile-counts b { font-size: 22px; }
.profile-counts span { color: var(--muted); font-size: 13px; }
.feed-item { padding: 12px 0; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.feed-item:first-of-type { border-top: 0; }
.feed-item p { flex-basis: 100%; margin: 2px 0 0; color: var(--text-2); word-break: break-word; }

.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.settings .panel + .panel { margin-top: 0; }
.avatar-row { display: flex; gap: 18px; align-items: center; }
.settings .form { align-items: flex-start; }
.settings .form label { width: 100%; }

/* ---------- списки, сообщения ---------- */
.list { padding: 6px; }
.list > p { padding: 12px; margin: 0; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border-radius: 9px; }
.list-item:hover { background: var(--panel-2); text-decoration: none; }
.list-item.unread { background: var(--panel-2); border-left: 3px solid var(--accent); }
.dialog-item .right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; }

.chat { display: flex; flex-direction: column; gap: 14px; }
.chat-log { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; padding: 4px; }
.bubble { max-width: 70%; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--panel-2); align-self: flex-start; word-break: break-word; }
.bubble.mine { background: var(--accent); color: var(--accent-ink); border-radius: 14px 14px 4px 14px; align-self: flex-end; }
.bubble.mine a { color: var(--accent-ink); }
.bubble .time { display: block; font-size: 11px; opacity: .6; margin-top: 2px; }
.chat-form { display: flex; gap: 10px; align-items: flex-end; }

/* ---------- сообщество ---------- */
.community { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.community > .panel + .panel { margin-top: 0; }
.user-list { list-style: none; margin: 0; padding: 0; }
.user-list li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14px; }
.user-list a { display: flex; align-items: center; gap: 8px; }

/* ---------- админка ---------- */
.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-list li, .admin-result { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.admin-list li:first-child { border-top: 0; }
.admin-list img, .admin-result img { width: 44px; height: 62px; object-fit: cover; border-radius: 6px; background: var(--border); }
.admin-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 0 24px; margin-top: 12px; }
.sync-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-top: 1px solid var(--border); }
.sync-row:first-of-type { border-top: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px; border-top: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 500; border-top: 0; }

.error-page { text-align: center; padding: 80px 0; }
.error-code { font-size: 64px; font-weight: 800; color: var(--muted); }

.footer { border-top: 1px solid var(--border); background: var(--bg-2); }
.footer-inner { display: flex; justify-content: space-between; padding: 18px 20px; font-size: 13px; }

/* ---------- уведомления (всплывающий блок) ---------- */
.notif { position: relative; }
.notif-pop {
  position: absolute; top: calc(100% + 10px); right: -60px; width: 360px; max-height: 70vh;
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); z-index: 60; overflow: hidden;
}
.notif-pop[hidden] { display: none; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-list { overflow-y: auto; padding: 6px; }
.notif-item { display: block; padding: 10px; border-radius: 9px; font-size: 14px; color: var(--text); }
.notif-item:hover { background: var(--panel-2); text-decoration: none; }
.notif-item.unread { background: var(--panel-2); border-left: 3px solid var(--accent); }
.notif-time { font-size: 12px; margin-top: 2px; }
.notif-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- нижнее меню (телефоны) ---------- */
.bottom-nav { display: none; }

/* ---------- топ-100: сортировка ---------- */
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sorter summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.sorter summary::-webkit-details-marker { display: none; }
.sorter summary h3 { margin: 0; }
.sorter summary::after { content: '▾'; color: var(--muted); transition: transform .2s; }
.sorter:not([open]) summary::after { transform: rotate(-90deg); }
.sorter-group { margin-top: 16px; }
.sorter-title { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.sorter-opt { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-size: 14px; }
.sorter-opt:hover { background: var(--panel-2); text-decoration: none; color: #fff; }
.sorter-opt.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.sorter .btn { margin-top: 16px; }
a.chip:hover { color: #fff; border-color: var(--muted); text-decoration: none; }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }

.table-wrap { overflow-x: auto; }
.wide-form { width: 100%; margin: 0; }
.carousel { position: relative; }

/* фокус с клавиатуры и пульта ТВ */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #fff; outline-offset: 3px; border-radius: 8px;
}
.card:focus-visible .card-cover, .ong-card:focus-visible { box-shadow: 0 0 0 3px #fff; }

/* ---------- адаптив ---------- */

/* телевизоры и большие мониторы: всё крупнее */
@media (min-width: 1900px) { body { zoom: 1.25; } }
@media (min-width: 2500px) { body { zoom: 1.6; } }
@media (min-width: 3400px) { body { zoom: 2.2; } }

/* ноутбуки */
@media (max-width: 1300px) {
  .grid-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .grid-6 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .community { grid-template-columns: 1fr 1fr; }
  .community aside { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .community aside .panel + .panel { margin-top: 0; }
}

/* планшеты */
@media (max-width: 1100px) {
  .watch-layout { grid-template-columns: 1fr; }
  .room-panel { min-height: 520px; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .search { max-width: none; }
  .layout { grid-template-columns: 1fr; }
  .side-col { position: static; }
  .top-layout .side-col { order: -1; }
  .me-nick { display: none; }
  .anime-hero { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
  .notif-pop { right: -100px; }
}
@media (max-width: 860px) {
  .grid-4, .grid-5, .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .anime-hero { grid-template-columns: 1fr; }
  .anime-poster { max-width: 240px; margin: 0 auto; width: 100%; }
  .anime-info h1 { font-size: 24px; }
  .profile { grid-template-columns: 1fr; }
  .community, .community aside { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 120px 1fr; }
  .admin-results { grid-template-columns: 1fr; }
}

/* телефоны */
@media (max-width: 760px) {
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .container { padding: 0 12px; }
  .page { padding-top: 16px; }
  h1 { font-size: 22px; }
  .topbar-inner { flex-wrap: nowrap; gap: 8px; height: 56px; padding-top: 0; padding-bottom: 0; }
  .tabs { display: none; }
  .logo span { display: none; }
  .search { min-width: 0; }
  .search input { padding-top: 7px; padding-bottom: 7px; }
  .userbar { gap: 0; }
  .hide-phone { display: none !important; }
  .icon-btn { width: 36px; height: 36px; }
  .me { padding: 2px; margin: 0 0 0 2px; background: none; }
  .btn { padding: 7px 12px; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(24, 24, 27, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bnav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; color: var(--muted); font-size: 11px; }
  .bnav-item svg { width: 22px; height: 22px; }
  .bnav-item.active { color: #fff; }
  .bnav-item:hover { text-decoration: none; }

  .notif-pop { position: fixed; top: 60px; left: 8px; right: 8px; width: auto; max-height: calc(100vh - 140px); }

  /* поля ввода 16px — iPhone не приближает страницу при фокусе */
  input, textarea, select { font-size: 16px; }

  .section { margin-bottom: 24px; }
  .carousel { grid-auto-columns: 132px; gap: 10px; }
  .grid { gap: 14px 10px; }
  .card-title { font-size: 13px; }
  .card-rating, .card-rank { font-size: 11.5px; top: 6px; padding: 1px 6px; }
  .card-rating { left: 6px; } .card-rank { right: 6px; }

  .facts { grid-template-columns: 110px 1fr; font-size: 14px; }
  .actions .btn { flex: 1; }
  .player-frame { border-radius: 0; margin: 0 -12px; }
  .player-head h2 { font-size: 17px; }
  .shots { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .room-panel { min-height: 480px; }
  .post-form > .avatar { display: none; }
  .tabbar button { font-size: 15px; padding: 10px; }

  .inline-form { flex-direction: column; width: 100%; }
  .inline-form input { width: 100%; }
  .section-head { align-items: flex-start; }
  .auth { padding: 20px; margin: 10px auto; }
  .chat-log { max-height: 55vh; }
  .bubble { max-width: 88%; }
  .admin-list li { flex-wrap: wrap; }
  .sync-row { flex-wrap: wrap; }
  .footer-inner { flex-direction: column; gap: 4px; text-align: center; }
  .error-page { padding: 40px 0; }
}
@media (max-width: 560px) {
  .grid-4, .grid-5, .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats b { font-size: 15px; }
}

/* устройства без мыши: подсказки наведения не нужны, кнопки крупнее */
@media (hover: none) {
  .card:hover .card-cover img, .ong-card:hover img { transform: none; }
  .round-btn { width: 40px; height: 40px; }
}

/* ---------- SEO ---------- */
/* заголовок страницы только для поисковиков и экранных дикторов */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.about-site { margin-top: 40px; padding: 20px 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); color: var(--muted); font-size: 14px; }
.about-site h2 { font-size: 16px; color: var(--text-2); margin-bottom: 8px; }
.about-site p { margin: 0 0 8px; }
.about-site p:last-child { margin: 0; }
