/* ─────────────────────────────────────────────
   BlinkChat – Dark Mode Theme
   Farbpalette: Deep Navy + Electric Cyan
   ───────────────────────────────────────────── */

/* ── Local Inter Font ────────────────────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter/inter-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter/inter-600.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter/inter-700.ttf') format('truetype');
}

:root {
  --bg-primary:   #0b0e17;
  --bg-secondary: #121829;
  --bg-card:      #1a2035;
  --bg-input:     #151b2e;
  --accent:       #00e5ff;
  --accent-hover: #00b8d4;
  --accent-dim:   rgba(0, 229, 255, 0.12);
  --text:         #e4e8f1;
  --text-muted:   #6b7a99;
  --danger:       #ff4060;
  --danger-hover: #e0334f;
  --success:      #00e676;
  --border:       rgba(255, 255, 255, 0.06);
  --radius:       12px;
  --shadow:       0 8px 32px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text);
  overflow: hidden;
}

/* Allow scrolling on legal pages & profile page */
html.legal-html, html.legal-html body,
html.profile-html, html.profile-html body {
  overflow: auto;
  height: auto;
  min-height: 100%;
}

/* ── Screens ─────────────────────────────── */
.screen { display: none; height: 100vh; }
.screen.active { display: flex; }

/* ── Landing ─────────────────────────────── */
#landing {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 20%, #0d1a3a 0%, var(--bg-primary) 70%);
}
.landing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow);
}
.logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.logo-icon { font-size: 36px; }
.logo h1 { font-size: 32px; font-weight: 700; }
.accent { color: var(--accent); }
.tagline { color: var(--text-muted); margin-bottom: 28px; font-size: 14px; }
.hint { color: var(--text-muted); font-size: 12px; margin-top: 20px; }

#nickname-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
#nickname-input:focus { border-color: var(--accent); }

#chat-options > .device-select-group {
  text-align: left;
  margin-bottom: 16px;
}

/* Device Selectors */
.device-selectors {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.device-select-group {
  flex: 1;
  text-align: left;
}
.device-select-group label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  padding-left: 2px;
}
.device-select-group label i {
  margin-right: 4px;
  font-size: 10px;
}
.device-select-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color .2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7a99'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
  text-overflow: ellipsis;
}
.device-select-group select:focus {
  border-color: var(--accent);
}
.device-select-group select option {
  background: var(--bg-card);
  color: var(--text);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, transform .1s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── ToS Consent ─────────────────────────── */
.tos-consent {
  margin: 0 0 20px;
}
.tos-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  user-select: none;
}
.tos-label input[type="checkbox"] {
  display: none;
}
.tos-checkmark {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,.25);
  border-radius: 4px;
  background: var(--bg-input);
  position: relative;
  transition: border-color .2s, background .2s;
  margin-top: 1px;
}
.tos-label input[type="checkbox"]:checked + .tos-checkmark {
  background: var(--accent);
  border-color: var(--accent);
}
.tos-label input[type="checkbox"]:checked + .tos-checkmark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.tos-text {
  flex: 1;
}
.tos-text a {
  color: var(--accent);
  text-decoration: underline;
}
.tos-text a:hover {
  color: var(--accent-hover);
}

/* ── Google Login ────────────────────────── */
#google-login-area,
#admin-google-login-area {
  display: flex;
  justify-content: center;
  margin: 0 0 0;
}
.google-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.google-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.google-user-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.google-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.google-email {
  font-size: 11px;
  color: var(--text-muted);
}
.btn-google-logout {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: color .2s, border-color .2s;
  margin-left: auto;
}
.btn-google-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ── Admin Chat Actions ──────────────────── */
.admin-chat-actions {
  display: flex;
  gap: 8px;
  position: absolute;
  left: 20px;
}
.btn-admin-warn {
  background: #f59e0b !important;
  color: #000 !important;
  border: none;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-admin-warn:hover:not(:disabled) { opacity: .85; }
.btn-admin-warn:disabled { opacity: .4; cursor: not-allowed; }
.btn-admin-ban {
  background: var(--danger) !important;
  color: #fff !important;
  border: none;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-admin-ban:hover:not(:disabled) { opacity: .85; }
.btn-admin-ban:disabled { opacity: .4; cursor: not-allowed; }

/* ── Online Counter ──────────────────────── */
.online-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: onlinePulse 2s infinite;
}
@keyframes onlinePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* ── Country Selector ────────────────────── */
.device-select-group.full-width {
  width: 100%;
}

/* ── Chat Layout ─────────────────────────── */
#chat-screen { flex-direction: column; }

.chat-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Video Area */
.video-area {
  flex: 1;
  position: relative;
  background: #000;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
}
/* Single remote: fill entire area */
.video-area.mode-duo .remote-video-box {
  position: absolute;
  inset: 0;
}
/* Trio: 1 big + 1 small (side by side on top, or big left + small right) */
.video-area.mode-trio {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 2px;
}
/* Team: 2x2 grid */
.video-area.mode-team {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
}

.remote-video-box {
  position: relative;
  inset: auto;
  overflow: hidden;
  background: #111;
  min-height: 0;
}
/* Grid mode: subtle separator between videos */
.video-area.mode-trio .remote-video-box,
.video-area.mode-team .remote-video-box {
  border: 1px solid rgba(255,255,255,.06);
}

/* Smaller local cam in grid modes */
.video-area.mode-trio .video-box.small,
.video-area.mode-team .video-box.small {
  width: 160px;
  height: 120px;
}
/* General video-box base (used by local-box) */
.video-box {
  position: absolute;
  inset: 0;
}
.remote-video-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.video-box.small video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.video-box.small {
  position: absolute;
  inset: auto;
  bottom: 16px;
  right: 16px;
  width: 260px;
  height: 195px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: 0 4px 20px rgba(0,0,0,.6);
  z-index: 5;
  cursor: grab;
  transition: box-shadow .2s;
  user-select: none;
  touch-action: none;
}
.video-box.small.dragging {
  cursor: grabbing;
  box-shadow: 0 8px 32px rgba(0,230,200,.25);
  transition: none;
}
.video-label {
  position: absolute;
  bottom: 10px;
  left: 12px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: #fff;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
}
.video-label-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.video-box.small .video-label { bottom: 6px; left: 8px; font-size: 11px; }
.video-box.small .video-label-avatar { width: 14px; height: 14px; }

.video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11,14,23,.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  color: var(--text-muted);
  font-size: 15px;
}
.video-overlay.hidden { display: none; }

/* Spinner */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sidebar / Chat */
.sidebar {
  width: 340px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-header h2 { font-size: 16px; font-weight: 600; }
.sidebar-header-left {
  display: flex;
  align-items: center;
  gap: 0;
}
/* Chat tab style */
.sidebar-tab-active {
  font-size: 16px;
  font-weight: 600;
  padding: 4px 12px;
  margin: 0;
  color: var(--text);
}
/* Sidebar tab (clickable, not active) */
.sidebar-tab {
  font-size: 16px;
  font-weight: 600;
  padding: 4px 12px;
  margin: 0;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  transition: color .2s, background .2s;
}
.sidebar-tab:hover {
  color: var(--text);
  background: rgba(255,255,255,.05);
}
.sidebar-tab.sidebar-tab-active {
  color: var(--text);
  cursor: default;
  background: none;
}
/* Profile tab link – matches Chat tab style */
.sidebar-tab-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: color .2s, background .2s;
  position: relative;
}
.sidebar-tab-link:hover {
  color: var(--text);
  background: rgba(255,255,255,.05);
}
.sidebar-profile-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
  transition: border-color .2s;
}
.sidebar-tab-link:hover .sidebar-profile-avatar {
  border-color: var(--accent);
}
/* Fallback icon when no avatar */
.sidebar-profile-fallback {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
  transition: border-color .2s;
}
.sidebar-tab-link:hover .sidebar-profile-fallback {
  border-color: var(--accent);
}
/* Hide fallback when avatar has a src */
.sidebar-profile-avatar[src]:not([src=""]) ~ .sidebar-profile-fallback {
  display: none;
}
.sidebar-profile-avatar[src=""],
.sidebar-profile-avatar:not([src]) {
  display: none;
}
.sidebar-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Sidebar Panels ──────────────────────── */
.sidebar-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Rules Panel ─────────────────────────── */
.rules-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rules-intro p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rule-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  transition: background .2s;
}
.rule-item:hover {
  background: rgba(255,255,255,.06);
}
.rule-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.rule-icon-danger {
  background: rgba(255,64,96,.12);
  color: var(--danger);
}
.rule-icon-warn {
  background: rgba(255,193,7,.12);
  color: #ffc107;
}
.rule-icon-info {
  background: rgba(0,229,255,.1);
  color: var(--accent);
}
.rule-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.rule-text p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}
.rules-footer {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rules-consequences h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.consequence-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}
.consequence-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.consequence-warn {
  background: rgba(255,193,7,.15);
  color: #ffc107;
}
.consequence-ban {
  background: rgba(255,64,96,.12);
  color: var(--danger);
}
.rules-hint {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: .7;
}

/* ── Profile Warnings ────────────────────── */
.warnings-count-text {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.warnings-count-text strong {
  color: #ffc107;
}
.warnings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.warning-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,193,7,.04);
  overflow: hidden;
}
.warning-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255,193,7,.06);
  border-bottom: 1px solid rgba(255,193,7,.1);
}
.warning-number {
  font-size: 13px;
  font-weight: 700;
  color: #ffc107;
}
.warning-date {
  font-size: 11px;
  color: var(--text-muted);
}
.warning-scores {
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.warning-score-tag {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.warning-screenshot-wrap {
  padding: 8px 14px 12px;
}
.warning-screenshot-img {
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
  cursor: pointer;
}

/* ── Profile Panel ───────────────────────── */
.profile-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.profile-avatar-section {
  display: flex;
  justify-content: center;
}
.profile-avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  cursor: pointer;
  border-radius: 50%;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 20px rgba(0,230,255,.15);
}
.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  font-size: 22px;
  color: #fff;
}
.profile-avatar-wrap:hover .profile-avatar-overlay { opacity: 1; }
.profile-field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.profile-input-row {
  display: flex;
  gap: 8px;
}
.profile-input-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.profile-input-row input:focus { border-color: var(--accent); }
.btn-profile-save {
  padding: 8px 12px !important;
  font-size: 14px;
  flex-shrink: 0;
  flex-grow: 0;
  width: auto;
  min-width: 0;
}
.profile-save-result {
  font-size: 12px;
  margin-top: 4px;
  min-height: 16px;
}
.profile-save-result.success { color: var(--success); }
.profile-save-result.error { color: var(--danger); }

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profile-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,.04);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.profile-info-label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}
.profile-info-value {
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
}

/* Ban section in profile */
.profile-ban-section { margin-top: 18px; }
.profile-ban-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,64,96,.08);
  border: 1px solid rgba(255,64,96,.25);
  border-radius: var(--radius);
}
.profile-ban-icon {
  font-size: 24px;
  color: var(--danger);
  flex-shrink: 0;
  margin-top: 2px;
}
.profile-ban-info strong {
  display: block;
  color: var(--danger);
  font-size: 14px;
  margin-bottom: 4px;
}
.profile-ban-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.profile-ban-date {
  font-size: 11px;
  color: var(--text-muted);
  opacity: .7;
}

/* Ban screenshot in profile */
.ban-screenshot-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 16px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ban-screenshot-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 360px;
}
.ban-screenshot-img {
  width: 100%;
  display: block;
  cursor: pointer;
}
.ban-screenshot-hint {
  font-size: 11px;
  color: var(--text-muted);
  opacity: .6;
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Appeal section */
.ban-appeal-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.ban-appeal-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.appeal-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.appeal-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  transition: border-color .2s;
  box-sizing: border-box;
}
.appeal-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.appeal-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 10px;
}
.appeal-char-count {
  font-size: 11px;
  color: var(--text-muted);
}
.btn-appeal-submit {
  width: auto !important;
  flex-grow: 0;
  min-width: 0;
  padding: 8px 16px !important;
  font-size: 13px !important;
}

/* Appeal status card */
.appeal-status-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.appeal-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  width: fit-content;
}
.badge-pending {
  background: rgba(255,193,7,.15);
  color: #ffc107;
}
.badge-accepted {
  background: rgba(76,175,80,.15);
  color: #4caf50;
}
.badge-rejected {
  background: rgba(255,64,96,.15);
  color: var(--danger);
}
.appeal-status-message {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.appeal-admin-note {
  font-size: 13px;
  color: var(--text);
  padding: 10px 12px;
  background: rgba(0,229,255,.06);
  border: 1px solid rgba(0,229,255,.15);
  border-radius: var(--radius);
  margin: 4px 0 0;
}
.appeal-admin-note strong {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
}
.appeal-status-date {
  font-size: 11px;
  color: var(--text-muted);
  opacity: .7;
}

/* Admin badge-success (for appeals table) */
.badge-success {
  background: rgba(76,175,80,.15);
  color: #4caf50;
}

.btn-profile-logout {
  margin-top: 20px;
  padding: 10px 16px;
  border: 1px solid rgba(255,64,96,.3);
  border-radius: var(--radius);
  background: rgba(255,64,96,.08);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .2s, border-color .2s;
}
.btn-profile-logout:hover {
  background: rgba(255,64,96,.18);
  border-color: var(--danger);
}

.badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-waiting { background: rgba(255,255,255,.07); color: var(--text-muted); }
.badge-connected { background: rgba(0,230,118,.15); color: var(--success); }
.badge-searching { background: var(--accent-dim); color: var(--accent); }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}
.msg.me {
  align-self: flex-end;
  background: var(--accent);
  color: #000;
  border-bottom-right-radius: 4px;
}
.msg.them {
  align-self: flex-start;
  background: var(--bg-card);
  border-bottom-left-radius: 4px;
}
.msg .msg-name { font-size: 11px; font-weight: 600; opacity: .7; margin-bottom: 2px; }
.msg.them .msg-name { color: var(--accent); }

/* ── Message Avatars ─────────────────────── */
.msg-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.msg-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.msg-avatar-placeholder {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.msg-text { line-height: 1.45; }

.system-msg {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px 0;
}

.chat-input-area {
  display: flex;
  padding: 12px;
  gap: 8px;
  border-top: 1px solid var(--border);
}
#chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
#chat-input:focus { border-color: var(--accent); }
#chat-input:disabled { opacity: .4; }

.btn-send {
  border: none;
  background: var(--accent);
  color: #000;
  width: 44px;
  border-radius: var(--radius);
  font-size: 18px;
  cursor: pointer;
  transition: background .2s;
}
.btn-send:hover { background: var(--accent-hover); }
.btn-send:disabled { opacity: .3; cursor: default; }

/* ── Controls Bar ────────────────────────── */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  position: relative;
}
.controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.controls-group-right {
  display: flex;
  align-items: center;
  gap: 14px;
  position: absolute;
  right: 20px;
}
.controls-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}
.skip-hint {
  font-size: 10px;
  opacity: .5;
  margin-left: 2px;
}
.btn-control {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.btn-control:hover { background: var(--bg-input); border-color: var(--accent); }

.btn-skip {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(0,229,255,.25);
  font-weight: 600;
}
.btn-skip:hover { background: rgba(0,229,255,.2); }
.btn-skip:disabled { opacity: .35; cursor: default; pointer-events: none; }

.btn-stop {
  background: rgba(255,64,96,.1);
  color: var(--danger);
  border-color: rgba(255,64,96,.25);
  font-weight: 600;
}
.btn-stop:hover { background: rgba(255,64,96,.2); }
.btn-stop:disabled { opacity: .35; cursor: default; pointer-events: none; }

.btn-start-chat {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(0,229,255,.25);
  font-weight: 600;
}
.btn-start-chat:hover { background: rgba(0,229,255,.2); }

.btn-control.muted {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

/* ── Profile Link Button (sidebar header) ── */
/* (moved to sidebar-tab-link styles above) */

/* ── Responsive: Tablet ──────────────────── */
@media (max-width: 900px) {
  .controls-group-right {
    position: static;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    order: 2;
  }
  .controls-divider {
    display: none;
  }
  .controls {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
  }
  .controls-group {
    order: 1;
  }
  .admin-chat-actions {
    position: static;
    order: 0;
    width: 100%;
    justify-content: center;
  }
}

/* ── Responsive: Mobile ──────────────────── */
@media (max-width: 768px) {
  .chat-layout { flex-direction: column; position: relative; }
  .video-area { flex: 1; min-height: 0; }
  .video-area.mode-trio { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
  .video-area.mode-team { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

  /* Sidebar becomes a bottom panel */
  .sidebar {
    width: 100%;
    height: 40vh;
    max-height: 40vh;
    border-left: none;
    border-top: 1px solid var(--border);
    display: none;
  }
  .sidebar.mobile-open {
    display: flex;
  }

  /* When sidebar is open, video area shrinks */
  .chat-layout.sidebar-visible .video-area {
    flex: none;
    height: 60vh;
  }

  /* Local cam smaller on mobile */
  .video-box.small {
    width: 120px;
    height: 90px;
    bottom: 10px;
    right: 10px;
  }
  .video-area.mode-trio .video-box.small,
  .video-area.mode-team .video-box.small {
    width: 100px;
    height: 75px;
  }

  /* Controls bar */
  .controls {
    padding: 6px 10px;
    gap: 6px;
  }
  .btn-control {
    padding: 8px 12px;
    font-size: 13px;
  }
  .skip-hint {
    display: none;
  }
  .controls-group-right {
    position: static;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
  }
  /* Hide cam/mic selectors on mobile — replaced by flip button */
  .control-select-group.device-select-group {
    display: none !important;
  }
  /* Flip camera button */
  .btn-flip-cam {
    border-radius: 50% !important;
    width: 36px;
    height: 36px;
    padding: 0 !important;
    font-size: 15px;
    flex-shrink: 0;
  }
  .control-select {
    max-width: 120px;
    font-size: 12px;
    padding: 6px 24px 6px 8px;
  }
  .control-select-icon {
    font-size: 11px;
  }
  .admin-chat-actions {
    position: static;
    width: 100%;
    justify-content: center;
    order: 0;
  }
  .btn-admin-warn,
  .btn-admin-ban {
    font-size: 12px;
    padding: 6px 10px;
  }

  /* Chat footer smaller */
  .chat-footer {
    padding: 6px 10px;
    font-size: 10px;
  }

  /* Profile panel mobile */
  .profile-content { padding: 16px 14px; gap: 16px; }
  .profile-avatar, .profile-avatar-wrap { width: 64px; height: 64px; }
  .sidebar-tab { font-size: 12px; padding: 5px 10px; }
  .profile-dropdown-btn { width: 32px; height: 32px; }
  .profile-dropdown-menu { min-width: 180px; }
}

/* ── Responsive: Small phones ────────────── */
@media (max-width: 480px) {
  /* Landing card */
  .landing-card {
    padding: 32px 24px;
  }
  .logo h1 { font-size: 26px; }
  .logo-icon { font-size: 28px; }
  .tagline { font-size: 13px; margin-bottom: 20px; }

  /* Controls: icon-only buttons */
  .btn-control {
    padding: 8px 10px;
    font-size: 12px;
  }
  .btn-skip span:not(.skip-hint),
  .btn-stop span {
    /* Keep text visible but smaller */
  }
  .controls-group {
    gap: 4px;
  }
  .controls-group-right {
    gap: 4px;
  }
  .control-select {
    max-width: 90px;
    font-size: 11px;
    padding: 5px 22px 5px 6px;
  }
  .control-select-group {
    gap: 4px;
  }

  /* Sidebar panel */
  .sidebar {
    height: 45vh;
    max-height: 45vh;
  }
  .sidebar-header {
    padding: 10px 14px;
  }
  .sidebar-header h2 { font-size: 14px; }
  .sidebar-tab { font-size: 11px; padding: 4px 8px; }
  .profile-content { padding: 14px 10px; gap: 12px; }
  .profile-avatar, .profile-avatar-wrap { width: 56px; height: 56px; }
  .profile-input-row input { font-size: 13px; padding: 8px 12px; }
  .profile-ban-card { padding: 10px 12px; gap: 8px; }
  .profile-ban-icon { font-size: 20px; }
  .messages { padding: 10px; gap: 6px; }
  .msg { font-size: 13px; padding: 8px 12px; }
  .chat-input-area { padding: 8px; gap: 6px; }
  #chat-input { padding: 10px 12px; font-size: 13px; }
  .btn-send { width: 40px; font-size: 16px; }

  /* Local cam even smaller */
  .video-box.small {
    width: 100px;
    height: 75px;
    bottom: 8px;
    right: 8px;
  }
  .video-box.small .video-label {
    display: none;
  }
}

/* ── Mobile Chat Toggle Button ───────────── */
.mobile-chat-toggle {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 20;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(18, 24, 41, 0.85);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  align-items: center;
  justify-content: center;
}
.mobile-chat-toggle:hover {
  border-color: var(--accent);
  background: rgba(18, 24, 41, 0.95);
}
.mobile-chat-toggle.has-unread {
  border-color: var(--accent);
  animation: chatPulse 1.5s infinite;
}
@keyframes chatPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,229,255,.4); }
  50% { box-shadow: 0 0 0 6px rgba(0,229,255,0); }
}
@media (max-width: 768px) {
  .mobile-chat-toggle {
    display: flex;
  }
}

.logo-icon {
  color: var(--accent);
}

/* ── Legal Footer Links (Landing) ────────── */
.legal-links {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
}
.legal-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s;
}
.legal-links a:hover {
  color: var(--accent);
}
.legal-sep {
  margin: 0 8px;
  opacity: .4;
}

/* Landing Footer */
.landing-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.landing-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s;
}
.landing-footer a:hover {
  color: var(--accent);
}
.landing-footer .legal-sep {
  margin: 0 8px;
  opacity: .4;
}

/* Chat Footer */
.chat-footer {
  text-align: center;
  padding: 8px 16px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}
.chat-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s;
}
.chat-footer a:hover {
  color: var(--accent);
}
.chat-footer .legal-sep {
  margin: 0 6px;
  opacity: .4;
}

/* ── NSFW Warning / Ban Overlay ──────────── */
.nsfw-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  padding: 24px;
}
.nsfw-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow);
}
.nsfw-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}
.nsfw-icon.warning {
  color: #ffab00;
}
.nsfw-icon.banned {
  color: var(--danger);
}
.nsfw-inner h2 {
  font-size: 22px;
  margin-bottom: 12px;
}
.nsfw-inner p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 8px;
}
.nsfw-sub {
  font-size: 13px !important;
  color: var(--danger) !important;
  font-weight: 600;
  margin-top: 8px;
}
.nsfw-inner .cookie-btn {
  margin-top: 20px;
}
.nsfw-profile-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ── Cookie Banner ───────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  padding: 16px;
  background: rgba(11, 14, 23, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
}
.cookie-inner {
  max-width: 900px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.cookie-text {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 280px;
}
.cookie-icon {
  font-size: 28px;
  color: var(--accent);
  margin-top: 2px;
  flex-shrink: 0;
}
.cookie-text strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}
.cookie-text p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.cookie-text a {
  color: var(--accent);
  text-decoration: none;
}
.cookie-text a:hover {
  text-decoration: underline;
}
.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cookie-btn {
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background .2s, border-color .2s, transform .1s;
  white-space: nowrap;
}
.cookie-btn:active { transform: scale(0.97); }
.cookie-btn-accept {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.cookie-btn-accept:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.cookie-btn-essential {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
.cookie-btn-essential:hover {
  background: var(--bg-input);
  border-color: var(--accent);
}

@media (max-width: 600px) {
  .cookie-inner { flex-direction: column; align-items: stretch; }
  .cookie-actions { justify-content: stretch; flex-wrap: wrap; }
  .cookie-btn { flex: 1; text-align: center; }
}

/* ── Cookie Settings Panel ───────────────── */
.cookie-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 16px 0 8px;
  border-top: 1px solid var(--border);
}
.cookie-setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cookie-setting-info {
  flex: 1;
}
.cookie-setting-info strong {
  font-size: 13px;
  display: block;
  margin-bottom: 2px;
}
.cookie-setting-info p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: background .2s, border-color .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform .2s, background .2s;
}
.toggle input:checked + .toggle-slider {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--accent);
}
.toggle.disabled {
  opacity: .5;
}
.toggle.disabled .toggle-slider {
  cursor: not-allowed;
}

.cookie-btn-settings {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
.cookie-btn-settings:hover {
  background: var(--bg-input);
  border-color: var(--accent);
}

/* ── Legal Pages ─────────────────────────── */
.legal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow-y: auto;
}
.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.legal-back {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity .2s;
}
.legal-back:hover { opacity: .8; }
.legal-header .logo { margin-bottom: 0; }
.legal-header .logo h1 { font-size: 22px; }
.legal-header .logo-icon { font-size: 24px; }

.legal-content {
  flex: 1;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 32px 60px;
}
.legal-content h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.legal-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}
.legal-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--accent);
}
.legal-content h4 {
  font-size: 15px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--text);
}
.legal-content p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.legal-content a {
  color: var(--accent);
  text-decoration: none;
}
.legal-content a:hover {
  text-decoration: underline;
}
.legal-content ul {
  margin: 8px 0 16px 24px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}
.legal-content li {
  margin-bottom: 6px;
}
.legal-date {
  margin-top: 40px;
  font-style: italic;
  font-size: 13px;
  color: var(--text-muted);
  opacity: .7;
}

.legal-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 13px;
}
.legal-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s;
}
.legal-footer a:hover {
  color: var(--accent);
}

/* ─────────────────────────────────────────────
   Admin Panel
   ───────────────────────────────────────────── */

.admin-body {
  overflow: auto;
  height: auto;
  min-height: 100vh;
}

/* ── Login ────────────────────────────────── */
.admin-login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 20%, #0d1a3a 0%, var(--bg-primary) 70%);
}

.admin-login-card input[type="text"],
.admin-login-card input[type="password"] {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 15px;
  outline: none;
  margin-bottom: 12px;
  transition: border-color .2s;
}
.admin-login-card input:focus {
  border-color: var(--accent);
}

.admin-login-info {
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 16px;
  font-weight: 600;
}

.admin-error {
  display: none;
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
}

/* ── Top Bar ─────────────────────────────── */
.admin-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-topbar h2 {
  font-size: 20px;
  font-weight: 700;
  flex: 1;
}
.admin-sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color .2s;
}
.admin-sidebar-toggle:hover {
  border-color: var(--accent);
}
.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
#admin-user-display {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

/* ── Sidebar ─────────────────────────────── */
.admin-sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.admin-sidebar-brand .logo-icon { font-size: 20px; }
.admin-sidebar-brand h1 { font-size: 18px; font-weight: 700; }

.admin-nav {
  flex: 1;
  padding: 12px 0;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.admin-nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,.03);
}
.admin-nav-item.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
  font-weight: 600;
}
.admin-nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
}

.admin-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.admin-sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}
.admin-sidebar-user i {
  color: var(--accent);
}
.admin-sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,64,96,.06);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
}
.admin-sidebar-logout:hover {
  background: rgba(255,64,96,.15);
  border-color: var(--danger);
}

/* ── Admin Shell (sidebar + main) ────────── */
#admin-shell {
  display: flex;
  min-height: 100vh;
}
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Pages ────────────────────────────────── */
.admin-page {
  animation: adminPageIn .25s ease;
}
@keyframes adminPageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Content wrapper ─────────────────────── */
.admin-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-dim);
  padding: 2px 10px;
  border-radius: 20px;
  margin-left: 2px;
}

.admin-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 28px 40px;
  width: 100%;
}

/* ── Stats ────────────────────────────────── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 0 0 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}

.stat-icon-wrap {
  font-size: 22px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
  background: rgba(255,255,255,.04);
  color: var(--text-muted);
}
.stat-icon-wrap.danger { color: var(--danger); background: rgba(255,64,96,.1); }
.stat-icon-wrap.warning { color: #ffc107; background: rgba(255,193,7,.1); }
.stat-icon-wrap.accent { color: var(--accent); background: var(--accent-dim); }
.stat-icon-wrap.search { color: #8b5cf6; background: rgba(139,92,246,.12); }

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Sections ────────────────────────────── */
.admin-section {
  margin-bottom: 24px;
}

.section-header {
  margin-bottom: 12px;
}
.section-header h2 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header h2 i {
  color: var(--accent);
  font-size: 15px;
}

/* ── Searching Users ─────────────────────── */
.searching-users-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 52px;
  align-items: center;
}

.search-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(139,92,246,.1);
  border: 1px solid rgba(139,92,246,.2);
  font-size: 13px;
  color: var(--text);
  animation: chipIn .25s ease;
}
.search-user-chip i {
  color: #8b5cf6;
  font-size: 12px;
}
.chip-nick {
  font-weight: 600;
}
.chip-ip {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  color: var(--text-muted);
}
.chip-email {
  font-size: 12px;
  color: var(--accent);
  opacity: .8;
}
.chip-ban-btn {
  margin-left: 4px;
  padding: 3px 8px;
  border: 1px solid rgba(255,64,96,.3);
  border-radius: 6px;
  background: rgba(255,64,96,.1);
  color: var(--danger);
  font-size: 11px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.chip-ban-btn:hover {
  background: rgba(255,64,96,.25);
  border-color: var(--danger);
}
@keyframes chipIn {
  from { opacity: 0; transform: scale(.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ── Manual Ban Row (horizontal) ─────────── */
.manual-ban-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.manual-ban-row input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.manual-ban-row select {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  min-width: 140px;
  transition: border-color .2s;
}
.manual-ban-row select:focus {
  border-color: var(--accent);
}
.manual-ban-row input:focus {
  border-color: var(--accent);
}
.btn-ban-submit {
  white-space: nowrap;
  padding: 12px 24px !important;
  max-width: 140px;
  flex-shrink: 0;
}

/* ── Tabs ─────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0 4px;
  margin-top: 8px;
}

.admin-tab {
  padding: 12px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-tab i {
  font-size: 13px;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.admin-tab-content {
  display: none;
  padding: 24px 0;
}
.admin-tab-content.active { display: block; }

/* ── Tables ───────────────────────────────── */
.admin-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.admin-table-header h2 {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-table-header h2 i {
  color: var(--accent);
  font-size: 16px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all .2s;
}
.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table thead {
  background: var(--bg-secondary);
}
.admin-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover { background: rgba(255,255,255,.02); }
.admin-table tr.row-inactive { opacity: .5; }

.mono { font-family: 'Consolas', 'Monaco', monospace; font-size: 13px; }

.actions-cell {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.btn-action {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all .2s;
}
.btn-action:hover { border-color: var(--accent); color: var(--accent); }
.btn-delete:hover { border-color: var(--danger); color: var(--danger); }
.btn-unban:hover { border-color: var(--success); color: var(--success); }

.btn-thumb {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: all .2s;
  white-space: nowrap;
}
.btn-thumb:hover { border-color: var(--accent); background: var(--accent-dim); }

.scores-cell {
  font-size: 11px;
  line-height: 1.8;
}
.score-item {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,.05);
  margin: 1px 2px;
  white-space: nowrap;
}
.score-high {
  background: rgba(255,64,96,.15);
  color: var(--danger);
  font-weight: 600;
}

/* Badges (extending existing) */
.badge-danger { background: var(--danger); color: #fff; }
.badge-warning { background: #ffc107; color: #1a1a1a; }
.badge-muted { background: var(--bg-input); color: var(--text-muted); }

.admin-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 14px;
  width: 100%;
}
.admin-empty i { margin-right: 6px; color: var(--success); }

/* ── Result Message ──────────────────────── */
.admin-result {
  display: none;
  font-size: 13px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
}
.admin-result.success { background: rgba(0,230,118,.1); color: var(--success); }
.admin-result.error { background: rgba(255,64,96,.1); color: var(--danger); }

/* ── Screenshot Modal ────────────────────── */
.screenshot-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
}

.screenshot-modal-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.screenshot-modal-inner img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius);
  border: 2px solid var(--border);
}

.screenshot-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.screenshot-close:hover { border-color: var(--danger); color: var(--danger); }

/* ── Chat device selectors in controls ────── */
.control-select-group {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}
.control-select-icon {
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
}
.control-select {
  padding: 8px 28px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  max-width: 180px;
  transition: border-color .2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7a99'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  text-overflow: ellipsis;
}
.control-select:focus {
  border-color: var(--accent);
}

/* ── Online counter in sidebar header ─────── */
.online-counter-chat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* ── Admin Responsive ────────────────────── */
@media (max-width: 1024px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }

  /* Sidebar becomes overlay on tablet */
  .admin-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    z-index: 200;
    transition: left .25s ease;
    box-shadow: none;
  }
  .admin-sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }
  .admin-sidebar-toggle {
    display: flex;
  }
  #admin-user-display {
    display: none;
  }
}

@media (max-width: 768px) {
  .admin-content { padding: 20px 16px 32px; }
  .admin-stats { grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; }
  .admin-topbar { padding: 12px 16px; }
  .admin-topbar h2 { font-size: 16px; }
  .manual-ban-row {
    flex-direction: column;
  }
  .manual-ban-row input, .manual-ban-row select { width: 100%; min-width: 0; }
}

@media (max-width: 480px) {
  .admin-stats { grid-template-columns: 1fr; }
  .stat-card { padding: 16px; }
  .admin-table { font-size: 12px; }
  .admin-table th, .admin-table td { padding: 8px 10px; }
}

/* ── Mode Selector (Landing) ─────────────── */
.mode-selector {
  margin-top: 12px;
  margin-bottom: 16px;
  text-align: left;
}
.mode-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
  padding-left: 2px;
}
/* ── Mode Dropdown ───────────────────────── */
.mode-dropdown {
  position: relative;
}
.mode-dropdown-btn {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: border-color .2s;
  text-align: left;
}
.mode-dropdown-btn:hover,
.mode-dropdown-btn:focus {
  border-color: var(--accent);
  outline: none;
}
.mode-dropdown-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform .2s;
}
.mode-dropdown.open .mode-dropdown-arrow {
  transform: rotate(180deg);
}
.mode-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  z-index: 50;
  overflow: hidden;
}
.mode-dropdown-menu-up {
  top: auto;
  bottom: calc(100% + 4px);
}
.mode-dropdown.open .mode-dropdown-menu {
  display: block;
}
.mode-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  transition: background .15s, color .15s;
}
.mode-dropdown-item:hover {
  background: rgba(255,255,255,.05);
}
.mode-dropdown-item input[type="checkbox"] {
  display: none;
}
.mode-dropdown-item .mode-check {
  font-size: 12px;
  color: var(--accent);
  opacity: 0;
  transition: opacity .15s;
  width: 14px;
  flex-shrink: 0;
}
.mode-dropdown-item input:checked ~ .mode-check {
  opacity: 1;
}
.mode-dropdown-item input:checked ~ span {
  color: var(--text);
}
.mode-dropdown-item .mode-item-icon {
  font-size: 12px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
/* Chat controls mode dropdown */
.mode-dropdown-chat .mode-dropdown-btn {
  padding: 6px 10px;
  font-size: 12px;
  min-width: 100px;
}

/* ── Mode Badge (Chat Sidebar) ───────────── */
.badge-mode {
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 600;
}

/* ── Remote Video Admin Overlay ──────────── */
.remote-admin-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 10;
  opacity: 0;
  transition: opacity .2s;
}
.remote-video-box:hover .remote-admin-actions {
  opacity: 1;
}
.remote-admin-actions button {
  background: rgba(0,0,0,.7);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.remote-admin-actions .btn-mini-warn { color: #ffc107; }
.remote-admin-actions .btn-mini-ban { color: #ff4444; }
.remote-admin-actions .btn-mini-warn:hover { background: rgba(255,193,7,.3); }
.remote-admin-actions .btn-mini-ban:hover { background: rgba(255,68,68,.3); }
.remote-admin-actions button:disabled { opacity: .3; cursor: not-allowed; }

/* ── Profile Page ───────────────────────── */
.profile-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.profile-page-header {
  width: 100%;
  max-width: 560px;
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.profile-page-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.profile-page-logo h1 { font-size: 20px; font-weight: 800; margin: 0; }
.profile-page-logo .logo-icon { font-size: 20px; color: var(--accent); }
.btn-back-chat {
  padding: 8px 16px;
  border-radius: var(--radius);
  background: var(--accent-dim);
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .2s;
}
.btn-back-chat:hover { background: rgba(0,229,255,.2); }

.profile-page-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-muted);
}

.profile-page-main {
  width: 100%;
  max-width: 520px;
  padding: 0 20px 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.profile-page-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Danger zone */
.profile-danger-zone {
  border-color: rgba(255,64,96,.25);
}
.profile-danger-zone h3 {
  font-size: 15px;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.profile-danger-zone p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.btn-danger {
  padding: 10px 20px;
  border: 1px solid rgba(255,64,96,.4);
  border-radius: var(--radius);
  background: rgba(255,64,96,.12);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .2s, border-color .2s;
}
.btn-danger:hover {
  background: rgba(255,64,96,.22);
  border-color: var(--danger);
}
.btn-danger:disabled { opacity: .5; cursor: not-allowed; }

/* Delete modal */
.profile-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.profile-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.profile-modal h2 { font-size: 18px; margin: 0; color: var(--text); }
.profile-modal p { font-size: 13px; color: var(--text-muted); margin: 0; }
.profile-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}
.btn-modal-cancel {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s;
}
.btn-modal-cancel:hover { background: rgba(255,255,255,.06); }
.profile-modal-actions .btn-danger { flex: 1; }

.profile-page-footer {
  padding: 20px;
  text-align: center;
  font-size: 12px;
}
.profile-page-footer a {
  color: var(--text-muted);
  text-decoration: none;
}
.profile-page-footer a:hover { color: var(--accent); }
.profile-page-footer .legal-sep {
  color: var(--text-muted);
  opacity: .4;
  margin: 0 6px;
}

@media (max-width: 480px) {
  .profile-page-header { padding: 16px 14px; }
  .profile-page-card { padding: 20px 16px; }
  .profile-page-main { padding: 0 14px 30px; }
  .btn-back-chat { font-size: 12px; padding: 6px 12px; }
}
