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

:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #222240;
  --bg-tertiary: #2a2a4a;
  --bg-hover: #333358;
  --accent: #c0c0c0;
  --accent-light: #d4d4d4;
  --accent-dark: #a0a0a0;
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6e6e88;
  --danger: #ff4757;
  --danger-hover: #ff6b7a;
  --success: #2ed573;
  --bubble-out: #2d2d50;
  --bubble-in: #242445;
  --border: rgba(192, 192, 192, 0.12);
  --shadow: rgba(0, 0, 0, 0.4);
  --online-color: #2ed573;
  --verified-color: #1d9bf0;
}

[data-theme="silver"] {
  --bg-primary: #1a1a2e;
  --bg-secondary: #222240;
  --bg-tertiary: #2a2a4a;
  --bg-hover: #333358;
  --accent: #c0c0c0;
  --accent-light: #d4d4d4;
  --accent-dark: #a0a0a0;
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6e6e88;
  --bubble-out: #2d2d50;
  --bubble-in: #242445;
  --border: rgba(192, 192, 192, 0.12);
}

[data-theme="midnight"] {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-hover: #30363d;
  --accent: #8b949e;
  --accent-light: #c9d1d9;
  --accent-dark: #6e7681;
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --bubble-out: #1f2937;
  --bubble-in: #161b22;
  --border: rgba(139, 148, 158, 0.12);
}

[data-theme="emerald"] {
  --bg-primary: #0f1a15;
  --bg-secondary: #152820;
  --bg-tertiary: #1d3a2e;
  --bg-hover: #264a3a;
  --accent: #50c878;
  --accent-light: #70d890;
  --accent-dark: #38a05c;
  --text-primary: #e0f0e8;
  --text-secondary: #88b8a0;
  --text-muted: #507868;
  --bubble-out: #1a3828;
  --bubble-in: #152820;
  --border: rgba(80, 200, 120, 0.12);
}

[data-theme="rose"] {
  --bg-primary: #1a0f18;
  --bg-secondary: #281520;
  --bg-tertiary: #3a1d30;
  --bg-hover: #4a2840;
  --accent: #e8668a;
  --accent-light: #f088a0;
  --accent-dark: #c84870;
  --text-primary: #f0e0e8;
  --text-secondary: #b888a0;
  --text-muted: #785068;
  --bubble-out: #381a2a;
  --bubble-in: #281520;
  --border: rgba(232, 102, 138, 0.12);
}

[data-theme="ocean"] {
  --bg-primary: #0a1628;
  --bg-secondary: #0f1f3d;
  --bg-tertiary: #162a4a;
  --bg-hover: #1a3358;
  --accent: #4a9eff;
  --accent-light: #6bb3ff;
  --accent-dark: #2d7ad4;
  --text-primary: #e8edf5;
  --text-secondary: #8899b5;
  --text-muted: #556b8a;
  --bubble-out: #1a3a6a;
  --bubble-in: #162a4a;
  --border: rgba(74, 158, 255, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  user-select: none;
}

#app {
  height: 100vh;
  height: var(--tg-viewport-height, 100vh);
  position: relative;
  overflow: hidden;
  max-width: 100%;
}

/* Screens */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  pointer-events: none;
  background: var(--bg-primary);
  overflow: hidden;
}

.screen.active {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
}

.screen.slide-left {
  transform: translateX(-30%);
  opacity: 0.5;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  min-height: 56px;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  flex: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
  position: relative;
}

.header-user-info {
  cursor: pointer;
}

.header-username {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.header-status {
  font-size: 11px;
  color: var(--text-secondary);
  min-height: 16px;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.header-status.online {
  color: var(--online-color);
}

.header-status.typing {
  color: var(--accent);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:active {
  background: var(--bg-hover);
  transform: scale(0.92);
}

/* Avatar */
.avatar-small {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  border: 1.5px solid var(--accent);
}

.avatar-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Online indicator on avatar */
.avatar-wrapper {
  position: relative;
  display: inline-flex;
}

.online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: var(--online-color);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

.online-dot.offline {
  background: var(--text-muted);
}

/* Search */
.search-bar {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--bg-secondary);
  gap: 8px;
  border-bottom: 1px solid var(--border);
  animation: slideDown 0.2s ease;
}

.search-bar.hidden {
  display: none;
}

.search-bar input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input:focus {
  border-color: var(--accent);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-results {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  max-height: 300px;
  overflow-y: auto;
}

.search-results.hidden {
  display: none;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.search-result-item:active {
  background: var(--bg-hover);
}

.search-result-item .avatar-small {
  width: 40px;
  height: 40px;
}

.search-result-info {
  flex: 1;
}

.search-result-info .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.search-result-info .username {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Chat List */
.chat-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.chat-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.chat-item:active {
  background: var(--bg-hover);
}

.chat-item .avatar-small {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.chat-item-content {
  flex: 1;
  min-width: 0;
}

.chat-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.chat-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-item-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.chat-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-item-last {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.chat-item-status {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.chat-item-status.online {
  color: var(--online-color);
}

/* Unread Badge */
.unread-badge {
  background: var(--success);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.4;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state p {
  margin-top: 16px;
  font-size: 16px;
  color: var(--text-secondary);
}

.empty-state span {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Messages */
.messages {
  flex: 1 1 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  background: var(--bg-primary);
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  overscroll-behavior: contain;
}

.messages > .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  text-align: center;
}

.message-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  min-width: 0;
  overflow: hidden;
  margin-bottom: 4px;
}

.message-wrapper.msg-new {
  animation: fadeInUp 0.2s ease;
}

.message-wrapper.out {
  margin-left: auto;
  align-items: flex-end;
}

.message-wrapper.in {
  margin-right: auto;
  align-items: flex-start;
}

.message-sender {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  padding: 0 0 2px;
  letter-spacing: 0.2px;
}

.message-sender-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 3px;
}

.group-msg-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.group-msg-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
}

.message-bubble {
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  word-break: break-all;
  overflow-wrap: break-word;
  overflow: hidden;
  max-width: 100%;
  position: relative;
}

.message-wrapper.out .message-bubble {
  background: var(--bubble-out);
  border-bottom-right-radius: 4px;
  color: var(--text-primary);
}

.message-wrapper.in .message-bubble {
  background: var(--bubble-in);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  padding: 0 4px;
}

.message-time {
  font-size: 11px;
  color: var(--text-muted);
}

.message-status {
  display: flex;
  align-items: center;
}

.message-status svg {
  color: var(--text-muted);
}

.message-status.read svg {
  color: var(--accent);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 16px 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.typing-indicator.hidden {
  display: none;
}

.typing-dots {
  display: flex;
  gap: 3px;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: typingBounce 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Input Area */
.input-area {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.input-area input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.input-area input:focus {
  border-color: var(--accent);
}

.input-area input::placeholder {
  color: var(--text-muted);
}

.send-btn {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--bg-primary);
  transition: all 0.2s;
  flex-shrink: 0;
}

.send-btn:active {
  transform: scale(0.9);
  background: var(--accent-dark);
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  min-width: 220px;
  box-shadow: 0 8px 32px var(--shadow);
  z-index: 100;
  animation: fadeIn 0.15s ease;
}

.dropdown-menu.hidden {
  display: none;
}

.dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.dropdown-menu button:active {
  background: var(--bg-hover);
}

.dropdown-menu button:last-child {
  color: var(--danger);
}

.dropdown-menu button:last-child svg {
  stroke: var(--danger);
}

/* Profile */
.profile-content {
  flex: 1;
  overflow-y: auto;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-avatar-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
  border: 1.5px solid var(--accent);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--bg-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}

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

.profile-username-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.profile-username {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

.profile-id {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.profile-field {
  width: 100%;
  max-width: 340px;
  margin-bottom: 24px;
}

.profile-field label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  padding-left: 4px;
}

.field-row {
  display: flex;
  gap: 8px;
}

.field-row input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.field-row input:focus {
  border-color: var(--accent);
}

.field-row input::placeholder {
  color: var(--text-muted);
}

.save-btn {
  background: var(--accent);
  border: none;
  border-radius: 12px;
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--bg-primary);
  transition: all 0.2s;
}

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

.profile-menu {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s;
}

.menu-item:active {
  background: var(--bg-hover);
  transform: scale(0.98);
}

.menu-item span {
  flex: 1;
}

.menu-item svg:first-child {
  color: var(--accent);
}

.menu-item svg:last-child {
  color: var(--text-muted);
}

/* Blocked List */
.blocked-list {
  flex: 1;
  overflow-y: auto;
}

.blocked-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.blocked-item .avatar-small {
  width: 44px;
  height: 44px;
}

.blocked-item-info {
  flex: 1;
}

.blocked-item-info .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.blocked-item-info .username {
  font-size: 12px;
  color: var(--text-secondary);
}

.unblock-btn {
  background: none;
  border: 1px solid var(--danger);
  border-radius: 8px;
  color: var(--danger);
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.unblock-btn:active {
  background: var(--danger);
  color: white;
}

/* About */
.about-content {
  flex: 1;
  overflow-y: auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.about-logo {
  margin-bottom: 16px;
  animation: pulse 3s infinite;
}

.about-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.version {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.about-text p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.about-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: left;
}

.feature span {
  font-size: 13px;
  color: var(--text-primary);
}

/* FAQ Section */
.faq-section {
  width: 100%;
  max-width: 320px;
  margin-top: 24px;
}

.faq-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.faq-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: background 0.15s;
}

.faq-question:active {
  background: var(--bg-hover);
}

.faq-question svg {
  transition: transform 0.2s;
  flex-shrink: 0;
  color: var(--text-muted);
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 0 16px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Support Card */
.support-card {
  width: 100%;
  max-width: 320px;
  margin-top: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.support-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
  border: 1.5px solid var(--accent);
}

.support-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.support-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Verified Badge - Support (bright blue, smaller) */
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #1d9bf0;
  border-radius: 50%;
  flex-shrink: 0;
}

.verified-badge svg {
  width: 10px;
  height: 10px;
  color: #fff;
}

.verified-badge.support-verified {
  width: 14px;
  height: 14px;
  background: #1d9bf0;
}

.verified-badge.support-verified svg {
  width: 9px;
  height: 9px;
}

/* Small verified badge for chat lists */
.verified-badge-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: #1d9bf0;
  border-radius: 50%;
  flex-shrink: 0;
  vertical-align: middle;
  margin-left: 2px;
}

.verified-badge-small svg {
  width: 9px;
  height: 9px;
  color: #fff;
}

.support-role {
  font-size: 12px;
  color: var(--accent);
  background: rgba(192, 192, 192, 0.1);
  padding: 3px 10px;
  border-radius: 10px;
}

.support-btn {
  margin-top: 8px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  padding: 10px 24px;
  color: var(--bg-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.support-btn:active {
  transform: scale(0.95);
  background: var(--accent-dark);
}

/* Settings */
.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 4px 8px;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.settings-item:active {
  background: var(--bg-hover);
  transform: scale(0.98);
}

.settings-item.active {
  border-color: var(--accent);
}

.settings-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.settings-item-text {
  flex: 1;
}

.settings-item-text .title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.settings-item-text .subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.settings-item-arrow {
  color: var(--text-muted);
}

/* Color Theme Picker */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.theme-option:active {
  transform: scale(0.95);
}

.theme-option.active {
  border-color: var(--accent);
}

.theme-preview {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1);
}

.theme-option .name {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Groups */
.group-create-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.group-create-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.group-create-card p {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
}

.group-create-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  color: var(--bg-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.group-create-btn:active {
  transform: scale(0.95);
  background: var(--accent-dark);
}

.group-name-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  text-align: center;
  transition: border-color 0.2s;
}

.group-name-input:focus {
  border-color: var(--accent);
}

.group-name-input::placeholder {
  color: var(--text-muted);
}

.group-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.group-item:active {
  background: var(--bg-hover);
}

.group-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  flex-shrink: 0;
  overflow: hidden;
}

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

.group-info .name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.group-info .members {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px 24px;
  width: 85%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: scaleIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
  border: 1.5px solid var(--accent);
  margin-bottom: 12px;
}

.modal-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-username {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-name {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.modal-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.modal-id {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.block-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid var(--danger);
  border-radius: 12px;
  color: var(--danger);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.block-btn:active {
  background: var(--danger);
  color: white;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 16px;
  transition: color 0.2s;
}

.modal-close:active {
  color: var(--text-primary);
}

/* Payment Modal */
.payment-modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px 24px;
  width: 90%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: scaleIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 85vh;
  overflow-y: auto;
}

.payment-modal-content h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.premium-modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.premium-icon {
  margin-bottom: 8px;
}

/* Premium Status */
.premium-status {
  background: rgba(46, 213, 115, 0.1);
  border: 1px solid var(--success);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  width: 100%;
}

.premium-status .vip-badge-large {
  display: inline-block;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  font-size: 14px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.premium-status div {
  font-size: 13px;
  color: var(--success);
  font-weight: 600;
}

.premium-expires-text {
  font-size: 11px !important;
  color: var(--text-secondary) !important;
  font-weight: 400 !important;
  margin-top: 4px;
}

/* Premium Plans */
.premium-plans {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 16px;
}

.premium-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.premium-plan:active {
  transform: scale(0.98);
  border-color: var(--accent);
}

.premium-plan.featured {
  border-color: #FFD700;
  background: rgba(255, 215, 0, 0.05);
}

.plan-badge {
  position: absolute;
  top: -8px;
  right: 12px;
  background: #FFD700;
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}

.plan-duration {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.plan-price {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 700;
  color: #FFD700;
}

.plan-price svg {
  color: #FFD700;
  stroke: #FFD700;
}

/* VIP Badges */
.vip-badge-small {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  vertical-align: middle;
  margin-left: 3px;
}

.vip-badge-profile {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 1px;
}

/* Copyable text */
.copyable {
  cursor: pointer;
  user-select: text;
  -webkit-user-select: text;
}

.copyable:active {
  opacity: 0.7;
}

/* Chat Wallpaper */
.messages.wallpaper-1 {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.messages.wallpaper-2 {
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03' fill-rule='evenodd'%3E%3Ccircle cx='20' cy='20' r='3'/%3E%3Ccircle cx='0' cy='0' r='3'/%3E%3Ccircle cx='40' cy='40' r='3'/%3E%3Ccircle cx='40' cy='0' r='3'/%3E%3Ccircle cx='0' cy='40' r='3'/%3E%3C/g%3E%3C/svg%3E");
}
.messages.wallpaper-3 {
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.03' stroke-width='1'%3E%3Cpath d='M0 20h80M0 40h80M0 60h80M20 0v80M40 0v80M60 0v80'/%3E%3C/g%3E%3C/svg%3E");
}
.messages.wallpaper-4 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M12 0L24 12L12 24L0 12zM36 0L48 12L36 24L24 12zM12 24L24 36L12 48L0 36zM36 24L48 36L36 48L24 36z'/%3E%3C/g%3E%3C/svg%3E");
}
.messages.wallpaper-5 {
  background-image: url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.messages.wallpaper-6 {
  background: linear-gradient(180deg, rgba(30,30,60,1) 0%, rgba(20,20,50,1) 100%);
}
.messages.wallpaper-7 {
  background: linear-gradient(135deg, rgba(15,25,40,1) 0%, rgba(25,40,60,1) 50%, rgba(15,25,40,1) 100%);
}
.messages.wallpaper-8 {
  background: linear-gradient(180deg, rgba(20,30,20,1) 0%, rgba(15,25,15,1) 100%);
}

/* Wallpaper Settings */
.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.wallpaper-option {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
  position: relative;
}

.wallpaper-option:active {
  transform: scale(0.95);
}

.wallpaper-option.active {
  border-color: var(--accent);
}

.wallpaper-option .wp-preview {
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
}

.wallpaper-option .wp-label {
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 8px;
  color: var(--text-muted);
}

/* Custom wallpaper */
.wallpaper-custom {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Unblock bar in chat */
.chat-blocked-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-unblock-btn {
  background: none;
  border: 1px solid var(--danger);
  border-radius: 10px;
  color: var(--danger);
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-unblock-btn:active {
  background: var(--danger);
  color: white;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-primary);
  z-index: 300;
  animation: fadeInUp 0.2s ease;
  box-shadow: 0 4px 16px var(--shadow);
}

.toast.error {
  border-color: var(--danger);
  color: var(--danger);
}

/* Language flag icon - removed, flags no longer used */

/* Bottom nav for tabs */
/* Compact header for main screen */
.header-compact {
  min-height: 44px;
  padding: 8px 16px;
}

/* Tiny avatar for bottom nav */
.avatar-tiny {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-tiny img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.bottom-nav {
  display: flex;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  transition: color 0.2s;
}

.bottom-nav-item.active {
  color: var(--accent);
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
}

/* ==================== Group Profile ==================== */
#screen-group-profile {
  overflow-y: auto;
}

.group-profile-scroll {
  flex: 1;
  overflow-y: auto;
}

#screen-group-profile .profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  gap: 6px;
}

#screen-group-profile .profile-avatar-wrapper {
  position: relative;
  margin-bottom: 8px;
}

#screen-group-profile .avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  border: 2px solid var(--accent);
  overflow: hidden;
}

#screen-group-profile .avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#screen-group-profile .avatar-upload-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profile-name-display {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Group member list */
.group-members-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.group-member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-radius: 10px;
}

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

.group-member-info .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-member-info .username {
  font-size: 12px;
  color: var(--text-muted);
}

.group-owner-badge {
  font-size: 10px;
  background: var(--accent);
  color: var(--bg-primary);
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
}

.group-remove-btn {
  background: none;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Invite member button */
.invite-member-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 32px);
  margin: 0 16px 8px;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border: 1px dashed var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.invite-member-btn:active {
  background: var(--bg-hover);
  transform: scale(0.98);
}

/* Group profile screen header */
#screen-group-profile .screen-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#screen-group-profile .screen-header .back-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
}

#screen-group-profile .screen-header .header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

#screen-group-profile .settings-section {
  padding: 12px 0;
}

#screen-group-profile .settings-section-title {
  font-size: 13px;
  color: var(--accent);
  padding: 0 16px 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#screen-group-profile .profile-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

#screen-group-profile .profile-input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

#screen-group-profile .save-btn {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* Danger button (leave group) */
.danger-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 32px);
  margin: 0 16px;
  padding: 12px 16px;
  background: none;
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
}

.danger-btn:active {
  background: rgba(255, 71, 87, 0.1);
}

/* ==================== Invite Modal ==================== */
.invite-modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 16px;
  width: 90%;
  max-width: 360px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  text-align: center;
  animation: scaleIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.invite-modal-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.invite-search-bar {
  margin-bottom: 12px;
}

.invite-search-bar input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.invite-search-bar input:focus {
  border-color: var(--accent);
}

.invite-search-bar input::placeholder {
  color: var(--text-muted);
}

.invite-search-results {
  flex: 1;
  overflow-y: auto;
  max-height: 300px;
  margin-bottom: 12px;
}

.invite-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.invite-user-item:active {
  background: var(--bg-hover);
}

.invite-user-info {
  flex: 1;
  text-align: left;
}

.invite-user-info .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.invite-user-info .username {
  font-size: 12px;
  color: var(--text-muted);
}

.invite-send-btn {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.empty-invite-state {
  padding: 30px 20px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ==================== Invitations Screen ==================== */
.invitations-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.invitation-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 8px;
}

.invitation-text {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.invitation-actions {
  display: flex;
  gap: 8px;
}

.inv-accept-btn {
  flex: 1;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.inv-decline-btn {
  flex: 1;
  background: none;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.inv-decline-btn:active {
  background: rgba(255, 71, 87, 0.1);
  transform: scale(0.97);
}

/* Invitation badge */
.invitation-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Auth error screen */
.auth-error-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  padding: 40px;
  gap: 16px;
}

.auth-error-screen h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-error-screen p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Toggle switch */
.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
}

.toggle-label input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background: var(--bg-tertiary);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-muted);
  top: 2px;
  left: 2px;
  transition: transform 0.2s, background 0.2s;
}

.toggle-label input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-label input:checked + .toggle-slider::after {
  transform: translateX(20px);
  background: var(--bg-primary);
}

/* Sticker Shop */
.shop-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.sticker-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.sticker-card:active {
  transform: scale(0.96);
  border-color: var(--accent);
}

/* Reply Bar */
.reply-bar {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  gap: 8px;
}

.reply-bar-content {
  flex: 1;
  min-width: 0;
}

.reply-bar-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.reply-bar-text {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-bar-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Message Reply Preview */
.message-reply-preview {
  background: rgba(255,255,255,0.06);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  padding: 4px 8px;
  margin-bottom: 4px;
  cursor: pointer;
  max-width: 100%;
}

.message-reply-preview .reply-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

.message-reply-preview .reply-text {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Photo Message */
.message-photo {
  max-width: 240px;
  max-height: 320px;
  border-radius: 12px;
  cursor: pointer;
  object-fit: cover;
  display: block;
  border: none !important;
  outline: none;
  box-shadow: none;
}

.message-wrapper .message-bubble:has(.message-photo) {
  padding: 4px;
  border: none !important;
  background: transparent !important;
  box-shadow: none;
}

.photo-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.photo-fullscreen img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 8px;
}

.photo-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Photo Button */
.photo-btn {
  color: var(--text-muted);
  flex-shrink: 0;
}

.photo-btn:active {
  color: var(--accent);
}

/* Chat Context Menu (Long Press) */
.chat-context-menu {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  min-width: 200px;
  animation: fadeInUp 0.15s ease;
}

.chat-context-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}

.chat-context-menu button:active {
  background: var(--bg-hover);
}

.chat-context-menu button:first-child svg {
  color: var(--danger);
}

.chat-context-menu button:last-child svg {
  color: var(--danger);
}

/* NFT Badge */
.nft-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  color: var(--bg-primary);
  letter-spacing: 0.5px;
}

/* ==================== Report/Complaint System ==================== */
.report-btn-modal {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  background: rgba(231, 76, 60, 0.1);
  border: 1.5px solid rgba(231, 76, 60, 0.3);
  border-radius: 12px;
  color: #e74c3c;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.report-btn-modal:active {
  transform: scale(0.97);
  background: rgba(231, 76, 60, 0.2);
}

.report-btn-modal svg {
  stroke: #e74c3c;
}

.report-modal-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 24px 20px 20px;
  width: 92%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  z-index: 1001;
  animation: fadeInUp 0.25s ease;
}

.report-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.report-modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.report-user-info {
  margin-bottom: 16px;
}

.report-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.report-user-card .avatar-small {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.report-field {
  margin-bottom: 16px;
}

.report-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.report-cat-btn:active {
  transform: scale(0.95);
}

.report-cat-btn.selected {
  background: rgba(231, 76, 60, 0.15);
  border-color: #e74c3c;
  color: #e74c3c;
}

.report-cat-btn.selected svg {
  stroke: #e74c3c;
}

.report-field textarea {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  max-height: 200px;
  outline: none;
  transition: border-color 0.2s;
}

.report-field textarea:focus {
  border-color: var(--accent);
}

.report-field textarea::placeholder {
  color: var(--text-muted);
}

.report-char-count {
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  padding-right: 4px;
}

.report-submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  background: #e74c3c;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}

.report-submit-btn:active:not(:disabled) {
  transform: scale(0.97);
  background: #c0392b;
}

.report-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.report-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.report-note svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--text-muted);
}

/* Report Success Modal */
.report-success-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 30px 24px 24px;
  width: 88%;
  max-width: 380px;
  text-align: center;
  position: relative;
  z-index: 1001;
  animation: fadeInUp 0.25s ease;
}

.report-success-content h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 12px;
  margin-bottom: 8px;
}

.report-success-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.report-tip {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  background: var(--bg-tertiary);
  padding: 10px 14px;
  border-radius: 10px;
}

.ai-result-card {
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  text-align: left;
}

.ai-score-bar {
  margin-bottom: 8px;
}

.ai-score-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.ai-score-track {
  width: 100%;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}

.ai-score-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.ai-recommendation {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 6px;
}

.support-btn {
  width: 100%;
  padding: 12px 20px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: var(--bg-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.support-btn:active {
  transform: scale(0.97);
  background: var(--accent-dark);
}

/* Banned Account Modal */
.banned-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 40px 30px;
  width: 88%;
  max-width: 380px;
  text-align: center;
  position: relative;
  z-index: 1001;
  animation: fadeInUp 0.25s ease;
}

.banned-content h3 {
  font-size: 22px;
  font-weight: 700;
  color: #e74c3c;
  margin-top: 16px;
  margin-bottom: 8px;
}

.banned-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==================== Confirmation Dialog ==================== */
.confirm-dialog-content {
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 32px 24px 24px;
  width: 88%;
  max-width: 360px;
  text-align: center;
  position: relative;
  z-index: 1001;
  animation: fadeInUp 0.2s ease;
}

.confirm-dialog-icon {
  margin-bottom: 16px;
}

.confirm-dialog-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.confirm-dialog-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.confirm-dialog-buttons {
  display: flex;
  gap: 12px;
}

.confirm-dialog-cancel {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-dialog-cancel:active {
  background: var(--bg-hover);
}

.confirm-dialog-ok {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-dialog-ok.danger {
  background: #e74c3c;
  color: white;
}

.confirm-dialog-ok.success {
  background: #27ae60;
  color: white;
}

.confirm-dialog-ok:active {
  opacity: 0.8;
  transform: scale(0.98);
}

/* ==================== Consent Modal (RF Law 152-FZ) ==================== */
.consent-modal-content {
  background: var(--bg-secondary);
  border-radius: 24px;
  padding: 32px 24px 28px;
  width: 92%;
  max-width: 400px;
  position: relative;
  z-index: 1001;
  animation: fadeInUp 0.3s ease;
}

.consent-header {
  text-align: center;
  margin-bottom: 24px;
}

.consent-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 12px 0 6px;
  letter-spacing: 1px;
}

.consent-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.consent-age-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(243, 156, 18, 0.1);
  border: 1px solid rgba(243, 156, 18, 0.25);
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #f39c12;
  font-weight: 500;
}

.consent-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.consent-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.consent-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-top: 1px;
  accent-color: var(--accent);
  cursor: pointer;
}

.consent-checkbox a {
  color: var(--accent);
  text-decoration: underline;
}

.consent-checkbox a:active {
  opacity: 0.7;
}

.consent-accept-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.consent-accept-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.consent-accept-btn:not(:disabled):active {
  opacity: 0.85;
  transform: scale(0.98);
}

/* ==================== Legal Document Modal ==================== */
.legal-doc-content {
  background: var(--bg-secondary);
  border-radius: 20px;
  width: 94%;
  max-width: 440px;
  max-height: 80vh;
  position: relative;
  z-index: 1001;
  animation: fadeInUp 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.legal-doc-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  margin-right: 12px;
}

.legal-doc-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-hover);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.legal-doc-close:active {
  opacity: 0.7;
}

.legal-doc-body {
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.65;
}

.legal-doc-body h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--accent);
}

.legal-doc-body h5 {
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 8px;
  color: var(--text-primary);
}

.legal-doc-body p {
  margin-bottom: 10px;
}

.legal-doc-body ul {
  margin: 8px 0 12px 20px;
}

.legal-doc-body li {
  margin-bottom: 4px;
}

.legal-doc-body strong {
  color: var(--accent);
}

/* ==================== Legal Links in About Section ==================== */
.legal-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.legal-link-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
}

.legal-link-btn:active {
  background: var(--bg-hover);
}

.legal-link-btn svg {
  color: var(--accent);
  stroke: var(--accent);
  flex-shrink: 0;
}

.operator-info {
  padding: 10px 14px;
  background: rgba(192, 192, 192, 0.06);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.operator-info p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==================== Report Block Option ==================== */
.report-block-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin: 8px 0 16px;
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.2);
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  color: #e74c3c;
  font-weight: 500;
}

.report-block-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #e74c3c;
  cursor: pointer;
}

/* ==================== Settings Data & Privacy Section ==================== */
.settings-item.danger-item:active {
  background: rgba(231, 76, 60, 0.1);
}

.settings-item.danger-item .title {
  color: #e74c3c;
}

/* ==================== Referral Section ==================== */
.referral-section {
  margin: 0 16px 8px;
}

.referral-card {
  background: rgba(var(--accent-rgb, 108, 92, 231), 0.08);
  border: 1px solid rgba(var(--accent-rgb, 108, 92, 231), 0.2);
  border-radius: 14px;
  padding: 16px;
}

.referral-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.referral-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.referral-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.referral-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.referral-count-text {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.referral-done-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
}

.referral-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.referral-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.referral-link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.referral-link-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text);
  outline: none;
}

.referral-copy-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.referral-share-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.referral-share-btn:active {
  background: rgba(255,255,255,0.12);
}

/* ==================== Ad Banners ==================== */
.ad-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin: 2px 0;
  background: rgba(var(--accent-rgb, 108, 92, 231), 0.04);
  border-top: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  position: relative;
}

.ad-banner:active {
  background: rgba(var(--accent-rgb, 108, 92, 231), 0.1);
}

.ad-banner-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--accent-rgb, 108, 92, 231), 0.1);
  border-radius: 50%;
  flex-shrink: 0;
}

.ad-banner-content {
  flex: 1;
  min-width: 0;
}

.ad-banner-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.ad-banner-desc {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-banner-label {
  font-size: 10px;
  color: var(--text-secondary);
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* ==================== Chat Roulette ==================== */
.roulette-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  min-height: calc(100vh - 60px);
}

.roulette-icon {
  font-size: 80px;
  margin-bottom: 16px;
  animation: roulette-bounce 2s ease-in-out infinite;
}

@keyframes roulette-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.roulette-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.roulette-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 32px;
  max-width: 280px;
}

.roulette-status {
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 24px;
  padding: 12px 20px;
  background: var(--accent-alpha, rgba(106, 17, 203, 0.1));
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.roulette-status .spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.roulette-start-btn {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: #fff;
  border: none;
  padding: 14px 40px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(238, 90, 36, 0.3);
}

.roulette-start-btn:active {
  transform: scale(0.96);
}

.roulette-cancel-btn {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 12px 32px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 12px;
  transition: transform 0.2s;
}

.roulette-cancel-btn:active {
  transform: scale(0.96);
}

/* Referral Section */
.referral-section {
  padding: 0 16px;
}

.referral-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 8px;
}

.referral-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.referral-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.referral-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.referral-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
}

.referral-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.referral-progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.referral-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.referral-link-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
}

.referral-copy-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.referral-copy-btn:active {
  transform: scale(0.95);
}

.referral-share-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s;
}

.referral-share-btn:active {
  transform: scale(0.96);
}

/* Profile VIP Buy Section */
.profile-vip-section {
  padding: 0 16px;
  margin-bottom: 8px;
}

.profile-vip-buy-btn {
  width: 100%;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #1a1a2e;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s;
}

.profile-vip-buy-btn:active {
  transform: scale(0.96);
}

.profile-vip-buy-btn svg {
  stroke: #1a1a2e;
}

/* ==================== Toggle Switch ==================== */
.toggle-switch {
  width: 44px;
  height: 24px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  flex-shrink: 0;
}
.toggle-switch.active {
  background: var(--accent);
}
.toggle-switch .toggle-slider {
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  border: none;
}
.toggle-switch.active .toggle-slider {
  transform: translateX(20px);
}

.toggle-switch .toggle-slider::after {
  display: none;
}

/* ==================== Color Picker ==================== */
.color-wheel-container {
  padding: 8px 0;
}
.color-hue-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  border-radius: 12px;
  background: linear-gradient(to right,
    hsl(0,100%,50%),
    hsl(30,100%,50%),
    hsl(60,100%,50%),
    hsl(90,100%,50%),
    hsl(120,100%,50%),
    hsl(150,100%,50%),
    hsl(180,100%,50%),
    hsl(210,100%,50%),
    hsl(240,100%,50%),
    hsl(270,100%,50%),
    hsl(300,100%,50%),
    hsl(330,100%,50%),
    hsl(360,100%,50%)
  );
  outline: none;
  cursor: pointer;
}
.color-hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid rgba(0,0,0,0.3);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.color-hue-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid rgba(0,0,0,0.3);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.color-hue-preview {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  margin-top: 8px;
  transition: background 0.2s;
}

/* Custom theme */
[data-theme="custom"] {
  --accent: var(--custom-accent, #ff6b6b);
  --accent-light: var(--custom-accent-light, rgba(255,107,107,0.15));
}
