:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #1c2330;
  --border: #2a3342;
  --text: #e6edf3;
  --muted: #8b949e;
  --pink: #ff6fb5;
  --blue: #4a9eff;
  --green: #3fb950;
  --orange: #f0883e;
  --red: #f85149;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2434 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--blue); cursor: pointer; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

.btn {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 15px;
  transition: .15s;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #ff6fb5, #e14d94); border: none; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-danger { background: #3d1b1b; border-color: #7a2a2a; color: #ffb4b0; }
.btn-danger:hover { border-color: var(--red); }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }

input[type=text], input[type=password], textarea, select {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
  width: 100%;
}
input:focus, textarea:focus { border-color: var(--pink); }
label { font-size: 14px; color: var(--muted); }

/* ---------- Рекламные заглушки ---------- */
.ad {
  border: 2px dashed #39465a;
  border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, #141a22, #141a22 12px, #171e28 12px, #171e28 24px);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  letter-spacing: .4px;
  min-height: 90px;
  user-select: none;
}
.ad-vert { width: 100%; min-height: 400px; }
.ad-horiz { width: 100%; min-height: 90px; margin: 8px 0; }

/* ---------- Гейт 18+ ---------- */
.gate-wrap { max-width: 640px; margin: 0 auto; padding: 40px 16px; display: flex; flex-direction: column; gap: 14px; }
.gate-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px;
  text-align: center;
}
.logo { font-size: 30px; font-weight: 800; letter-spacing: 1px; }
.logo span { color: var(--pink); }
.age-badge {
  display: inline-block;
  border: 3px solid var(--red);
  color: var(--red);
  border-radius: 10px;
  padding: 2px 12px;
  font-weight: 800;
  font-size: 20px;
  margin: 12px 0;
}
.gate-warn { color: var(--muted); line-height: 1.55; margin-top: 6px; }
.gate-list { text-align: left; margin: 14px auto; max-width: 460px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.gate-btns { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.gate-note { font-size: 13px; color: var(--muted); margin-top: 14px; }
.denied-title { color: var(--red); font-size: 22px; font-weight: 700; margin-bottom: 8px; }

/* ---------- Шапка ---------- */
header.top {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 16px;
  background: rgba(13,17,23,.85);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
}
.top .logo { font-size: 20px; }
.top .logo .age-badge { font-size: 12px; padding: 0 6px; border-width: 2px; border-radius: 6px; margin: 0; }
.online-count { margin-left: auto; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.online-count b { color: var(--green); font-size: 16px; }
.online-count::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.top-actions { display: flex; gap: 8px; }

/* ---------- Лейаут чата ---------- */
.layout {
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  gap: 14px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 14px 16px;
  align-items: start;
}
.sidebar { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 64px; }
.center-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ---------- Сцена видео ---------- */
.stage {
  position: relative;
  background: #05070a;
  border: 3px solid var(--border);
  border-radius: 16px;
  aspect-ratio: 16/9;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: box-shadow .3s, border-color .3s;
}
.stage video { width: 100%; height: 100%; object-fit: cover; }
.stage.empty::after {
  content: 'Ожидание собеседника…';
  color: var(--muted); font-size: 18px;
}
.stage .stage-msg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 17px; background: #05070a; z-index: 2; flex-direction: column; gap: 10px;
}
.stage .stage-msg .spinner {
  width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--pink);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Рамка по полу */
.peer-male .stage { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(74,158,255,.18), 0 0 34px rgba(74,158,255,.35); }
.peer-female .stage { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255,111,181,.18), 0 0 34px rgba(255,111,181,.4); }
.peer-admin .stage { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240,136,62,.2), 0 0 34px rgba(240,136,62,.35); }

/* Бейдж собеседника */
.peer-badge {
  position: absolute; top: 10px; left: 10px; z-index: 5;
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
  border-radius: 20px; padding: 5px 12px;
  display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600;
}
.peer-badge .g-ico { font-size: 15px; }
.g-male { color: var(--blue); }
.g-female { color: var(--pink); }
.g-admin { color: var(--orange); }
.peer-badge .flag { font-size: 13px; }
.nsfw-tag {
  background: var(--red); color: #fff; border-radius: 6px;
  padding: 1px 7px; font-size: 11px; font-weight: 800; letter-spacing: .5px;
}

/* Плашка 18+ (блюр) */
.blur-plate {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(18px) saturate(.6);
  cursor: pointer;
  transition: opacity .25s;
}
.blur-plate .plate-box {
  border: 2px solid var(--red); color: var(--red);
  background: rgba(20,20,25,.7);
  font-size: 30px; font-weight: 900; border-radius: 14px; padding: 8px 22px;
}
.blur-plate .plate-hint { color: #d6dde5; font-size: 14px; }
.blur-plate:hover { opacity: .92; }

/* Своё видео */
.local-pip {
  position: absolute; right: 12px; bottom: 12px; z-index: 8;
  width: 200px; aspect-ratio: 4/3;
  border: 2px solid var(--border); border-radius: 12px; overflow: hidden;
  background: #05070a;
  box-shadow: 0 4px 18px rgba(0,0,0,.55);
}
.local-pip video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.local-pip .local-label {
  position: absolute; left: 6px; bottom: 4px; font-size: 11px; color: #fff;
  background: rgba(0,0,0,.5); border-radius: 6px; padding: 1px 7px;
}
.local-pip .local-nsfw-tag {
  position: absolute; top: 6px; right: 6px; z-index: 2;
}

/* ---------- Контролы ---------- */
.controls {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  padding: 10px 0;
}
.ctrl-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); border-radius: 12px;
  padding: 10px 16px; font-size: 15px; transition: .15s;
}
.ctrl-btn:hover { border-color: var(--muted); transform: translateY(-1px); }
.ctrl-btn.active { border-color: var(--red); background: #331a1c; color: #ffb4b0; }
.ctrl-btn.skip { border-color: var(--pink); color: var(--pink); font-weight: 600; }
.ctrl-btn.stop { border-color: var(--red); color: var(--red); }
.ctrl-btn.report { border-color: var(--orange); color: var(--orange); }
.ctrl-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* ---------- Текстовый чат ---------- */
.chat-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex; flex-direction: column;
  height: 240px;
}
.chat-head {
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px; color: var(--muted);
  display: flex; justify-content: space-between; align-items: center;
}
.chat-body { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; }
.chat-msg { font-size: 14px; line-height: 1.45; word-break: break-word; }
.chat-msg .c-nick { font-weight: 700; margin-right: 6px; }
.chat-msg.own { align-self: flex-end; text-align: right; }
.chat-msg .c-nick { color: var(--blue); }
.chat-msg.own .c-nick { color: var(--pink); }
.chat-empty { color: var(--muted); font-size: 13px; text-align: center; margin: auto; }
.chat-input-row { display: flex; gap: 8px; padding: 8px; border-top: 1px solid var(--border); }
.chat-input-row input { flex: 1; }
.chat-input-row button { flex-shrink: 0; }

/* ---------- Модалки ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.68); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 26px; max-width: 480px; width: 100%;
  max-height: 86vh; overflow-y: auto;
}
.modal h2 { font-size: 20px; margin-bottom: 14px; }
.modal .m-note { color: var(--muted); font-size: 14px; line-height: 1.6; }
.modal .form-row { margin: 14px 0; display: flex; flex-direction: column; gap: 7px; }
.radio-row { display: flex; gap: 18px; }
.radio-row label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 16px; cursor: pointer; padding: 10px 16px; border: 1px solid var(--border); border-radius: 12px; flex: 1; justify-content: center; transition: .15s; }
.radio-row label:hover { border-color: var(--muted); }
.radio-row input:checked + span { font-weight: 700; }
.radio-row label:has(input:checked) { border-color: var(--pink); background: rgba(255,111,181,.08); }
.radio-row .g-male-opt:has(input:checked) { border-color: var(--blue); background: rgba(74,158,255,.08); }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.modal-btns .btn { flex: 1; min-width: 120px; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.check-row input { width: 18px; height: 18px; accent-color: var(--pink); }

/* ---------- Тосты ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg3); border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  padding: 12px 16px; border-radius: 10px; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  animation: slideIn .25s ease;
  max-width: 340px;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Админка ---------- */
.admin-body { padding: 16px; }
.admin-stats { display: flex; gap: 26px; font-size: 14px; color: var(--muted); padding: 4px 2px 14px; flex-wrap: wrap; }
.admin-stats b { color: var(--text); font-size: 18px; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-btn { padding: 9px 16px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.tab-btn.active { color: var(--text); border-color: var(--pink); background: rgba(255,111,181,.08); }
.tab-btn .badge { background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 6px; margin-left: 6px; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.tile {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; position: relative;
}
.tile .thumb { width: 100%; aspect-ratio: 4/3; background: #05070a; object-fit: cover; display: block; }
.tile .no-thumb {
  width: 100%; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; background: #0a0e14;
}
.tile .t-info { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.tile .t-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tile .t-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-idle { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-call { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.tile .t-actions { display: flex; gap: 6px; padding: 0 10px 10px; flex-wrap: wrap; }
.tile .t-actions .btn-sm { flex: 1; white-space: nowrap; }
.tile .flag-icon { font-size: 13px; }
.report-dot {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.report-dot.r { background: var(--red); color: var(--red); }
.report-dot.n { background: var(--orange); color: var(--orange); }

/* Окно просмотра админа */
.watch-win {
  position: fixed; right: 18px; bottom: 18px; z-index: 120;
  width: 380px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.watch-win video { width: 100%; aspect-ratio: 16/9; background: #000; display: block; }
.watch-win .w-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.watch-win .w-head .w-title { flex: 1; font-weight: 600; }
.watch-win .w-body { display: flex; flex-direction: column; }
.watch-win .w-chat { display: flex; flex-direction: column; height: 150px; border-top: 1px solid var(--border); }
.watch-win .w-chat .chat-body { flex: 1; }
.watch-win .w-chat .chat-input-row { border-top: 1px solid var(--border); }

/* Отчёты/журнал/баны */
.list-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
  display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap;
}
.list-card .lc-evidence { width: 150px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); flex-shrink: 0; }
.list-card .lc-evidence img { width: 100%; display: block; }
.list-card .lc-body { flex: 1; min-width: 240px; }
.list-card .lc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.list-card .lc-title { font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-card .lc-meta { color: var(--muted); font-size: 13px; margin: 4px 0; }
.journal-item { font-size: 13px; padding: 6px 2px; border-bottom: 1px dashed var(--border); color: var(--muted); }
.journal-item b { color: var(--text); }
.journal-item time { float: right; }

.login-wrap { max-width: 400px; margin: 12vh auto; background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 30px; }
.login-wrap h1 { font-size: 22px; margin-bottom: 6px; }
.login-wrap .form-row { margin: 14px 0; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; flex-direction: row; }
  .ad-vert { min-height: 90px; flex: 1; }
}

/* Мелкие индикаторы на плитках админки (без плашек) */
.flag-badge {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  font-size: 12px; font-weight: 800; border-radius: 8px;
  padding: 2px 8px; line-height: 1.35;
}
.flag-badge.rep { background: var(--red); color: #fff; box-shadow: 0 0 10px var(--red); }
.flag-badge.nsfw { background: var(--orange); color: #111; box-shadow: 0 0 10px var(--orange); }
.cam-off-chip { color: var(--muted); font-size: 11px; background: var(--bg3); border-radius: 6px; padding: 0 6px; }

/* ===== SEO-текст на главной ===== */
.seo-block {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 20px 56px;
  color: #cbd5e1;
  line-height: 1.65;
  font-size: 15px;
}
.seo-block h1 { color: #fff; font-size: 26px; margin: 0 0 14px; }
.seo-block h2 { color: #f472b6; font-size: 19px; margin: 26px 0 10px; }
.seo-block p { margin: 0 0 12px; }
.seo-block b { color: #fff; }
