/* Budgi — Privacy-First Chat Platform
   Clean, accessible design. No third-party CSS frameworks. */

:root {
  --bg: #0f0f13;
  --bg-surface: #1a1a24;
  --bg-elevated: #24243a;
  --text: #e4e4ef;
  --text-muted: #8888a4;
  --accent: #6c5ce7;
  --accent-hover: #7f70f0;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #e17055;
  --border: #2d2d44;
  --radius: 8px;
  --radius-lg: 12px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* === Navigation === */
.top-nav {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.nav-link:hover { color: var(--text); }
.nav-link--primary {
  background: var(--accent);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
}
.nav-link--verify {
  color: var(--warning);
  font-weight: 600;
}
.nav-link--logout { color: var(--text-muted); }
.nav-user {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* === Age Badges === */
.age-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  letter-spacing: 0.05em;
}
.age-badge--unverified { background: #3d3d5c; color: var(--text-muted); }
.age-badge--adult { background: #4c3b8c; color: #b8a9f0; }
.age-badge--unrestricted { background: #2d3748; color: #a0aec0; }
.age-badge--adult_only { background: #6b2d3b; color: #feb2b2; }

/* === Flash Messages === */
#flash-messages {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}
.flash {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  animation: flash-in 0.3s ease-out;
}
.flash.flash--hiding {
  animation: flash-out 0.3s ease-in forwards;
}
.flash-dismiss {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.6;
  padding: 0;
  line-height: 1;
}
.flash-dismiss:hover { opacity: 1; }
.flash--notice { background: #1b4d3e; color: #6ee7b7; }
.flash--alert { background: #4d1b2d; color: #feb2b2; }
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-1rem); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes flash-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-1rem); }
}

/* === Main Content === */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
/* === App Shell (Discord-style layout) === */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.sidebar-wrapper {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
}
.sidebar-columns {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}
.app-main {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
  padding: 2rem 1.5rem;
}
.app-main:has(.chat-container) {
  padding: 0;
  overflow: hidden;
}

/* === Flock Switcher === */
.flock-switcher {
  width: 64px;
  min-width: 64px;
  background: var(--bg);
  box-shadow: inset -1px 0 0 var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0 7rem;
  gap: 0.5rem;
  overflow-y: auto;
}
.flock-switcher-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  font-size: 1.5rem;
  text-decoration: none;
  transition: background 0.15s;
}
.flock-switcher-brand:hover {
  background: var(--bg-elevated);
}
.flock-switcher-item {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  transition: border-radius 0.2s, background 0.2s, color 0.2s;
  text-decoration: none;
  overflow: hidden;
  flex-shrink: 0;
}
.flock-switcher-item:hover {
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: white;
}
.flock-switcher-item--active,
.flock-switcher-item--active:hover {
  align-self: stretch;
  width: auto;
  height: auto;
  min-height: 74px;
  border-radius: 0;
  background: var(--bg-surface);
  color: var(--text);
  margin-top: -0.75rem;
  margin-bottom: 0.25rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.flock-switcher-icon {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: inherit;
}
.flock-switcher-initials {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
.flock-switcher-divider {
  width: 32px;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  margin: 0.25rem 0;
  flex-shrink: 0;
}
.flock-switcher-item--add {
  background: transparent;
  border: 2px dashed var(--border);
  color: var(--text-muted);
}
.flock-switcher-item--add:hover {
  border-color: var(--accent);
  background: transparent;
  color: var(--accent);
}
.flock-switcher-plus {
  font-size: 1.3rem;
  line-height: 1;
}
.sidebar-collapse-btn {
  position: absolute;
  left: 52px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sidebar-collapse-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.sidebar-collapse-btn svg {
  transition: transform 0.2s;
}
.sidebar-wrapper--collapsed .sidebar-collapse-btn {
  left: 8px;
  transform: translateY(-50%);
}
.sidebar-wrapper--collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}
.sidebar-wrapper--collapsed .flock-switcher {
  width: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

/* === Auth Forms === */
.auth-container {
  max-width: 480px;
  margin: 0 auto;
}
.auth-container h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}
.auth-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}
.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.form-preview {
  margin-bottom: 0.5rem;
}
.form-preview-image {
  max-width: 100%;
  max-height: 120px;
  border-radius: var(--radius);
  object-fit: cover;
}
.form-errors {
  background: #4d1b2d;
  color: #feb2b2;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.form-error {
  color: var(--danger);
  font-size: 0.8rem;
}
.auth-footer {
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  cursor: pointer;
}
.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.btn--primary {
  background: var(--accent);
  color: white;
}
.btn--primary:hover { background: var(--accent-hover); }
.btn--small { padding: 0.35rem 0.85rem; font-size: 0.85rem; }
.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn--ghost:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.btn--send {
  background: var(--accent);
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* === Privacy Notice === */
.privacy-notice {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 2rem;
}
.privacy-notice h3 { margin-bottom: 0.5rem; font-size: 1rem; }
.privacy-notice p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.35rem; }

/* === Rooms List === */
.rooms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.room-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s;
}
.room-card:hover { border-color: var(--accent); }
.room-card-link {
  display: block;
  padding: 1.25rem;
  color: var(--text);
}
.room-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.room-name { font-size: 1.1rem; font-weight: 600; }
.room-description { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.room-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.verification-prompt-banner {
  background: var(--bg-elevated);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* === Chat Sidebar === */
.chat-sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: 7rem;
}
.sidebar-section {
  padding: 0.75rem;
}
.sidebar-section + .sidebar-section {
  border-top: 1px solid var(--border);
}
.sidebar-flock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.sidebar-flock-link {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
  min-width: 0;
  flex: 1;
}
a.sidebar-flock-link:hover {
  background: var(--bg-elevated);
}
.sidebar-flock-name {
  font-weight: 700;
  font-size: 1.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-flock-menu {
  position: relative;
  flex-shrink: 0;
}
.sidebar-flock-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  transition: background 0.15s, color 0.15s;
}
.sidebar-flock-menu-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.sidebar-flock-menu-btn::-webkit-details-marker { display: none; }
.sidebar-flock-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 200;
}
.sidebar-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.sidebar-count {
  font-size: 0.65rem;
  background: var(--bg-elevated);
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
}
.sidebar-room-list,
.sidebar-member-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.sidebar-room-item { border-radius: var(--radius); }
.sidebar-room-item--active {
  background: var(--bg-elevated);
}
.sidebar-room-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
}
.sidebar-room-link:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.sidebar-room-item--active .sidebar-room-link {
  color: var(--text);
  font-weight: 600;
}
.sidebar-room-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-age-badge {
  font-size: 0.55rem;
  padding: 0.05rem 0.3rem;
  flex-shrink: 0;
}
.sidebar-member-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.sidebar-member-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.sidebar-role-badge {
  font-size: 0.55rem;
  padding: 0.05rem 0.3rem;
  flex-shrink: 0;
}
.sidebar-member-item--idle { opacity: 0.7; }
.sidebar-member-item--offline { opacity: 0.45; }
.presence-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.presence-indicator--online { background: var(--success); }
.presence-indicator--idle { background: var(--warning); }
.presence-indicator--offline { background: var(--border); }
.sidebar-actions {
  padding-top: 0.5rem;
}
.sidebar-action-link {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: background 0.15s, color 0.15s;
}
.sidebar-action-link:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.4rem 0.5rem;
}

/* === Sidebar User Panel === */
.sidebar-user-panel {
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-surface);
  overflow: visible;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
}
.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.sidebar-user-info > .avatar,
.sidebar-user-info > .avatar-placeholder {
  margin-top: -2.5rem;
  flex-shrink: 0;
}
.sidebar-user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-user-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-age {
  font-size: 0.6rem;
  padding: 0.05rem 0.35rem;
  align-self: flex-start;
}
.sidebar-user-menu {
  position: relative;
  flex-shrink: 0;
}
.sidebar-user-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  list-style: none;
}
.sidebar-user-btn::-webkit-details-marker { display: none; }
.sidebar-user-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.sidebar-user-dropdown {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 200;
}
.sidebar-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--text);
  font-size: 0.9rem;
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  text-decoration: none;
}
.sidebar-user-dropdown-item:hover {
  background: var(--bg-surface);
  color: var(--text);
}
.sidebar-user-dropdown-item--danger:hover {
  background: #4d1b2d;
  color: var(--danger);
}
.sidebar-user-dropdown-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.35rem 0;
}

/* === Lobby Welcome === */
.lobby-welcome {
  max-height: 50vh;
  overflow-y: auto;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.lobby-banner-graphic {
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}
.lobby-banner-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.lobby-banner-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 50%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lobby-banner-placeholder-text {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.02em;
}
.lobby-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.lobby-banner-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
}
.lobby-rooms-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.lobby-rooms-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.lobby-room-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 140px;
  max-width: 220px;
  transition: border-color 0.15s, background 0.15s;
}
.lobby-room-card:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
}
.lobby-room-card-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}
.lobby-room-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lobby-room-card-badge {
  font-size: 0.55rem;
  padding: 0.05rem 0.3rem;
  align-self: flex-start;
}

/* === Chat Interface === */
.chat-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 1rem 1.5rem;
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.chat-header h1 {
  font-size: 1.3rem;
  display: inline;
  margin-right: 0.5rem;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.chat-input {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* === Budgi Birds === */
.budgi-perch {
  position: relative;
  height: 28px;
  flex-shrink: 0;
  overflow: hidden;
}
.budgi-perch-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
}
.budgi-perch-birds {
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  height: 26px;
}
.budgi-bird {
  position: absolute;
  bottom: 0;
  font-size: 16px;
  line-height: 1;
  transition: left 0.3s ease-in-out;
  cursor: default;
  user-select: none;
}
.budgi-bird--hopping {
  animation: budgi-hop 0.4s ease-in-out;
}
.budgi-bird--landing {
  opacity: 0;
  animation: budgi-land 0.7s ease-out forwards;
}
.budgi-bird--flying-away {
  animation: budgi-fly-away 0.7s ease-in forwards;
  pointer-events: none;
}
@keyframes budgi-hop {
  0%   { translate: 0 0; }
  40%  { translate: 0 -10px; }
  70%  { translate: 0 -3px; }
  100% { translate: 0 0; }
}
@keyframes budgi-land {
  0%   { translate: 0 -35px; opacity: 0; }
  50%  { opacity: 1; }
  70%  { translate: 0 2px; opacity: 1; }
  85%  { translate: 0 -3px; }
  100% { translate: 0 0; opacity: 1; }
}
@keyframes budgi-fly-away {
  0%   { translate: 0 0; opacity: 1; }
  50%  { translate: 0 -20px; opacity: 0.5; }
  100% { translate: 0 -40px; opacity: 0; }
}

/* === Individual Messages === */
.message {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  transition: background 0.15s;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.chat-messages--loaded .message:last-child {
  animation: message-appear 0.3s ease-out;
}
@keyframes message-appear {
  from { opacity: 0; translate: 0 8px; }
  to   { opacity: 1; translate: 0 0; }
}
.message:hover { background: var(--bg-surface); }
.message-avatar { flex-shrink: 0; padding-top: 0.1rem; }
.message-content { flex: 1; min-width: 0; }
.message-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}
.message-author { font-weight: 600; font-size: 0.9rem; }
.message-age-badge { font-size: 0.6rem; padding: 0.1rem 0.3rem; }
.message-time { font-size: 0.75rem; color: var(--text-muted); }
.message-body { font-size: 0.95rem; color: var(--text); overflow-wrap: break-word; word-break: break-word; }
.message-body p { margin: 0; }
.message-body p + p { margin-top: 0.4em; }
.message-body strong { font-weight: 700; }
.message-body em { font-style: italic; }
.message-body del { text-decoration: line-through; color: var(--text-muted); }
.message-body code {
  background: var(--bg-elevated);
  padding: 0.15em 0.35em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}
.message-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 0.4em 0;
  overflow-x: auto;
  white-space: pre;
}
.message-body pre code { background: transparent; padding: 0; border-radius: 0; font-size: 0.85em; }
.message-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.25rem 0 0.25rem 0.75rem;
  margin: 0.4em 0;
  color: var(--text-muted);
}
.message-body ul, .message-body ol { margin: 0.4em 0; padding-left: 1.5em; }
.message-body li { margin: 0.15em 0; }
.message-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.message-body a:hover { color: var(--accent-hover); }

/* === Message Reactions === */
.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0.35rem;
  align-items: center;
}
.reaction-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1.2;
  transition: background 0.15s, border-color 0.15s;
  color: var(--text-muted);
}
.reaction-badge:hover {
  background: var(--bg-elevated);
  border-color: var(--text-muted);
}
.reaction-badge--active {
  background: rgba(108, 92, 231, 0.15);
  border-color: var(--accent);
  color: var(--text);
}
.reaction-badge--active:hover {
  background: rgba(108, 92, 231, 0.25);
}
.reaction-emoji { font-size: 0.95rem; line-height: 1; }
.reaction-count { font-size: 0.75rem; font-weight: 600; }

.reaction-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0.15rem 0.35rem;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  font-size: 0.75rem;
}
.message:hover .reaction-add-btn,
.message-reactions:has(.reaction-badge) .reaction-add-btn {
  opacity: 1;
}
.reaction-add-btn:hover {
  background: var(--bg-surface);
  border-color: var(--text-muted);
}
.reaction-add-btn svg { width: 14px; height: 14px; }
.reaction-add-plus { font-size: 0.65rem; font-weight: 600; }

.reaction-picker-panel {
  position: fixed;
  width: 352px;
  max-height: 280px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 300;
  display: flex;
  flex-direction: column;
}

/* === Message Form === */
.message-input-wrapper {
  display: flex;
  flex-direction: column;
}
.format-toolbar {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.3rem 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.format-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex: 1;
}
.format-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.format-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.format-separator {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 0.2rem;
}
.message-input {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--text);
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  font-family: inherit;
  resize: none;
  overflow-y: hidden;
  max-height: 8rem;
  line-height: 1.4;
}
.message-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* === Verification Page === */
.verification-container {
  max-width: 560px;
  margin: 0 auto;
}
.verification-container h1 { margin-bottom: 1rem; }
.mock-provider-notice {
  background: #4d3b1b;
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--warning);
}
.verification-prompt {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}
.verification-form { display: flex; flex-direction: column; gap: 1.25rem; }
.age-bracket-options { display: flex; flex-direction: column; gap: 0.75rem; }
.age-bracket-option {
  cursor: pointer;
  display: block;
}
.age-bracket-option input { display: none; }
.option-card {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: border-color 0.2s;
}
.age-bracket-option input:checked + .option-card {
  border-color: var(--accent);
  background: var(--bg-elevated);
}
.option-label { font-weight: 600; font-size: 1.05rem; display: block; }
.option-desc { font-size: 0.85rem; color: var(--text-muted); }

/* === Invite Codes === */
.invites-container { max-width: 600px; margin: 0 auto; }
.invites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.invites-list { display: flex; flex-direction: column; gap: 0.75rem; }
.invite-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.invite-card--used { opacity: 0.6; }
.invite-code-display code {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
  background: var(--bg-elevated);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
}
.invite-meta { font-size: 0.85rem; }
.invite-status--available { color: var(--success); }
.invite-status--used { color: var(--text-muted); }
.invite-status--expired { color: var(--danger); }

/* === Avatars === */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.avatar--tiny { width: 24px; height: 24px; }
.avatar--small { width: 32px; height: 32px; }
.avatar--medium { width: 40px; height: 40px; }
.avatar--large { width: 80px; height: 80px; }

.avatar-placeholder {
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar-placeholder--tiny { width: 24px; height: 24px; font-size: 0.65rem; }
.avatar-placeholder--small { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar-placeholder--medium { width: 40px; height: 40px; font-size: 1rem; }
.avatar-placeholder--large { width: 80px; height: 80px; font-size: 1.8rem; }

/* === Settings === */
.settings-heading {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
}
.settings-layout {
  display: flex;
  gap: 0;
  height: 60vh;
}
.settings-nav {
  width: 160px;
  min-width: 160px;
  padding: 1rem 0.5rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.settings-nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.settings-nav-item--active {
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
}
.settings-nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}
.settings-nav-item--active svg {
  opacity: 1;
}
.settings-content {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 1.5rem 1.5rem;
  overflow-y: auto;
}
.settings-container {
  max-width: 560px;
  margin: 0 auto;
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.settings-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.settings-section h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.avatar-preview-area {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.avatar-current {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.settings-actions {
  display: flex;
  justify-content: flex-start;
}
.form-group input[type="file"] {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem;
  font-size: 0.9rem;
  width: 100%;
}
.form-group input[type="file"]::file-selector-button {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.85rem;
  margin-right: 0.75rem;
  cursor: pointer;
  font-family: inherit;
}

/* === Flocks === */
.flocks-container { max-width: 800px; margin: 0 auto; }
.flocks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.flocks-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.flock-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s;
}
.flock-card:hover { border-color: var(--accent); }
.flock-card-link {
  display: block;
  padding: 1.25rem;
  color: var(--text);
}
.flock-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.flock-name { font-size: 1.1rem; font-weight: 600; }
.flock-description { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.flock-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.flock-default-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  letter-spacing: 0.05em;
  background: #1b4d3e;
  color: #6ee7b7;
}
.flock-container { max-width: 1100px; margin: 0 auto; }
.flock-header-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.flock-header-section h1 {
  font-size: 1.5rem;
  display: inline;
  margin-right: 0.5rem;
}
.rooms-actions {
  display: flex;
  gap: 0.5rem;
}
.flock-preview {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.flock-preview-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  align-items: center;
}

/* === Join Flock === */
.join-flock-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.join-flock-section h2 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}
.join-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.join-form {
  display: flex;
  gap: 0.5rem;
}
.join-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem 0.85rem;
  font-size: 1rem;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.join-input:focus {
  outline: none;
  border-color: var(--accent);
}
.invite-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.invite-share-url {
  margin-top: 0.25rem;
  color: var(--text-muted);
  word-break: break-all;
}

/* === Notification Badge === */
.notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}
.flock-switcher-item--add {
  position: relative;
}
.flock-switcher-item--add .notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.6rem;
  min-width: 16px;
  height: 16px;
}

/* === Pending Invitations === */
.pending-invitations-section {
  background: var(--bg-surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.pending-invitations-section h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.invitations-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.invitation-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.invitation-info {
  flex: 1;
  min-width: 0;
}
.invitation-flock-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}
.invitation-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0.15rem 0 0;
}
.invitation-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.invitation-status {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* === Invite User Search === */
.invite-user-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.invite-user-section h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}
.search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.search-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem 0.85rem;
  font-size: 1rem;
  font-family: inherit;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
}
.search-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.search-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* === Role Badges === */
.role-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.role-badge--owner { background: #f59e0b22; color: #f59e0b; border: 1px solid #f59e0b44; }
.role-badge--moderator { background: #8b5cf622; color: #8b5cf6; border: 1px solid #8b5cf644; }
.role-badge--member { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.role-badge--admin { background: #ef444422; color: #ef4444; border: 1px solid #ef444444; }

/* === Danger / Tiny Buttons === */
.btn--danger {
  background: #ef4444;
  color: white;
  border: none;
}
.btn--danger:hover { background: #dc2626; }
.btn--tiny {
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  border-radius: 4px;
}

/* === Message Delete === */
.message-delete {
  opacity: 0;
  transition: opacity 0.15s;
  margin-left: 0.5rem;
}
.message:hover .message-delete { opacity: 1; }

/* === Chat Header Actions === */
.chat-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.flock-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* === Members Page === */
.members-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1rem;
}
.members-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.members-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.member-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.member-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.member-name { font-weight: 600; }
.member-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.role-form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.role-select {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.8rem;
}

/* === Admin Page === */
.admin-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}
.admin-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.admin-user-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-user-name { font-weight: 600; }
.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-toggle-form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.nav-link--admin { color: #ef4444; }

/* === Admin Dashboard === */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.admin-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.admin-stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.admin-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin-nav-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.admin-nav-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  color: var(--text);
  transition: border-color 0.2s;
}
.admin-nav-card:hover {
  border-color: var(--accent);
  color: var(--text);
}
.admin-nav-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}
.admin-nav-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.admin-recent-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}
.admin-recent-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.admin-recent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.admin-recent-header h2 { font-size: 1rem; }
.admin-recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.admin-recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.admin-recent-item:last-child { border-bottom: none; }
.admin-recent-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.admin-flock-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-flock-name { font-weight: 600; }

/* === Admin Flocks List === */
.admin-flocks-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.admin-flock-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-flock-card-info { flex: 1; min-width: 0; }
.admin-flock-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}
.admin-flock-name-link {
  font-weight: 600;
  font-size: 1.05rem;
}
.admin-flock-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.admin-flock-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.admin-flock-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* === Admin Username === */
.username--admin {
  color: #ef4444;
  font-weight: 700;
}

/* === Modal (dialog) === */
dialog#modal-dialog {
  background: transparent;
  border: none;
  padding: 0;
  width: min(560px, 90vw);
  max-height: 85vh;
  overflow: visible;
  margin: auto;
}
dialog#modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}
dialog#modal-dialog .modal-container {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  max-height: 85vh;
}
dialog#modal-dialog .modal-header {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1;
}
dialog#modal-dialog .modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
dialog#modal-dialog .modal-close-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
dialog#modal-dialog .modal-body {
  padding: 0 1.5rem 1.5rem;
}
dialog#modal-dialog .settings-container {
  max-width: none;
  margin: 0;
}
dialog#modal-dialog:has(.settings-layout) {
  width: min(700px, 90vw);
}
dialog#modal-dialog .settings-layout {
  margin: -0.75rem -1.5rem -1.5rem;
}


/* === Emoji Picker === */
.emoji-picker-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 300;
  max-height: 320px;
  overflow-y: auto;
}
.emoji-picker-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: background 0.1s;
}
.emoji-picker-item--active {
  background: var(--bg-surface);
}
.emoji-picker-item-emoji {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
  width: 1.6rem;
  text-align: center;
}
.emoji-picker-item-img {
  width: 1.3rem;
  height: 1.3rem;
  object-fit: contain;
}
.emoji-picker-item-name {
  font-size: 0.85rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.emoji-picker-item--active .emoji-picker-item-name {
  color: var(--text);
}

/* Emoji toggle button */
.btn--emoji-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.btn--emoji-toggle:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

/* Emoji panel (grid picker) */
.emoji-panel {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 4px;
  width: 352px;
  max-height: 360px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 300;
  display: flex;
  flex-direction: column;
}
.emoji-panel-search {
  margin: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}
.emoji-panel-search:focus {
  border-color: var(--accent);
}
.emoji-panel-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 0 0.5rem 0.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}
.emoji-panel-btn {
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.35rem;
  text-align: center;
  transition: background 0.1s;
}
.emoji-panel-btn:hover {
  background: var(--bg-surface);
}
.emoji-panel-btn-img {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
}

/* === Email Display (Settings) === */
.email-display { margin-bottom: 0.5rem; }
.email-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
}
.email-reveal-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.email-reveal-btn:hover { color: var(--text); }
.email-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.email-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.email-badge--verified { background: #1b4d3e; color: #6ee7b7; }
.email-badge--unverified { background: #4d3b1b; color: #fdcb6e; }
.hidden { display: none !important; }

/* === Unverified Banners (Chat) === */
.email-unverified-banner,
.age-unverified-banner {
  background: var(--bg-surface);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--warning);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.btn--link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}
.btn--link:hover { color: var(--accent-hover); }

/* === Form email field === */
.form-group input[type="email"] {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-group input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
}

/* === Voice Chat === */
.voice-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.voice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.voice-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.voice-btn--join {
  color: var(--success);
  border-color: var(--success);
}
.voice-btn--join:hover {
  background: rgba(0, 184, 148, 0.15);
  color: var(--success);
}
.voice-btn--leave {
  color: var(--danger);
  border-color: var(--danger);
}
.voice-btn--leave:hover {
  background: rgba(225, 112, 85, 0.15);
  color: var(--danger);
}
.voice-btn--muted {
  color: var(--danger) !important;
  border-color: var(--danger) !important;
  background: rgba(225, 112, 85, 0.1);
}
.voice-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.voice-status[data-status="connected"] {
  color: var(--success);
}
.voice-status[data-status="error"],
.voice-status[data-status="rejected"] {
  color: var(--danger);
}

/* Voice participants sidebar */
.voice-participant-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.voice-participant {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.voice-participant--self {
  color: var(--text);
}
.voice-participant-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}
.voice-participant-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mic test (settings) */
.mic-level {
  margin-top: 0.75rem;
}
.mic-level-bar {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.mic-level-fill {
  height: 100%;
  width: 0%;
  background: var(--success);
  border-radius: 4px;
  transition: width 0.05s linear;
}
.mic-test-status {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.mic-test-status[data-state="connected"] {
  color: var(--success);
}
.mic-test-status[data-state="error"] {
  color: var(--danger);
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
