:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-tertiary: #242836;
  --bg-hover: #2d3348;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --admin: #f59e0b;
  --admin-soft: rgba(245, 158, 11, 0.15);
  --success: #22c55e;
  --danger: #ef4444;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #2d3348;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* ── Auth / Willkommensseite ── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: #0a0c10;
  position: relative;
  overflow: hidden;
}

.auth-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 40%, rgba(99, 102, 241, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 15%, rgba(167, 139, 250, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 70% 85%, rgba(59, 130, 246, 0.08) 0%, transparent 45%);
  pointer-events: none;
}

.auth-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 2.5rem;
  width: 100%;
  max-width: 980px;
  align-items: center;
}

.auth-hero {
  position: relative;
  padding: 1rem 0;
}

.auth-hero-glow {
  position: absolute;
  top: -20%;
  left: -10%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.auth-hero-inner {
  position: relative;
}

.auth-brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.auth-brand-icon {
  font-size: 2.75rem;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.4));
}

.auth-brand h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #e0e7ff 0%, #818cf8 50%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.15;
}

.auth-tagline {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-top: 0.375rem;
  font-weight: 500;
}

.auth-intro {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 1.75rem;
  max-width: 420px;
}

.auth-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
  padding: 0.625rem 0.875rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  transition: background 0.2s, border-color 0.2s;
}

.auth-features li:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
}

.auth-feature-icon {
  font-size: 1.125rem;
  width: 1.75rem;
  text-align: center;
  flex-shrink: 0;
}

.auth-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.auth-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.375rem 0.625rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

.auth-card {
  width: 100%;
  background: rgba(26, 29, 39, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2rem 2rem 2.25rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.auth-card-header {
  margin-bottom: 1.25rem;
}

.auth-card-header h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-card-header p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.auth-tabs {
  display: flex;
  gap: 0.375rem;
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 0.3125rem;
  margin-bottom: 1.25rem;
}

.auth-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5625rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8125rem;
  transition: all 0.2s;
}

.auth-tab-icon { font-size: 1rem; line-height: 1; }

.auth-tab.active {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.auth-tab:not(.active):hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.auth-form { display: none; animation: authFadeIn 0.25s ease; }
.auth-form.active { display: block; }

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.gender-pills {
  display: flex;
  gap: 0.5rem;
}

.gender-pill {
  flex: 1;
  cursor: pointer;
}

.gender-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gender-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5625rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.15s;
}

.gender-pill.male span { color: #93c5fd; }
.gender-pill.female span { color: #f9a8d4; }

.gender-pill input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.gender-pill:hover span { border-color: rgba(99, 102, 241, 0.4); }

.btn-auth {
  margin-top: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-auth:hover {
  background: linear-gradient(135deg, var(--accent-hover), #8b5cf6);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}

.form-group input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.auth-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1rem;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .auth-layout {
    grid-template-columns: 1fr;
    max-width: 440px;
    gap: 1.5rem;
  }

  .auth-hero {
    text-align: center;
    padding: 0;
  }

  .auth-brand {
    flex-direction: column;
    align-items: center;
  }

  .auth-intro { max-width: none; }

  .auth-features { text-align: left; }

  .auth-badges { justify-content: center; }
}

@media (max-width: 480px) {
  .auth-screen { padding: 1rem; }
  .auth-card { padding: 1.5rem; }
  .auth-tab { font-size: 0.75rem; padding: 0.5rem 0.375rem; }
  .auth-tab-icon { display: none; }
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.form-group input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: white;
  margin-top: 0.5rem;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}

.btn-danger:hover { filter: brightness(1.1); }

#btn-clear-chat { color: var(--danger); border-color: rgba(239, 68, 68, 0.4); }
#btn-clear-chat:hover { background: rgba(239, 68, 68, 0.1); }

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}

/* ── Chat Layout ── */
.chat-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-header h1 {
  font-size: 1.125rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-hover), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.online-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}

.online-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-info {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.user-info strong { color: var(--text-primary); }

.chat-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.room-tabs-wrap {
  flex-shrink: 0;
  padding: 0.5rem 1rem 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.room-tabs {
  display: flex;
  gap: 0.375rem;
  flex-wrap: nowrap;
  min-height: 2.25rem;
}

.room-tab {
  flex-shrink: 0;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.room-tab:hover {
  color: var(--text-primary);
  background: var(--bg-primary);
}

.room-tab.active {
  color: var(--accent-hover);
  background: var(--bg-primary);
  border-color: var(--accent);
}

.chat-photo-link {
  color: var(--accent-hover);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

.photo-modal .photo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.photo-modal-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.photo-modal-body {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}

#photo-preview {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-md);
  user-select: none;
  -webkit-user-drag: none;
}

/* ── Global Chat ── */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  background:
    radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.04) 0%, transparent 40%),
    var(--bg-primary);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.375rem 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  line-height: 1.45;
  animation: fadeIn 0.15s ease;
}

.chat-line:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.chat-line.own { background: rgba(99, 102, 241, 0.06); }
.chat-line.system { color: #fde047; font-size: 0.8125rem; }
.chat-line.system .chat-line-text strong { color: #facc15; }

.chat-line-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  min-width: 2.5rem;
  flex-shrink: 0;
}

.chat-line-user {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.chat-line-name {
  font-weight: 700;
  color: #93c5fd;
}

.chat-line-name.admin { color: var(--admin); }
.chat-line-age {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.chat-line-text {
  word-break: break-word;
  flex: 1;
  min-width: 0;
}

.chat-input-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

.chat-line-name-click {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.chat-line-name-click:hover { opacity: 0.85; }

.picker-popup,
.pm-picker-wrap {
  position: absolute;
  bottom: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 20;
  max-height: 260px;
  overflow: hidden;
}

.picker-popup:not(.hidden),
.pm-picker-wrap:not(.hidden) {
  display: block;
}

.picker-emoji {
  background: none;
  border: none;
  font-size: 1.375rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  line-height: 1.2;
}

.picker-emoji:hover { background: var(--bg-hover); }

.picker-panel {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.125rem;
  padding: 0.5rem;
  overflow-y: auto;
  max-height: 220px;
}

.pm-picker-wrap {
  left: 0.625rem;
  right: 0.625rem;
  bottom: calc(100% + 0.25rem);
}

.user-menu {
  position: fixed;
  z-index: 150;
  width: 240px;
  background: #2a2a2a;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.user-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.625rem;
  background: linear-gradient(180deg, #444, #2a2a2a);
  font-size: 0.8125rem;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-menu-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
}

.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.625rem 0.75rem;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 0.8125rem;
  cursor: pointer;
}

.user-menu-item:hover { background: rgba(255, 255, 255, 0.08); }
.user-menu-item:last-child { border-bottom: none; }

.chat-input-area {
  padding: 0.75rem 1rem 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.chat-input-row input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  color: #0f172a;
  outline: none;
  font-size: 0.9375rem;
}

.chat-input-row input:focus { border-color: var(--accent); }

.btn-send {
  width: auto !important;
  margin: 0 !important;
  padding: 0.75rem 1rem !important;
  border-radius: 4px !important;
  font-size: 1.125rem;
}

.chat-toolbar {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.toolbar-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.toolbar-btn:hover { background: var(--bg-hover); }

.members-search-wrap {
  padding: 0.625rem;
  border-bottom: 1px solid var(--border);
}

.members-search-wrap input {
  width: 100%;
  padding: 0.5rem 0.625rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.8125rem;
  outline: none;
}

.members-search-wrap input:focus { border-color: var(--accent); }

.members-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.8125rem;
}

.member-item .gender-icon { font-size: 0.875rem; }

.member-age {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.125rem;
}

/* ── Members Sidebar ── */
.members-sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.members-header {
  padding: 1rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.members-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.member-item:hover { background: var(--bg-hover); }

.member-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  flex-shrink: 0;
}

.member-dot.admin { background: var(--admin); }

.member-name {
  font-size: 0.875rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-name.admin {
  color: var(--admin);
  font-weight: 600;
}

.member-badge {
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  background: var(--admin-soft);
  color: var(--admin);
  font-weight: 600;
}

.member-pm-btn {
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.15s;
}

.member-item:hover .member-pm-btn { opacity: 1; }
.member-pm-btn:hover { color: var(--accent-hover); background: var(--accent-soft); }

/* ── PM Windows (Privatchat) ── */
.pm-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  z-index: 100;
}

.pm-window {
  position: relative;
  width: 340px;
  height: 380px;
  min-width: 280px;
  min-height: 220px;
  max-width: 95vw;
  max-height: 90vh;
  background: #1a1a1a;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  pointer-events: all;
  overflow: hidden;
}

.pm-window.minimized { display: none; }

.pm-header {
  display: flex;
  align-items: center;
  padding: 0.625rem 0.875rem;
  background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 50%, #1f1f1f 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  cursor: move;
  user-select: none;
  gap: 0.5rem;
}

.pm-header-title {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-close {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.pm-close:hover { background: rgba(239, 68, 68, 0.5); }

.pm-notice {
  margin: 0.5rem 0.625rem 0;
  padding: 0.5rem 0.625rem;
  background: #b91c1c;
  border: 2px solid #fff;
  border-radius: 4px;
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.4;
}

.pm-notice-icon { font-size: 0.875rem; }

.pm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 80px;
  background: #111;
}

.pm-msg-line {
  font-size: 0.8125rem;
  line-height: 1.45;
  word-break: break-word;
}

.pm-msg-line.male,
.pm-msg-line.male .pm-msg-body { color: #7dd3fc; }

.pm-msg-line.female,
.pm-msg-line.female .pm-msg-body { color: #f9a8d4; }

.pm-msg-line.neutral .pm-msg-body { color: #e2e8f0; }

.pm-msg-line .pm-msg-body strong { font-weight: 700; }

.pm-msg-time {
  color: #94a3b8;
  font-size: 0.75rem;
  margin-right: 0.25rem;
}

.pm-msg-line .gender-icon { font-size: 0.8125rem; }

.pm-input-wrap {
  position: relative;
  padding: 0.5rem;
  background: #222;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.pm-input-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pm-input-area input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  background: #fff;
  border: 2px solid #eab308;
  border-radius: 999px;
  color: #0f172a;
  font-size: 0.8125rem;
  outline: none;
}

.pm-input-area input:focus {
  border-color: #facc15;
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.25);
}

.pm-actions {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}

.pm-act {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: transform 0.1s;
}

.pm-act:hover { transform: scale(1.06); }

.pm-act-send {
  background: linear-gradient(180deg, #4ade80, #16a34a);
  color: #fff;
}

.pm-act-emoji {
  background: linear-gradient(180deg, #fde047, #ca8a04);
  color: #1f2937;
}

.pm-act-report {
  background: linear-gradient(180deg, #f87171, #dc2626);
  color: #fff;
  font-weight: 700;
}

.pm-act-block {
  background: linear-gradient(180deg, #fca5a5, #b91c1c);
  color: #fff;
}

.pm-picker-panel {
  margin: 0 0 0.375rem;
  max-width: none;
}

.pm-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.35) 50%);
  border-radius: 0 0 6px 0;
  z-index: 5;
}

/* ── Report Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.modal h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.report-reasons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.report-reason {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s;
}

.report-reason:has(input:checked) {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

.report-reason input { accent-color: var(--danger); }

.report-reason label {
  cursor: pointer;
  font-size: 0.875rem;
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.875rem;
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .members-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s;
  }

  .members-sidebar.open { transform: translateX(0); }

  .pm-container {
    align-items: flex-end;
    padding-bottom: 0.5rem;
  }

  .pm-window { width: calc(100vw - 1rem); max-height: 85vh; }
}

/* ── Gender, Profile, Emoji ── */
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }
.gender-select { display: flex; flex-direction: column; gap: 0.375rem; font-size: 0.875rem; }
.gender-select label { display: flex; align-items: center; gap: 0.375rem; cursor: pointer; }
.gender-icon { font-weight: 700; font-size: 0.9375rem; }
.gender-icon.male { color: #60a5fa; }
.gender-icon.female { color: #f472b6; }
.member-info { flex: 1; min-width: 0; }
.member-meta { display: flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: var(--text-muted); }
.member-age { font-size: 0.6875rem; }
.member-self { opacity: 0.85; background: var(--bg-tertiary); }
.modal-lg { max-width: 520px; }
.profile-section { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.profile-section h4 { font-size: 0.9375rem; margin-bottom: 0.75rem; }
.photo-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.photo-slot {
  background: var(--bg-tertiary); border-radius: var(--radius-sm);
  padding: 0.5rem; text-align: center; font-size: 0.75rem;
}
.photo-slot img { width: 100%; height: 80px; object-fit: cover; border-radius: 4px; margin: 0.375rem 0; }
.photo-empty { height: 80px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.photo-status { display: block; font-size: 0.6875rem; margin-bottom: 0.25rem; }
.photo-input { width: 100%; font-size: 0.6875rem; }
