
/* =========================================================
   TALKATIVE — FRONTEND DESIGN SYSTEM
   Optimized Version 3.2
   Default: Lavender & Soft White
========================================================= */

/* 01. GLOBAL VARIABLES */

:root {
  color-scheme: light;

  --bg: #f7f5ff;
  --surface: #ffffff;
  --surface-soft: #f2efff;
  --surface-hover: #eee9ff;

  --primary: #9275e8;
  --primary-dark: #7658d2;
  --primary-light: #e9e1ff;

  --text: #29243b;
  --text-soft: #817b96;
  --text-light: #aaa4b9;

  --border: #eae6f3;

  --danger: #e36b83;
  --success: #54b994;
  --warning: #e6ad59;

  --shadow: 0 8px 28px rgba(66, 48, 111, 0.07);
  --shadow-strong: 0 18px 55px rgba(49, 34, 91, 0.16);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --transition: 0.22s ease;

  /* Theme helpers (auto-follow the active theme) */
  --on-primary: #ffffff;
  --glass: color-mix(in srgb, var(--surface) 86%, transparent);
  --glass-strong: color-mix(in srgb, var(--surface) 96%, transparent);
  --glass-soft: color-mix(in srgb, var(--surface) 45%, transparent);
  --glass-border: color-mix(in srgb, var(--surface) 85%, transparent);
  --tint: color-mix(in srgb, var(--primary) 14%, transparent);
  --pattern: none;
  --theme-emoji: "";

  --font: "DM Sans", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

/* 02. RESET AND BASE */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, var(--tint), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--primary-light);
  color: var(--primary-dark);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent);
  outline-offset: 3px;
}

/* 03. MAIN APPLICATION */

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  width: min(100% - 48px, 1080px);
  margin: 0 auto;
  flex: 1;
  padding: 36px 0 70px;
}

.app-view {
  width: 100%;
  animation: pageFadeIn 0.3s ease both;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 04. TOP NAVIGATION */

.topbar {
  position: relative;
  flex: none;
  z-index: 100;
  width: 100%;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100% - 1080px) / 2));
  background: var(--glass);
  border-bottom: 1px solid rgba(226, 220, 241, 0.8);
}

.brand-area,
.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1.1px;
  color: var(--text);
}

.brand-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--on-primary);
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(130, 98, 223, 0.25);
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--text-soft);
  font-size: 19px;
  transition:
    background var(--transition),
    color var(--transition),
    transform var(--transition),
    border-color var(--transition);
}

.icon-button:hover {
  background: var(--surface-soft);
  color: var(--primary-dark);
  border-color: var(--border);
}

.icon-button:active {
  transform: scale(0.94);
}

.menu-button {
  font-size: 21px;
}

.top-actions {
  gap: 8px;
}

.dm-top-button {
  position: relative;
}

.dm-unread-badge {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: var(--danger);
  color: var(--on-primary);
  font-size: 10px;
  font-weight: 800;
  border: 2px solid var(--surface);
}

.profile-button {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

/* 05. LANDING PAGE */

.welcome-section {
  max-width: 650px;
  padding: 38px 0 42px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.welcome-section h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 43px);
  line-height: 1.16;
  letter-spacing: -1.6px;
  font-weight: 800;
  color: var(--text);
}

.welcome-subtitle {
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 15px;
}

.rooms-section {
  margin-top: 8px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 17px;
}

.section-heading h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
}

.room-count {
  color: var(--text-light);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

.room-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.room-item {
  width: 100%;
  min-height: 94px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: left;
  box-shadow: var(--shadow);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition),
    background var(--transition);
}

.room-item:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  box-shadow: 0 13px 32px rgba(66, 48, 111, 0.11);
}

.room-item:active {
  transform: scale(0.99);
}

.room-icon {
  width: 53px;
  height: 53px;
  flex: 0 0 53px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 17px;
  font-size: 24px;
  font-weight: 700;
}

.main-room-icon {
  color: var(--primary-dark);
  background: var(--primary-light);
}

.hot-room-icon {
  color: #df7794;
  background: color-mix(in srgb, #df7794 14%, var(--surface));
}

.gaming-room-icon {
  color: #5b9cce;
  background: color-mix(in srgb, #5b9cce 14%, var(--surface));
}

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

.room-info h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
}

.room-info p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
}

.room-arrow {
  color: var(--text-light);
  font-size: 28px;
  line-height: 1;
  transition: transform var(--transition);
}

.room-item:hover .room-arrow {
  color: var(--primary);
  transform: translateX(4px);
}

/* 06. CHAT ROOM */

#chat-view {
  min-height: 650px;
  height: calc(100vh - 130px);
  max-height: 850px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.chat-header {
  min-height: 76px;
  padding: 14px 19px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}

.chat-room-details {
  flex: 1;
}

.chat-room-details h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.chat-room-details p {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 11px;
}

.chat-toolbar {
  min-height: 36px;
  padding: 7px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-soft);
  font-size: 11px;
  background: var(--surface-soft);
}

#typingIndicator {
  color: var(--primary-dark);
  font-style: italic;
}

.message-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  background:
    radial-gradient(circle at 50% 0%, var(--tint), transparent 50%),
    var(--surface);
}

.message-list::-webkit-scrollbar,
.dm-message-list::-webkit-scrollbar,
.dm-conversation-list::-webkit-scrollbar {
  width: 5px;
}

.message-list::-webkit-scrollbar-thumb,
.dm-message-list::-webkit-scrollbar-thumb,
.dm-conversation-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.chat-welcome {
  margin: auto;
  max-width: 300px;
  padding: 30px 15px;
  text-align: center;
}

.chat-welcome-icon {
  width: 57px;
  height: 57px;
  margin: 0 auto 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 19px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 25px;
}

.chat-welcome h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.chat-welcome p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
}

/* 07. GENERAL MESSAGE BUBBLES */

.message-item,
.chat-message {
  max-width: min(78%, 520px);
  align-self: flex-start;
}

.message-item.own,
.chat-message.own,
.message-item.sent,
.chat-message.sent {
  align-self: flex-end;
}

.message-bubble {
  padding: 10px 14px;
  border-radius: 16px 16px 16px 5px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.own .message-bubble,
.sent .message-bubble {
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 16px 16px 5px 16px;
}

.message-meta {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 4px 5px 0;
  color: var(--text-light);
  font-size: 10px;
}

.own .message-meta,
.sent .message-meta {
  justify-content: flex-end;
}

.message-author {
  font-weight: 800;
  color: var(--primary-dark);
}

.message-reply-quote {
  margin-bottom: 7px;
  padding: 7px 9px;
  border-left: 3px solid var(--primary);
  border-radius: 5px;
  background: var(--glass-soft);
  color: var(--text-soft);
  font-size: 11px;
}

/* 08. CHAT REPLY PREVIEW */

.reply-preview {
  margin: 0 15px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  background: var(--surface-soft);
}

.reply-preview strong {
  color: var(--primary-dark);
  font-size: 11px;
}

.reply-preview p {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 11px;
}

#cancelReply {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
}

/* 09. CHAT COMPOSER */

.message-composer {
  margin: 12px 15px 0;
  padding: 7px 8px 7px 15px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(50, 35, 90, 0.04);
}

.message-composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  max-height: 120px;
  resize: none;
  padding: 9px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.message-composer textarea::placeholder {
  color: var(--text-light);
}

.message-composer button,
.chat-quick-actions button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-soft);
  font-size: 17px;
  transition: background var(--transition), color var(--transition);
}

.message-composer button:hover,
.chat-quick-actions button:hover {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

#sendMessageButton {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 4px 11px color-mix(in srgb, var(--primary) 24%, transparent);
}

#sendMessageButton:hover {
  background: var(--primary-dark);
  color: var(--on-primary);
}

.chat-quick-actions {
  min-height: 44px;
  padding: 3px 17px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-quick-actions button {
  font-size: 15px;
}

#gifButton {
  font-size: 10px;
  font-weight: 800;
}

/* 10. CHAT PICKERS AND RECORDING */

.attachment-menu,
.emoji-picker,
.gif-picker,
.voice-recording-panel,
.dm-attachment-menu {
  position: absolute;
  z-index: 30;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-strong);
}

.attachment-menu {
  margin: 0 15px;
  bottom: 110px;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attachment-menu button,
.dm-attachment-menu button {
  padding: 10px 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  color: var(--text);
}

.attachment-menu button:hover,
.dm-attachment-menu button:hover {
  background: var(--surface-soft);
}

.emoji-picker,
.gif-picker {
  bottom: 100px;
  left: 20px;
  width: min(320px, calc(100% - 40px));
}

.emoji-picker-content {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.emoji-picker-content button {
  padding: 7px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 20px;
}

.emoji-picker-content button:hover {
  background: var(--surface-soft);
}

.gif-picker input {
  width: 100%;
  margin-bottom: 10px;
}

.voice-recording-panel {
  bottom: 100px;
  left: 15px;
  right: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-recording-panel button {
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--text);
}

/* 11. PRIVATE MESSAGES FALLBACK PAGE */

.page-heading {
  min-height: 58px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 13px;
}

.page-heading h2 {
  flex: 1;
  margin: 0;
  font-size: 21px;
  font-weight: 800;
}

.page-heading > button:not(.icon-button) {
  padding: 9px 15px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: var(--on-primary);
}

.dm-layout {
  min-height: 500px;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dm-sidebar {
  padding: 16px;
  border-right: 1px solid var(--border);
}

.dm-sidebar > input {
  margin-bottom: 15px;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dm-conversation {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
}

.empty-state {
  max-width: 290px;
  margin: auto;
  padding: 35px 20px;
  text-align: center;
}

.empty-state > span {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 24px;
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.empty-state p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
}

/* 12. FRIENDS PAGE */

.friends-search {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.friends-search input {
  flex: 1;
}

.friends-search button {
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}

.friends-tabs {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 12px;
  margin-bottom: 15px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.friends-tabs button {
  white-space: nowrap;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.friends-tabs button:hover,
.friends-tabs button.active {
  background: var(--surface-soft);
  border-color: var(--primary-light);
  color: var(--primary-dark);
}

.friends-tabs span {
  margin-left: 4px;
  color: var(--primary);
}

/* 13. PROFILE PAGE */

.profile-cover {
  position: relative;
  min-height: 190px;
  display: flex;
  align-items: flex-end;
  padding: 22px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 20% 30%, var(--primary-light), transparent 35%),
    radial-gradient(circle at 80% 20%, var(--primary-light), transparent 38%),
    linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: 1px solid var(--border);
}

.profile-avatar {
  width: 94px;
  height: 94px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 5px solid var(--surface);
  border-radius: 30px;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: var(--on-primary);
  font-size: 36px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.profile-information {
  padding: 22px 5px;
}

.profile-information h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 800;
}

.profile-information > p {
  margin: 4px 0;
  color: var(--text-soft);
}

#profileUsername {
  font-size: 12px;
  color: var(--primary-dark);
}

#profileBio {
  margin-top: 13px;
  font-size: 13px;
}

.profile-stats {
  display: flex;
  gap: 30px;
  margin-top: 20px;
}

.profile-stats div {
  display: flex;
  flex-direction: column;
}

.profile-stats strong {
  font-size: 19px;
}

.profile-stats span {
  color: var(--text-soft);
  font-size: 11px;
}

.profile-actions {
  display: flex;
  gap: 10px;
}

.profile-actions button {
  padding: 11px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.profile-actions button:hover {
  background: var(--surface-soft);
  border-color: var(--primary-light);
}

/* 14. FORMS AND INPUTS */

form {
  width: 100%;
}

label {
  display: block;
  margin: 15px 0 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
textarea,
select {
  width: 100%;
  min-height: 43px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-light);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

input[type="checkbox"] {
  accent-color: var(--primary);
  width: 17px;
  height: 17px;
}

input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text-soft);
}

form > button[type="submit"],
form > button:not([type]),
#confirmAgeButton,
#eliteUpgradeButton,
#contactSupportButton,
#markAllReadButton {
  min-height: 44px;
  margin-top: 18px;
  padding: 11px 19px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 13px;
  font-weight: 800;
  transition: background var(--transition), transform var(--transition);
}

form > button[type="submit"]:hover,
form > button:not([type]):hover,
#confirmAgeButton:hover,
#eliteUpgradeButton:hover,
#contactSupportButton:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* 15. SETTINGS */

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.settings-list > button,
.settings-list > div,
.settings-list > label {
  width: 100%;
  min-height: 59px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.settings-list > button {
  font-size: 13px;
  font-weight: 700;
}

.settings-list > button:hover {
  background: var(--surface-soft);
  border-color: var(--primary-light);
}

.settings-list > button span {
  color: var(--text-light);
  font-size: 22px;
}

.settings-list > div {
  display: block;
}

.settings-list > div strong {
  font-size: 13px;
}

.settings-list > div p {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 12px;
}

.settings-list > label {
  cursor: pointer;
  margin: 0;
}

.settings-list > label input {
  flex: 0 0 auto;
}

/* 16. ELITE MEMBERSHIP */

.elite-card {
  max-width: 570px;
  margin: 20px auto;
  padding: 35px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: 25px;
  background:
    radial-gradient(circle at top right, var(--tint), transparent 45%),
    linear-gradient(145deg, var(--surface), var(--surface-soft));
  box-shadow: var(--shadow);
  text-align: center;
}

.elite-card > span {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 19px;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: var(--on-primary);
  font-size: 27px;
}

.elite-card h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 1px;
}

.elite-card p {
  color: var(--text-soft);
  font-size: 13px;
}

.elite-card ul {
  display: inline-block;
  margin: 17px auto;
  padding-left: 20px;
  text-align: left;
  color: var(--text-soft);
  font-size: 12px;
}

.elite-card li {
  margin: 7px 0;
}

/* 17. MUSIC PLAYER */

.music-player {
  max-width: 420px;
  margin: 20px auto;
  padding: 27px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.music-artwork {
  width: 190px;
  height: 190px;
  margin: 0 auto 23px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 25px;
  background:
    radial-gradient(circle at 30% 25%, var(--primary-light), transparent 40%),
    linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: var(--on-primary);
  font-size: 60px;
  box-shadow: 0 13px 30px rgba(130, 100, 219, 0.2);
}

.music-player h3 {
  margin: 0;
  font-size: 17px;
}

.music-player > p {
  margin: 5px 0 20px;
  color: var(--text-soft);
  font-size: 12px;
}

.music-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
}

.music-controls button {
  width: 43px;
  height: 43px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--primary-dark);
}

#playPauseMusic {
  width: 55px;
  height: 55px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 19px;
}

.music-player input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

/* 18. STAFF PANEL */

.staff-role {
  padding: 16px 19px;
  margin-bottom: 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}

.staff-role span {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

.staff-role strong {
  color: var(--primary-dark);
}

.staff-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.staff-dashboard button {
  min-height: 65px;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.staff-dashboard button:hover {
  background: var(--surface-soft);
}

.staff-dashboard button span {
  color: var(--primary-dark);
}

/* 19. CONTENT PANELS */

.policy-content,
.support-content {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
}

.policy-content h3,
.support-content h3 {
  margin: 0 0 7px;
  font-size: 15px;
}

.policy-content p,
.support-content p {
  margin: 0 0 22px;
  color: var(--text-soft);
  font-size: 13px;
}

/* 20. AUTHENTICATION */

.auth-container {
  width: min(100%, 450px);
  margin: 25px auto;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 23px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-brand {
  margin-bottom: 24px;
  text-align: center;
}

.auth-brand .brand-icon {
  width: 55px;
  height: 55px;
  margin: 0 auto 12px;
  font-size: 28px;
  border-radius: 17px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 23px;
  letter-spacing: 1px;
}

.auth-brand p {
  margin: 4px 0;
  color: var(--text-soft);
  font-size: 12px;
}

.auth-tabs {
  display: flex;
  gap: 5px;
  padding: 5px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.auth-tabs button {
  flex: 1;
  padding: 9px 5px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

.auth-tabs button.active {
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(50, 35, 90, 0.08);
}

.auth-container form h2 {
  font-size: 19px;
  margin: 24px 0 13px;
}

/* 21. SIDE DRAWER BACKDROP */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(37, 29, 58, 0.28);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.drawer-overlay.show,
.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 22. SIDE DRAWER */

.side-drawer {
  position: fixed;
  z-index: 201;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(340px, 82vw);
  display: flex;
  flex-direction: column;
  padding: 21px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-strong);
  transform: translateX(-105%);
  transition: transform 0.32s cubic-bezier(.2, .8, .2, 1);
  overflow-y: auto;
}

.side-drawer.open,
.side-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

.drawer-nav {
  flex: 1;
  padding: 17px 0;
}

.drawer-label {
  margin: 18px 8px 8px;
  color: var(--text-light);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.drawer-item {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
}

.drawer-item:hover,
.drawer-item.active {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.drawer-item > span {
  color: inherit;
}

.logout-button {
  min-height: 45px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
  color: var(--danger);
  font-weight: 700;
  text-align: left;
}

/* 23. FLOATING DM OVERLAY */

.dm-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 35px;
  background: rgba(40, 31, 63, 0.32);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.dm-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 24. DM WINDOW */

.dm-window {
  position: relative;
  width: min(940px, 100%);
  height: min(650px, calc(100vh - 70px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-strong);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.28s cubic-bezier(.2, .8, .2, 1);
}

.dm-overlay.active .dm-window {
  transform: translateY(0) scale(1);
}

.dm-window.minimized {
  height: 67px;
}

.dm-window.maximized {
  width: 100%;
  height: calc(100vh - 30px);
  max-width: 1200px;
}

/* 25. DM WINDOW HEADER */

.dm-window-header {
  min-height: 67px;
  flex: 0 0 67px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 17px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.dm-window-header:active {
  cursor: grabbing;
}

.dm-window-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dm-heading-icon {
  width: 39px;
  height: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-size: 19px;
}

.dm-window-heading h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.dm-window-heading p {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 10px;
}

.dm-window-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dm-window-control {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  font-size: 17px;
}

.dm-window-control:hover {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.dm-close-button:hover {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--danger);
}

/* 26. DM WINDOW BODY AND INBOX */

.dm-window-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 305px minmax(0, 1fr);
}

.dm-inbox {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.dm-inbox-top {
  padding: 17px 15px 12px;
  border-bottom: 1px solid var(--border);
}

.dm-inbox-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.dm-inbox-title-row h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

#newDMButton {
  width: 33px;
  height: 33px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-size: 16px;
}

.dm-search-box {
  height: 39px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
  color: var(--text-light);
}

.dm-search-box > span {
  font-size: 17px;
}

.dm-search-box input {
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  font-size: 11px;
}

.dm-conversation-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
}

.dm-empty-inbox {
  padding: 30px 12px;
  text-align: center;
  color: var(--text-soft);
}

.dm-empty-inbox > span {
  width: 45px;
  height: 45px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 20px;
}

.dm-empty-inbox h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 12px;
}

.dm-empty-inbox p {
  margin: 0;
  font-size: 10px;
}

/* 27. DM CONVERSATION ITEMS */

.dm-conversation-item,
.conversation-item {
  width: 100%;
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  transition: background var(--transition);
}

.dm-conversation-item:hover,
.conversation-item:hover,
.dm-conversation-item.active,
.conversation-item.active {
  background: var(--surface-soft);
}

.dm-conversation-avatar,
.conversation-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: var(--on-primary);
  font-size: 15px;
  font-weight: 800;
}

.dm-conversation-info {
  flex: 1;
  min-width: 0;
}

.dm-conversation-info strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.dm-conversation-info p {
  margin: 3px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-soft);
  font-size: 10px;
}

.dm-conversation-time {
  align-self: flex-start;
  color: var(--text-light);
  font-size: 9px;
}

/* 28. DM CHAT PANE */

.dm-chat {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 80% 0%, var(--tint), transparent 40%),
    var(--surface);
}

.dm-chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 25px;
  text-align: center;
}

.dm-empty-icon {
  width: 62px;
  height: 62px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 21px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 27px;
}

.dm-chat-empty h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.dm-chat-empty p {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
}

.dm-active-chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 29. DM ACTIVE CHAT HEADER */

.dm-chat-header {
  min-height: 65px;
  flex: 0 0 65px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 15px;
  border-bottom: 1px solid var(--border);
  background: var(--glass);
}

.dm-chat-user-avatar {
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: var(--on-primary);
  font-size: 15px;
  font-weight: 800;
}

.dm-chat-user-info {
  flex: 1;
  min-width: 0;
}

.dm-chat-user-info h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.dm-chat-user-info p {
  margin: 2px 0 0;
  color: var(--success);
  font-size: 10px;
}

.dm-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dm-chat-header-actions button,
.dm-mobile-back {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
}

.dm-chat-header-actions button:hover,
.dm-mobile-back:hover {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.dm-mobile-back {
  display: none;
}

/* 30. DM MESSAGE LIST */

.dm-message-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dm-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 10px;
}

.dm-date-divider span {
  padding: 5px 11px;
  border-radius: 20px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 700;
}

.dm-message,
.dm-message-item {
  max-width: 75%;
  align-self: flex-start;
}

.dm-message.own,
.dm-message.sent,
.dm-message-item.own,
.dm-message-item.sent {
  align-self: flex-end;
}

.dm-message-bubble,
.dm-message-content {
  padding: 9px 12px;
  border-radius: 14px 14px 14px 5px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.dm-message.own .dm-message-bubble,
.dm-message.sent .dm-message-bubble,
.dm-message-item.own .dm-message-content,
.dm-message-item.sent .dm-message-content {
  border-radius: 14px 14px 5px 14px;
  background: var(--primary);
  color: var(--on-primary);
}

.dm-message-meta {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  margin: 3px 5px 0;
  color: var(--text-light);
  font-size: 9px;
}

/* 31. DM TYPING AND REPLY PREVIEW */

.dm-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 17px;
  color: var(--text-soft);
}

.dm-typing-indicator span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  animation: typingBounce 1s infinite ease-in-out;
}

.dm-typing-indicator span:nth-child(2) {
  animation-delay: 0.15s;
}

.dm-typing-indicator span:nth-child(3) {
  animation-delay: 0.3s;
}

.dm-typing-indicator small {
  margin-left: 5px;
  font-size: 10px;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.dm-reply-preview {
  margin: 0 12px;
  padding: 8px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 3px solid var(--primary);
  border-radius: 9px;
  background: var(--surface-soft);
}

.dm-reply-preview strong {
  color: var(--primary-dark);
  font-size: 10px;
}

.dm-reply-preview p {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 10px;
}

#dmCancelReply {
  border: 0;
  background: transparent;
  color: var(--text-soft);
}

/* 32. DM COMPOSER */

.dm-composer-area {
  padding: 9px 12px 7px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.dm-composer {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
}

.dm-composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  max-height: 100px;
  padding: 8px 3px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  box-shadow: none !important;
  font-size: 11px;
}

.dm-composer button {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  font-size: 15px;
}

.dm-composer button:hover {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

#dmSendButton {
  background: var(--primary);
  color: var(--on-primary);
}

#dmSendButton:hover {
  background: var(--primary-dark);
  color: var(--on-primary);
}

.dm-quick-actions {
  display: flex;
  gap: 5px;
  padding: 4px 3px 0;
}

.dm-quick-actions button {
  min-width: 30px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
}

.dm-quick-actions button:hover {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

#dmGifButton {
  font-size: 9px;
  font-weight: 800;
}

.dm-attachment-menu {
  right: 20px;
  bottom: 105px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* 33. DM WINDOW STATES */

.dm-window.minimized .dm-window-body {
  display: none;
}

.dm-window.maximized .dm-window-body {
  min-height: 0;
}

/* 34. MESSAGE CONTEXT MENU */

.message-context-menu {
  position: fixed;
  z-index: 500;
  min-width: 185px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-strong);
  animation: menuPop 0.15s ease both;
}

@keyframes menuPop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(5px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.message-context-menu button {
  width: 100%;
  padding: 10px 11px;
  display: block;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 11px;
}

.message-context-menu button:hover {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.message-context-menu button[data-message-action="delete"] {
  color: var(--danger);
}

/* 35. MODAL SYSTEM */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(40, 31, 63, 0.35);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal-overlay.active,
.modal-overlay.show,
.modal-overlay.open,
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-panel {
  width: min(100%, 510px);
  max-height: min(82vh, 760px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--glass-border);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: var(--shadow-strong);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s ease;
}

.modal-overlay.active .modal-panel,
.modal-overlay.show .modal-panel,
.modal-overlay.open .modal-panel,
.modal-overlay.active .modal-panel {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-header .eyebrow {
  margin-bottom: 5px;
}

.modal-panel > p {
  color: var(--text-soft);
  font-size: 13px;
}

.modal-panel .help-content h3 {
  margin: 18px 0 4px;
  font-size: 13px;
}

.modal-panel .help-content p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
}

.confirmation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.confirmation-actions button {
  min-height: 39px;
  padding: 8px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

#confirmActionButton {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

/* 36. FLOATING MUSIC AND PROFILE PANELS */

.floating-panel {
  position: fixed;
  z-index: 250;
  top: 85px;
  right: max(20px, calc((100% - 1080px) / 2));
  width: min(320px, calc(100vw - 30px));
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-strong);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-7px);
  transition:
    opacity var(--transition),
    visibility var(--transition),
    transform var(--transition);
}

.floating-panel.show,
.floating-panel.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-heading h3 {
  margin: 0;
  font-size: 14px;
}

.floating-panel > p {
  color: var(--text-soft);
  font-size: 12px;
}

.panel-action {
  width: 100%;
  min-height: 40px;
  display: block;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  text-align: left;
  font-size: 12px;
  font-weight: 700;
}

.panel-action:hover {
  background: var(--primary-light);
}

/* 37. RULES REMINDER TOAST */

.rules-toast {
  position: fixed;
  z-index: 600;
  left: 50%;
  bottom: 25px;
  width: min(390px, calc(100% - 30px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--glass-strong);
  box-shadow: var(--shadow-strong);
  transform: translate(-50%, 15px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.rules-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.toast-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 17px;
}

.rules-toast strong {
  display: block;
  font-size: 11px;
}

.rules-toast p {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 10px;
}

/* 38. GENERAL APP NOTIFICATION */

.app-notification {
  position: fixed;
  z-index: 700;
  top: 88px;
  left: 50%;
  max-width: calc(100% - 30px);
  padding: 11px 17px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-strong);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition:
    opacity var(--transition),
    visibility var(--transition),
    transform var(--transition);
  font-size: 12px;
  font-weight: 600;
}

.app-notification.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* 39. WELCOME INTRO ANIMATION */

.welcome-intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(247, 245, 255, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

.welcome-intro.is-hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-intro-content {
  width: min(100%, 370px);
  padding: 38px 25px;
  text-align: center;
  border: 1px solid var(--glass-border);
  border-radius: 25px;
  background: var(--glass);
  box-shadow: var(--shadow-strong);
  animation: welcomeCardIn 0.75s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes welcomeCardIn {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.welcome-logo {
  width: 67px;
  height: 67px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: var(--on-primary);
  font-size: 33px;
  font-weight: 800;
  box-shadow: 0 9px 25px rgba(130, 98, 223, 0.27);
}

.welcome-intro h1 {
  margin: 0;
  color: var(--text);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.7px;
}

.welcome-intro p {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 12px;
}

.welcome-loading-line {
  width: 115px;
  height: 3px;
  margin: 23px auto 0;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface-soft);
}

.welcome-loading-line::after {
  content: "";
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  animation: loadingLine 1.5s ease-in-out infinite;
}

@keyframes loadingLine {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(240%);
  }
}

/* 40. FOOTER */

.app-footer {
  width: min(100% - 48px, 1080px);
  margin: auto auto 0;
  padding: 20px 0 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: 10px;
}

.app-footer p {
  margin: 0;
}

/* 41. COMMON BUTTON INTERACTIONS */

button {
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

button:active {
  transform: scale(0.98);
}

button:disabled:active {
  transform: none;
}

/* 42. RESPONSIVE — TABLETS */

@media (max-width: 900px) {
  .main-content {
    width: min(100% - 36px, 760px);
    padding-top: 27px;
  }

  .topbar {
    padding: 0 18px;
  }

  .dm-window {
    width: min(100%, 850px);
  }

  .dm-window-body {
    grid-template-columns: 275px minmax(0, 1fr);
  }
}

/* 43. RESPONSIVE — MOBILE */

@media (max-width: 600px) {
  body {
    font-size: 13px;
  }

  .topbar {
    height: 64px;
    padding: 0 12px;
  }

  .brand {
    font-size: 14px;
    gap: 7px;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 17px;
  }

  .brand-area,
  .top-actions {
    gap: 5px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
    font-size: 17px;
  }

  .main-content {
    width: calc(100% - 26px);
    padding: 20px 0 40px;
  }

  .welcome-section {
    padding: 26px 2px 30px;
  }

  .welcome-section h1 {
    font-size: 31px;
  }

  .welcome-subtitle {
    font-size: 13px;
  }

  .room-item {
    min-height: 82px;
    padding: 13px;
    gap: 12px;
    border-radius: 17px;
  }

  .room-icon {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-radius: 14px;
  }

  .room-info h3 {
    font-size: 13px;
  }

  .room-info p {
    font-size: 10px;
  }

  .section-heading h2 {
    font-size: 17px;
  }

  .app-footer {
    width: calc(100% - 26px);
    font-size: 9px;
  }

  #chat-view {
    height: calc(100dvh - 88px);
    min-height: 470px;
    border-radius: 17px;
  }

  .chat-header {
    min-height: 64px;
    padding: 10px;
  }

  .message-list {
    padding: 14px 11px;
  }

  .message-item,
  .chat-message {
    max-width: 88%;
  }

  .message-composer {
    margin: 8px 8px 0;
  }

  .chat-quick-actions {
    padding-left: 10px;
  }

  .page-heading h2 {
    font-size: 18px;
  }

  .dm-layout {
    grid-template-columns: 1fr;
  }

  .dm-sidebar {
    border-right: 0;
  }

  .dm-conversation {
    display: none;
  }

  .profile-cover {
    min-height: 145px;
  }

  .profile-avatar {
    width: 78px;
    height: 78px;
  }

  .staff-dashboard {
    grid-template-columns: 1fr;
  }

  .auth-container {
    padding: 21px;
  }

  .floating-panel {
    top: 72px;
    right: 10px;
  }

  .rules-toast {
    bottom: 15px;
  }

  .modal-panel {
    padding: 19px;
    border-radius: 17px;
  }
}

/* 44. RESPONSIVE — FLOATING DM ON MOBILE */

@media (max-width: 700px) {
  .dm-overlay {
    padding: 18px;
    align-items: center;
    justify-content: center;
  }

  .dm-window {
    width: min(90%, 430px);
    height: min(76dvh, 650px);
    max-height: calc(100dvh - 36px);
    min-height: 380px;
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    overflow: hidden;
  }

  .dm-window.maximized {
    width: min(96%, 600px);
    height: calc(100dvh - 36px);
    max-height: calc(100dvh - 36px);
    border-radius: 22px;
  }

  .dm-window.minimized {
    width: min(90%, 430px);
    height: 60px;
    min-height: 60px;
  }

  .dm-window-header {
    min-height: 60px;
    flex-basis: 60px;
    padding: 8px 12px;
    cursor: grab;
    touch-action: pan-y;
  }

  .dm-window-body {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    position: relative;
    overflow: hidden;
  }

  .dm-inbox {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    border-right: 0;
    transition: transform 0.25s ease;
  }

  .dm-chat {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }

  .dm-window-body.mobile-chat-open .dm-inbox {
    transform: translateX(-100%);
  }

  .dm-window-body.mobile-chat-open .dm-chat {
    transform: translateX(0);
  }

  .dm-mobile-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .dm-message-list {
    padding: 14px 12px;
  }

  .dm-message,
  .dm-message-item {
    max-width: 86%;
  }

  .dm-composer-area {
    padding: 8px;
  }
}

/* 45. SMALL MOBILE DEVICES */

@media (max-width: 380px) {
  .brand {
    font-size: 12px;
    letter-spacing: 0.6px;
  }

  .top-actions {
    gap: 1px;
  }

  .topbar {
    padding: 0 8px;
  }

  .icon-button {
    width: 33px;
    height: 33px;
  }

  .welcome-section h1 {
    font-size: 27px;
  }

  .room-item {
    gap: 9px;
    padding: 11px;
  }

  .room-info p {
    font-size: 9px;
  }

  .dm-window-controls {
    gap: 1px;
  }

  .dm-window-control {
    width: 28px;
    height: 30px;
  }

  .dm-window-heading {
    gap: 8px;
  }

  .dm-window-heading h2 {
    font-size: 12px;
  }
}

/* 46. ACCESSIBILITY AND REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   END OF TALKATIVE STYLESHEET
========================================================= */

/* DM unread count (matches the markup built in script.js) */
.conversation-unread {
  align-self: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: var(--danger);
  color: var(--on-primary);
  font-size: 11px;
  font-weight: 800;
}


/* THEME BACKGROUND PATTERN LAYER */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--pattern);
  background-size: 180px 180px;
}

#app {
  position: relative;
  z-index: 1;
}

.welcome-section h1::after {
  content: " " var(--theme-emoji);
  font-size: 0.6em;
  vertical-align: 0.15em;
}


/* DM WINDOW STATES (class names match script.js) */

.dm-window.dm-minimized {
  width: min(340px, 100%);
  height: 67px;
  min-height: 0;
  cursor: pointer;
}

.dm-window.dm-minimized .dm-window-body {
  display: none;
}

.dm-window.dm-maximized {
  width: 100%;
  max-width: 1200px;
  height: calc(100vh - 30px);
}

.dm-window.dm-maximized .dm-window-body {
  min-height: 0;
}

/* Docked: no blur, no dark backdrop, page behind stays usable */
.dm-overlay.active:has(.dm-minimized) {
  align-items: flex-end;
  justify-content: flex-end;
  padding: 18px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
}

.dm-overlay.active:has(.dm-minimized) .dm-window {
  pointer-events: auto;
}
