/* =========================================================
   Troupe — Default Theme (Desktop)
   Dark ambient. Something ancient hums in the negative space.
   Wisps of light drift through the void. The UI breathes.
   ========================================================= */

:root {
  /* Void depths — layered darkness with cold undertones */
  --void-deep: #06070b;
  --void-mid: #0a0c12;
  --void-surface: #0e1018;
  --void-raised: #13151f;
  --void-bright: #181b28;

  /* Borders — barely there, like cracks letting light through */
  --border-dim: rgba(60, 70, 100, 0.15);
  --border-glow: rgba(80, 130, 180, 0.2);
  --border-active: rgba(100, 160, 200, 0.3);

  /* Text — cool, distant, slightly luminous */
  --text-bright: #c4cad8;
  --text-mid: #7a829a;
  --text-dim: #4a5068;
  --text-ghost: #2e3348;

  /* Accent — deep teal that glows like bioluminescence */
  --wisp-teal: #4db8b0;
  --wisp-teal-dim: #2a7a74;
  --wisp-teal-glow: rgba(77, 184, 176, 0.08);
  --wisp-teal-bright: rgba(77, 184, 176, 0.15);

  /* Secondary accents */
  --wisp-amber: #c8a848;
  --wisp-violet: #8060b0;
  --wisp-rose: #a06878;

  /* Bubbles — glass in the dark */
  --bubble-them: rgba(14, 16, 24, 0.85);
  --bubble-them-border: rgba(60, 70, 100, 0.2);
  --bubble-me: rgba(20, 40, 50, 0.7);
  --bubble-me-border: rgba(77, 184, 176, 0.15);

  /* Semantic */
  --danger: #a04050;
  --danger-bg: rgba(160, 64, 80, 0.06);
  --success: #6aaa7a;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Timing — slow breaths, something vast is sleeping */
  --ease-drift: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-settle: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 180ms var(--ease-settle);
  --transition-slow: 350ms var(--ease-drift);
  --transition-breathe: 600ms var(--ease-drift);
}

/* =========================================================
   Reset
   ========================================================= */

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

html, body {
  height: 100%;
  background: var(--void-deep);
  color: var(--text-bright);
  overflow: hidden;
}

body {
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   Wisps canvas — the deep background
   ========================================================= */

.wisps-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* =========================================================
   App shell — glass floating over the void
   ========================================================= */

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

/* =========================================================
   Header — a thin presence at the edge
   ========================================================= */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 var(--space-md);
  background: rgba(10, 12, 18, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
  user-select: none;
  z-index: 100;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  position: relative;
}

.app-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  transition: color var(--transition-slow);
}

.app-title:hover {
  color: var(--wisp-teal-dim);
}

.streak-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--void-raised);
  border: 1px solid var(--border-dim);
  border-radius: 12px;
  padding: 2px 10px;
  white-space: nowrap;
  display: none;
  letter-spacing: 0.02em;
  transition: border-color var(--transition-slow);
}

.streak-badge.visible {
  display: inline-block;
}

.streak-badge:hover {
  border-color: var(--border-glow);
}

/* Dolphin / escape button */
.dolphin-btn {
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  color: var(--text-ghost);
  transition: color var(--transition-slow), transform var(--transition-fast);
}

.dolphin-btn:hover {
  color: var(--wisp-teal-dim);
  transform: scale(1.1);
}

.dolphin-btn:active {
  transform: scale(0.9);
}

.dolphin-btn:focus-visible {
  outline: 1px solid var(--wisp-teal);
  outline-offset: 2px;
  border-radius: 4px;
}

.dolphin-icon {
  display: block;
}

/* Menu button */
.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--text-dim);
  transition: color var(--transition-fast);
}

.menu-btn:hover, .menu-btn[aria-expanded="true"] {
  color: var(--text-bright);
}

.menu-btn:focus-visible {
  outline: 1px solid var(--wisp-teal);
  outline-offset: 2px;
  border-radius: 4px;
}

.menu-icon {
  display: block;
}

/* Notification dot */
.menu-btn .notif-dot {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wisp-teal);
  box-shadow: 0 0 8px rgba(77, 184, 176, 0.5);
  animation: notif-pulse 3s infinite ease-in-out;
}

.menu-btn .notif-dot.active {
  display: block;
}

@keyframes notif-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px rgba(77, 184, 176, 0.3); }
  50% { opacity: 0.3; box-shadow: 0 0 12px rgba(77, 184, 176, 0.6); }
}

/* =========================================================
   Dropdown menu
   ========================================================= */

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--void-raised);
  border: 1px solid var(--border-glow);
  border-radius: 10px;
  padding: 4px 0;
  min-width: 180px;
  z-index: 100;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.dropdown-menu.open {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-mid);
  font-size: 13px;
  padding: 8px 16px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--void-bright);
  color: var(--text-bright);
}

.dropdown-item:focus-visible {
  outline: 1px solid var(--wisp-teal);
  outline-offset: -2px;
  border-radius: 4px;
}

/* =========================================================
   Modal
   ========================================================= */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 5, 8, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--void-raised);
  border: 1px solid var(--border-glow);
  border-radius: 14px;
  padding: var(--space-lg);
  width: 340px;
  max-width: 90vw;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6), 0 0 1px rgba(77, 184, 176, 0.1);
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: var(--space-md);
  letter-spacing: 0.01em;
}

.modal-input {
  width: 100%;
  background: var(--void-deep);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-bright);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.modal-input:focus {
  border-color: var(--wisp-teal-dim);
  box-shadow: 0 0 0 3px var(--wisp-teal-glow);
}

.modal-input:focus-visible {
  outline: none;
}

.modal-hint {
  font-size: 12px;
  color: var(--text-ghost);
  margin-top: 6px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: var(--space-md);
}

.modal-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.modal-btn:active {
  transform: scale(0.97);
}

.modal-btn.cancel {
  background: var(--void-bright);
  color: var(--text-mid);
}

.modal-btn.cancel:hover {
  background: rgba(30, 35, 55, 0.8);
}

.modal-btn.confirm {
  background: var(--wisp-teal-dim);
  color: #fff;
}

.modal-btn.confirm:hover {
  background: var(--wisp-teal);
}

.modal-btn:focus-visible {
  outline: 1px solid var(--wisp-teal);
  outline-offset: 2px;
}

.modal-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 8px;
  min-height: 18px;
}

/* Modal list */
.modal-list {
  display: none;
  max-height: 240px;
  overflow-y: auto;
  margin: 8px 0;
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  background: var(--void-deep);
}

.modal-list.visible {
  display: block;
}

.modal-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-dim);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.modal-list-item:hover {
  background: var(--void-surface);
}

.contact-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--void-bright);
  border: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  flex-shrink: 0;
  text-transform: uppercase;
}

.contact-name {
  flex: 1;
  font-size: 14px;
  color: var(--text-bright);
}

.contact-action {
  font-size: 12px;
  color: var(--wisp-teal);
  padding: 4px 10px;
  border: 1px solid var(--wisp-teal-dim);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.contact-action:hover {
  background: var(--wisp-teal-glow);
}

.modal-list-section {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-ghost);
  border-bottom: 1px solid var(--border-dim);
  background: var(--void-mid);
}

/* =========================================================
   Body: sidebar + chat
   ========================================================= */

.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* =========================================================
   Sidebar — a pane of dark glass
   ========================================================= */

.sidebar {
  width: 230px;
  background: rgba(10, 12, 18, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 0 1 auto;
  max-height: 40%;
}

.sidebar-section--channels {
  flex: 1;
  border-top: 1px solid var(--border-dim);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--space-md) 6px;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-ghost);
}

.sidebar-add-btn {
  background: none;
  border: 1px solid var(--border-dim);
  color: var(--text-ghost);
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.sidebar-add-btn:hover {
  background: var(--void-bright);
  border-color: var(--wisp-teal-dim);
  color: var(--wisp-teal);
}

.sidebar-add-btn:focus-visible {
  outline: 1px solid var(--wisp-teal);
  outline-offset: 2px;
}

/* Contacts list */
.contact-list {
  overflow-y: auto;
  padding: 4px 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px var(--space-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  color: var(--text-mid);
  font-size: 14px;
}

.contact-item:hover {
  background: rgba(77, 184, 176, 0.04);
}

.contact-item.active {
  background: var(--wisp-teal-glow);
  color: var(--wisp-teal);
}

.contact-item:focus-visible {
  outline: 1px solid var(--wisp-teal);
  outline-offset: -1px;
}

.contact-item-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-ghost);
  flex-shrink: 0;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.contact-item.has-unread .contact-item-status {
  background: var(--wisp-teal);
  box-shadow: 0 0 6px rgba(77, 184, 176, 0.4);
}

.contact-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-pending {
  opacity: 0.7;
}

.contact-pending-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.accept-btn,
.decline-btn {
  background: none;
  border: 1px solid var(--border-dim);
  color: var(--text-dim);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.accept-btn:hover {
  background: rgba(106, 170, 122, 0.15);
  border-color: var(--success);
  color: var(--success);
}

.decline-btn:hover {
  background: rgba(160, 64, 80, 0.15);
  border-color: var(--danger);
  color: var(--danger);
}

.accept-btn:focus-visible,
.decline-btn:focus-visible {
  outline: 1px solid var(--wisp-teal);
  outline-offset: 1px;
}

/* Room list */
.room-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.room-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px var(--space-md);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-slow);
  border-left: 2px solid transparent;
}

.room-item:hover {
  background: rgba(77, 184, 176, 0.04);
}

.room-item.active {
  background: var(--wisp-teal-glow);
  border-left-color: var(--wisp-teal);
}

.room-item:focus-visible {
  outline: 1px solid var(--wisp-teal);
  outline-offset: -1px;
}

.room-item-icon {
  color: var(--text-ghost);
  font-size: 12px;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.room-item.has-unread .room-item-icon {
  color: var(--wisp-teal);
}

.room-item.active .room-item-icon {
  color: var(--text-ghost);
}

.room-item-body {
  flex: 1;
  min-width: 0;
}

.room-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition-fast);
}

.room-item.active .room-item-name {
  color: var(--text-bright);
}

.room-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.room-item-time {
  font-size: 11px;
  color: var(--text-ghost);
}

.unread-badge {
  background: var(--wisp-teal);
  color: var(--void-deep);
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  padding: 0 5px;
  margin-left: auto;
  box-shadow: 0 0 8px rgba(77, 184, 176, 0.3);
}

/* Pending room invites */
.room-item.room-pending {
  opacity: 0.7;
}

.room-pending-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.room-pending-actions .accept-btn,
.room-pending-actions .decline-btn {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.room-pending-actions .accept-btn {
  background: rgba(77, 184, 176, 0.15);
  color: var(--wisp-teal);
}

.room-pending-actions .accept-btn:hover {
  background: rgba(77, 184, 176, 0.3);
}

.room-pending-actions .decline-btn {
  background: rgba(255, 100, 100, 0.1);
  color: #ff6464;
}

.room-pending-actions .decline-btn:hover {
  background: rgba(255, 100, 100, 0.25);
}

/* =========================================================
   Chat panel
   ========================================================= */

.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(6, 7, 11, 0.4);
  min-width: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  height: 48px;
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
  background: rgba(10, 12, 18, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.chat-room-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.chat-room-name:hover {
  color: var(--wisp-teal);
}

.info-btn {
  background: none;
  border: none;
  color: var(--text-ghost);
  cursor: pointer;
  padding: 4px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.info-btn:hover {
  color: var(--text-mid);
}

.info-btn:focus-visible {
  outline: 1px solid var(--wisp-teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* =========================================================
   Messages
   ========================================================= */

.messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg) var(--space-lg) var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 12px;
  animation: msg-appear 350ms var(--ease-drift) both;
}

.message-row.mine {
  flex-direction: row-reverse;
}

.message-row.system {
  justify-content: center;
}

.system-notice {
  font-size: 12px;
  color: var(--text-faint);
  background: var(--surface-2);
  padding: 4px 12px;
  border-radius: 10px;
  max-width: 80%;
  text-align: center;
}

@keyframes msg-appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.message-row.mine .bubble-wrap {
  align-items: flex-end;
}

.username {
  font-size: 11px;
  color: var(--text-ghost);
  margin-bottom: 3px;
  padding: 0 4px;
}

.bubble {
  background: var(--bubble-them);
  border: 1px solid var(--bubble-them-border);
  border-radius: 14px 14px 14px 4px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-bright);
  word-break: break-word;
  line-height: 1.5;
  transition: border-color var(--transition-slow);
}

.bubble:hover {
  border-color: var(--border-glow);
}

.message-row.mine .bubble {
  background: var(--bubble-me);
  border-color: var(--bubble-me-border);
  border-radius: 14px 14px 4px 14px;
}

.timestamp {
  font-size: 10px;
  color: var(--text-ghost);
  margin-top: 3px;
  padding: 0 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.message-row:hover .timestamp {
  opacity: 1;
}

/* =========================================================
   Composer
   ========================================================= */

.composer {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  border-top: 1px solid var(--border-dim);
  background: rgba(10, 12, 18, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.composer-input {
  flex: 1;
  background: var(--void-deep);
  border: 1px solid var(--border-dim);
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 14px;
  color: var(--text-bright);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.composer-input::placeholder {
  color: var(--text-ghost);
}

.composer-input:focus {
  border-color: var(--wisp-teal-dim);
  box-shadow: 0 0 0 2px var(--wisp-teal-glow);
}

.composer-input:focus-visible {
  outline: none;
}

.send-btn {
  background: var(--wisp-teal-dim);
  border: none;
  border-radius: 20px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.send-btn:hover:not(:disabled) {
  background: var(--wisp-teal);
  box-shadow: 0 0 12px rgba(77, 184, 176, 0.2);
}

.send-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.send-btn:focus-visible {
  outline: 1px solid var(--wisp-teal);
  outline-offset: 2px;
}

/* =========================================================
   States — the void responds
   ========================================================= */

@keyframes void-breathe {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.15; }
}

.loading-state, .empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-ghost);
  font-size: 13px;
  text-align: center;
  padding: var(--space-xl);
  animation: void-breathe 4s infinite ease-in-out;
  letter-spacing: 0.03em;
}

.error-state {
  color: var(--danger);
  font-size: 12px;
  text-align: center;
  padding: var(--space-md);
}

/* =========================================================
   Shimmer effect — for elements that catch the light
   ========================================================= */

@keyframes shimmer-drift {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.app-title {
  background: linear-gradient(
    90deg,
    var(--text-dim) 40%,
    var(--wisp-teal-dim) 50%,
    var(--text-dim) 60%
  );
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer-drift 8s infinite linear;
}

/* =========================================================
   Shame
   ========================================================= */

body.shame-1 { filter: saturate(0.5); }
body.shame-2 .bubble.my-bubble { background: #1a2a1a; }
body.shame-3 { font-family: 'Comic Sans MS', cursive; }

/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .loading-state, .empty-state { animation: none; opacity: 0.35; }
  .app-title { animation: none; }
  .menu-btn .notif-dot { animation: none; }
  .message-row { animation: none; }
  * { transition-duration: 0ms !important; }
}

/* =========================================================
   Focus visible — teal ring from the void
   ========================================================= */

:focus-visible {
  outline: 1px solid var(--wisp-teal);
  outline-offset: 2px;
}

input:focus-visible,
.composer-input:focus-visible,
.modal-input:focus-visible {
  outline: none;
}

/* Reaction badges */
.reaction-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
  font-size: 14px; cursor: pointer; line-height: 1.4; user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.reaction-badge:hover { background: rgba(255,255,255,0.12); }
.reaction-badge.mine { border-color: #c8a848; background: rgba(200,168,72,0.15); }
.reaction-badge .reaction-count { font-size: 11px; opacity: 0.7; }
.reaction-badge .smiley svg { height: 16px; width: 16px; }

/* Reply preview in messages */
.reply-preview {
  display: flex; gap: 8px; padding: 6px 10px; margin-bottom: 4px;
  border-left: 3px solid #c8a848; background: rgba(255,255,255,0.04);
  border-radius: 0 6px 6px 0; cursor: pointer; font-size: 12px;
  max-width: 100%; overflow: hidden;
}
.reply-preview:hover { background: rgba(255,255,255,0.08); }
.reply-preview-sender { font-weight: 600; color: #c8a848; white-space: nowrap; }
.reply-preview-text { opacity: 0.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Reply banner in composer */
.reply-banner { display: none; align-items: center; gap: 8px; padding: 6px 12px; background: rgba(255,255,255,0.06); border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 12px; }
.reply-banner.active { display: flex; }
.reply-banner-text { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; opacity: 0.7; }
.reply-banner-sender { font-weight: 600; margin-right: 4px; }
.reply-banner-close { background: transparent; border: none; color: inherit; cursor: pointer; opacity: 0.5; font-size: 16px; padding: 2px 6px; line-height: 1; }
.reply-banner-close:hover { opacity: 1; }
