@font-face {
  font-family: 'PixelMplus12';
  src: url('ttf/PixelMplus12-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:root {
  --sidebar-bg: #121214;
  --sidebar-sub-bg: #121214;
  --chat-bg: #1a1a1e;
  --member-bg: #242429;
  --header-height: 48px;
  --channel-sidebar-width: 240px;
  --primary: #5865f2;
  --primary-hover: #4752c4;
  --primary-dark: #3c45a5;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-link: #5865f2;
  --danger: #ef4444;
  --border: rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);

  --status-online: #22c55e;
  --status-idle: #f59e0b;
  --status-dnd: #ef4444;
  --status-offline: #80808a;
}

/* ── Custom Scrollbar ───────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #2b2b2f;
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a3e;
  background-clip: padding-box;
}

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #2b2b2f transparent;
}



/* ── Keyframes ───────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.93);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse-green {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.55;
  }
}

@keyframes settingsSlide {
  from {
    opacity: 0;
    transform: translateX(28px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Reset ───────────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif !important;
}

*:focus {
  outline: none !important;
}

::selection {
  background: rgba(88, 101, 242, 0.3);
  color: #fff;
}

body {
  font-family: 'Outfit', sans-serif;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--sidebar-bg);
  color: var(--text-main);
  animation: fadeIn 0.3s ease;
  user-select: none;
  font-size: 15px;
}

*:focus {
  outline: none !important;
}

.app-layout {
  display: flex;
  height: 100%;
  width: 100%;
}

/* ── Sidebars ────────────────────────────────────────── */
/* ── Sidebars ────────────────────────────────────────── */
.sidebar-dm {
  width: 240px;
  background-color: var(--sidebar-bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  user-select: none;
  animation: slideInLeft 0.3s ease;
}

.sidebar-channels {
  width: var(--channel-sidebar-width);
  background-color: var(--sidebar-sub-bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  user-select: none;
  animation: slideInLeft 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-dm .sidebar-header,
.sidebar-channels .sidebar-header {
  height: var(--header-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  font-size: 14px;
  color: #cacaca;
  letter-spacing: 0.01em;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.category-label {
  font-size: 11px;
  font-weight: 800;
  color: #64646b;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 8px;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin: 1px 8px;
  border-radius: 4px;
  cursor: pointer;
  color: #64646b;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
}

.unread-badge {
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 12px;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  z-index: 2;
}

.channel-item.has-mention .unread-badge {
  display: flex;
  align-items: center;
  justify-content: center;
}

.channel-item.unread:not(.has-mention)::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background-color: #fff;
  border-radius: 50%;
}

.channel-item.unread {
  color: var(--text-main);
}

.channel-item:hover {
  background-color: #35373c;
  color: #dbdee1;
}

.channel-item.active {
  background-color: #3f4248;
  color: #fff;
}

#ch-rules.active {
  background-color: #1a1a1e;
  color: #8a8a8f;
}

#ch-rules.active svg {
  opacity: 0.4 !important;
}

/* DM */

.dm-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  gap: 14px;
  color: #64646b;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.15s ease;
  margin: 2px 10px;
}

.dm-item:hover {
  background-color: #35373c;
  color: #dbdee1;
}

.dm-item.active {
  background-color: #3f4248;
  color: #fff;
}

.dm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: 800;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  flex-shrink: 0;
}

/* VC */
.vc-members {
  margin-left: 24px;
  margin-bottom: 6px;
  padding-left: 8px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vc-member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 4px;
  transition: background-color 0.15s ease;
}

.vc-member:hover {
  background-color: rgba(14, 165, 233, 0.1);
}

.vc-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--primary);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.vc-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

/* ── User Panel (Floating) ─────────────────────────── */
.user-panel-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 310px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: #1e1f22;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: slideInUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.modal-card.profile-view {
  animation: scaleIn 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  user-select: text;
}

[data-theme="dark"] .user-panel-container {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(56, 189, 248, 0.2);
}

/* Voice status */
.voice-status-panel {
  padding: 12px 16px;
  background: rgba(34, 197, 94, 0.08);
  border-bottom: 1px solid rgba(34, 197, 94, 0.1);
  display: none;
  animation: fadeIn 0.3s ease;
}

.voice-status-panel.active {
  display: block;
}

.vs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.vs-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vs-text-title {
  color: #16a34a;
  font-size: 13px;
  font-weight: 800;
  animation: pulse-green 2s ease-in-out infinite;
}

.vs-text-sub {
  color: #64748b;
  font-size: 11px;
}

.vs-actions-top {
  display: flex;
  gap: 4px;
}

.vs-btns-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.vs-grid-btn {
  height: 30px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(34, 197, 94, 0.12);
  border-radius: 7px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: #475569;
  transition: background 0.15s ease, transform 0.12s ease;
}

.vs-grid-btn:hover {
  background: white;
}

.user-panel {
  height: 52px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  user-select: none;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  padding: 4px 6px;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.user-info:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.username {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
  max-width: 100px;
}

/* Clean UI Font for Profile */
.profile-preview-card,
.profile-preview-card * {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.user-status-text {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-actions {
  display: flex;
  gap: 2px;
}

/* Icon button */
.icon-btn {
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  background: transparent;
  color: #b5bac1;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.1s ease;
}

.icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.icon-btn.toggle-active {
  color: var(--danger) !important;
  position: relative;
}

.icon-btn.toggle-active::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 2px;
  background: var(--danger);
  transform: rotate(-45deg);
  border-radius: 1px;
}

.icon-btn.disconnect {
  color: #64748b;
}

.icon-btn.disconnect:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* ── Chat ────────────────────────────────────────────── */
.chat-container {
  flex: 1;
  background-color: var(--chat-bg);
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.28s ease;
}

.chat-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.chat-header .channel-name {
  font-weight: 900;
  font-size: 18px;
  color: #ffffff;
  letter-spacing: 0.02em;
  transition: color 0.3s ease;
}

.chat-header .channel-name.rules-active {
  color: #94a3b8;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  user-select: text;
}

/* Message grouping and structure */
.message-group {
  display: flex;
  gap: 16px;
  position: relative;
  padding: 6px 24px; /* Reduced vertical padding */
  transition: background-color 0.12s ease;
  animation: slideInUp 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.message-group:hover {
  background-color: #1d1d1e;
}

.date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 20px 8px;
  position: relative;
}

.date-divider::before {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border);
}

.date-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border);
}

.date-divider span {
  padding: 0 16px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Grouped message */
.message-group.grouped {
  padding-top: 0;
  padding-bottom: 2px;
  margin-top: -3px;
}

.message-group.grouped .message-avatar {
  visibility: hidden;
  height: 0;
  width: 44px; /* Keep width to maintain alignment */
  flex-shrink: 0;
}

.message-group.grouped .message-header {
  display: none;
}

.message-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--primary);
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: 800;
  font-size: 20px;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.message-avatar:hover {
  filter: brightness(0.9);
}

.message-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-header strong {
  font-size: 16px;
  color: #fff;
  font-weight: 700;
}

.message-body {
  font-size: 16.5px;
  line-height: 1.6;
  color: #e3e5e8;
  user-select: text;
  word-break: break-word;
}

.mention-tag {
  background: rgba(88, 101, 242, 0.3);
  color: #c9cdfb;
  border-radius: 3px;
  padding: 0 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.1s, color 0.1s;
}

.mention-tag:hover {
  background: rgba(88, 101, 242, 1);
  color: #fff;
}

/* User is mentioned highlight */
.mention-tag.self-mention {
  background: rgba(250, 166, 26, 0.2);
  color: #faa61a;
}
.mention-tag.self-mention:hover {
  background: rgba(250, 166, 26, 0.8);
  color: #fff;
}

.message-group.mentioned {
  background: rgba(250, 166, 26, 0.1);
  border-left: 3px solid #faa61a;
  padding-left: 17px; /* Original padding 20px - 3px border */
}

.message-group.mentioned:hover {
  background: rgba(250, 166, 26, 0.15);
}

.message-body.emoji-only {
  font-size: 48px;
  line-height: 1.2;
  margin: 6px 0;
}

.message-body a {
  color: var(--text-link);
  text-decoration: none;
  font-weight: 500;
}

.inline-emoji {
  width: 32px;
  height: 32px;
  vertical-align: middle;
  object-fit: contain;
  margin: 0 1px;
}

.inline-emoji.jumbo {
  width: 48px;
  height: 48px;
  margin: 4px;
}

.message-actions {
  position: absolute;
  top: -16px;
  right: 20px;
  background: #2c2c30;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: none;
  box-shadow: var(--shadow-md);
  z-index: 5;
  padding: 2px;
  animation: scaleIn 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}

.message-group:hover .message-actions {
  display: flex;
  align-items: center;
}

.quick-reactions {
  display: flex;
  padding: 0 4px;
}

.action-separator {
  width: 1px;
  height: 16px;
  background-color: var(--border);
  margin: 0 4px;
}

.action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #64646b;
  border-radius: 4px;
  transition: all 0.12s ease;
}

.action-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #dbdee1;
}

.reactions-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  padding-bottom: 2px;
}

.reaction-badge {
  display: flex;
  align-items: center;
  background: rgba(43, 45, 49, 0.8);
  border: 1px solid transparent;
  padding: 0 10px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.1s;
  user-select: none;
}

.reaction-badge:hover {
  background: #3c3e44;
  border-color: #5d5f66;
}

.reaction-badge.active {
  background: rgba(88, 101, 242, 0.15);
  border-color: #5865f2;
}

.reaction-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 22px;
  margin-right: 6px;
}

.reaction-emoji img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.reaction-count {
  color: #b5bac1;
  font-weight: 700;
  font-size: 14px;
}

.reaction-badge.active .reaction-count {
  color: #5865f2;
}

.reaction-badge.add-reaction-trigger {
  padding: 0 10px;
  color: #b5bac1;
}

.reaction-badge.add-reaction-trigger:hover {
  color: #fff;
}


/* Reply preview above input */
.reply-preview-container {
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  animation: slideInDown 0.15s ease;
}

.reply-preview-text {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.reply-preview-text strong {
  color: var(--text-main);
  margin-right: 4px;
}

/* Reply chain styles */
.message-reply-chain {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  top: 8px;
  left: 60px;
  font-size: 13px;
  color: var(--text-muted);
  opacity: 0.8;
  white-space: nowrap;
  max-width: 80%;
}

.message-reply-chain::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 10px;
  width: 24px;
  height: 12px;
  border-left: 2px solid var(--border);
  border-top: 2px solid var(--border);
  border-top-left-radius: 6px;
}

.reply-avatar-mini {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-size: cover;
}

.reply-content-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.message-group.has-reply {
  padding-top: 32px;
}

/* ── Input ───────────────────────────────────────────── */
.chat-input-area {
  padding: 0 20px 20px;
  width: 100%;
  position: relative;
}

.input-wrapper {
  background-color: #2b2b2f;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  transition: all 0.2s ease;
}

.input-wrapper:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background-color: #323238;
}

.input-wrapper:focus-within {
  border-color: rgba(255, 255, 255, 0.3);
  background-color: #2f2f33;
}

.attach-btn:hover {
  background-color: #64646b;
  color: #fff;
}

.send-btn:hover {
  color: #cacaca;
  background-color: rgba(255, 255, 255, 0.05);
}

.input-wrapper input {
  flex: 1;
  height: 40px;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: var(--text-main);
}

.input-wrapper input::placeholder {
  color: #b5bac1;
  font-weight: 500;
}

.attach-btn {
  width: 28px;
  height: 28px;
  background-color: #4e5058;
  color: white;
  border-radius: 50%;
  border: none;
  font-size: 18px;
  line-height: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
  flex-shrink: 0;
}

.attach-btn:hover {
  background-color: #64646b;
  transform: rotate(90deg);
}

.send-btn {
  background: transparent;
  color: #94a3b8;
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.mention-tag {
  background: rgba(88, 101, 242, 0.1);
  color: #5865f2;
  font-weight: 600;
  padding: 0 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s;
}

.mention-tag:hover {
  background: #5865f2;
  color: #fff;
}

/* ── Mention Popover ── */
.mention-popover {
  position: absolute;
  bottom: 100%;
  left: 16px;
  right: 16px;
  background: #2b2d31;
  border-radius: 8px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.mention-popover.open {
  display: flex;
}

.mention-item {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.1s;
}

.mention-item:hover, .mention-item.selected {
  background: rgba(255, 255, 255, 0.05);
}

.mention-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
}

.mention-name {
  color: #dbdee1;
  font-size: 14px;
  font-weight: 500;
}

.mention-info {
  margin-left: auto;
  font-size: 11px;
  color: #94a3b8;
}
.emoji-picker-container {
  position: absolute;
  bottom: 80px;
  right: 20px;
  background: #2f3136;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  width: 440px;
  height: 480px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  animation: scaleIn 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.emoji-picker-container.open {
  display: flex;
}

.emoji-picker-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.emoji-search-box {
  background: #1e1f22;
  border-radius: 4px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.emoji-search-box input {
  background: transparent;
  border: none;
  color: #dbdee1;
  font-size: 14px;
  width: 100%;
  outline: none;
}

.emoji-picker-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.emoji-picker-sidebar {
  width: 48px;
  background: #232428;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 12px;
}

.emoji-sidebar-item {
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #b5bac1;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s;
}

.emoji-sidebar-item:hover, .emoji-sidebar-item.active {
  background: #35373c;
  color: #fff;
}

.emoji-scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px;
  position: relative;
}

.emoji-scroll-area::-webkit-scrollbar {
  width: 8px;
}

.emoji-scroll-area::-webkit-scrollbar-thumb {
  background: #1e1f22;
  border-radius: 4px;
}

.emoji-category-title {
  font-size: 12px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 12px;
  margin-top: 16px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  width: 100%;
}

.emoji-item {
  font-size: 36px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 6px;
  transition: background 0.1s, transform 0.1s;
}

.emoji-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.emoji-picker-footer {
  height: 48px;
  background: #232428;
  padding: 0 16px;
  display: flex;
  align-items: center;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
}

.emoji-preview-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

#emoji-preview-char {
  font-size: 28px;
}

#emoji-preview-name {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.emoji-trigger-btn {
  color: #b5bac1;
  transition: color 0.2s ease;
}

.emoji-trigger-btn:hover {
  color: #fff;
}

.emoji-trigger-btn--active {
  color: #ffcc4d;
}

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.18s ease;
}

.modal-card {
  background: #1e1e22;
  padding: 32px;
  border-radius: 20px;
  width: 360px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.modal-btn {
  padding: 11px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.modal-btn.primary {
  background: #cacaca;
  color: #121214;
}

.modal-btn.primary:hover {
  background: #fff;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* ── Settings ───────────────────────────────────────── */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: #111214;
  z-index: 5000;
  display: none;
  flex-direction: row;
}

.settings-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.settings-sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 56px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.settings-nav {
  width: 100%;
  max-width: 188px;
}

.settings-nav-section {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  margin-bottom: 2px;
  margin-top: 12px;
}

.settings-nav-item {
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 2px;
  transition: background 0.14s ease, color 0.14s ease, transform 0.12s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #dbdee1;
}

.settings-nav-item.active {
  background: #3f4248;
  color: #fff;
  border-left: 4px solid #fff;
}

.settings-content-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 56px 48px;
  position: relative;
}

.settings-page {
  display: none;
}

.settings-page.active {
  display: block;
  animation: settingsSlide 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.settings-section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(14, 165, 233, 0.07);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.settings-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-track {
  background: var(--primary);
}

.toggle-switch input:checked+.toggle-track::after {
  transform: translateX(20px);
}

/* Settings avatar card */
.settings-avatar-card {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.settings-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 28px;
  font-weight: 900;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
  flex-shrink: 0;
}

.settings-avatar-name {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-main);
}

.settings-avatar-tag {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.settings-input {
  background-color: #1e1f22;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: #dbdee1;
  font-size: 14px;
  user-select: text;
  transition: all 0.2s ease;
  outline: none;
}

.settings-input:focus {
  border-color: var(--primary);
  background-color: #000;
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.15);
}

.settings-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.modal-btn, .settings-save-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 24px;
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.modal-btn:hover, .settings-save-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.25);
}

.modal-btn:active, .settings-save-btn:active {
  background: var(--primary-dark);
  transform: translateY(0);
}

.modal-btn.secondary {
  background: #313338;
}

.modal-btn.secondary:hover {
  background: #4e5058;
  box-shadow: none;
}

.close-settings {
  position: fixed;
  right: 40px;
  top: 40px;
  text-align: center;
  cursor: pointer;
  z-index: 10;
}

.close-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 11px;
  transition: border-color 0.15s ease, color 0.15s ease,
    background 0.15s ease;
}

/* Settings modern styles */
.settings-group {
  margin-bottom: 32px;
}

.settings-group-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

#chat-input-field {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 15px;
  padding: 10px 0;
  outline: none;
  user-select: text;
}

.settings-card {
  background: #1a1a1e;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.avatar-edit-container {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.avatar-preview-big {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--primary);
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 32px;
  font-weight: 900;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease;
  box-shadow: var(--shadow-md);
}

.avatar-preview-big:hover {
  transform: scale(1.05);
}

.avatar-preview-big::after {
  content: "変更";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 50%;
}

.avatar-preview-big:hover::after {
  opacity: 1;
}

/* Profile Preview Card */
.profile-preview-card {
  background: var(--profile-bg, #111827);
  background-image: var(--profile-gradient, none);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-banner {
  height: 100px;
  background: var(--banner-bg, var(--primary));
  background-size: cover;
  background-position: center;
  position: relative;
  cursor: pointer;
}

.profile-banner::after {
  content: "バナーを変更";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.profile-banner:hover::after {
  opacity: 1;
}

.profile-header {
  padding: 0 16px 16px;
  position: relative;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  /* Improve readability on banner */
}

.profile-avatar-wrapper {
  margin-top: -45px;
  margin-bottom: 12px;
  padding: 6px;
  background: inherit;
  display: inline-block;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--primary);
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 32px;
  font-weight: 900;
  border: 6px solid #111827;
  /* Fallback */
  border-color: inherit;
  box-sizing: content-box;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.profile-avatar::after {
  content: "変更";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-transform: uppercase;
}

.profile-avatar:hover::after {
  opacity: 1;
}

.profile-body {
  background: rgba(0, 0, 0, 0.45);
  /* Darker for better contrast */
  margin: 0 12px 12px;
  border-radius: 8px;
  padding: 16px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Volume Slider Style ── */
input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: #4e5058;
  border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #fff;
  border: none;
  margin-top: -5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  transition: transform 0.1s ease;
}

input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.1);
}

.sidebar-scrollable::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

#dm-list {
  flex: 1;
  overflow-y: auto;
}

#dm-list::-webkit-scrollbar {
  width: 4px;
}

#dm-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.profile-name-area {
  margin-bottom: 12px;
}

.profile-display-name {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
}

.profile-tag {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin-top: 2px;
  font-weight: 600;
}

.profile-section-label {
  font-size: 12px;
  font-weight: 900;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
  letter-spacing: 0.05em;
}

.profile-bio-text {
  font-size: 14px;
  line-height: 1.6;
  color: #dbdee1;
  white-space: pre-wrap;
  user-select: text;
}

.profile-pronouns-tag {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  margin-top: 8px;
  display: inline-block;
  font-weight: 700;
  color: white;
}

/* Fix line-clamp warning */
.embed-description {
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.member-sidebar {
  width: 240px;
  background-color: var(--member-bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  padding: 16px 8px;
  user-select: none;
  animation: slideInLeft 0.32s cubic-bezier(0.22, 1, 0.36, 1) reverse;
}

.member-group-label {
  padding: 0 12px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.member-item {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
  gap: 12px;
  margin-bottom: 2px;
}

.member-item:hover {
  background-color: #1d1d1e;
}

.member-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  color: white;
  overflow: hidden;
}

.member-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.member-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Reduced Motion */
.reduced-motion *,
.reduced-motion {
  animation: none !important;
  transition: none !important;
}

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(14, 165, 233, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 165, 233, 0.35);
}

/* ── Login Page ── */
.login-body {
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at top right, #1e293b, #0f172a);
  overflow: hidden;
  position: relative;
}

.login-bg-shapes {
  position: absolute;
  inset: 0;
  z-index: 0;
  filter: blur(80px);
}

.login-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.4;
  animation: float-shape 20s infinite alternate;
}

.login-shape:nth-child(1) {
  width: 400px;
  height: 400px;
  background: #2b2d31;
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.login-shape:nth-child(2) {
  width: 300px;
  height: 300px;
  background: #323338;
  bottom: -50px;
  left: -50px;
  animation-delay: -5s;
}

@keyframes float-shape {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(50px, 50px) scale(1.1);
  }
}

/* ── Login Page (Theme Cohesion) ── */
.login-body {
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--sidebar-bg, #0f172a);
  overflow: hidden;
  position: relative;
  font-family: 'Outfit', sans-serif;
}

.login-card {
  width: 100%;
  max-width: 480px;
  background: #1a1a1e;
  padding: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  text-align: center;
  animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.login-form-group {
  text-align: left;
  margin-bottom: 24px;
}

.login-form-label {
  font-size: 12px;
  font-weight: 900;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
  letter-spacing: 0.05em;
}

.login-input {
  width: 100%;
  background: var(--sidebar-bg, #0f172a);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: 6px;
  color: var(--text-main);
  font-size: 16px;
  transition: border-color 0.2s;
  box-sizing: border-box;
  user-select: text;
}

.login-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.login-btn {
  width: 100%;
  background: #2b2d31;
  color: white;
  border: none;
  padding: 16px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 12px;
  transition: transform 0.2s, background 0.2s;
}

.login-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.login-btn:active {
  transform: translateY(0);
}

.login-footer {
  margin-top: 24px;
  font-size: 14px;
  color: #94a3b8;
}

.login-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.login-link:hover {
  text-decoration: underline;
}

/* Rich Media */
.file-attachment {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #2b2d31;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  width: fit-content;
  max-width: 300px;
  transition: background 0.2s;
  margin-top: 8px;
}

.file-attachment:hover {
  background: #35373c;
}

.file-attachment svg {
  color: #00a8fc;
  flex-shrink: 0;
}

.file-info {
  display: flex;
  flex-direction: column;
}

.file-name {
  font-weight: 700;
  font-size: 14px;
  color: #00a8fc;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.file-action {
  font-size: 11px;
  color: #b5bac1;
}

/* YouTube Preview Premium Style */
.youtube-preview {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 4px solid #f00;
  border-radius: 4px;
  padding: 12px;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yt-title {
  color: #38bdf8;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.yt-title:hover {
  text-decoration: underline;
}

.yt-thumb-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.yt-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.yt-thumb-container:hover .yt-thumb {
  opacity: 1;
}

.yt-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  pointer-events: none;
}

.yt-header-row {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.message-body a:hover {
  text-decoration: underline !important;
}

/* ── Image Viewer (Lightbox) ── */
.image-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
  animation: fadeIn 0.15s ease;
}

.image-viewer.open {
  display: flex;
}

.image-viewer img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 4px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  animation: scaleIn 0.2s cubic-bezier(0.2, 0, 0.2, 1);
  cursor: default;
}

.viewer-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
  cursor: pointer;
  transition: background 0.2s;
}

.viewer-close:hover {
  background: rgba(255, 255, 255, 0.2);
}