/* spoko-strona Pure Matte Dark Theme */
:root {
  --bg-app: #0e1117;
  --bg-sidebar: #131720;
  --bg-surface: #171c26;
  --bg-surface-raised: #1f2533;
  --bg-input: #12151d;
  
  --border-subtle: #242b3b;
  --border-strong: #30394e;
  
  --text-primary: #f0f3f8;
  --text-secondary: #9aa5b8;
  --text-muted: #5e697e;
  
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.12);
  
  --gold: #f59e0b;
  --gold-soft: rgba(245, 158, 11, 0.15);
  
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.12);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --warning: #f59e0b;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ================= AUTH GATE ================= */
.auth-gate-screen {
  position: fixed;
  inset: 0;
  background-color: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.auth-gate-card {
  width: 100%;
  max-width: 400px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.auth-gate-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-gate-logo {
  width: 48px;
  height: 48px;
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 12px;
}

.auth-gate-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.auth-gate-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.auth-gate-tabs {
  display: flex;
  background-color: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 20px;
  border: 1px solid var(--border-subtle);
}

.gate-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.gate-tab.active {
  background-color: var(--bg-surface-raised);
  color: var(--text-primary);
}

.auth-gate-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  height: 40px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

.form-input:focus {
  border-color: var(--accent);
}

.form-error {
  background-color: var(--danger-soft);
  border: 1px solid var(--danger);
  color: #fca5a5;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* ================= APP LAYOUT ================= */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header */
.app-header {
  height: 56px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  background-color: var(--bg-surface-raised);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  border: 1px solid var(--border-strong);
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-badge {
  font-size: 11px;
  background-color: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.nav-tabs {
  display: flex;
  background-color: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-tab.active {
  background-color: var(--bg-surface-raised);
  color: var(--text-primary);
}

.files-count-badge {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s;
}

.user-profile:hover {
  background-color: var(--bg-surface-raised);
}

.user-avatar-wrap {
  position: relative;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background-color: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
}

.avatar-badge-edit {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface);
  opacity: 0.85;
  transition: opacity 0.15s, transform 0.15s;
}

.user-profile:hover .avatar-badge-edit {
  opacity: 1;
  transform: scale(1.1);
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ================= WORKSPACE & SIDEBAR ================= */
.app-workspace {
  display: flex;
  flex: 1;
  height: calc(100vh - 56px);
  overflow: hidden;
  position: relative;
}

.app-sidebar {
  width: 240px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-section {
  padding: 16px;
}

.sidebar-section.users-section {
  flex: 1;
  border-top: 1px solid var(--border-subtle);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.8px;
}

.dm-tip-text {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-style: italic;
}

.online-pill {
  font-size: 11px;
  background-color: var(--success-soft);
  color: var(--success);
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.channels-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.channel-item:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

.channel-item.active {
  background-color: var(--bg-surface-raised);
  color: var(--text-primary);
  font-weight: 600;
}

.channel-hash {
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 700;
}

.channel-item.active .channel-hash {
  color: var(--accent);
}

/* Sidebar Users List */
.sidebar-users-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.users-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online {
  background-color: var(--success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.status-dot.offline {
  background-color: var(--text-muted);
}

.users-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.15s;
  cursor: pointer;
  position: relative;
}

.user-item:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

.user-item:hover::after {
  content: 'DM 💬';
  position: absolute;
  right: 8px;
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
}

.user-item.is-offline {
  opacity: 0.6;
}

.user-item-avatar {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background-color: var(--border-strong);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

.user-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 8px;
}

/* ================= MAIN VIEWS ================= */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-app);
  position: relative;
}

.view-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ================= CHAT ================= */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-header {
  height: 52px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  gap: 12px;
}

.chat-channel-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  min-width: 0;
}

.chat-channel-info .hash {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 18px;
}

.chat-channel-info .channel-name {
  font-weight: 600;
  color: var(--text-primary);
}

.chat-channel-info .channel-desc {
  color: var(--text-muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Search bar in chat header */
.chat-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  height: 30px;
}

.chat-search-wrap svg {
  color: var(--text-muted);
}

.chat-search-wrap input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  width: 140px;
  transition: width 0.2s ease;
}

.chat-search-wrap input:focus {
  width: 180px;
}

.btn-clear-search {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
}

.btn-clear-search:hover {
  color: var(--text-primary);
}

/* Search summary banner */
.chat-search-summary {
  padding: 6px 20px;
  background-color: var(--bg-surface-raised);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-loading {
  color: var(--text-muted);
  text-align: center;
  margin-top: 40px;
  font-size: 14px;
}

.message-card {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
  position: relative;
  border-left: 3px solid transparent;
}

.message-card:hover {
  background-color: var(--bg-surface-raised);
}

.message-card.highlighted {
  background-color: rgba(59, 130, 246, 0.15);
  transition: background-color 0.8s ease-out;
}

.message-card.is-pinned {
  border-left-color: var(--accent);
}

.message-card.has-mention {
  background-color: rgba(245, 158, 11, 0.08);
  border-left-color: var(--gold);
}

.message-card.has-mention:hover {
  background-color: rgba(245, 158, 11, 0.13);
}

.message-card.search-dimmed {
  opacity: 0.25;
}

.message-card.search-match {
  background-color: rgba(59, 130, 246, 0.1);
  opacity: 1;
}

.msg-pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.msg-edited-badge {
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 4px;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  flex-shrink: 0;
  overflow: hidden;
}

.msg-avatar img,
.user-item-avatar img,
.user-avatar img,
.dm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.msg-body {
  flex: 1;
  min-width: 0;
}

/* Reply quote header inside message */
.msg-reply-quote {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  padding-left: 8px;
  border-left: 2px solid var(--accent);
  cursor: pointer;
  transition: color 0.15s;
}

.msg-reply-quote:hover {
  color: var(--text-primary);
}

.msg-reply-quote strong {
  color: var(--text-secondary);
}

.msg-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.msg-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.msg-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.msg-text {
  font-size: 14px;
  color: #d1d5db;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.45;
}

.msg-text a {
  color: var(--accent);
  text-decoration: underline;
  word-break: break-all;
}

/* Inline Edit Box */
.msg-edit-box {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.msg-edit-textarea {
  width: 100%;
  min-height: 60px;
  background-color: var(--bg-input);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
}

.msg-edit-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Mentions */
.mention-tag {
  background-color: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.mention-tag.mention-me {
  background-color: var(--gold-soft);
  color: var(--gold);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Reactions under message */
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.reaction-pill {
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.reaction-pill:hover {
  border-color: var(--accent);
  background-color: var(--bg-surface-raised);
}

.reaction-pill.reacted-by-me {
  background-color: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.reaction-count {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Reaction Popover */
.reaction-picker-popover {
  position: absolute;
  top: -34px;
  right: 68px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  display: flex;
  gap: 4px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  z-index: 50;
  animation: popoverFade 0.15s ease;
}

@keyframes popoverFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.popover-emoji {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: transform 0.1s, background-color 0.1s;
}

.popover-emoji:hover {
  transform: scale(1.25);
  background-color: var(--bg-surface-raised);
}

/* Poll Card in Chat */
.poll-card {
  margin-top: 8px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  max-width: 440px;
}

.poll-question {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.poll-option-btn {
  position: relative;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, background-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.poll-option-btn:hover {
  border-color: var(--accent);
}

.poll-option-btn.voted {
  border-color: var(--accent);
  background-color: rgba(59, 130, 246, 0.08);
}

.poll-option-bar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background-color: rgba(59, 130, 246, 0.22);
  border-radius: inherit;
  transition: width 0.3s ease;
  z-index: 1;
}

.poll-option-text {
  position: relative;
  z-index: 2;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.poll-option-pct {
  position: relative;
  z-index: 2;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.poll-footer {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.msg-image-wrap {
  margin-top: 8px;
  max-width: 420px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  background-color: var(--bg-input);
}

.msg-image {
  display: block;
  max-width: 100%;
  max-height: 320px;
  object-fit: cover;
}

/* Attached Bank File Card inside message */
.msg-attached-file {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 10px 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  max-width: 420px;
}

.attached-file-icon {
  width: 32px;
  height: 32px;
  background-color: var(--bg-surface-raised);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.attached-file-meta {
  min-width: 0;
  flex: 1;
}

.attached-file-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attached-file-size {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Actions on message card (Reply, React, Edit, Pin, Delete) */
.msg-actions-hover {
  position: absolute;
  top: 6px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 2px;
  transition: opacity 0.15s;
  z-index: 10;
}

.message-card:hover .msg-actions-hover {
  opacity: 1;
}

.msg-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.msg-action-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-raised);
}

.msg-action-btn.delete:hover {
  color: var(--danger);
  background-color: var(--danger-soft);
}

/* Replying Banner */
.replying-banner {
  padding: 6px 20px;
  background-color: var(--bg-surface-raised);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.replying-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-close-reply {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}

.btn-close-reply:hover {
  color: var(--text-primary);
}

/* Pending Attachments Bar */
.pending-attachments-bar {
  padding: 8px 20px;
  background-color: var(--bg-surface-raised);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.attachment-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 4px 10px 4px 6px;
}

.attachment-preview img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 2px;
}

.attachment-name {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
}

.pending-file-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  color: var(--accent);
}

.attached-file-name {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.btn-remove-attachment {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.btn-remove-attachment:hover {
  color: var(--danger);
}

/* Typing indicator */
.typing-indicator {
  padding: 4px 20px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.typing-dots span {
  animation: typingBounce 1.4s infinite ease-in-out both;
  display: inline-block;
}
.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

/* Mentions Autocomplete Box */
.mention-autocomplete {
  position: absolute;
  bottom: 64px;
  left: 140px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  max-height: 180px;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 100;
  width: 200px;
  display: flex;
  flex-direction: column;
}

.mention-option {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.15s;
}

.mention-option:hover {
  background-color: var(--bg-surface-raised);
  color: var(--accent);
}

/* Chat Input Bar */
.chat-input-bar {
  padding: 12px 20px;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: flex-end;
}

.chat-input-bar textarea,
.chat-input-bar input[type="text"] {
  flex: 1;
  min-height: 40px;
  max-height: 160px;
  height: 40px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: none;
  overflow-y: auto;
  line-height: 1.4;
  transition: border-color 0.15s;
}

.chat-input-bar textarea:focus,
.chat-input-bar input[type="text"]:focus {
  border-color: var(--accent);
}

/* ================= FILES & FOLDERS ================= */
.files-container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  overflow-y: auto;
  height: 100%;
}

.files-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  background-color: var(--bg-surface);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.breadcrumb-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}

.breadcrumb-item:hover {
  background-color: var(--bg-surface-raised);
  color: var(--text-primary);
}

.bc-separator {
  color: var(--text-muted);
}

.breadcrumb-current {
  font-weight: 700;
  color: var(--accent);
}

.upload-card {
  margin-bottom: 20px;
}

.upload-dropzone {
  border: 2px dashed var(--border-strong);
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--accent);
  background-color: var(--bg-surface-raised);
}

.file-input-hidden {
  display: none;
}

.dropzone-icon {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.dropzone-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.accent-link {
  color: var(--accent);
  text-decoration: underline;
}

.dropzone-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-progress-bar {
  margin-top: 14px;
  height: 6px;
  background-color: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--accent);
  width: 0%;
  transition: width 0.2s;
}

.files-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.scope-tabs {
  display: flex;
  gap: 4px;
  background-color: var(--bg-surface);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.scope-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.scope-tab.active {
  background-color: var(--bg-surface-raised);
  color: var(--text-primary);
}

.scope-tab.scope-trash.active {
  background-color: var(--danger-soft);
  color: var(--danger);
}

.search-input {
  height: 32px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}

.subsection-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

/* 2-Column Folders Split Section */
.folders-split-wrapper {
  margin-bottom: 24px;
}

.folders-split-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 860px) {
  .folders-split-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.folders-column {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.folders-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.col-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-header-title h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.folders-col-public .col-header-title h4 {
  color: var(--accent);
}

.folders-col-private .col-header-title h4 {
  color: #f59e0b;
}

.badge-count {
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  font-family: var(--font-mono);
}

.folders-column .folders-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.folder-card {
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
  cursor: pointer;
}

.folder-card-public {
  border-left: 3px solid var(--accent);
}

.folder-card-private {
  border-left: 3px solid #f59e0b;
}

.folder-card:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-strong);
}

.folder-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.folder-icon {
  font-size: 20px;
}

.folder-text {
  min-width: 0;
}

.folder-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.folder-actions {
  display: flex;
  gap: 4px;
}

/* Files Grid */
.subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.files-stats {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.files-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-placeholder, .empty-mini {
  text-align: center;
  padding: 30px;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
}

.empty-mini {
  padding: 16px;
  grid-column: 1 / -1;
}

.file-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.15s;
}

.file-item:hover {
  background-color: var(--bg-surface-raised);
}

.file-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}

.file-type-icon {
  width: 36px;
  height: 36px;
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.file-info-text {
  min-width: 0;
}

.file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.file-name:hover {
  color: var(--accent);
}

.file-details {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  font-family: var(--font-mono);
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.badge-public {
  background-color: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-private {
  background-color: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-trash-time {
  background-color: var(--danger-soft);
  color: var(--danger);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Pick Files List in Modal */
.modal-card-wide {
  max-width: 540px;
}

.pick-files-list, .pinned-messages-list {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.pick-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.pick-file-item:hover {
  background-color: var(--bg-surface-raised);
  border-color: var(--accent);
}

.pick-file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pick-file-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.pinned-item {
  padding: 10px 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.pinned-item:hover {
  background-color: var(--bg-surface-raised);
  border-color: var(--accent);
}

.pinned-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.pinned-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.pinned-time {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.pinned-snippet {
  font-size: 13px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Poll Inputs */
.poll-options-inputs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Buttons */
.btn {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  font-family: inherit;
  text-decoration: none;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-xs {
  height: 24px;
  padding: 0 6px;
  font-size: 11px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
}

.btn-primary {
  background-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-secondary {
  background-color: var(--bg-surface-raised);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-raised);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
}

.btn-danger-ghost:hover {
  background-color: var(--danger-soft);
}

.btn-block {
  width: 100%;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  width: 100%;
  max-width: 400px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Universal File Preview Modal */
.modal-card-preview {
  max-width: 860px;
  width: 90vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.preview-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.preview-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.preview-size {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.preview-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-modal-body {
  padding: 0;
  overflow: auto;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0b0d13;
  min-height: 300px;
}

.preview-code-wrap {
  width: 100%;
  height: 100%;
  padding: 16px;
  overflow: auto;
}

.preview-code-wrap pre {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: #e2e8f0;
}

.preview-media-player {
  max-width: 100%;
  max-height: 70vh;
  outline: none;
}

.preview-audio-wrap {
  padding: 40px;
  text-align: center;
  width: 100%;
}

.preview-audio-wrap audio {
  width: 100%;
  max-width: 420px;
}

/* FLOATING 1-ON-1 DM WINDOW (Bottom-Right) */
.floating-dm {
  position: fixed;
  bottom: 16px;
  right: 20px;
  width: 330px;
  height: 420px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  z-index: 500;
  overflow: hidden;
  transition: height 0.2s ease, width 0.2s ease;
}

.floating-dm.minimized {
  height: 44px;
}

.floating-dm.minimized .dm-body {
  display: none;
}

.dm-header {
  height: 44px;
  padding: 0 12px;
  background-color: var(--bg-surface-raised);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.dm-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dm-avatar {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background-color: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dm-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.dm-status-dot {
  width: 6px;
  height: 6px;
}

.dm-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dm-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}

.dm-btn:hover {
  color: var(--text-primary);
}

.dm-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dm-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.dm-bubble.outgoing {
  align-self: flex-end;
  background-color: var(--accent);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.dm-bubble.incoming {
  align-self: flex-start;
  background-color: var(--bg-surface-raised);
  color: var(--text-primary);
  border-bottom-left-radius: 2px;
}

.dm-bubble-time {
  font-size: 9px;
  opacity: 0.75;
  margin-top: 2px;
  text-align: right;
  font-family: var(--font-mono);
}

.dm-input-bar {
  padding: 8px 10px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  display: flex;
  gap: 6px;
}

.dm-input-bar input {
  flex: 1;
  height: 32px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.dm-input-bar input:focus {
  border-color: var(--accent);
}

/* Avatar Modal Styles */
.avatar-modal-body {
  align-items: center;
  text-align: center;
  padding: 24px 20px;
}

.avatar-large-preview {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-lg);
  background-color: var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 8px;
  border: 2px solid var(--border-strong);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.avatar-large-fallback {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
}

.avatar-large-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-modal-user-info h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.avatar-modal-hint {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  max-width: 280px;
  margin: 0 auto 16px;
}

.avatar-modal-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Lightbox */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: zoom-out;
}

.lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-container img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: -36px;
  right: -8px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3000;
}

.toast {
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.2s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* DM Enhanced Actions & Attachments */
.dm-action-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.dm-action-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.dm-pending-bar {
  padding: 6px 10px;
  background-color: var(--bg-surface-raised);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.dm-pending-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  font-size: 11px;
  max-width: 100%;
}

.dm-pending-item img {
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: 3px;
}

.dm-pending-file-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.dm-remove-pending {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0 2px;
}

.dm-remove-pending:hover {
  color: var(--color-danger);
}

.dm-image-attachment {
  margin-bottom: 6px;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  max-width: 210px;
}

.dm-image-attachment img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-fast);
}

.dm-image-attachment:hover img {
  transform: scale(1.02);
}

.dm-file-attachment {
  margin-bottom: 6px;
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 230px;
}

.dm-file-info {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  cursor: pointer;
  flex: 1;
}

.dm-file-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dm-file-name {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.dm-file-size {
  font-size: 9px;
  color: var(--text-muted);
}

/* Read Receipts in DM */
.dm-read-status {
  display: inline-block;
  margin-left: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: -0.5px;
  vertical-align: middle;
}

.dm-read-status.sent {
  color: var(--text-muted);
  opacity: 0.65;
}

.dm-read-status.read {
  color: #00d26a;
  opacity: 1;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(0, 210, 106, 0.4);
}

/* Markdown & Inline Code */
.inline-code {
  background-color: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: #ff7b72;
}

/* Code Blocks with Header & Copy Button */
.code-block-wrap {
  margin: 6px 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: #0d1117;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px;
  background-color: #161b22;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
}

.code-block-lang {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  font-weight: 600;
}

.btn-copy-code {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.btn-copy-code:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-copy-code.copied {
  color: #00d26a;
  border-color: #00d26a;
  background-color: rgba(0, 210, 106, 0.1);
}

.code-block-content {
  margin: 0;
  padding: 8px 12px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  color: #e6edf3;
  tab-size: 2;
  white-space: pre;
}

.code-block-content code {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  padding: 0;
  border: none;
}

/* Spoilers & Blockquotes */
.spoiler-text {
  background-color: #2b2d31;
  color: transparent;
  border-radius: 3px;
  padding: 0 4px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.spoiler-text.revealed {
  color: inherit;
  background-color: rgba(255, 255, 255, 0.1);
  user-select: text;
}

.chat-quote-line {
  border-left: 3px solid var(--accent);
  padding-left: 8px;
  margin: 4px 0;
  color: var(--text-muted);
  font-style: italic;
}

/* Accent Picker Swatches */
.accent-picker-group {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

.accent-swatch-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--swatch);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  outline: none;
}

.accent-swatch-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 0 10px var(--swatch);
}

.accent-swatch-btn.active {
  border-color: #fff;
  transform: scale(1.15);
  box-shadow: 0 0 12px var(--swatch);
}

.accent-profile-section {
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 12px;
}

/* Rich URL Embed Cards */
.msg-embed-card {
  margin-top: 8px;
  max-width: 440px;
  background-color: rgba(22, 27, 34, 0.7);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: border-color var(--transition-fast);
}

.msg-embed-card:hover {
  border-left-color: var(--accent-hover);
}

.embed-site-name {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.embed-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  line-height: 1.35;
  word-break: break-word;
}

.embed-title:hover {
  text-decoration: underline;
}

.embed-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.embed-thumb {
  margin-top: 4px;
  max-width: 100%;
  max-height: 200px;
  border-radius: 4px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

/* ==================== KEYDROP CS2 STYLES ==================== */
.keydrop-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.keydrop-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(135deg, rgba(26, 31, 46, 0.9) 0%, rgba(15, 18, 28, 0.95) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.keydrop-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.keydrop-logo {
  font-size: 36px;
  filter: drop-shadow(0 4px 12px rgba(255, 180, 0, 0.4));
}

.keydrop-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin: 0 0 2px 0;
}

.keydrop-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.keydrop-user-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.keydrop-balance-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 215, 0, 0.25);
  padding: 8px 16px;
  border-radius: var(--radius-md);
}

.kd-coin-icon {
  font-size: 22px;
}

.kd-balance-info {
  display: flex;
  flex-direction: column;
}

.kd-balance-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.kd-balance-amount {
  font-size: 16px;
  font-weight: 700;
  color: #ffd700;
  font-family: var(--font-mono);
}

/* Live Drop Ticker */
.keydrop-live-feed {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-bottom: 28px;
  overflow-x: auto;
}

.live-feed-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #ef4444;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  padding-right: 12px;
  border-right: 1px solid var(--border-subtle);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  animation: pulseLive 1.5s infinite;
}

@keyframes pulseLive {
  0% { transform: scale(0.95); opacity: 0.7; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.live-feed-items {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-grow: 1;
}

.live-feed-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(22, 27, 34, 0.9);
  border-left: 3px solid #4b69ff;
  border-radius: 4px;
  padding: 4px 10px;
  flex-shrink: 0;
  animation: slideInDrop 0.4s ease-out;
}

@keyframes slideInDrop {
  from { opacity: 0; transform: translateX(-15px); }
  to { opacity: 1; transform: translateX(0); }
}

.live-feed-item img {
  width: 32px;
  height: 24px;
  object-fit: contain;
}

.live-feed-text {
  display: flex;
  flex-direction: column;
}

.live-feed-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.live-feed-val {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Cases Grid */
.keydrop-section-header {
  margin-bottom: 16px;
}

.keydrop-section-header h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--text-primary);
}

.keydrop-section-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.keydrop-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 40px;
}

.kd-case-card {
  background: linear-gradient(180deg, rgba(26, 31, 46, 0.85) 0%, rgba(18, 21, 31, 0.95) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 18px 16px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-medium);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.kd-case-card:hover {
  transform: translateY(-5px);
  border-color: var(--case-accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 16px var(--case-accent);
}

.kd-case-icon {
  font-size: 54px;
  margin-bottom: 10px;
  display: inline-block;
  transition: transform var(--transition-fast);
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.5));
}

.kd-case-card:hover .kd-case-icon {
  transform: scale(1.1) rotate(4deg);
}

.kd-case-name {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: var(--text-primary);
}

.kd-case-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 14px 0;
  min-height: 32px;
  line-height: 1.35;
}

.kd-case-preview-skins {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}

.kd-preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

.kd-case-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.kd-case-price {
  font-size: 15px;
  font-weight: 800;
  color: #ffd700;
  font-family: var(--font-mono);
}

/* User Inventory */
.keydrop-inv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inv-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.keydrop-inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.kd-inv-card {
  background: rgba(22, 27, 34, 0.9);
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--skin-rarity);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  position: relative;
  transition: all var(--transition-fast);
}

.kd-inv-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.kd-inv-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.kd-inv-img {
  width: 100%;
  height: 85px;
  object-fit: contain;
  margin: 6px 0;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

.kd-inv-info {
  margin-bottom: 10px;
}

.kd-inv-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kd-inv-price {
  font-size: 13px;
  font-weight: 700;
  color: #00d26a;
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* ==================== ROULETTE MODAL ==================== */
.kd-modal-card {
  max-width: 850px;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.7);
}

.kd-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kd-modal-case-icon {
  font-size: 28px;
}

.kd-modal-case-price {
  font-size: 13px;
  color: #ffd700;
  font-weight: 700;
  font-family: var(--font-mono);
}

.kd-modal-body {
  padding: 24px;
  position: relative;
}

/* Roulette Viewport */
.roulette-viewport-wrap {
  position: relative;
  margin: 10px 0 24px;
  background: #161b22;
  border: 2px solid #30363d;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.roulette-pointer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: #ef4444;
  transform: translateX(-50%);
  z-index: 10;
  box-shadow: 0 0 10px #ef4444, 0 0 20px #ef4444;
}

.roulette-pointer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #ef4444;
}

.roulette-pointer::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 10px solid #ef4444;
}

.roulette-viewport {
  width: 100%;
  height: 140px;
  overflow: hidden;
  position: relative;
}

.roulette-strip {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  will-change: transform;
}

.roulette-item {
  width: 140px;
  height: 100%;
  flex-shrink: 0;
  margin: 0 5px;
  background: rgba(26, 31, 46, 0.6);
  border-bottom: 4px solid var(--skin-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  user-select: none;
}

.roulette-item img {
  width: 100px;
  height: 75px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
}

.roulette-item-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  margin-top: 6px;
}

.roulette-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.btn-kd-open {
  font-size: 16px;
  font-weight: 800;
  padding: 12px 36px;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 18px rgba(92, 92, 255, 0.4);
}

/* Win Overlay */
.kd-win-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 17, 23, 0.94);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  animation: fadeIn 0.3s ease;
  border-radius: var(--radius-lg);
}

.kd-win-card {
  background: #1c2128;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px 36px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6);
  animation: zoomIn 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

.kd-win-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.kd-win-image-wrap {
  width: 180px;
  height: 130px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kd-win-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6));
}

.kd-win-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px 0;
}

.kd-win-price {
  font-size: 16px;
  font-weight: 700;
  color: #00d26a;
  font-family: var(--font-mono);
  margin-bottom: 20px;
}

.kd-win-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Contents grid in modal */
.kd-case-contents {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.kd-case-contents h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kd-contents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.kd-content-card {
  background: #161b22;
  border: 1px solid var(--border-subtle);
  border-bottom: 3px solid var(--skin-rarity);
  border-radius: var(--radius-md);
  padding: 8px;
  text-align: center;
}

.kd-content-badge {
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  padding: 1px 4px;
  border-radius: 2px;
  display: inline-block;
  margin-bottom: 4px;
}

.kd-content-card img {
  width: 100%;
  height: 60px;
  object-fit: contain;
  margin: 4px 0;
}

.kd-content-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kd-content-price {
  font-size: 10px;
  font-weight: 700;
  color: #ffd700;
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* KeyDrop Chance Percentage Badge */
.kd-chance-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffd700;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}

/* KeyDrop Sub-Navigation */
.kd-subnav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.kd-subnav-btn {
  background: rgba(26, 31, 46, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.kd-subnav-btn:hover {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.kd-subnav-btn.active {
  background: var(--accent-gradient, linear-gradient(135deg, #6366f1 0%, #4f46e5 100%));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.kd-subview {
  width: 100%;
}

/* ==================== UPGRADER ARENA ==================== */
.upgrader-arena {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 20px;
  margin-bottom: 30px;
  align-items: start;
}

@media (max-width: 1100px) {
  .upgrader-arena {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.upgrader-col {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.upgrader-panel-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.upgrader-panel-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px 0;
}

.upgrader-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.upgrader-selected-card {
  min-height: 120px;
  background: rgba(13, 17, 23, 0.6);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  margin-bottom: 14px;
  text-align: center;
}

.selected-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.selected-inner img {
  width: 90px;
  height: 65px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
}

.selected-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-val {
  font-size: 14px;
  font-weight: 800;
  color: #00d26a;
  font-family: var(--font-mono);
}

/* Source bet inputs */
.upgrader-cash-input-wrap {
  margin-bottom: 14px;
  background: rgba(22, 27, 34, 0.5);
  border-radius: var(--radius-sm);
  padding: 10px;
  border: 1px solid var(--border-subtle);
}

.upgrader-cash-input-wrap label,
.upgrader-source-inv label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.upgrader-cash-row {
  display: flex;
  gap: 8px;
}

.upgrader-cash-row input {
  flex: 1;
}

.upgrader-mini-inv {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.upgrader-mini-card {
  background: rgba(22, 27, 34, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.upgrader-mini-card:hover {
  background: var(--bg-surface-raised);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.upgrader-mini-card.selected {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.15);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.upgrader-mini-card img {
  width: 100%;
  height: 44px;
  object-fit: contain;
}

.mini-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.mini-price {
  font-size: 10px;
  font-weight: 700;
  color: #00d26a;
  font-family: var(--font-mono);
}

/* Upgrader Center Column */
.upgrader-center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 10px;
}

.upgrader-wheel-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.upgrader-wheel-wrap {
  position: relative;
  width: 240px;
  height: 240px;
}

.upgrader-wheel-svg {
  width: 100%;
  height: 100%;
}

.upgrader-needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 75px;
  background: #ef4444;
  border-radius: 2px;
  transform-origin: bottom center;
  transform: translate(-50%, -100%) rotate(0deg);
  box-shadow: 0 0 10px #ef4444, 0 0 18px rgba(239, 68, 68, 0.6);
  z-index: 5;
  pointer-events: none;
}

.upgrader-needle::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 12px solid #ef4444;
}

.upgrader-wheel-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.upgrader-chance-val {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffd700;
  text-shadow: 0 0 14px rgba(255, 215, 0, 0.4);
  line-height: 1;
}

.upgrader-chance-sub {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin: 4px 0 2px 0;
}

.upgrader-multiplier {
  font-size: 14px;
  font-weight: 700;
  color: #00d26a;
  font-family: var(--font-mono);
}

.btn-upgrader-spin {
  width: 100%;
  max-width: 260px;
  height: 48px;
  font-size: 16px;
  font-weight: 800;
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Upgrader Target Column & Catalog */
.upgrader-catalog-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upgrader-catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.upgrader-catalog-card {
  background: rgba(22, 27, 34, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.upgrader-catalog-card:hover {
  background: var(--bg-surface-raised);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.upgrader-catalog-card.selected {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.08);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}

.catalog-badge {
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  padding: 1px 5px;
  border-radius: 2px;
  display: inline-block;
  margin-bottom: 2px;
}

.upgrader-catalog-card img {
  width: 100%;
  height: 50px;
  object-fit: contain;
  margin: 4px 0;
}

.catalog-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-price {
  font-size: 11px;
  font-weight: 700;
  color: #ffd700;
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* ==================== DAILY REWARDS CARD ==================== */
.daily-reward-card {
  background: linear-gradient(180deg, #1c2128 0%, #12161f 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 40px 24px;
  max-width: 520px;
  margin: 30px auto;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.daily-reward-card::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 100px;
  background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.22) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
}

.daily-chest-icon {
  font-size: 72px;
  margin-bottom: 12px;
  display: inline-block;
  animation: floatChest 3s ease-in-out infinite;
}

@keyframes floatChest {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.daily-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px 0;
}

.daily-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 24px 0;
  line-height: 1.4;
}

.daily-status-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.daily-timer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 24px;
}

.daily-timer-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.daily-timer {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #00d26a;
}

.btn-daily-claim {
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 800;
}

/* ==================== CASE BATTLES STYLES ==================== */
.battles-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.battles-header-title h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.battles-header-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.battles-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 14px;
}

.battles-filters {
  display: flex;
  gap: 6px;
}

.battle-filter-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.battle-filter-btn:hover {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
}

.battle-filter-btn.active {
  background: var(--accent-gradient, linear-gradient(135deg, #6366f1 0%, #4f46e5 100%));
  color: #fff;
}

.battles-stats-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* Battles Grid & Card */
.battles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.battle-card {
  background: linear-gradient(180deg, rgba(26, 31, 46, 0.85) 0%, rgba(18, 21, 31, 0.95) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.battle-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.battle-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.battle-card-mode-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mode-standard {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.mode-crazy {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.battle-card-cost {
  font-size: 14px;
  font-weight: 800;
  color: #ffd700;
  font-family: var(--font-mono);
}

.battle-cases-strip {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  padding: 6px 0;
}

.battle-case-mini {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(13, 17, 23, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.battle-case-mini .case-icon {
  font-size: 14px;
}

.battle-players-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(13, 17, 23, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
}

.battle-player-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 65px;
}

.battle-player-pill .pill-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface-raised);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.battle-player-pill .pill-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-vs-badge {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
}

.battle-player-pill.empty .pill-avatar {
  border-style: dashed;
  border-color: var(--border-strong);
  color: var(--text-muted);
}

.battle-card-footer {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* ==================== BATTLE ARENA ==================== */
.battle-arena-container {
  background: #0d1117;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.arena-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.arena-round-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.arena-round-badge {
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.arena-case-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.arena-jackpot-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
}

.arena-jackpot-box .jackpot-label {
  font-size: 11px;
  color: #facc15;
  font-weight: 700;
  text-transform: uppercase;
}

.arena-jackpot-box .jackpot-val {
  font-size: 15px;
  font-weight: 800;
  color: #ffd700;
  font-family: var(--font-mono);
}

/* Arena Slots Grid */
.arena-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.arena-slot {
  background: linear-gradient(180deg, #161b22 0%, #11141a 100%);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all var(--transition-fast);
}

.arena-slot.is-leader {
  border-color: #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.25);
}

.arena-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.arena-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.arena-player-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-surface-raised);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}

.arena-player-text {
  display: flex;
  flex-direction: column;
}

.arena-player-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.arena-player-total {
  font-size: 14px;
  font-weight: 800;
  color: #00d26a;
  font-family: var(--font-mono);
}

.arena-leader-crown {
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.3s;
}

.arena-slot.is-leader .arena-leader-crown {
  opacity: 1;
}

/* Arena Slot Spinner Box */
.arena-slot-spinner-box {
  position: relative;
  height: 120px;
  background: #0d1117;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7);
}

.arena-slot-spinner-pointer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #ef4444;
  transform: translateX(-50%);
  z-index: 10;
  box-shadow: 0 0 8px #ef4444;
}

.arena-slot-spinner-pointer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #ef4444;
}

.arena-slot-spinner-pointer::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 8px solid #ef4444;
}

.arena-slot-strip {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  will-change: transform;
}

.arena-strip-item {
  width: 100px;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-bottom: 3px solid var(--item-color, #4b69ff);
  background: rgba(22, 27, 34, 0.5);
}

.arena-strip-item img {
  width: 60px;
  height: 45px;
  object-fit: contain;
}

.arena-strip-item .item-name {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
  margin-top: 4px;
}

/* Drops history in slot */
.arena-slot-drops {
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.arena-drop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(22, 27, 34, 0.7);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--drop-color, #4b69ff);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
}

.arena-drop-item img {
  width: 28px;
  height: 20px;
  object-fit: contain;
}

.arena-drop-item .drop-name {
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin: 0 6px;
}

.arena-drop-item .drop-price {
  font-weight: 700;
  color: #00d26a;
  font-family: var(--font-mono);
}

/* Arena Controls Bar */
.arena-controls-bar {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* ==================== CREATE BATTLE MODAL ==================== */
.battle-setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.setup-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setup-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.btn-group-segmented {
  display: flex;
  gap: 4px;
  background: #0d1117;
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.seg-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.seg-btn:hover {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
}

.seg-btn.active {
  background: var(--accent-gradient, linear-gradient(135deg, #6366f1 0%, #4f46e5 100%));
  color: #fff;
}

.setup-group-checkbox {
  display: flex;
  align-items: center;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.checkbox-container input {
  cursor: pointer;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* Selected Cases Queue */
.battle-rounds-section {
  margin-bottom: 20px;
}

.rounds-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.rounds-header h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.battle-selected-cases-queue {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  min-height: 70px;
  background: #0d1117;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 8px;
  align-items: center;
}

.queue-case-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(26, 31, 46, 0.9);
  border: 1px solid var(--case-color, #4b69ff);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  position: relative;
  animation: slideInDrop 0.25s ease-out;
}

.queue-case-item .case-remove-btn {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.queue-case-item .case-remove-btn:hover {
  transform: scale(1.2);
}

/* Available Cases Picker */
.battle-cases-picker-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 10px 0;
}

.battle-cases-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.picker-case-card {
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.picker-case-card:hover {
  background: var(--bg-surface-raised);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.picker-case-card .picker-icon {
  font-size: 24px;
}

.picker-case-card .picker-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 4px 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker-case-card .picker-price {
  font-size: 11px;
  font-weight: 700;
  color: #ffd700;
  font-family: var(--font-mono);
}

/* Footer Submit */
.battle-create-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.battle-total-cost-wrap {
  display: flex;
  flex-direction: column;
}

.battle-total-cost-wrap .cost-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.battle-total-cost-wrap .cost-val {
  font-size: 18px;
  font-weight: 800;
  color: #ffd700;
  font-family: var(--font-mono);
}

/* ==================== VICTORY MODAL ==================== */
.battle-victory-card {
  text-align: center;
  background: linear-gradient(180deg, #1c2128 0%, #11141a 100%);
  border: 2px solid #ffd700;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.35);
  padding: 30px;
}

.victory-crown-icon {
  font-size: 54px;
  margin-bottom: 6px;
  animation: floatChest 2.5s ease-in-out infinite;
}

.victory-title {
  font-size: 26px;
  font-weight: 800;
  color: #ffd700;
  margin: 0 0 4px 0;
  text-shadow: 0 0 16px rgba(255, 215, 0, 0.5);
}

.victory-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 20px 0;
}

.victory-total-val {
  font-size: 18px;
  font-weight: 800;
  color: #00d26a;
  font-family: var(--font-mono);
  margin-bottom: 16px;
}

.victory-loot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 24px;
  padding: 6px;
  background: rgba(13, 17, 23, 0.7);
  border-radius: var(--radius-md);
}

.victory-loot-card {
  background: rgba(26, 31, 46, 0.9);
  border: 1px solid var(--loot-color, #4b69ff);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.victory-loot-card img {
  width: 50px;
  height: 38px;
  object-fit: contain;
  margin: 4px 0;
}

.victory-loot-card .loot-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.victory-loot-card .loot-price {
  font-size: 10px;
  font-weight: 700;
  color: #ffd700;
  font-family: var(--font-mono);
  margin-top: 2px;
}

.victory-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}




