/* ===== IRONITT Main Styles ===== */

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-color); text-decoration: none; }
a:hover { color: var(--accent-hover); }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  color: inherit;
  font-size: inherit;
}

input, textarea {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  outline: none;
  transition: border-color var(--transition-fast);
}

input:focus, textarea:focus {
  border-color: transparent;
  outline: none;
}

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

::-webkit-scrollbar {
  width: 7px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Firefox scrollbar fallback */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* ===== Utility Classes ===== */

/* Base avatar: flex-centered circle */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-round);
  flex-shrink: 0;
}

/* Single-line text truncation */
.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-tile.active-tile .quick-tile-label,
.feed-item-text,
.friend-chip-status,
.dm-item-preview {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Base popup panel (settings, profile) */
.popup-panel {
  display: none;
  position: fixed;
  bottom: 84px;
  left: var(--space-md);
  width: var(--profile-panel-width);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-modal);
  overflow: hidden;
  flex-direction: column;
}

.popup-panel.active {
  display: flex;
  animation: panelSlideIn var(--transition-normal) forwards;
}

.popup-panel.closing {
  display: flex;
  animation: panelSlideOut var(--transition-normal) forwards;
}

.popup-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.popup-panel-header h2 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

/* Global keyboard focus indicator */
:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ===== IRON Diamond Icon ===== */
.iron-diamond {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
  vertical-align: -0.2em;
}

.iron-diamond svg {
  width: 100%;
  height: 100%;
}

/* ===== App Layout ===== */
#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ===== Brand Logo ===== */

/* ===== Top Navigation Island ===== */
.nav-island-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md) 0;
  position: relative;
  z-index: var(--z-nav);
  flex-shrink: 0;
  pointer-events: none;
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1), gap 280ms ease;
}

.nav-island {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 6px;
  box-shadow: var(--shadow-island);
  position: relative;
  pointer-events: auto;
  transition: border-radius 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.nav-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 29px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  transition: color var(--transition-fast), background-color var(--transition-fast);
  white-space: nowrap;
  z-index: 1;
  user-select: none;
}

.nav-tab i {
  font-size: 17px;
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  color: var(--text-primary);
  cursor: default;
  pointer-events: none;
}

.nav-indicator {
  position: absolute;
  top: 6px;
  left: 0;
  height: calc(100% - 12px);
  background: var(--accent-color);
  border-radius: var(--radius-pill);
  transition: left var(--transition-normal), width var(--transition-normal);
  opacity: 0.15;
}

/* ===== Nav Collapse Toggle ===== */
.nav-collapse-toggle {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 14px;
  padding: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-top: none;
  color: var(--text-muted);
  font-size: 8px;
  cursor: pointer;
  pointer-events: auto;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-collapse-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-collapse-toggle i {
  transition: transform 300ms ease;
}

.nav-collapse-toggle.collapsed i {
  transform: rotate(180deg);
}

/* Manual nav collapse */
.nav-island-wrapper.nav-manual-hidden {
  transform: translateY(-100%);
  pointer-events: none;
}

.nav-island-wrapper.nav-manual-hidden .nav-collapse-toggle {
  pointer-events: auto;
}

.nav-island-wrapper.nav-manual-merging {
  gap: 0 !important;
}

.nav-island-wrapper.nav-manual-merging .nav-island {
  border-radius: 0;
  border-left-color: transparent;
  border-right-color: transparent;
}

.nav-island-wrapper.nav-manual-merging .comm-sub-left {
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
  border-right-color: transparent;
}

.nav-island-wrapper.nav-manual-merging .comm-sub-right {
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  border-left-color: transparent;
}

.nav-island-wrapper.nav-manual-merging .comm-sub-tabs,
.nav-island-wrapper.nav-manual-merging .nav-island {
  box-shadow: none;
}

.nav-island-wrapper.nav-manual-merging {
  filter: drop-shadow(0 5px 24px rgba(0, 0, 0, 0.5));
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  overflow: hidden;
  position: relative;
  padding: var(--space-sm) var(--space-md) var(--space-md);
}

.view {
  display: none;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.view.active {
  display: block;
  animation: fadeIn var(--transition-normal) forwards;
}

/* ===== Dashboard ===== */
.dashboard-layout {
  display: flex;
  justify-content: center;
  min-height: 100%;
  padding: var(--space-sm) 0;
  margin: 0 auto;
  max-width: 1200px;
}

.dashboard-view {
  flex: 1;
  max-width: 1200px;
  min-width: 0;
}

/* ===== Quick Tiles ===== */
.quick-tiles-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
}

.quick-tile {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              border-color var(--transition-fast),
              background-color var(--transition-fast);
  position: relative;
  user-select: none;
}

/* Inactive tile */
.quick-tile.inactive {
  background: var(--bg-secondary);
  border: none;
  color: var(--text-muted);
  opacity: 0.4;
  transition: opacity var(--transition-fast), transform var(--transition-fast), background-color var(--transition-fast);
}

.quick-tile.inactive:hover {
  opacity: 1;
  background: var(--accent-subtle);
  transform: scale(1.04);
}

.quick-tile.inactive .quick-tile-icon {
  font-size: 22px;
  transition: color var(--transition-fast);
  z-index: 1;
}

.quick-tile.inactive:hover .quick-tile-icon {
  color: var(--accent-color);
}

.tile-border-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tile-border-svg rect {
  stroke: var(--border-strong);
  transition: stroke var(--transition-fast);
}

.quick-tile.inactive:hover .tile-border-svg rect {
  stroke: var(--accent-color);
  animation: marchingDashes 1.2s linear infinite;
}

@keyframes marchingDashes {
  to { stroke-dashoffset: -14; }
}

/* Active tile */
.quick-tile.active-tile {
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

.quick-tile.active-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.quick-tile.active-tile .quick-tile-icon {
  font-size: 24px;
  margin-bottom: 5px;
  transition: color var(--transition-fast);
}

.quick-tile.active-tile .quick-tile-label {
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  text-align: center;
  line-height: 1.1;
  max-width: 100%;
}

/* Clear button */
.quick-tile-clear {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-round);
  background: var(--color-danger);
  color: var(--text-on-accent);
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity var(--transition-fast), transform var(--transition-fast), background-color var(--transition-fast);
  z-index: 2;
}

.quick-tile.active-tile:hover .quick-tile-clear {
  opacity: 1;
  transform: scale(1);
}

.quick-tile-clear:hover {
  background: #c0354a;
  transform: scale(1.15) !important;
}

/* Tile Picker Modal */
.tile-picker-modal {
  width: 440px;
  max-width: 90vw;
}

.tile-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.tile-picker-option {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  cursor: pointer;
  transition: border-color var(--transition-fast),
              background-color var(--transition-fast),
              transform var(--transition-fast);
}

.tile-picker-option:hover {
  border-color: var(--accent-color);
  background: var(--accent-subtle);
  transform: translateY(-2px);
}

.tile-picker-option.already-assigned {
  opacity: 0.35;
  pointer-events: none;
}

.tile-picker-option-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.tile-picker-option-info {
  flex: 1;
}

.tile-picker-option-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
}

.tile-picker-option-desc {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* Responsive: compact tiles on narrow screens */
@media (max-width: 600px) {
  .quick-tiles-row {
    gap: var(--space-sm);
  }
  .quick-tile {
    width: 72px;
    height: 72px;
  }
  .quick-tile.active-tile .quick-tile-icon { font-size: 20px; }
  .quick-tile.inactive .quick-tile-icon { font-size: 18px; }
}

.dashboard-header {
  margin-bottom: var(--space-md);
  animation: slideDown var(--transition-slow) forwards;
  position: relative;
}

.dashboard-header h1 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xs);
}

.dashboard-header p {
  color: var(--text-secondary);
  font-size: var(--font-size-md);
}

/* Dashboard edit button */
.dash-edit-btn {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.dash-edit-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.dashboard-view.edit-mode .dash-edit-btn {
  background: var(--accent-solid);
  border-color: var(--accent-solid);
  color: var(--text-on-accent);
}

.dashboard-view.edit-mode .dash-edit-btn:hover {
  background: var(--accent-solid-hover);
}

/* Widget wrapper (edit mode) */
.widget-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-color);
  padding: 0;
  transition: opacity var(--transition-fast), border-color var(--transition-fast);
}

.widget-wrapper:hover {
  border-color: var(--accent-color);
}

.widget-wrapper.widget-hidden {
  opacity: 0.4;
}

.widget-wrapper.widget-hidden:hover {
  opacity: 0.6;
}

.widget-wrapper.dragging {
  opacity: 0.5;
  border-color: var(--accent-color);
  cursor: grabbing;
}

.widget-wrapper.drag-over {
  border-color: var(--accent-color);
  background: var(--accent-color-10);
}

/* Widget edit bar (drag handle + controls) */
.widget-edit-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px var(--space-sm);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.widget-drag-handle {
  cursor: grab;
  color: var(--text-tertiary);
  padding: 2px 4px;
  font-size: var(--font-size-sm);
}

.widget-drag-handle:hover {
  color: var(--text-secondary);
}

.widget-title {
  flex: 1;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
}

.widget-toggle-vis,
.widget-toggle-size {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.widget-toggle-vis:hover,
.widget-toggle-size:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Half-width widgets in bottom row during edit mode */
.dashboard-bottom-row .widget-wrapper.widget-half {
  min-width: 0;
}

/* Edit mode: add subtle background to dashboard */
.dashboard-view.edit-mode {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

/* Dashboard bottom row (streak + balance boxes) */
.dashboard-bottom-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.dash-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  animation: cardEnter var(--transition-slow) forwards;
  opacity: 0;
}

.dash-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

/* Invitation actions */
.invite-actions {
  display: flex;
  gap: var(--space-xs);
}

.invite-actions button {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  transition: background-color var(--transition-fast), opacity var(--transition-fast);
}

.invite-accept {
  background: var(--accent-solid);
  color: var(--text-on-accent);
}

.invite-accept:hover {
  background: var(--accent-solid-hover);
}

.invite-decline {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.invite-decline:hover {
  opacity: 0.8;
}

/* ===== Combined Feed Card ===== */
.dash-feed-card {
  margin-bottom: var(--space-lg);
  max-height: 340px;
  overflow-y: auto;
}

.feed-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: calc(var(--space-lg) * -1) calc(var(--space-lg) * -1) var(--space-md);
  padding: var(--space-md) var(--space-lg);
  position: sticky;
  top: calc(var(--space-lg) * -1);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  z-index: 1;
}

.feed-card-header .card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent-color);
  font-size: 15px;
}

.feed-section-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
}

.feed-divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-sm) 0;
}

/* Unified feed items */
.feed-items {
  display: flex;
  flex-direction: column;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
}

.feed-item-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  background: var(--accent-light);
  color: var(--accent-color);
}

.feed-item-text {
  flex: 1;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.feed-item-text strong {
  color: var(--text-primary);
}

.feed-item-time {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ===== Dashboard Bottom Boxes ===== */
.dash-bottom-box {
  padding: var(--space-md) var(--space-lg);
}

.bottom-box-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
}

.bottom-box-header i,
.bottom-box-header .iron-diamond {
  font-size: 16px;
}

.bottom-box-value {
  margin-left: auto;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
  color: var(--accent-color);
}

.balance-box-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.balance-box-stat {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
}

.balance-box-stat.earned {
  color: var(--color-success);
}

.balance-box-stat.spent {
  color: var(--color-danger);
}


/* ===== Quick Stats ===== */
.quick-stats {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.quick-stat-pill {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
}

.quick-stat-pill i {
  color: var(--accent-color);
  font-size: 15px;
}

.quick-stat-value {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
}

.quick-stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ===== Section Header Row ===== */
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.section-header-row h3 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
}

/* ===== Friends Online ===== */
.friends-online-section {
  margin-bottom: var(--space-lg);
}

.friends-online-count {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.friends-online-strip {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.friends-online-strip::-webkit-scrollbar {
  display: none;
}

.friend-online-chip {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  min-width: 190px;
  flex-shrink: 0;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.friend-online-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.friend-chip-avatar {
  width: 36px;
  height: 36px;
  background: var(--bg-hover);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  position: relative;
}

.friend-chip-name {
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

.friend-chip-status {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  max-width: 130px;
}

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

.friends-online-empty {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  padding: var(--space-sm) 0;
}

/* ===== Streak Dots (used in bottom box) ===== */
.streak-dots {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.streak-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.streak-dot {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-round);
  background: var(--bg-hover);
  transition: background-color var(--transition-fast);
}

.streak-day.filled .streak-dot {
  background: var(--accent-color);
}

.streak-day.today .streak-dot {
  box-shadow: 0 0 0 3px var(--accent-light);
}

.streak-day-label {
  font-size: 11px;
  color: var(--text-muted);
}

.streak-day.today .streak-day-label {
  color: var(--accent-color);
  font-weight: var(--font-weight-semibold);
}

.streak-reward {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.streak-reward-amount {
  color: var(--color-warning);
  font-weight: var(--font-weight-semibold);
}

.streak-reward .iron-diamond {
  color: var(--color-warning);
}

/* ===== Communication ===== */
.communication-view {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Suppress animations on initial page load */
.no-transition,
.no-transition * {
  transition-duration: 0s !important;
  animation-duration: 0s !important;
}

/* Communication Sub-Tabs (flanking the nav island) */
.comm-sub-tabs {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 6px;
  box-shadow: var(--shadow-island);
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.9);
  visibility: hidden;
  position: relative;
  transition: opacity var(--transition-normal), transform var(--transition-normal), visibility var(--transition-normal),
              border-radius 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.comm-sub-tabs.visible {
  opacity: 1;
  transform: scale(1);
  visibility: visible;
}

.comm-sub-left {
  transform-origin: right center;
}

.comm-sub-left:not(.visible) {
  transform: scale(0.9) translateX(12px);
}

.comm-sub-right {
  transform-origin: left center;
}

.comm-sub-right:not(.visible) {
  transform: scale(0.9) translateX(-12px);
}

.comm-sub-tab {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  transition: color var(--transition-fast), background-color var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.comm-sub-tab i {
  font-size: 15px;
}

.comm-sub-tab:hover {
  color: var(--text-primary);
}

.comm-sub-tab.active {
  color: var(--text-primary);
  cursor: default;
  pointer-events: none;
}

.comm-sub-indicator {
  position: absolute;
  top: 6px;
  left: 0;
  height: calc(100% - 12px);
  background: var(--accent-color);
  border-radius: var(--radius-pill);
  transition: left var(--transition-normal), width var(--transition-normal);
  opacity: 0.15;
}

.comm-sub-tab {
  position: relative;
  z-index: 1;
}

.comm-content {
  flex: 1;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 60px;
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.3);
}

.comm-panel {
  display: none;
  height: 100%;
}

.comm-panel.active {
  display: flex;
  animation: fadeIn var(--transition-fast) forwards;
}

/* === Servers — Command Deck === */
.servers-panel {
  display: none;
  gap: 0;
  flex-direction: column;
}

.servers-panel.active {
  display: flex;
}

/* Diamond Strip — horizontal server selector */
.server-diamond-strip {
  min-height: 72px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  gap: var(--space-md);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.server-diamond-strip::-webkit-scrollbar { height: 0; }

.server-diamond {
  width: 42px;
  height: 42px;
  transform: rotate(45deg);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}

.server-diamond:hover {
  border-color: var(--accent-color);
  background: var(--bg-hover);
}

.server-diamond.active {
  border-color: var(--accent-color);
  background: var(--accent-subtle);
  animation: diamondPulse 3s ease-in-out infinite;
}

.server-diamond-icon {
  transform: rotate(-45deg);
  font-size: 13px;
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  user-select: none;
}

.server-diamond.active .server-diamond-icon {
  color: var(--accent-color);
}

.server-diamond-add {
  width: 36px;
  height: 36px;
  transform: rotate(45deg);
  border-radius: var(--radius-sm);
  border: 2px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
  flex-shrink: 0;
  margin-top: var(--space-xs);
}

.server-diamond-add:hover {
  border-color: var(--accent-color);
  background: var(--accent-subtle);
}

.server-diamond-add i {
  transform: rotate(-45deg);
  font-size: 12px;
  color: var(--text-muted);
}

.server-diamond-add:hover i {
  color: var(--accent-color);
}

/* Servers body (sidebar + chat) */
.servers-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.servers-body.server-switching .channel-sidebar {
  animation: slideInLeft 250ms ease forwards;
}

.servers-body.server-switching .chat-area {
  animation: fadeIn 300ms ease forwards;
}

.servers-body.server-switching .chat-messages .message-group {
  animation: slideUp 250ms ease forwards;
  opacity: 0;
}

.servers-body.server-switching .channel-tile {
  animation: slideInLeft 200ms ease forwards;
  opacity: 0;
}

.servers-body.server-switching .channel-category:nth-child(1) .channel-tile { animation-delay: 30ms; }
.servers-body.server-switching .channel-category:nth-child(2) .channel-tile { animation-delay: 80ms; }
.servers-body.server-switching .channel-category:nth-child(3) .channel-tile { animation-delay: 130ms; }

/* Channel Sidebar — docked mode (default) */
.channel-sidebar {
  width: 220px;
  background: rgba(0, 0, 0, 0.2);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--transition-normal);
}

/* Channel Sidebar — floating mode */
.channel-sidebar.floating {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: var(--bg-secondary-translucent, rgba(30, 30, 35, 0.92));
  border-right: 1px solid var(--border-color);
  animation: flyoutSlideIn 250ms ease forwards;
  box-shadow: var(--shadow-lg);
}

.channel-sidebar.floating.closing {
  animation: flyoutSlideOut 200ms ease forwards;
}

.channel-sidebar.floating-hidden {
  display: none;
}

.channel-sidebar-toggle {
  font-size: 14px;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.channel-sidebar-toggle:hover {
  color: var(--accent-color);
  background: var(--bg-hover);
}

/* Message Groups — batched by author */
.message-group {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  animation: messageIn 200ms ease forwards;
}

.message-group.own {
  border-left: 3px solid var(--accent-color);
}

.message-group-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.message-group-avatar {
  width: 36px;
  height: 36px;
  background: var(--bg-elevated);
  font-weight: var(--font-weight-bold);
  font-size: 13px;
  color: var(--accent-color);
}

.message-group-author {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
}

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

.message-group-messages {
  padding-left: 44px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.message-group-item {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  word-wrap: break-word;
  position: relative;
}

.message-group-item:hover {
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
}

.message-group-item .message-actions {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  gap: var(--space-xs);
}

.message-group-item:hover .message-actions {
  display: flex;
}

.channel-header {
  padding: 0 var(--space-md);
  border-bottom: 1px solid var(--border-color);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: relative;
  height: 48px;
  box-sizing: border-box;
}

.channel-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
}

.channel-category {
  margin-bottom: var(--space-sm);
}

.channel-category-name {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  user-select: none;
}

.channel-category-name i {
  font-size: 10px;
  transition: transform var(--transition-fast);
}

.channel-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-xs) 0;
}

.channel-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  transition: background-color var(--transition-fast), color var(--transition-fast),
              border-color var(--transition-fast), transform var(--transition-fast);
}

.channel-tile i {
  font-size: 18px;
}

.channel-tile span {
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  line-height: 1;
}

.channel-tile:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.channel-tile.active {
  background: var(--accent-light);
  color: var(--text-primary);
  border-color: var(--accent-color);
}

.channel-type-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  transform: scale(0.75);
  transform-origin: top right;
  color: var(--text-muted);
  opacity: 0.4;
}

/* Channel list-view item (compact rows) */
.channel-list-item {
  display: none; /* hidden by default, shown when data-channel-view="list" */
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.channel-list-item i {
  font-size: 14px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.channel-list-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.channel-list-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.channel-list-item.active {
  background: var(--accent-light);
  color: var(--text-primary);
  border-left: 2px solid var(--accent-color);
}

/* Toggle tile/list views via data attribute */
[data-channel-view="list"] .channel-tiles {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 2px;
}

[data-channel-view="list"] .channel-tile,
[data-channel-view="list"] .channel-type-badge {
  display: none;
}

[data-channel-view="list"] .channel-list-item {
  display: flex;
}

/* Chat Area */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  border-radius: 0 0 var(--radius-lg) 0;
  min-width: 0;
}

/* Members Sidebar */
.members-sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-lg) 0;
  overflow-y: auto;
}

.members-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.members-sidebar-header h3 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.members-sidebar-header button {
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
}

.members-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xs);
}

.members-role-group {
  margin-bottom: var(--space-sm);
}

.members-role-header {
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--space-xs) var(--space-sm);
}

.members-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px var(--space-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.members-row:hover {
  background: var(--bg-hover);
}

.members-row:hover .members-actions {
  opacity: 1;
}

.members-avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  background: var(--bg-elevated);
  position: relative;
}

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

.members-name {
  font-size: var(--font-size-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.members-tag {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 2px;
}

.members-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.member-action-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.member-action-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.member-action-btn.danger:hover {
  color: var(--color-danger);
}

.members-loading {
  padding: var(--space-md);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  height: 48px;
  box-sizing: border-box;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.chat-header-info .channel-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-md);
}

.chat-header-info .channel-topic {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  margin-left: var(--space-sm);
  padding-left: var(--space-sm);
  border-left: 1px solid var(--border-color);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.chat-header-actions button {
  color: var(--text-muted);
  font-size: 19px;
  transition: color var(--transition-fast);
}

.chat-header-actions button:hover {
  color: var(--text-primary);
}

.chat-search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 1px 10px;
  opacity: 0.5;
  transition: border-color var(--transition-fast), opacity var(--transition-fast);
}

.chat-search-bar:focus-within {
  border-color: var(--accent-color);
  opacity: 1;
}

.chat-search-bar i {
  color: var(--text-muted);
  font-size: 11px;
}

.chat-search-bar input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  width: 160px;
  outline: none;
}

.chat-search-bar input::placeholder {
  color: var(--text-muted);
  font-size: 11px;
}

.header-members-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
}

.header-members-strip::-webkit-scrollbar { height: 0; }

.header-member-item {
  flex-shrink: 0;
  cursor: pointer;
}

.header-member-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
  background: var(--bg-secondary);
  border: 2px solid var(--border-strong);
  color: var(--accent-color);
  position: relative;
  transition: border-color var(--transition-fast);
}

.header-member-avatar:hover {
  border-color: var(--accent-color);
}

.header-member-avatar .status-dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--bg-primary);
}

.header-member-count {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: var(--space-xs);
}

/* Member popover */
.member-popover {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  overflow: hidden;
  animation: fadeIn var(--transition-fast) forwards;
}

.member-popover-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.member-popover-avatar {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

.member-popover-info {
  display: flex;
  flex-direction: column;
}

.member-popover-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.member-popover-role {
  font-size: 11px;
  color: var(--text-muted);
}

.member-popover-actions {
  padding: var(--space-xs);
}

.member-pop-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 8px var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.member-pop-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.member-pop-btn.danger {
  color: var(--danger-color, #e84057);
}

.member-pop-btn.danger:hover {
  background: rgba(232, 64, 87, 0.1);
}

.member-popover-divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-xs) 0;
}

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

.message {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-xs) 0;
  animation: messageIn 200ms ease forwards;
}

.message-avatar {
  width: 48px;
  height: 48px;
  background: var(--bg-elevated);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  color: var(--accent-color);
}

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

.message-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: 2px;
}

.message-author {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.message-timestamp {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.message-content {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  word-wrap: break-word;
}

/* Chat file preview bar */
.chat-file-preview {
  padding: 0 var(--space-lg);
}

.chat-file-preview-inner {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xs);
}

.chat-file-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.chat-file-preview-inner > i {
  font-size: 24px;
  color: var(--text-muted);
  width: 40px;
  text-align: center;
}

.chat-file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-file-name {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.chat-file-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.chat-file-remove:hover {
  color: var(--color-danger);
}

/* Message attachment rendering */
.msg-attachment {
  margin-top: var(--space-xs);
}

.msg-attachment--image img {
  max-width: 300px;
  max-height: 300px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.msg-attachment--file a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  color: var(--accent-color);
  font-size: var(--font-size-xs);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.msg-attachment--file a:hover {
  background: var(--bg-hover);
}

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

.chat-input-area {
  padding: 0 var(--space-lg) var(--space-lg);
  flex-shrink: 0;
}

.chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-md);
  transition: border-color var(--transition-fast);
}

.chat-input-wrapper:focus-within {
  border-color: var(--border-strong);
}

.chat-input-wrapper input {
  flex: 1;
  background: none;
  border: none;
  padding: var(--space-xs) 0;
  font-size: var(--font-size-sm);
}

.chat-input-wrapper input:focus {
  border: none;
}

.chat-input-wrapper button {
  color: var(--text-muted);
  font-size: 19px;
  padding: var(--space-xs);
  transition: color var(--transition-fast);
}

.chat-input-wrapper button:hover {
  color: var(--accent-color);
}

/* === Friends — Iron Roster === */
.friends-panel {
  flex-direction: column;
  gap: 0;
}

.friends-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-shrink: 0;
}

.friends-header h2 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

/* Friends sub-tab slide animations */
@keyframes ftabSlideRight {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes ftabSlideLeft {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}
.ftab-slide-right {
  animation: ftabSlideRight var(--transition-normal) forwards;
}
.ftab-slide-left {
  animation: ftabSlideLeft var(--transition-normal) forwards;
}

.friends-sub-tabs {
  display: flex;
  gap: var(--space-xs);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 4px;
  position: relative;
}

.friends-sub-indicator {
  position: absolute;
  height: calc(100% - 8px);
  top: 4px;
  background: var(--accent-light);
  border-radius: var(--radius-pill);
  transition: left var(--transition-normal), width var(--transition-normal);
  z-index: 0;
  pointer-events: none;
}

.friends-sub-tab {
  padding: 7px 17px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  position: relative;
  z-index: 1;
}

.friends-sub-tab:hover {
  color: var(--text-primary);
}

.friends-sub-tab.active {
  color: var(--text-primary);
}

.friends-sub-tab .tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--accent-solid);
  color: var(--text-on-accent);
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  margin-left: var(--space-xs);
}

/* Add Friend Island */
.add-friend-island {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  margin: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  transition: border-color var(--transition-fast);
}

.add-friend-island:focus-within {
  border-color: var(--border-strong);
}

.add-friend-island input {
  flex: 1;
  border: none;
  background: none;
  padding: 8px var(--space-md);
  font-size: var(--font-size-sm);
}

.add-friend-island input:focus {
  border: none;
}

.add-friend-island .btn-add-friend {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-round);
  background: var(--accent-solid);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}

.add-friend-island .btn-add-friend:hover {
  background: var(--accent-solid-hover);
  transform: scale(1.05);
}

/* Friend Card Grid */
.friends-grid {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  background: var(--bg-primary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.friends-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}

/* Friend Tile */
.friend-tile {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  animation: cardEnter var(--transition-slow) forwards;
  opacity: 0;
  position: relative;
  overflow: hidden;
}

.friend-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.friend-tile-avatar {
  width: 56px;
  height: 56px;
  background: var(--bg-elevated);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
  color: var(--accent-color);
  position: relative;
}

.friend-tile-avatar.online-ring {
  box-shadow: 0 0 0 3px var(--color-online);
}

.friend-tile-avatar.offline-desaturated {
  filter: saturate(0.5);
  opacity: 0.7;
}

.friend-tile-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
}

.friend-tile-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  background: var(--bg-hover);
  color: var(--text-muted);
}

.friend-tile-status.online { color: var(--color-online); }
.friend-tile-status.idle { color: var(--color-idle); }
.friend-tile-status.dnd { color: var(--color-dnd); }

.friend-tile-actions {
  display: flex;
  gap: var(--space-xs);
  opacity: 0;
  transition: opacity var(--transition-fast);
  margin-top: var(--space-xs);
}

.friend-tile:hover .friend-tile-actions {
  opacity: 1;
}

/* Shared friend action button styles */
.friend-action-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-round);
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-secondary);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.friend-action-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.friend-action-btn.accept:hover {
  background: rgba(67, 181, 129, 0.2);
  color: var(--color-success);
}

.friend-action-btn.decline:hover {
  background: rgba(232, 64, 87, 0.2);
  color: var(--color-danger);
}

/* Pending List */
.pending-list {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.pending-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--space-sm) 0;
  margin-top: var(--space-sm);
}

.pending-section-header:first-child {
  margin-top: 0;
}

.pending-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.pending-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.friend-avatar {
  width: 48px;
  height: 48px;
  background: var(--bg-elevated);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  color: var(--accent-color);
  position: relative;
}

.status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  border-radius: var(--radius-round);
}

.friend-chip-avatar .status-dot,
.dm-item-avatar .status-dot {
  width: 12px;
  height: 12px;
  border: 2px solid var(--bg-secondary);
}

.friend-avatar .status-dot,
.user-corner-avatar .status-dot {
  width: 14px;
  height: 14px;
  border: 2px solid var(--bg-primary);
}

.user-corner-avatar .status-dot {
  background: var(--color-online);
}

.status-dot.online { background: var(--color-online); }
.status-dot.idle { background: var(--color-idle); }
.status-dot.dnd { background: var(--color-dnd); }
.status-dot.offline { background: var(--color-offline); }

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

.friend-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
}

.friend-status-text {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.friend-actions {
  display: flex;
  gap: var(--space-xs);
}

.friends-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
  text-align: center;
  grid-column: 1 / -1;
}

.friends-empty i {
  font-size: 58px;
  margin-bottom: var(--space-md);
  opacity: 0.3;
}

.friends-empty p {
  font-size: var(--font-size-sm);
}

/* === DMs — Signal Chamber === */
.dms-panel {
  flex-direction: column;
  gap: 0;
}

/* DM Avatar Strip */
.dm-avatar-strip {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-md) var(--space-sm);
  min-height: 96px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.dm-avatar-strip::-webkit-scrollbar { height: 0; }

.dm-strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.dm-strip-item:hover {
  transform: translateY(-2px);
}

.dm-strip-avatar {
  width: 48px;
  height: 48px;
  background: var(--bg-elevated);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  color: var(--accent-color);
  position: relative;
  transition: width var(--transition-fast), height var(--transition-fast), box-shadow var(--transition-fast), border var(--transition-fast);
}

.dm-strip-item.active .dm-strip-avatar {
  width: 54px;
  height: 54px;
  border: 2px solid var(--accent-color);
  box-shadow: 0 0 8px var(--accent-light);
}

.dm-strip-name {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 60px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-strip-item.active .dm-strip-name {
  color: var(--accent-color);
  font-weight: var(--font-weight-medium);
}

.dm-strip-unread {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--accent-solid);
  color: var(--text-on-accent);
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: unreadPulse 2s ease-in-out infinite;
}

/* DM Chat Area */
.dm-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Message Bubbles */
.dm-bubble-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.dm-bubble {
  max-width: 70%;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  line-height: 1.6;
  word-wrap: break-word;
}

.dm-bubble.own {
  align-self: flex-end;
  background: var(--accent-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
  animation: bubbleInRight 200ms ease forwards;
}

.dm-bubble.other {
  align-self: flex-start;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm);
  animation: bubbleInLeft 200ms ease forwards;
}

.dm-bubble-author {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: 2px;
}

.dm-bubble-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  text-align: right;
}

.dm-bubble.own .dm-bubble-time {
  text-align: right;
}

.dm-bubble.other .dm-bubble-time {
  text-align: left;
}

.dm-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.dm-empty i {
  font-size: 58px;
  margin-bottom: var(--space-md);
  opacity: 0.3;
}

/* === Posts — The Forge === */
.posts-panel {
  flex-direction: column;
  gap: 0;
  position: relative;
}

.posts-panel.active {
  display: flex;
}

.posts-container {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: var(--space-md);
}

/* Posts Grid */
.posts-masonry {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
}

.posts-masonry .post-card {
  width: 340px;
  max-width: 100%;
  margin-bottom: 0;
}

/* Post Card — enhanced */
.post-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl, 16px);
  padding: var(--space-lg);
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  animation: cardEnter var(--transition-slow) forwards;
  opacity: 0;
  position: relative;
  overflow: hidden;
}

/* Removed accent top line from post cards */

.post-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.post-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.post-avatar {
  width: 46px;
  height: 46px;
  background: var(--bg-elevated);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  color: var(--accent-color);
}

.post-author-info {
  flex: 1;
}

.post-author-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
}

.post-time {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.post-menu-btn {
  color: var(--text-muted);
  font-size: 17px;
  padding: var(--space-xs);
  border-radius: var(--radius-round);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.post-menu-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.post-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 140px;
  z-index: var(--z-tooltip);
  padding: var(--space-xs);
  animation: fadeIn var(--transition-fast) forwards;
}

.post-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.post-menu-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.post-menu-item.danger { color: var(--color-danger); }
.post-menu-item.danger:hover { background: rgba(232, 64, 87, 0.1); }

.post-body {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-md);
  word-wrap: break-word;
}

/* Rich content in posts */
.post-body h2 {
  font-size: 1.3em;
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin: 0.6em 0 0.3em;
}
.post-body h3 {
  font-size: 1.1em;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0.5em 0 0.2em;
}
.post-body ul, .post-body ol {
  padding-left: 1.5em;
  margin: 0.4em 0;
}
.post-body li {
  margin-bottom: 0.2em;
}
.post-body pre {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  margin: 0.5em 0;
}
.post-body code {
  background: var(--bg-tertiary);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}
.post-body pre code {
  background: none;
  padding: 0;
}
.post-body a {
  color: var(--accent-color);
  text-decoration: underline;
}
.post-body a:hover {
  opacity: 0.8;
}
.post-body img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 0.5em 0;
}

/* Reaction Pills */
.post-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.post-action-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-hover);
  border: 1px solid transparent;
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}

.post-action-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-color);
}

.post-action-pill.liked {
  color: var(--color-danger);
  background: rgba(232, 64, 87, 0.1);
  border-color: rgba(232, 64, 87, 0.2);
}

.post-action-pill.liked i {
  animation: heartBounce 400ms ease;
}

.post-action-pill i {
  font-size: 15px;
}

/* Comment Smooth Expand */
.post-comments-section {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms ease;
}

.post-comments-section.expanded {
  max-height: 600px;
  overflow-y: auto;
}

.post-comment {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
}

.post-comment-avatar {
  width: 34px;
  height: 34px;
  background: var(--bg-elevated);
  font-weight: var(--font-weight-bold);
  font-size: 12px;
  color: var(--accent-color);
}

.post-comment-body {
  flex: 1;
  min-width: 0;
}

.post-comment-author {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-xs);
  display: inline;
  margin-right: var(--space-xs);
}

.post-comment-text {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  display: inline;
}

.post-comment-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.post-comment-input {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-sm);
}

.post-comment-input input {
  flex: 1;
  padding: 7px var(--space-md);
  font-size: var(--font-size-xs);
  border-radius: var(--radius-pill);
  background: var(--bg-input);
}

.post-comment-send {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-round);
  background: var(--accent-solid);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background-color var(--transition-fast);
  flex-shrink: 0;
}

.post-comment-send:hover {
  background: var(--accent-solid-hover);
}

/* FAB Composer */
.post-fab {
  position: absolute;
  bottom: var(--space-lg);
  right: var(--space-lg);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-round);
  background: var(--accent-solid);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 10;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.post-fab:hover {
  background: var(--accent-solid-hover);
  transform: scale(1.05);
}

.post-fab.open {
  transform: rotate(45deg);
}

/* FAB Composer Overlay */
.post-fab-composer {
  position: absolute;
  bottom: calc(var(--space-lg) + 70px);
  right: var(--space-lg);
  width: 400px;
  max-width: calc(100% - 2 * var(--space-lg));
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  z-index: 10;
  box-shadow: var(--shadow-lg);
  display: none;
}

.post-fab-composer.active {
  display: block;
  animation: composerScaleIn 300ms ease forwards;
}

/* Rich text editor toolbar */
.post-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.post-editor-toolbar button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.post-editor-toolbar button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.post-toolbar-sep {
  width: 1px;
  height: 18px;
  background: var(--border-color);
  margin: 0 4px;
}

/* Contenteditable editor */
.post-composer-editor {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  min-height: 100px;
  max-height: 300px;
  overflow-y: auto;
  font-size: var(--font-size-sm);
  line-height: 1.5;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.post-composer-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

.post-composer-editor:focus {
  border-color: var(--accent-color);
}

.post-char-count {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-right: auto;
  align-self: center;
}

.post-fab-composer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-sm);
}

.post-submit-btn {
  padding: 10px 24px;
  background: var(--accent-solid);
  color: var(--text-on-accent);
  border-radius: var(--radius-pill);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.post-submit-btn:hover {
  background: var(--accent-solid-hover);
  transform: translateY(-1px);
}

/* ===== Iron Center ===== */
.iron-center-view {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-sm) 0;
}

.iron-center-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  animation: slideDown var(--transition-slow) forwards;
}

.iron-center-header h1 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
}

.iron-balance-display {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
}

.iron-balance-display i,
.iron-balance-display .iron-diamond {
  color: var(--color-warning);
}

.iron-sub-nav {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.iron-sub-tab {
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.iron-sub-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.iron-sub-tab.active {
  color: var(--text-primary);
  background: var(--accent-light);
}

.iron-panel {
  display: none;
}

.iron-panel.active {
  display: block;
  animation: fadeIn var(--transition-normal) forwards;
}

/* Quests */
.quests-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.weekly-timer {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.weekly-timer i {
  color: var(--accent-color);
}

.weekly-timer .timer-value {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.btn-refresh-quests {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 22px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.btn-refresh-quests:hover {
  background: var(--accent-light);
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.btn-refresh-quests .iron-cost {
  color: var(--color-warning);
  font-weight: var(--font-weight-semibold);
}

.quests-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.quest-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  animation: cardEnter var(--transition-slow) forwards;
  opacity: 0;
}

.quest-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.quest-card.completed {
  opacity: 0.6;
}

.quest-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.quest-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}

.quest-reward {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 5px 12px;
  background: rgba(240, 168, 48, 0.1);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-warning);
}

.quest-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-md);
  margin-bottom: var(--space-xs);
}

.quest-description {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.quest-progress {
  margin-bottom: var(--space-md);
}

.quest-progress-bar {
  height: 7px;
  background: var(--bg-hover);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.quest-progress-fill {
  height: 100%;
  background: var(--accent-color);
  border-radius: 4px;
  transition: width var(--transition-slow);
  animation: progressFill 800ms ease forwards;
}

.quest-progress-text {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: right;
}

.quest-claim-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent-solid);
  color: var(--text-on-accent);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.quest-claim-btn:hover {
  background: var(--accent-solid-hover);
  transform: translateY(-1px);
}

.quest-claim-btn:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: default;
  transform: none;
}

.quest-claim-btn.claimed {
  background: var(--color-success);
  color: var(--text-on-accent);
  cursor: default;
}

/* Reward float animation */
.reward-float {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--accent-color);
  text-shadow: 0 0 12px var(--accent-light);
  pointer-events: none;
  animation: rewardFloat 1.2s ease-out forwards;
  z-index: 10;
}

@keyframes rewardFloat {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.8); }
  30%  { opacity: 1; transform: translate(-50%, -80%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -120%) scale(0.9); }
}

/* Shop */
.shop-categories {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.shop-category-tab {
  padding: 10px 19px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.shop-category-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.shop-category-tab.active {
  color: var(--text-primary);
  background: var(--accent-light);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.shop-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  animation: cardEnter var(--transition-slow) forwards;
  opacity: 0;
}

.shop-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.shop-item.owned {
  border-color: var(--accent-color);
}

.shop-item-preview {
  width: 96px;
  height: 96px;
  margin: 0 auto var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: var(--accent-color);
  position: relative;
}

.shop-item-preview[class*="avatar-frame-"],
.shop-item-preview[class*="avatar-effect-"] {
  border-radius: var(--radius-round);
}

.shop-item-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-xs);
}

.shop-item-desc {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.shop-item-price {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 5px 14px;
  background: rgba(240, 168, 48, 0.1);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-warning);
  margin-bottom: var(--space-md);
}

.shop-buy-btn {
  width: 100%;
  padding: 10px;
  background: var(--accent-solid);
  color: var(--text-on-accent);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  transition: background-color var(--transition-fast);
}

.shop-buy-btn:hover {
  background: var(--accent-solid-hover);
}

/* Owned label + Use button */
.shop-owned-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 5px 14px;
  background: rgba(18, 244, 156, 0.1);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-success);
  margin-bottom: var(--space-md);
}

.shop-owned-label i {
  margin-right: 4px;
}

.shop-use-btn {
  width: 100%;
  padding: 10px;
  background: var(--accent-solid);
  color: var(--text-on-accent);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.shop-use-btn:hover {
  background: var(--accent-solid-hover);
  transform: translateY(-1px);
}

.shop-use-btn.in-use {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: default;
}

.shop-use-btn.in-use:hover {
  transform: none;
}

/* ===== Iron Center Title Group ===== */
.iron-center-title-group {
  display: flex;
  flex-direction: column;
}

.iron-total-earned {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== Featured Banner ===== */
.featured-banner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-color);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
}

.featured-banner-content {
  flex: 1;
}

.featured-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-light);
  color: var(--accent-color);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}

.featured-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xs);
}

.featured-desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.featured-reward {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-warning);
}

.featured-banner-icon {
  font-size: 48px;
  color: var(--text-muted);
  opacity: 0.3;
  flex-shrink: 0;
}

/* ===== Quest Sections ===== */
.quest-section {
  margin-bottom: var(--space-xl);
}

.quest-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.quest-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.quest-section-title i {
  color: var(--accent-color);
  font-size: 18px;
}

.quest-section-title h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.quest-section-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.quest-timer {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.quest-timer i {
  color: var(--accent-color);
}

.quest-timer .timer-value {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

/* ===== Quest Meta & Tier Badges ===== */
.quest-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-xs);
}

.quest-tier {
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tier-daily {
  background: var(--accent-subtle);
  color: var(--accent-color);
}

.tier-weekly {
  background: rgba(240, 168, 48, 0.1);
  color: var(--color-warning);
}

/* ===== Achievements ===== */
.achievements-header {
  margin-bottom: var(--space-lg);
}

.achievements-header h2 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xs);
}

.achievements-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.achievements-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.achievement-card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  animation: cardEnter var(--transition-slow) forwards;
  opacity: 0;
}

.achievement-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.achievement-card.claimed {
  opacity: 0.6;
}

.achievement-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: var(--bg-hover);
  color: var(--text-muted);
}

.achievement-icon.unlocked {
  background: var(--accent-light);
  color: var(--accent-color);
}

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

.achievement-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-md);
  margin-bottom: 2px;
}

.achievement-desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.achievement-progress {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

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

.achievement-progress-fill {
  height: 100%;
  background: var(--accent-color);
  border-radius: 3px;
  transition: width var(--transition-slow);
  animation: progressFill 800ms ease forwards;
}

.achievement-progress-text {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.achievement-reward {
  flex-shrink: 0;
  text-align: center;
}

.achievement-reward-preview {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: rgba(240, 168, 48, 0.1);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-warning);
}

.achievement-claim-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--accent-solid);
  color: var(--text-on-accent);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.achievement-claim-btn:hover {
  background: var(--accent-solid-hover);
  transform: translateY(-1px);
}

.achievement-claimed-badge {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-success);
  color: var(--text-on-accent);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

/* ===== Shop Rarity Badges ===== */
.shop-item {
  position: relative;
}

/* ===== Bundles ===== */
.bundles-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.bundle-card {
  background: var(--bg-primary);
  border: 1px solid var(--accent-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  animation: cardEnter var(--transition-slow) forwards;
  opacity: 0;
}

.bundle-card.owned {
  opacity: 0.6;
  border-color: var(--border-strong);
}

.bundle-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-light);
  color: var(--accent-color);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-md);
}

.bundle-content {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.bundle-info {
  flex: 1;
}

.bundle-name {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
}

.bundle-desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.bundle-items-preview {
  display: flex;
  gap: var(--space-sm);
}

.bundle-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  font-size: 15px;
}

.bundle-item-icon.bonus {
  color: var(--color-warning);
}

.bundle-pricing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.bundle-original-price {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.bundle-sale-price {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-warning);
}

/* ===== User Corner (Bottom Left) ===== */
.user-corner {
  position: fixed;
  bottom: var(--space-md);
  left: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  z-index: var(--z-panel);
}

.user-corner-avatar {
  width: 50px;
  height: 50px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-strong);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  color: var(--accent-color);
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
  position: relative;
}

.user-corner-avatar:hover {
  border-color: var(--accent-color);
  transform: scale(1.05);
}

.user-corner-info {
  display: flex;
  flex-direction: column;
}

.user-corner-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  line-height: 1.2;
}

.user-corner-tag {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.settings-btn {
  width: 43px;
  height: 43px;
  border-radius: var(--radius-round);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.settings-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: rotate(30deg);
}

/* ===== Brand Logo (Bottom Center) ===== */
.brand-logo {
  position: fixed;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--accent-color);
  letter-spacing: 3px;
  z-index: var(--z-panel);
  cursor: pointer;
  user-select: none;
  transition: opacity var(--transition-fast);
  line-height: 50px;
}

.brand-logo:hover {
  opacity: 0.75;
}

.brand-logo.hidden {
  display: none;
}

/* ===== Audio Controls (Bottom Right) ===== */
.audio-controls {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  z-index: var(--z-panel);
}

.audio-btn {
  width: 43px;
  height: 43px;
  border-radius: var(--radius-round);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.audio-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
  transform: scale(1.08);
}

.audio-btn.active {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: var(--text-on-accent);
}

.audio-btn.active:hover {
  background: transparent;
  border-color: var(--color-danger);
  color: var(--color-danger);
  transform: scale(1.08);
}

/* Contextual buttons in audio controls (DM call, voice controls) */
.comm-context-btns {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  animation: scaleIn 200ms ease forwards;
}

.dm-context-divider {
  width: 1px;
  height: 24px;
  background: var(--border-color);
}

/* ===== Settings Panel ===== */
.panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-overlay);
}

.panel-overlay.active {
  display: block;
  animation: overlayIn var(--transition-fast) forwards;
}

.settings-panel {
  max-height: calc(100vh - 144px);
}

.panel-close-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.panel-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.settings-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-lg);
}

.settings-section {
  margin-bottom: var(--space-xl);
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-md);
}

/* Light/Dark mode toggle button */
.light-mode-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-round);
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.light-mode-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.light-mode-btn.active {
  background: #f0c830;
  color: #1a1a2e;
  border-color: #f0c830;
}

/* Status Options */
.status-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.status-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.status-option i {
  font-size: 11px;
}

.status-option:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.status-option.active {
  border-color: var(--accent-color);
  background: var(--accent-subtle);
  color: var(--text-primary);
}

.custom-status-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  position: relative;
}

.custom-status-bar input {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: var(--font-size-xs);
  outline: none;
  transition: border-color var(--transition-fast);
}

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

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

.custom-status-clear {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-round);
  background: var(--bg-hover);
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.custom-status-clear:hover {
  color: var(--color-danger);
  background: rgba(232, 64, 87, 0.15);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.theme-option:hover {
  background: var(--bg-hover);
}

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

.theme-option.locked {
  opacity: 0.5;
  cursor: default;
}

.theme-color-dot {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-round);
}

.theme-option-label {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.theme-option .lock-icon {
  font-size: 12px;
  color: var(--text-muted);
}

/* Settings items */
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
}

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

.settings-item-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.settings-item-value {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Equipped items */
.equipped-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
}

.equipped-item:last-child {
  border-bottom: none;
}

.equipped-item-icon {
  width: 43px;
  height: 43px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

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

.equipped-item-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.equipped-item-type {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.equipped-select {
  font-size: var(--font-size-xs);
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast);
  outline: none;
  max-width: 130px;
}

.equipped-select:hover,
.equipped-select:focus {
  border-color: var(--accent-color);
}

.equipped-only-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  padding: 5px 0;
}

/* Settings panel footer */
.settings-panel-footer {
  padding: var(--space-sm) var(--space-lg) var(--space-lg);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.settings-open-full-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px var(--space-md);
  background: var(--accent-light);
  color: var(--accent-color);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.settings-open-full-btn:hover {
  background: var(--accent-subtle);
  transform: translateY(-1px);
}

/* ===== Profile Panel ===== */

.profile-content {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-avatar-large {
  width: 96px;
  height: 96px;
  background: var(--bg-elevated);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xl);
  color: var(--accent-color);
  margin-bottom: var(--space-md);
  border: 4px solid var(--accent-color);
  position: relative;
  cursor: pointer;
}

.profile-avatar-camera {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-round);
  background: var(--accent-color);
  border: 2.5px solid var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  cursor: pointer;
  z-index: 3;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.profile-avatar-camera:hover {
  transform: scale(1.15);
  background: var(--accent-hover);
}

.profile-avatar-large:hover::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.profile-username {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xs);
}

.profile-tag {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.profile-bio {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--space-lg);
  padding: 0 var(--space-md);
  line-height: 1.6;
}

.profile-stats {
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-md) 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  width: 100%;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.profile-stat {
  text-align: center;
}

.profile-stat-value {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

.profile-stat-value.iron {
  color: var(--color-warning);
}

.profile-stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.profile-edit-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent-solid);
  color: var(--text-on-accent);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  transition: background-color var(--transition-fast);
}

.profile-edit-btn:hover {
  background: var(--accent-solid-hover);
}

/* ===== Toast Notification ===== */
.toast {
  display: none !important;
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%) scale(0.5);
  padding: var(--space-sm) var(--space-lg);
  background: var(--accent-color);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  color: #fff;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-tooltip);
  display: none;
  align-items: center;
  gap: var(--space-sm);
}

.toast.show {
  display: flex;
  animation: toastPillIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast.hide {
  display: flex;
  animation: toastPillOut 0.3s cubic-bezier(0.4, 0, 0.7, 0.2) forwards;
}

.toast.success { background: var(--color-success); border-color: transparent; }
.toast.error { background: var(--color-danger); border-color: transparent; }
.toast.info { background: var(--accent-color); border-color: transparent; }

/* Phase 2: settle — bg fades to neutral, text appears */
.toast.show.toast-settled {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-color);
  transition: background 0.4s ease, color 0.3s ease, border-color 0.3s ease;
}

.toast.show.toast-settled.success { border-color: var(--color-success); }
.toast.show.toast-settled.error { border-color: var(--color-danger); }
.toast.show.toast-settled.info { border-color: var(--accent-color); }

.toast i {
  font-size: 17px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.toast.show.toast-settled i { opacity: 1; }
.toast.show.toast-settled.success i { color: var(--color-success); }
.toast.show.toast-settled.error i { color: var(--color-danger); }
.toast.show.toast-settled.info i { color: var(--accent-color); }

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: var(--z-overlay);
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
  animation: overlayIn var(--transition-fast) forwards;
}

.modal-overlay.closing {
  display: flex;
  animation: overlayOut var(--transition-fast) forwards;
}

.modal-overlay.closing .modal {
  animation: scaleOut var(--transition-fast) forwards;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 528px;
  max-width: 90vw;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleIn var(--transition-normal) forwards;
}

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

.modal-header h2 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-color);
}

/* Icon Picker */
.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: var(--space-sm) 0;
}

.icon-picker-item {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 2px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.icon-picker-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.icon-picker-item.active {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: var(--accent-light);
}

.btn-primary {
  padding: 10px 24px;
  background: var(--accent-solid);
  color: var(--text-on-accent);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  transition: background-color var(--transition-fast);
}

.btn-primary:hover {
  background: var(--accent-solid-hover);
}

.btn-secondary {
  padding: 10px 24px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  transition: background-color var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.form-group input,
.form-group textarea {
  width: 100%;
}

.form-group textarea {
  resize: vertical;
  min-height: 96px;
}

/* ===== Full Settings Modal ===== */
.full-settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
}

.full-settings-overlay.active {
  display: flex;
  animation: overlayIn var(--transition-fast) forwards;
}

.full-settings-overlay.closing {
  display: flex;
  animation: overlayOut var(--transition-fast) forwards;
}

.full-settings {
  display: flex;
  width: 94vw;
  max-width: 1100px;
  height: 88vh;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: scaleIn var(--transition-normal) forwards;
}

.full-settings-overlay.closing .full-settings {
  animation: scaleOut var(--transition-fast) forwards;
}

/* Sidebar */
.full-settings__sidebar {
  width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.full-settings__sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-sm);
}

.full-settings__nav-label {
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: var(--space-sm) var(--space-sm) var(--space-xs);
  margin-top: var(--space-sm);
}

.full-settings__nav-label:first-child {
  margin-top: 0;
}

.full-settings__nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 9px var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
  margin-bottom: 2px;
}

.full-settings__nav-item i {
  width: 22px;
  text-align: center;
  font-size: 14px;
}

.full-settings__nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.full-settings__nav-item.active {
  background: var(--accent-light);
  color: var(--text-primary);
}

.full-settings__nav-separator {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-sm) var(--space-sm);
}

.full-settings__nav-item--danger {
  color: var(--color-danger);
}

.full-settings__nav-item--danger:hover {
  background: rgba(232, 64, 87, 0.1);
  color: var(--color-danger);
}

.full-settings__sidebar-footer {
  padding: var(--space-sm);
  border-top: 1px solid var(--border-color);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: center;
}

/* Hidden sidebar (grid home view) */
.full-settings__sidebar--hidden {
  display: none;
}

/* Back button in sidebar */
.full-settings__nav-back {
  color: var(--text-muted);
  font-size: 13px;
}
.full-settings__nav-back:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ─── Settings Grid Home ─── */
.fs-grid-home {
  flex: 1;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: var(--space-xl) var(--space-lg);
}

.fs-grid-home-inner {
  width: 100%;
  max-width: 800px;
}

.fs-grid-section-label {
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: var(--space-sm) 0 var(--space-xs);
  margin-top: var(--space-md);
}
.fs-grid-section-label:first-child {
  margin-top: 0;
}

.fs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.fs-grid-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.fs-grid-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.fs-grid-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.fs-grid-card-info {
  min-width: 0;
}

.fs-grid-card-title {
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.fs-grid-card-desc {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  line-height: 1.3;
}

.fs-grid-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) 0 var(--space-md);
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-md);
}

.fs-grid-logout {
  background: none;
  border: 1px solid var(--color-danger);
  color: var(--color-danger);
  padding: 8px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.fs-grid-logout:hover {
  background: var(--color-danger);
  color: #fff;
}

.fs-grid-version {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* Responsive: 2-column on narrow screens */
@media (max-width: 700px) {
  .fs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Content Area */
.full-settings__content {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.full-settings__content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl) var(--space-xl) var(--space-2xl);
  max-width: 740px;
}

.full-settings__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-round);
  border: 2px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  gap: 0;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.full-settings__close span {
  font-size: 8px;
  font-weight: var(--font-weight-semibold);
  margin-top: -1px;
}

.full-settings__close:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* Content Sections */
.fs-section-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xs);
}

.fs-section-desc {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.fs-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.fs-card-title {
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: var(--space-md);
}

/* Account banner + avatar */
.fs-account-banner {
  height: 100px;
  background: linear-gradient(135deg, var(--accent-solid), var(--accent-color));
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  margin: calc(-1 * var(--space-lg));
  margin-bottom: 0;
}

.fs-account-info {
  padding: 0 var(--space-lg) var(--space-md);
}

.fs-account-avatar {
  width: 80px;
  height: 80px;
  background: var(--bg-elevated);
  border: 5px solid var(--bg-secondary);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xl);
  color: var(--accent-color);
  margin-top: -40px;
  position: relative;
}

.fs-account-avatar-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-round);
  background: var(--accent-solid);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border: 3px solid var(--bg-secondary);
}

/* Field rows */
.fs-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
}

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

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

.fs-field-label {
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.fs-field-value {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.fs-field-edit-btn {
  font-size: var(--font-size-xs);
  color: var(--text-on-accent);
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-solid);
  font-weight: var(--font-weight-medium);
  transition: background-color var(--transition-fast);
  flex-shrink: 0;
}

.fs-field-edit-btn:hover {
  background: var(--accent-solid-hover);
}

/* Toggle switch */
.fs-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
  gap: var(--space-lg);
}

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

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

.fs-toggle-label {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.fs-toggle-desc {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.fs-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.fs-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.fs-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-hover);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.fs-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.fs-toggle input:checked + .fs-toggle-track {
  background: var(--accent-solid);
}

.fs-toggle input:checked + .fs-toggle-track::after {
  transform: translateX(20px);
  background: var(--text-on-accent);
}

/* Slider */
.fs-slider-row {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
}

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

.fs-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.fs-slider-label {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.fs-slider-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.fs-slider-value {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

.fs-slider-reset {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.fs-slider-reset:hover {
  background: var(--bg-hover);
  color: var(--accent-color);
}

.fs-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-hover);
  outline: none;
  border: none;
  padding: 0;
}

.fs-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.fs-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.fs-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  border: none;
}

/* Select / Dropdown */
.fs-select-row {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
}

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

.fs-select-label {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.fs-select {
  width: 100%;
  padding: 10px var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b80' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.fs-select:focus {
  border-color: var(--accent-color);
  outline: none;
}

/* Radio group */
.fs-radio-group {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
}

.fs-radio-option {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}

.fs-radio-option:hover {
  background: var(--bg-hover);
}

.fs-radio-option.active {
  border-color: var(--accent-color);
  background: var(--accent-subtle);
  color: var(--text-primary);
}

/* Keybind rows */
.fs-keybind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
}

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

.fs-keybind-action {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.fs-keybind-key {
  padding: 6px 16px;
  background: var(--bg-hover);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  min-width: 60px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.fs-keybind-key:hover {
  border-color: var(--accent-color);
}

.fs-keybind-key.recording {
  border-color: var(--color-danger);
  background: rgba(232, 64, 87, 0.1);
  color: var(--color-danger);
}

/* Language grid */
.fs-language-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.fs-language-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.fs-language-option:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.fs-language-option.active {
  border-color: var(--accent-color);
  background: var(--accent-color-10);
}

.fs-lang-native {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.fs-lang-english {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

/* Danger zone */
.fs-danger-zone {
  border-color: rgba(232, 64, 87, 0.3);
}

.fs-danger-zone .fs-card-title {
  color: var(--color-danger);
}

.fs-btn-danger {
  padding: 10px 24px;
  background: transparent;
  border: 1px solid var(--color-danger);
  color: var(--color-danger);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.fs-btn-danger:hover {
  background: rgba(232, 64, 87, 0.1);
}

/* Theme grid (full settings - 4 columns) */
.fs-theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.fs-theme-grid .theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.fs-theme-grid .theme-option:hover {
  background: var(--bg-hover);
}

.fs-theme-grid .theme-option.active {
  border-color: var(--accent-color);
  background: var(--accent-subtle);
}

.fs-theme-grid .theme-option.locked {
  opacity: 0.5;
  cursor: default;
}

/* Color picker */
.fs-color-input {
  -webkit-appearance: none;
  appearance: none;
  width: 48px;
  height: 48px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: transparent;
  padding: 2px;
}

.fs-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.fs-color-input::-webkit-color-swatch {
  border: none;
  border-radius: var(--radius-sm);
}

/* Custom color picker */
.fs-color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  position: relative;
}

.fs-color-swatch {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-round);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.fs-color-swatch:hover {
  transform: scale(1.08);
}

.fs-color-edit-btn {
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.fs-color-edit-btn:hover {
  color: var(--accent-color);
  background: var(--bg-hover);
}

.fs-color-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: var(--space-xs);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-sm);
  z-index: var(--z-tooltip);
  animation: scaleIn var(--transition-fast) forwards;
}

.fs-color-dropdown.open {
  display: block;
}

.fs-color-presets {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: var(--space-sm);
}

.fs-color-preset {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform var(--transition-fast);
  border: 2px solid transparent;
}

.fs-color-preset:hover {
  transform: scale(1.15);
}

.fs-color-hex-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: var(--space-xs);
  border-top: 1px solid var(--border-color);
}

.fs-color-hex-input {
  width: 70px;
  padding: 4px 6px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
}

/* Profile preview */
.fs-profile-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-top: var(--space-md);
}

.fs-profile-preview-avatar {
  width: 72px;
  height: 72px;
  background: var(--bg-hover);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  color: var(--accent-color);
  border: 3px solid var(--accent-color);
}

.fs-profile-preview-name {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

.fs-profile-preview-bio {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-align: center;
}

/* Inline input */
.fs-inline-input {
  width: 100%;
  padding: 10px var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: border-color var(--transition-fast);
}

.fs-inline-input:focus {
  border-color: var(--accent-color);
  outline: none;
}

.fs-inline-textarea {
  width: 100%;
  padding: 10px var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  transition: border-color var(--transition-fast);
}

.fs-inline-textarea:focus {
  border-color: var(--accent-color);
  outline: none;
}

/* Changelog */
.fs-changelog-entry {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-color);
}

.fs-changelog-entry:last-child {
  border-bottom: none;
}

.fs-changelog-version {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--accent-color);
  margin-bottom: var(--space-xs);
}

.fs-changelog-date {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.fs-changelog-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fs-changelog-list li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 3px 0 3px var(--space-md);
  position: relative;
}

.fs-changelog-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-color);
}

/* Block list */
.fs-block-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
}

.fs-block-item:last-child {
  border-bottom: none;
}

.fs-block-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.fs-block-avatar {
  width: 32px;
  height: 32px;
  background: var(--bg-elevated);
  font-size: 13px;
  font-weight: var(--font-weight-bold);
  color: var(--accent-color);
}

.fs-unblock-btn {
  font-size: var(--font-size-xs);
  color: var(--color-danger);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  transition: background-color var(--transition-fast);
}

.fs-unblock-btn:hover {
  background: rgba(232, 64, 87, 0.1);
}

/* Reduced motion utility */
.reduced-motion,
.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

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

/* High contrast utility */
.high-contrast {
  --border-color: rgba(255, 255, 255, 0.2);
  --border-strong: rgba(255, 255, 255, 0.35);
  --text-secondary: #c8c8d8;
  --text-muted: #9898b0;
}

/* Compact message display */
/* Compact message display mode */
[data-message-display="compact"] .message-group {
  padding: 2px 0;
  margin-bottom: 2px;
}

[data-message-display="compact"] .message-group-header {
  gap: 6px;
  margin-bottom: 1px;
}

[data-message-display="compact"] .message-group-avatar {
  width: 20px;
  height: 20px;
  font-size: 9px;
}

[data-message-display="compact"] .message-group-messages {
  padding-left: 28px;
}

[data-message-display="compact"] .message-group-item {
  padding: 1px 0;
  font-size: var(--font-size-xs);
}

[data-message-display="compact"] .message-group-author {
  font-size: var(--font-size-xs);
}

[data-message-display="compact"] .message-group-time {
  font-size: 10px;
}

/* Compact DM messages */
[data-message-display="compact"] .message {
  padding: 3px var(--space-md);
  gap: 8px;
}

[data-message-display="compact"] .message-avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

[data-message-display="compact"] .message-content {
  font-size: var(--font-size-xs);
}

[data-message-display="compact"] .message-author {
  font-size: var(--font-size-xs);
}

[data-message-display="compact"] .message-timestamp {
  font-size: 10px;
}

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .dashboard-bottom-row {
    grid-template-columns: 1fr;
  }

  .quick-stats {
    flex-direction: column;
  }

  .quests-grid {
    grid-template-columns: 1fr;
  }

  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .channel-sidebar {
    width: 240px;
  }

  .featured-banner {
    flex-direction: column;
  }

  .featured-banner-icon {
    display: none;
  }

  .achievement-card {
    flex-direction: column;
    text-align: center;
  }

  .achievement-progress {
    flex-direction: column;
  }

  .bundle-content {
    flex-direction: column;
  }

  .bundle-pricing {
    align-items: flex-start;
  }

  .quest-section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 840px) {
  .nav-tab span,
  .comm-sub-tab span {
    display: none;
  }

  .nav-tab {
    padding: 12px 19px;
  }

  .comm-sub-tab {
    padding: 12px 16px;
  }

  .shop-grid {
    grid-template-columns: 1fr;
  }

  .dm-list-sidebar {
    width: 264px;
  }
}

@media (max-width: 480px) {
  .full-settings {
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
  }

  .full-settings__sidebar {
    width: 100%;
    max-height: 160px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .full-settings__sidebar-scroll {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    gap: var(--space-xs);
  }

  .full-settings__nav-label,
  .full-settings__nav-separator {
    display: none;
  }

  .full-settings__nav-item {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .modal {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .friend-online-chip {
    min-width: 140px;
  }

  .popup-panel {
    left: 0;
    right: 0;
    width: auto;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .dm-list-sidebar {
    width: 200px;
  }
}

/* ===== Nav Auto-Hide ===== */

/* Slide transition — wrapper stays in normal flow so dashboard/iron-center don't shift */
.nav-island-wrapper.nav-autohide {
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1), gap 280ms ease;
}

/* Hidden: visually slid off screen (still occupies layout space) */
.nav-island-wrapper.nav-autohide.nav-hidden {
  transform: translateY(calc(-100% - var(--space-sm)));
  pointer-events: none;
}

/* Communication view covers full screen when auto-hide is on or nav is manually collapsed */
#app.nav-autohide-on #view-communication.active,
#app.nav-manual-collapsed #view-communication.active {
  position: fixed;
  inset: 0;
  padding: var(--space-sm) var(--space-md) var(--space-md);
  z-index: calc(var(--z-nav) - 1);
  background: var(--bg-primary);
  height: auto;
  overflow-y: auto;
}

/* Merging: fuse the 3 islands into one bar before hiding */
.nav-island-wrapper.nav-merging {
  gap: 0 !important;
}

.nav-island-wrapper.nav-merging .nav-island {
  border-radius: 0;
  border-left-color: transparent;
  border-right-color: transparent;
}

.nav-island-wrapper.nav-merging .comm-sub-left {
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
  border-right-color: transparent;
}

.nav-island-wrapper.nav-merging .comm-sub-right {
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  border-left-color: transparent;
}

.nav-island-wrapper.nav-merging .comm-sub-tabs,
.nav-island-wrapper.nav-merging .nav-island {
  box-shadow: none;
}

.nav-island-wrapper.nav-merging {
  filter: drop-shadow(0 5px 24px rgba(0, 0, 0, 0.5));
}

/* ===== Welcome / Auth Screen ===== */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-primary);
  scroll-behavior: smooth;
}

/* -- Animated background -- */
.welcome-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.welcome-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
}

.welcome-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  animation: welcomeGlowDrift 12s ease-in-out infinite alternate;
}

.welcome-glow-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-color);
  top: -10%;
  left: -5%;
  animation-delay: 0s;
}

.welcome-glow-2 {
  width: 400px;
  height: 400px;
  background: var(--accent-solid);
  bottom: -8%;
  right: -3%;
  animation-delay: -4s;
}

.welcome-glow-3 {
  width: 300px;
  height: 300px;
  background: var(--accent-hover);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.15;
  animation-delay: -8s;
}

/* -- Page wrapper -- */
.welcome-page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- Section 1: Hero ---- */
.wlp-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  position: relative;
  width: 100%;
}

.wlp-hero-content {
  animation: slideUp 0.7s ease both;
}

.wlp-hero-title {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
  background: linear-gradient(
    90deg,
    var(--accent-color) 0%, var(--accent-color) 44%,
    rgba(255, 255, 255, 0.9) 50%,
    var(--accent-color) 56%, var(--accent-color) 100%
  );
  background-size: 400% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--accent-color) 30%, transparent));
  animation: textShine 12s linear infinite;
}

.wlp-hero-title span {
  letter-spacing: 0.05em;
}

.wlp-hero-tagline {
  font-size: 48px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.wlp-hero-sub {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto var(--space-xl);
  line-height: 1.6;
}

/* Cat mascot */
.wlp-mascot-hero {
  margin: 0 auto var(--space-lg);
}

.wlp-cat-svg {
  width: 120px;
  height: 120px;
  animation: catFloat 4s ease-in-out infinite;
}

.wlp-cat-eyes {
  transform-origin: center 76px;
  animation: catBlink 4s ease-in-out infinite;
}

/* CTA button */
.wlp-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--accent-color);
  color: var(--bg-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow 0.4s ease, opacity 0.25s ease;
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent-color) 25%, transparent);
}

.wlp-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 36px color-mix(in srgb, var(--accent-color) 40%, transparent);
}

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

.wlp-download-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-sm);
  text-align: center;
}

.wlp-download-label i {
  color: var(--accent-color);
  margin-right: 6px;
  font-size: 13px;
}

/* Secondary CTA (ghost/outline style) */
.wlp-cta-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}

.wlp-cta-secondary:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  box-shadow: 0 0 20px rgba(18, 244, 156, 0.12);
}

/* Quick signup bar */
.wlp-quick-signup {
  margin-bottom: var(--space-lg);
}

.wlp-quick-signup-bar {
  display: flex;
  align-items: center;
  max-width: 400px;
  margin: 0 auto var(--space-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  overflow: hidden;
  transition: border-color var(--transition-normal);
}

.wlp-quick-signup-bar:focus-within {
  border-color: var(--accent-color);
}

.wlp-quick-signup-bar input {
  flex: 1;
  padding: 14px 22px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  outline: none;
}

.wlp-quick-signup-bar input::placeholder {
  color: var(--text-muted);
}

.wlp-quick-signup-bar button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  margin: 4px;
  background: var(--accent-color);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.25s ease, box-shadow 0.4s ease;
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent-color) 20%, transparent);
}

.wlp-quick-signup-bar button:hover {
  opacity: 0.9;
  box-shadow: 0 0 28px color-mix(in srgb, var(--accent-color) 40%, transparent);
}

.wlp-quick-login {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.wlp-quick-login a {
  color: var(--accent-color);
  cursor: pointer;
  text-decoration: none;
}

.wlp-quick-login a:hover {
  text-decoration: underline;
}

/* Hero downloads */
.wlp-hero-downloads {
  margin-bottom: var(--space-lg);
}

.wlp-hero-downloads .welcome-download-btns {
  justify-content: center;
}

/* ---- Section 2: Feature Showcases ---- */
.wlp-showcases {
  width: 100%;
  max-width: 1000px;
  padding: 80px var(--space-xl) 40px;
  display: flex;
  flex-direction: column;
  gap: 100px;
  margin: 0 auto;
}

.wlp-section-title {
  text-align: center;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  letter-spacing: -0.02em;
}

.wlp-showcase {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}

.wlp-showcase.reverse {
  flex-direction: row-reverse;
}

.wlp-showcase-text {
  flex: 1;
  min-width: 0;
}

.wlp-showcase-text h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.01em;
}

.wlp-showcase-text p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.7;
}

.wlp-showcase-visual {
  flex: 1.2;
  min-width: 0;
}

/* Mockup container */
.wlp-mockup {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: perspective(800px) rotateY(-2deg);
  transition: transform var(--transition-normal);
}

.reverse .wlp-mockup {
  transform: perspective(800px) rotateY(2deg);
}

.wlp-mockup:hover {
  transform: perspective(800px) rotateY(0deg);
}

/* Channel header (matches real .channel-header) */
.wlp-mock-channel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 var(--space-md);
  height: 48px;
  border-bottom: 1px solid var(--border-color);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.wlp-mock-channel-header i {
  color: var(--text-muted);
  font-size: 14px;
}

.wlp-mock-hash {
  color: var(--text-muted);
  font-weight: var(--font-weight-bold);
  font-size: 18px;
}

/* Shared avatar (matches real .avatar) */
.wlp-mock-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-round);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: 13px;
  color: #fff;
}

.wlp-mock-avatar span {
  line-height: 1;
}

/* ---- Chat mockup (matches .message-group) ---- */
.wlp-mock-chat-area {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.wlp-mock-msg-group {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.wlp-mock-msg-group.own {
  border-left: 3px solid var(--accent-color);
}

.revealed .wlp-mock-msg-group {
  opacity: 1;
  transform: translateY(0);
}

.revealed .wlp-mock-msg-group:nth-child(1) { transition-delay: 200ms; }
.revealed .wlp-mock-msg-group:nth-child(2) { transition-delay: 500ms; }
.revealed .wlp-mock-msg-group:nth-child(3) { transition-delay: 800ms; }

.wlp-mock-msg-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.wlp-mock-author {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.wlp-mock-time {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.wlp-mock-msg-content {
  padding-left: 46px;
}

.wlp-mock-msg-content p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Typing bar (matches real .typing-indicator) */
.wlp-mock-typing-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 var(--space-lg);
  min-height: 20px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.wlp-mock-typing-dots {
  display: inline-flex;
  gap: 2px;
}

.wlp-mock-typing-dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: var(--radius-round);
  background: var(--text-muted);
  animation: typingDot 1.4s ease-in-out infinite;
}

.wlp-mock-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.wlp-mock-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

/* Chat input mockup (matches real .chat-input-wrapper) */
.wlp-mock-input {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-sm) var(--space-lg) var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.wlp-mock-input span {
  flex: 1;
}

.wlp-mock-input i {
  font-size: 19px;
}

/* ---- Voice mockup (matches .voice-channel-area) ---- */
.wlp-mock-voice-area {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-xl) var(--space-lg);
}

.wlp-mock-voice-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.wlp-mock-voice-avatar {
  width: 56px;
  height: 56px;
  font-size: var(--font-size-lg);
  border: 2px solid transparent;
}

.wlp-mock-voice-user.speaking .wlp-mock-voice-avatar {
  border-color: var(--color-success);
  animation: voiceRing 1.5s ease-in-out infinite;
}

.wlp-mock-voice-name {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.wlp-mock-voice-icon {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.wlp-mock-voice-controls {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0 var(--space-lg) var(--space-lg);
}

.wlp-mock-voice-ctrl {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-round);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 16px;
}

.wlp-mock-voice-leave {
  background: var(--color-danger);
  color: #fff;
}

/* ---- DM mockup (matches .dm-bubble) ---- */
.wlp-mock-dm-header-avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.wlp-mock-dm-area {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.wlp-mock-dm-bubble {
  max-width: 70%;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.wlp-mock-dm-bubble.own {
  align-self: flex-end;
  background: var(--accent-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
}

.wlp-mock-dm-bubble.other {
  align-self: flex-start;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm);
}

.wlp-mock-dm-author {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: 2px;
}

.wlp-mock-dm-content {
  color: var(--text-secondary);
}

.wlp-mock-dm-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  text-align: right;
}

.wlp-mock-dm-time.left {
  text-align: left;
}

/* Status dots */
.wlp-mock-status {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-round);
  flex-shrink: 0;
}

.wlp-mock-status.online { background: var(--color-online); }
.wlp-mock-status.idle { background: var(--color-idle); }
.wlp-mock-status.offline { background: var(--color-offline); }

/* ---- Section 3: Theme Preview ---- */
.wlp-themes-section {
  width: 100%;
  max-width: 1000px;
  padding: 80px var(--space-xl) 40px;
  margin: 0 auto;
  text-align: center;
}

.wlp-themes-sub {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

.wlp-themes-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-lg);
  box-shadow: var(--shadow-lg);
}

.wlp-themes-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-md);
}

.wlp-theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
}

.wlp-theme-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.wlp-theme-swatch:hover .wlp-theme-preview {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Accent strip at top of swatch */
.wlp-theme-accent {
  height: 4px;
  width: 100%;
}

/* Mini UI mockup inside theme swatch */
.wlp-theme-ui {
  display: flex;
  height: calc(100% - 4px);
  padding: 3px;
  gap: 2px;
}

.wlp-theme-sidebar {
  width: 28%;
  border-radius: 2px;
}

.wlp-theme-chat {
  flex: 1;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3px;
  gap: 2px;
}

.wlp-theme-msg {
  height: 6px;
  border-radius: 2px;
  width: 75%;
}

.wlp-theme-msg.own {
  border-left: 2px solid;
  width: 65%;
}

/* Theme name label */
.wlp-theme-name {
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Active swatch state */
.wlp-theme-swatch.active .wlp-theme-preview {
  box-shadow: 0 0 0 2px var(--accent-color);
  transform: translateY(-3px);
}

/* ---- Section 4: Mascot Personality ---- */
.wlp-mascot-section {
  width: 100%;
  max-width: 800px;
  padding: 80px var(--space-xl);
}

.wlp-mascot-block {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}

.wlp-mascot-large {
  flex-shrink: 0;
}

.wlp-cat-large {
  width: 200px;
  height: 200px;
}

.wlp-mascot-text {
  flex: 1;
}

.wlp-speech-bubble {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  position: relative;
  margin-bottom: var(--space-md);
}

.wlp-speech-bubble::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: var(--border-color);
}

.wlp-speech-bubble::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--bg-secondary);
}

.wlp-speech-bubble p {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--accent-color);
  font-style: italic;
}

.wlp-mascot-desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.wlp-mascot-cta {
  margin-top: 0;
}

/* ---- Auth Page (separate view) ---- */
.wlp-auth-page {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-2xl) var(--space-xl);
}

.wlp-auth-page .auth-card {
  width: 100%;
  max-width: 420px;
  animation: slideUp 0.5s ease both;
}

.wlp-back-btn {
  position: absolute;
  top: var(--space-lg);
  left: var(--space-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  z-index: 2;
}

.wlp-back-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* ---- Scroll Reveal System ---- */
.scroll-reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.97);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Showcase stagger delays */
.wlp-showcases .wlp-showcase:nth-child(1) .scroll-reveal { transition-delay: 0ms; }
.wlp-showcases .wlp-showcase:nth-child(2) .scroll-reveal { transition-delay: 0ms; }
.wlp-showcases .wlp-showcase:nth-child(3) .scroll-reveal { transition-delay: 0ms; }

/* -- Download buttons -- */

.welcome-download-btns {
  display: flex;
  gap: var(--space-md);
}

.welcome-dl-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 36px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--transition-fast), transform var(--transition-fast), color var(--transition-fast);
  z-index: 0;
}

.welcome-dl-btn i {
  font-size: 24px;
  transition: color var(--transition-fast);
}

.welcome-dl-btn::before {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(
    from var(--dl-btn-angle, 0deg),
    var(--accent-color),
    var(--accent-solid),
    var(--accent-hover),
    var(--accent-color)
  );
  opacity: 0;
  transition: opacity var(--transition-normal);
  animation: dlBtnSpin 2.5s linear infinite;
}

.welcome-dl-btn::after {
  content: '';
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: inherit;
  background: var(--bg-tertiary);
  transition: background var(--transition-fast);
}

.welcome-dl-btn:hover {
  border-color: transparent;
  transform: translateY(-2px);
}

.welcome-dl-btn:hover::before {
  opacity: 1;
}

.welcome-dl-btn:hover::after {
  background: var(--bg-elevated);
}

/* OS-specific download button colors — always applied to ::before so no green flash on hover-off */
.welcome-dl-btn[data-os="windows"]::before {
  background: conic-gradient(from var(--dl-btn-angle, 0deg), #0078D4, #00a4ef, #50e6ff, #0078D4);
}
.welcome-dl-btn[data-os="windows"]:hover i { color: #00a4ef; }

.welcome-dl-btn[data-os="mac"]::before {
  background: conic-gradient(from var(--dl-btn-angle, 0deg), #48484a, #8e8e93, #b0b0b4, #48484a);
}
.welcome-dl-btn[data-os="mac"]:hover i { color: #b0b0b4; }

.welcome-dl-btn[data-os="linux"]::before {
  background: conic-gradient(from var(--dl-btn-angle, 0deg), #FCC624, #e5af00, #ffdd57, #FCC624);
}
.welcome-dl-btn[data-os="linux"]:hover i { color: #FCC624; }

/* -- Auth card -- */

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

.auth-card h2 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.auth-card .auth-subtitle {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  margin-bottom: var(--space-lg);
}

/* Social sign-in buttons */
.auth-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: var(--space-md);
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: background var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.auth-social-btn:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.auth-social-btn:active {
  box-shadow: none;
}

.auth-social-google {
  background: #24292f;
  color: #fff;
  border-color: #3d444d;
}

.auth-social-google:hover {
  background: #2f363d;
  border-color: #525960;
}

.auth-social-github {
  background: #24292f;
  color: #fff;
  border-color: #3d444d;
}

.auth-social-github:hover {
  background: #2f363d;
  border-color: #525960;
}

.auth-social-github i {
  font-size: 18px;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: var(--space-md);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-divider span {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Form */
.auth-card .form-group {
  margin-bottom: var(--space-md);
}

.auth-card .form-group label {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.auth-card .form-group input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  transition: border-color 0.2s;
}

.auth-card .form-group input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.auth-card .auth-submit {
  width: 100%;
  padding: 12px;
  background: var(--accent-color);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: opacity 0.2s, transform var(--transition-fast);
  margin-top: var(--space-sm);
}

.auth-card .auth-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.auth-card .auth-submit:active {
  transform: translateY(0);
}

.auth-card .auth-toggle {
  text-align: center;
  margin-top: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.auth-card .auth-toggle a {
  color: var(--accent-color);
  cursor: pointer;
  text-decoration: none;
}

.auth-card .auth-toggle a:hover {
  text-decoration: underline;
}

.auth-card .auth-error {
  background: rgba(231, 76, 60, 0.15);
  color: var(--color-danger);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  margin-bottom: var(--space-md);
}

/* Auth card inner wrapper for animated toggle */
.auth-card-inner {
  transition: opacity 0.25s ease;
}

.auth-card.auth-transitioning {
  transition: height 0.45s cubic-bezier(0.4, 0, 0.2, 1), transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.45s ease;
  overflow: hidden;
  transform: scale(1.015);
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.45);
  will-change: height, transform;
}

.auth-card.auth-transitioning.auth-settle {
  transform: scale(1);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

.auth-content-exit {
  animation: authContentOut 0.2s ease forwards;
}

.auth-content-enter {
  animation: authContentIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes authContentOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-12px) scale(0.98); }
}

@keyframes authContentIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Auth screen theme transition */
.auth-screen.theme-transitioning {
  transition: background 0.6s ease, color 0.6s ease;
}

/* Form field validation */
.form-field-error {
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 0 2px rgba(232, 64, 87, 0.15);
}

.form-error-msg {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--color-danger);
  font-size: var(--font-size-xs);
  margin-top: 4px;
  animation: formErrorAppear 0.2s ease;
}

.form-error-msg i {
  font-size: 11px;
}

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

/* -- Email Verification Screen -- */
.verify-container {
  text-align: center;
}

.verify-container h2 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.verify-icon {
  font-size: 48px;
  color: var(--accent-color);
  margin-bottom: var(--space-md);
}

.verify-code-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: var(--space-lg) 0;
}

.verify-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  caret-color: var(--accent-color);
}

.verify-digit:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(18, 244, 156, 0.15);
}

.verify-code-dash {
  width: 16px;
  height: 3px;
  background: var(--border-color);
  border-radius: 2px;
}

.verify-resend {
  margin-top: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.verify-resend a {
  color: var(--accent-color);
  cursor: pointer;
  text-decoration: none;
  margin-left: 4px;
}

.verify-resend a:hover {
  text-decoration: underline;
}

/* -- Welcome Page Responsive -- */
@media (max-width: 960px) {
  .wlp-hero-title {
    font-size: 40px;
  }

  .wlp-hero-tagline {
    font-size: 36px;
  }

  .wlp-showcase,
  .wlp-showcase.reverse {
    flex-direction: column;
    text-align: center;
  }

  .wlp-showcase-visual {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
  }

  .wlp-mockup,
  .reverse .wlp-mockup {
    transform: none;
  }

  .wlp-showcases {
    gap: 70px;
  }

  .wlp-themes-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .wlp-mascot-block {
    flex-direction: column;
    text-align: center;
  }

  .wlp-speech-bubble::before,
  .wlp-speech-bubble::after {
    display: none;
  }

  .welcome-download-btns {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .wlp-hero-title {
    font-size: 32px;
  }

  .wlp-hero-tagline {
    font-size: 28px;
  }

  .wlp-hero-sub {
    font-size: var(--font-size-xs);
  }

  .wlp-section-title {
    font-size: var(--font-size-xl);
  }

  .wlp-showcases {
    padding: 60px var(--space-md) 40px;
    gap: 50px;
  }

  .wlp-showcase-text h3 {
    font-size: var(--font-size-lg);
  }

  .wlp-themes-section {
    padding: 60px var(--space-md) 40px;
  }

  .wlp-themes-card {
    padding: var(--space-md);
  }

  .wlp-themes-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
  }

  .welcome-dl-btn {
    padding: 14px 24px;
    font-size: var(--font-size-xs);
  }

  .wlp-back-btn {
    top: var(--space-sm);
    left: var(--space-sm);
  }
}

/* ===== Voice Channel UI ===== */
.voice-channel-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  gap: var(--space-lg);
}

.voice-users {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}

.voice-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.voice-user-avatar {
  width: 56px;
  height: 56px;
  font-size: var(--font-size-lg);
}

.voice-user-name {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.voice-user-icon {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.voice-empty {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.voice-controls {
  display: flex;
  gap: var(--space-sm);
}

.voice-ctrl-btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent-color);
  color: var(--bg-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  transition: opacity 0.2s;
}

.voice-ctrl-btn:hover {
  opacity: 0.9;
}

#voice-leave-btn {
  background: var(--color-error);
}

/* ===== Incoming Call Overlay ===== */
.incoming-call-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  padding-top: var(--space-lg);
  animation: fadeIn 0.3s ease;
}

.incoming-call-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.incoming-call-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.incoming-call-info i {
  color: var(--accent-color);
  animation: pulse 1.5s infinite;
}

.incoming-call-actions {
  display: flex;
  gap: var(--space-sm);
}

.call-accept-btn, .call-reject-btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.call-accept-btn {
  background: var(--color-online);
  color: #fff;
}

.call-reject-btn {
  background: var(--color-error);
  color: #fff;
}

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

/* ===== Empty Server State ===== */
.servers-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  min-height: 300px;
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
}

.servers-empty-icon {
  font-size: 64px;
  opacity: 0.3;
  margin-bottom: var(--space-lg);
}

.servers-empty h3 {
  font-size: var(--font-size-xl);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.servers-empty p {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-lg);
}

.servers-empty-actions {
  display: flex;
  gap: var(--space-sm);
}

.servers-empty-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  transition: background 0.2s, transform 0.15s;
}

.servers-empty-actions button:hover {
  transform: translateY(-1px);
}

.btn-create-server {
  background: var(--accent-solid);
  color: var(--text-on-accent);
}

.btn-create-server:hover {
  background: var(--accent-solid-hover);
}

.btn-join-server {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-join-server:hover {
  background: var(--bg-hover);
}

/* ===== Channel Add Button ===== */
.channel-add-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  padding: 2px 4px;
  margin-left: auto;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  border-radius: var(--radius-sm);
}

.channel-category-name {
  display: flex;
  align-items: center;
}

.channel-category-name:hover .channel-add-btn {
  opacity: 1;
}

.channel-add-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ===== Voice Control Buttons ===== */
.voice-controls {
  display: flex;
  gap: var(--space-xs);
  justify-content: center;
  padding: var(--space-md);
}

.voice-ctrl-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.voice-ctrl-btn:hover {
  background: var(--bg-hover);
  transform: scale(1.1);
}

.voice-ctrl-btn.active {
  background: var(--color-error);
  color: #fff;
}

.voice-ctrl-btn.voice-leave {
  background: var(--color-error);
  color: #fff;
}

.voice-ctrl-btn.voice-leave:hover {
  background: #c0392b;
}

/* DM Call Panel removed — call state shown in island */

/* ===== Typing Indicator ===== */
.typing-indicator {
  min-height: 20px;
  padding: 0 16px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.typing-dots span {
  animation: typingBounce 1.2s infinite;
  font-weight: bold;
}

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

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

/* ===== Message Actions (Edit/Delete) ===== */
.message {
  position: relative;
}

.message-actions {
  position: absolute;
  top: 4px;
  right: 8px;
  display: none;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.message:hover .message-actions {
  display: flex;
}

.msg-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 4px 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: color 0.2s, background 0.2s;
}

.msg-action-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* Message edit input */
.msg-edit-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--accent-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: inherit;
  margin-bottom: 4px;
}

.msg-edit-actions {
  display: flex;
  gap: 6px;
}

.msg-edit-save, .msg-edit-cancel {
  padding: 2px 10px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  cursor: pointer;
}

.msg-edit-save {
  background: var(--accent-color);
  color: #fff;
}

.msg-edit-cancel {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* ===== Server Dropdown Menu ===== */
.server-settings-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.server-settings-btn:hover {
  color: var(--text-primary);
}

.server-settings-btn.open {
  transform: rotate(180deg);
  color: var(--text-primary);
}

.server-dropdown {
  position: absolute;
  top: 100%;
  left: 8px;
  right: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: dropdownFadeIn 0.15s ease;
}

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

.server-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.server-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.server-dropdown-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
}

.server-dropdown-item.danger {
  color: var(--color-danger);
}

.server-dropdown-item.danger:hover {
  background: rgba(232, 64, 87, 0.1);
  color: var(--color-danger);
}

.server-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* ===== Invite Code Row ===== */
.invite-code-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.invite-code-row input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: monospace;
  font-size: var(--font-size-md);
}

.btn-copy-invite {
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-copy-invite:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ===== Full Server Settings Extensions ===== */
.full-settings__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.full-settings__subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: 24px;
}

.full-settings__field {
  margin-bottom: 16px;
}

.full-settings__field label {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.full-settings__field input,
.full-settings__field select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--font-size-md);
}

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

.full-settings__save-btn {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
  margin-bottom: 24px;
}

.full-settings__save-btn:hover {
  background: var(--accent-hover);
}

.full-settings__info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.full-settings__info-row span:last-child {
  color: var(--text-primary);
  font-weight: 600;
}

.full-settings__nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 8px;
}

/* Channels tab */
.full-settings__category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  margin-top: 12px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.full-settings__channel-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 2px 0;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.full-settings__channel-row > i {
  color: var(--text-muted);
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.full-settings__channel-row > span {
  flex: 1;
}

.full-settings__channel-row > .full-settings__small-btn {
  margin-left: auto;
  flex-shrink: 0;
}

/* Members tab */
.full-settings__member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.full-settings__member-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.full-settings__member-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.full-settings__member-role {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: capitalize;
}

/* Small buttons */
.full-settings__small-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.full-settings__small-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.full-settings__small-btn.danger {
  color: var(--color-danger);
}

.full-settings__small-btn.danger:hover {
  background: rgba(232, 64, 87, 0.1);
}

/* ===== Confirm Dialog ===== */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: calc(var(--z-modal) + 10);
  align-items: center;
  justify-content: center;
}

.confirm-overlay.active {
  display: flex;
  animation: overlayIn var(--transition-fast) forwards;
}

.confirm-overlay.closing {
  display: flex;
  animation: overlayOut var(--transition-fast) forwards;
}

.confirm-overlay.closing .confirm-modal {
  animation: scaleOut var(--transition-fast) forwards;
}

.confirm-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 420px;
  max-width: 90vw;
  padding: 32px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: scaleIn var(--transition-normal) forwards;
}

.confirm-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(232, 64, 87, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--color-danger);
  margin-bottom: 16px;
}

.confirm-icon:not(.danger) {
  background: rgba(18, 244, 156, 0.1);
  color: var(--accent-color);
}

.confirm-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.confirm-message {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.confirm-actions .btn-secondary {
  flex: 1;
  max-width: 140px;
}

.confirm-actions .btn-danger,
.confirm-actions .btn-primary {
  flex: 1;
  max-width: 160px;
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-danger:hover {
  background: #c73048;
  transform: translateY(-1px);
}

/* ===== Dynamic Island ===== */

.island {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(14px) scaleX(0.25) scaleY(0.85);
  z-index: 450;
  background: color-mix(in srgb, var(--bg-secondary) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: fit-content;
  min-width: 200px;
  padding: 10px 18px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  will-change: transform, opacity;
}

/* Shimmer sweep layer (visible on persistent items) */
.island::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-light), transparent);
  transform: translateX(-160%);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}

/* Expand — smooth morph from pill to full size with spring physics */
.island--visible {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
  transform: translateX(-50%) translateY(0) scaleX(1) scaleY(1);
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s ease,
              background 0.3s ease,
              box-shadow 0.3s ease;
}

/* Exit — smooth contraction from sides inward */
.island.island--exiting {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(6px) scaleX(0.25) scaleY(0.85);
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.7, 0.2),
              opacity 0.3s ease 0.1s;
}

/* Content stagger — organic pop with overshoot, delayed for smooth morph */
.island--visible .island__icon,
.island--visible .island__avatar {
  animation: island-el-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

.island--visible .island__text {
  animation: island-el-in 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.island--visible .island__actions {
  animation: island-el-in 0.36s cubic-bezier(0.34, 1.56, 0.64, 1) 0.26s both;
}

@keyframes island-el-in {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.78);
  }
  65% {
    opacity: 1;
    transform: translateY(-2px) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Content exits quickly during close for clean morph */
.island--exiting .island__icon,
.island--exiting .island__avatar,
.island--exiting .island__text,
.island--exiting .island__actions {
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

/* Border color variants */
.island--green  { border-color: var(--color-success); box-shadow: var(--shadow-lg), 0 0 18px rgba(67, 181, 129, 0.2); }
.island--accent { border-color: var(--accent-color); box-shadow: var(--shadow-lg), 0 0 18px var(--accent-light); }
.island--warning { border-color: var(--color-warning); box-shadow: var(--shadow-lg), 0 0 18px rgba(240, 168, 48, 0.2); }
.island--success { border-color: var(--color-success); box-shadow: var(--shadow-lg), 0 0 18px rgba(67, 181, 129, 0.2); }
.island--muted  { border-color: var(--border-strong); }
.island--danger { border-color: var(--color-danger); box-shadow: var(--shadow-lg), 0 0 18px rgba(231, 76, 60, 0.2); }

/* Toast icon variants */
.island__icon--danger  { background: rgba(231, 76, 60, 0.15); color: var(--color-danger); }
.island__icon--info    { background: var(--accent-light); color: var(--accent-color); }

/* Content layout */
.island__content {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.island__content--clickable {
  cursor: pointer;
}

.island__content--clickable:hover .island__title {
  color: var(--accent-color);
}

/* Icon */
.island__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.island__icon--call    { background: rgba(67, 181, 129, 0.15); color: var(--color-success); }
.island__icon--muted   { background: var(--bg-hover); color: var(--text-muted); }
.island__icon--accent  { background: var(--accent-light); color: var(--accent-color); }
.island__icon--warning { background: rgba(240, 168, 48, 0.15); color: var(--color-warning); }
.island__icon--success { background: rgba(67, 181, 129, 0.15); color: var(--color-success); }

/* Avatar (for DMs) */
.island__avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-round);
  background: var(--accent-solid);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
}

/* Text */
.island__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.island__title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.island__subtitle {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.island__timer {
  font-variant-numeric: tabular-nums;
}

/* Action buttons */
.island__actions {
  display: flex;
  gap: 6px;
  margin-left: 4px;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.island--hide-actions .island__actions {
  opacity: 0;
  transform: scale(0.7);
  pointer-events: none;
  flex-shrink: 0;
}

.island__btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.island__btn:hover {
  transform: scale(1.1);
}

.island__btn--accept {
  background: var(--color-success);
  color: #fff;
}

.island__btn--decline {
  background: var(--color-danger);
  color: #fff;
}

/* Text-label variant for stop button */
.island__btn--decline:has(i) {
  width: 32px;
}

button.island__btn--decline:not(:has(i)) {
  width: auto;
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
}

/* Shimmer sweep for persistent items (calls, screenshare) */
.island--persistent.island--visible::after {
  opacity: 0.55;
  animation: island-shimmer 4.5s ease-in-out 1.2s infinite;
}

@keyframes island-shimmer {
  0%, 100% { transform: translateX(-160%); }
  35%, 55% { transform: translateX(320%); }
}

/* Glow pulse for persistent items */
@keyframes island-glow-green {
  0%, 100% { box-shadow: var(--shadow-lg), 0 0 18px rgba(67, 181, 129, 0.2); }
  50%      { box-shadow: var(--shadow-lg), 0 0 30px rgba(67, 181, 129, 0.38); }
}
@keyframes island-glow-accent {
  0%, 100% { box-shadow: var(--shadow-lg), 0 0 18px var(--accent-light); }
  50%      { box-shadow: var(--shadow-lg), 0 0 30px var(--accent-light); }
}
@keyframes island-glow-warning {
  0%, 100% { box-shadow: var(--shadow-lg), 0 0 18px rgba(240, 168, 48, 0.2); }
  50%      { box-shadow: var(--shadow-lg), 0 0 30px rgba(240, 168, 48, 0.38); }
}
.island--green.island--visible  { animation: island-glow-green 2.8s ease-in-out 0.5s infinite; }
.island--accent.island--visible { animation: island-glow-accent 2.8s ease-in-out 0.5s infinite; }
.island--warning.island--visible { animation: island-glow-warning 2.8s ease-in-out 0.5s infinite; }

/* ===== Onboarding Wizard ===== */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.onboarding-overlay.onboarding--visible { opacity: 1; }
.onboarding-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  width: 520px;
  max-width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.onboarding--visible .onboarding-card { transform: scale(1); }

/* Progress */
.onboarding-progress {
  display: flex;
  align-items: center;
  padding: 24px 32px 0;
  gap: 0;
}
.onboarding-progress-step {
  display: flex;
  align-items: center;
  flex: 1;
}
.onboarding-progress-step:last-child { flex: 0; }
.onboarding-progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  flex-shrink: 0;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.onboarding-progress-step.active .onboarding-progress-dot {
  background: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent-color) 50%, transparent);
}
.onboarding-progress-step.done .onboarding-progress-dot {
  background: var(--accent-color);
  border-color: var(--accent-color);
}
.onboarding-progress-line {
  flex: 1;
  height: 2px;
  background: var(--border-color);
  margin: 0 4px;
  transition: background 0.3s;
}
.onboarding-progress-step.done .onboarding-progress-line {
  background: var(--accent-color);
}

/* Body */
.onboarding-body { padding: 24px 32px; overflow: hidden; }

/* Step slide transition */
.onboarding-step-slide-out {
  animation: obSlideOut 0.25s ease forwards;
}
.onboarding-step-slide-in {
  animation: obSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes obSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-40px); }
}
@keyframes obSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
.onboarding-step-header { text-align: center; margin-bottom: 24px; }
.onboarding-step-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-color) 15%, transparent);
  color: var(--accent-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.onboarding-step-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.onboarding-step-desc {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Footer */
.onboarding-footer {
  padding: 0 32px 24px;
  display: flex;
  justify-content: flex-end;
}
.onboarding-next-btn {
  background: var(--accent-color);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 32px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.onboarding-next-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.onboarding-next-btn:active { transform: translateY(0); }

/* Theme grid */
.onboarding-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.onboarding-theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.onboarding-theme-swatch:hover { background: var(--bg-tertiary); }
.onboarding-theme-swatch.active {
  border-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 8%, transparent);
}
.onboarding-theme-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.onboarding-theme-name {
  font-size: var(--font-size-xs);
  color: var(--text-primary);
  font-weight: 500;
}

/* Channel view choice */
.onboarding-choice-row {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.onboarding-choice-card {
  flex: 1;
  max-width: 200px;
  padding: 20px 16px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}
.onboarding-choice-card:hover { background: var(--bg-tertiary); }
.onboarding-choice-card.active {
  border-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 8%, transparent);
}
.onboarding-choice-preview {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.onboarding-tile-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 72px;
}
.onboarding-mini-tile {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
}
.onboarding-list-preview {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 80px;
}
.onboarding-mini-row {
  height: 14px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
}
.onboarding-choice-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.onboarding-choice-desc {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
}

/* Toggle rows (island + notifications) */
.onboarding-toggles { display: flex; flex-direction: column; gap: 16px; }
.onboarding-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  cursor: pointer;
  gap: 16px;
}
.onboarding-toggle-info { flex: 1; }
.onboarding-toggle-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}
.onboarding-toggle-desc {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Switch */
.onboarding-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.onboarding-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.onboarding-switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  transition: background 0.25s, border-color 0.25s;
  cursor: pointer;
}
.onboarding-switch-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: transform 0.25s, background 0.25s;
}
.onboarding-switch input:checked + .onboarding-switch-slider {
  background: var(--accent-color);
  border-color: var(--accent-color);
}
.onboarding-switch input:checked + .onboarding-switch-slider::after {
  transform: translateX(20px);
  background: var(--bg-primary);
}

/* Language grid */
.onboarding-lang-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.onboarding-lang-option {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: left;
}
.onboarding-lang-option:hover { background: var(--bg-hover); }
.onboarding-lang-option.active {
  border-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 8%, transparent);
}
.onboarding-lang-native {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}
.onboarding-lang-name {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Notification hint */
.onboarding-notif-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent-color) 8%, transparent);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}
.onboarding-notif-hint i { color: var(--accent-color); font-size: 14px; flex-shrink: 0; }

/* Navigation guide step */
.onboarding-nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.onboarding-nav-tab {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
}
.onboarding-nav-tab-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent-color) 15%, transparent);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.onboarding-nav-tab-info { flex: 1; min-width: 0; }
.onboarding-nav-tab-name {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.onboarding-nav-tab-desc {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.onboarding-nav-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent-color) 8%, transparent);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}
.onboarding-nav-hint i { color: var(--accent-color); font-size: 14px; flex-shrink: 0; }
.onboarding-nav-hint strong { color: var(--text-primary); }

/* Quick Tiles step */
.onboarding-qt-preview {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.onboarding-qt-tile {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-secondary);
}
.onboarding-qt-tile i { font-size: 20px; }
.onboarding-qt-tile span { font-size: 10px; font-weight: 500; }
.onboarding-qt-tile--empty {
  background: var(--bg-secondary);
  border: none;
  color: var(--text-muted);
  opacity: 0.5;
  border: 2px dashed var(--border-strong);
}
.onboarding-qt-tile--empty i { font-size: 16px; }
.onboarding-qt-explain {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

