/* ============================================
   DASHBOARD & FRIENDS SYSTEM -- Styles
   ============================================ */

:root {
  --floating-dock-width: 142px;
  --floating-dock-right: max(12px, calc(((100vw - min(1560px, 100vw)) / 4) - (var(--floating-dock-width) / 2)));
}

.dashboard-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--spacing-lg) var(--spacing-xl);
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-page .glass-card,
.dashboard-page .btn,
.dashboard-page button,
.dashboard-page input,
.dashboard-page select,
.dashboard-page textarea,
.notification-center,
.notification-center *,
.private-chat-center,
.private-chat-center * {
  border-radius: 0 !important;
}

/* ============================================
   Header
   ============================================ */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  position: relative;
}

.dashboard-header::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

.brand-section {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.user-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.global-audio-control.header-tool {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  justify-items: center;
  column-gap: 5px;
  row-gap: 1px;
  padding: 4px 8px;
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.global-audio-control.header-tool .mute-btn {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: lowercase;
}

.global-audio-control.header-tool .volume-slider {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  min-width: 0;
}

.volume-divider {
  grid-column: 2;
  grid-row: 2;
  color: rgba(255, 255, 255, 0.18);
  line-height: 1;
}

.volume-value {
  grid-column: 3;
  grid-row: 2;
  color: var(--text-muted);
  font-size: inherit;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.lobby-header-nav {
  display: flex;
  gap: var(--spacing-sm);
  margin-right: var(--spacing-md);
}

.lobby-header-nav button {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
  font-family: inherit;
  font-weight: 600;
  font-size: var(--font-size-sm);
  padding: 6px 16px !important;
  border-radius: var(--radius-md) !important;
  cursor: pointer;
  transition: all var(--transition-fast) ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lobby-header-nav button:hover {
  background: rgba(0, 242, 254, 0.1) !important; /* cyan glow background */
  border-color: var(--accent-primary) !important;
  color: var(--accent-primary) !important;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
  transform: translateY(-1px);
}

.lobby-header-nav button:active {
  transform: translateY(1px);
}


.header-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

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

.header-elo {
  font-size: var(--font-size-xs);
  color: var(--accent-primary);
  font-weight: 700;
}

/* ============================================
   Dashboard Grid Layout
   ============================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--spacing-xl);
  align-items: start;
  flex: 1;
}

@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Profile & Stats Section
   ============================================ */
.profile-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.profile-card {
  padding: var(--spacing-xl);
  position: relative;
}

.profile-section > .profile-card:not(.profile-card--arena) {
  display: none;
}

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

.profile-name-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.profile-username {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
}

.profile-rename-form {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.profile-rename-input {
  max-width: 200px;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-sm);
}

/* Stats Kacheln */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--spacing-md);
}

.dashboard-ms-leaderboard {
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-ms-leaderboard h3 {
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.dashboard-ms-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: #070707;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard-ms-tab {
  border: 0;
  border-radius: 0;
  background: #0b0b0b;
  color: var(--text-muted);
  padding: 7px 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

.dashboard-ms-tab:hover,
.dashboard-ms-tab.active {
  background: var(--scrollbar-thumb);
  color: #fff;
}

.dashboard-ms-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
}

.dashboard-ms-row span:first-child {
  color: var(--text-muted);
}

.dashboard-ms-row span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-ms-row span:last-child {
  color: #00d98b;
  font-variant-numeric: tabular-nums;
}

.dashboard-ms-empty {
  color: var(--text-muted);
  font-size: 12px;
}

.stat-box {
  padding: var(--spacing-lg);
  text-align: center;
  position: relative;
  transition: all var(--transition-base);
}

.stat-box:hover {
  border-color: rgba(var(--accent-primary-rgb), 0.2);
  transform: translateY(-2px);
}

.stat-value {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  margin-top: var(--spacing-xs);
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Glow-Effekte fuer bestimmte Stats */
.stat-box--elo {
  background: linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.05), rgba(var(--accent-secondary-rgb), 0.05));
  border-color: rgba(var(--accent-primary-rgb), 0.15);
}

.stat-box--elo .stat-value {
  color: var(--accent-primary);
  text-shadow: 0 0 10px rgba(var(--accent-primary-rgb), 0.3);
}

.stat-box--streak {
  background: linear-gradient(135deg, rgba(var(--accent-success-rgb), 0.03), rgba(var(--accent-primary-rgb), 0.03));
}

.stat-box--streak .stat-value {
  color: var(--accent-success);
}

/* ============================================
   Friends Panel Section
   ============================================ */
.friends-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 500px;
  padding: var(--spacing-xl);
}

.friends-header {
  margin-bottom: var(--spacing-lg);
}

.friends-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--spacing-md);
}

/* Add Friend Input */
.add-friend-form {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.add-friend-input {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-sm);
}

/* Tabs */
.friends-tabs {
  display: flex;
  gap: var(--spacing-xs);
  background: rgba(10, 10, 30, 0.4);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: var(--spacing-md);
}

.friends-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
}

.friends-busy-control {
  margin: 0;
  gap: 8px;
  justify-content: flex-start;
}

.friends-sort-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: -4px 0 12px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.friends-sort-control .input-field {
  width: auto;
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.friends-tab {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
  position: relative;
}

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

.friends-tab--active {
  color: var(--text-primary);
  background: rgba(100, 140, 255, 0.1);
}

.badge {
  background: var(--accent-error);
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-left: var(--spacing-xs);
  display: inline-block;
  vertical-align: middle;
}

/* Listen */
.friends-list-wrapper {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.friends-list-wrapper::-webkit-scrollbar {
  width: 7px;
}

.friends-list-wrapper::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: var(--radius-full);
}

.friends-list-wrapper::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
  border: 1px solid var(--scrollbar-track);
}

.friends-list-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.friends-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.friend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.friend-item:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(100, 140, 255, 0.1);
}

.friend-item--friends {
  align-items: stretch;
}

.friend-details {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  min-width: 0;
}

.friend-item--friends .friend-details {
  align-items: flex-start;
  width: 100%;
  gap: 10px;
}

.friend-item--friends .status-indicator {
  margin-top: 5px;
}

/* Online Status Indikator */
.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--text-muted);
  flex-shrink: 0;
  transition: background-color var(--transition-base);
}

.status-indicator--online {
  background-color: var(--accent-success);
  box-shadow: 0 0 8px var(--accent-success);
  animation: pulse-online 2s infinite;
}

.status-indicator--offline {
  background-color: var(--text-muted);
}

.status-indicator--busy {
  background-color: var(--accent-error);
  box-shadow: 0 0 8px var(--accent-error);
}

@keyframes pulse-online {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(0, 255, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

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

.friend-item--friends .friend-info {
  flex: 1;
  gap: 7px;
}

.friend-name {
  display: flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
  font-weight: 600;
  font-size: 13px;
}

.friend-level {
  display: inline-block;
  font-weight: 700;
}

.friend-added {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 400;
  white-space: nowrap;
}

.friend-username-sub {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.friend-item--friends .friend-username-sub {
  white-space: nowrap;
  color: var(--text-muted);
}

/* Actions Buttons */
.friend-actions {
  display: flex;
  gap: var(--spacing-xs);
}

.friend-item--friends .friend-actions {
  flex-wrap: wrap;
}

.action-btn {
  background: transparent;
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  padding: 6px 12px;
  font-size: var(--font-size-xs);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--surface-border-hover);
}

.action-btn--success {
  border-color: rgba(0, 255, 136, 0.2);
  color: var(--accent-success);
}

.action-btn--success:hover {
  background: rgba(0, 255, 136, 0.1);
  border-color: var(--accent-success);
  color: var(--text-primary);
}

.action-btn--danger {
  border-color: rgba(255, 51, 102, 0.2);
  color: var(--accent-error);
}

.action-btn--danger:hover {
  background: rgba(255, 51, 102, 0.1);
  border-color: var(--accent-error);
  color: var(--text-primary);
}

.action-btn--block {
  border-color: rgba(255, 29, 64, 0.72);
  color: #ff2748;
}

.action-btn--block:hover {
  background: rgba(255, 29, 64, 0.18);
  border-color: #ff2748;
  color: #fff;
}

/* Empty State */
.friends-empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: var(--spacing-2xl) var(--spacing-md);
  font-size: var(--font-size-sm);
}

/* hidden Utility */
.hidden {
  display: none !important;
}

/* ============================================
   LOBBY ROOM & MODAL STYLES
   ============================================ */
.lobby-room-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--spacing-lg) var(--spacing-xl);
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

.lobby-room-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--spacing-xl);
  align-items: stretch;
  flex: 1;
}

@media (max-width: 992px) {
  .lobby-room-grid {
    grid-template-columns: 1fr;
  }
}

.lobby-info-section, .lobby-chat-section, .lobby-invites-section {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-xl);
}

.lobby-players-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lobby-player-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.lobby-player-card--master {
  border-color: rgba(var(--accent-primary-rgb), 0.3);
  background: rgba(var(--accent-primary-rgb), 0.03);
}

.lobby-player-name {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lobby-player-ready-tag {
  color: #ff3399;
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-shadow: 0 0 8px #ff3399;
}

/* Chat Messages */
.lobby-chat-messages {
  flex: 1;
  overflow-y: auto;
  max-height: 350px;
  min-height: 250px;
  padding: 10px;
  background: rgba(10, 10, 30, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg {
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-msg-sender {
  font-weight: 700;
  color: var(--accent-primary);
  margin-right: 6px;
}

.chat-msg-text {
  color: var(--text-primary);
}

.chat-msg-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 6px;
}

.lobby-chat-form {
  display: flex;
  gap: 8px;
}

/* Invites List */
.lobby-friends-invite-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 450px;
}

.invite-friend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
}

.invite-friend-name {
  font-weight: 600;
}

/* Modals extra stylings */
.lobby-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  margin: 15px 0;
}

.lobby-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lobby-list-item:hover {
  background: rgba(100, 140, 255, 0.1);
  border-color: var(--accent-primary);
}

.lobby-list-name {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lobby-list-players {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.btn--link {
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

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

/* Real-time invite toast notification bottom-right */
.invite-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: rgba(20, 20, 45, 0.95);
  border: 1.5px solid var(--accent-primary);
  box-shadow: 0 8px 32px rgba(var(--accent-primary-rgb), 0.3);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  animation: slide-in-toast 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes slide-in-toast {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================
   Compact black dashboard
   ============================================ */
.dashboard-page {
  width: 100%;
  max-width: 1560px;
  height: 100dvh;
  min-height: 0;
  padding: clamp(10px, 1.4vw, 20px);
  gap: clamp(10px, 1vw, 14px);
  overflow: hidden;
}

.dashboard-header {
  flex: 0 0 auto;
  padding: clamp(10px, 1.15vw, 13px) clamp(12px, 1.45vw, 18px);
  margin-bottom: 0;
  background: #080808;
}

.dashboard-header::before {
  display: none;
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.07em;
}

.brand-subtitle {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.user-controls {
  gap: 10px;
}

.lobby-header-nav button {
  color: var(--text-secondary) !important;
  background: transparent !important;
  border-color: var(--surface-border) !important;
  box-shadow: none;
}

.lobby-header-nav button:hover {
  color: var(--text-primary) !important;
  background: #111 !important;
  border-color: var(--surface-border-hover) !important;
  box-shadow: none;
}

.dashboard-grid {
  min-height: 0;
  grid-template-columns: minmax(270px, 0.94fr) minmax(320px, 1.13fr) minmax(270px, 0.93fr);
  gap: clamp(10px, 1vw, 14px);
  align-items: stretch;
}

.profile-section {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  gap: 12px;
}

.profile-card {
  padding: 17px;
}

.profile-header {
  margin: 0;
  gap: 12px;
}

.profile-username {
  color: var(--text-primary);
  font-size: 1.06rem;
  letter-spacing: -0.03em;
}

.profile-rename-form {
  width: 100%;
}

.profile-rename-input {
  flex: 1;
  max-width: none;
}

.profile-card--arena {
  padding: 18px !important;
  margin-top: 0 !important;
}

.stats-grid {
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(70px, 1fr);
  gap: 10px;
}

.stat-box {
  padding: clamp(10px, 1.1vh, 15px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #080808;
}

.stat-box:hover {
  transform: none;
  border-color: var(--surface-border-hover);
}

.stat-box--elo,
.stat-box--streak {
  background: #090909;
  border-color: var(--surface-border);
}

.stat-box--elo .stat-value,
.stat-box--streak .stat-value {
  color: var(--text-primary);
  text-shadow: none;
}

.stat-value {
  font-size: clamp(1.15rem, 2vh, 1.6rem);
  margin: 3px 0 0;
}

.stat-label {
  color: var(--text-muted);
}

.global-chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: clamp(16px, 1.4vw, 22px);
  background: #080808;
}

.global-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.panel-kicker {
  color: var(--text-muted);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  margin-bottom: 5px;
}

.global-chat-title {
  font-size: 1.22rem;
  letter-spacing: -0.04em;
}

.global-chat-note {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: 7px 0 15px;
}

.global-chat-messages {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 4px 0 12px;
}

.global-chat-empty {
  margin: auto;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
}

.global-chat-message {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 12px;
  padding: 9px 11px;
  background: #0d0d0d;
  transition: opacity 260ms linear, transform 260ms ease-out;
}

.global-chat-message--expired {
  opacity: 0;
  transform: translateY(-3px);
}

.global-chat-meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 4px;
}

.global-chat-sender {
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
}

.global-chat-time {
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.global-chat-text {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.global-chat-form {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.global-chat-form .input-field {
  flex: 1;
  min-width: 0;
}

.global-chat-panel .alert {
  margin: 0 0 8px;
}

.friends-panel {
  min-height: 0;
  height: auto;
  padding: clamp(16px, 1.4vw, 22px);
  background: #080808;
}

.friends-header {
  margin-bottom: 13px;
}

.friends-title {
  font-size: 1.18rem;
  letter-spacing: -0.04em;
  margin-bottom: 13px;
}

.add-friend-form {
  margin-bottom: 9px;
}

.friends-tabs {
  background: #060606;
  border: 1px solid var(--surface-border);
}

.friends-tab--active {
  color: var(--text-primary);
  background: #121212;
}

.friends-list-wrapper {
  min-height: 0;
  max-height: none;
}

.friend-item {
  background: #0c0c0c;
  border-color: rgba(255, 255, 255, 0.065);
}

.status-indicator--online {
  background: var(--accent-success);
  box-shadow: none;
  animation: none;
}

.global-audio-control.header-tool {
  background: #060606;
  border-color: var(--surface-border);
}

.volume-slider::-webkit-slider-thumb {
  background: var(--text-primary);
  box-shadow: none;
}

@media (max-width: 1180px), (max-height: 820px) {
  .dashboard-page {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
    padding: 10px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .dashboard-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .user-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .global-chat-panel {
    min-height: min(460px, calc(100dvh - 190px));
  }

  .friends-panel {
    min-height: 420px;
  }
}

/* Header tools, progression and live notifications */
.lobby-header-nav {
  margin-right: 0;
}

.lobby-header-nav button,
.header-tool {
  width: 138px;
  min-width: 138px;
  height: 42px;
  box-sizing: border-box;
}

.nav-icon,
.create-icon {
  width: 17px;
  height: 17px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
}

.create-icon {
  color: #ff3b4d;
  font-size: 22px;
}

.global-audio-control.header-tool {
  margin-right: 0;
  justify-content: center;
}

.language-control,
.mode-control {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.mode-control {
  flex-direction: column;
  gap: 2px;
  padding: 3px 8px;
  overflow: hidden;
}

.mode-control span {
  display: block;
  width: 100%;
  text-align: center;
  line-height: 11px;
}

.language-control select,
.mode-control select {
  border: 0;
  background: #101010;
  color: var(--text-primary);
  border-radius: 6px;
  padding: 5px;
}

.mode-control select {
  display: block;
  width: 120px;
  height: 20px;
  padding: 1px 5px;
  text-align: center;
  font-size: 11px;
}

.global-chat-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.online-users-btn {
  background: #050805;
  color: #75a58b;
  border: 1px solid rgba(117, 165, 139, .2);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  cursor: pointer;
}

.owner-users-btn {
  background: #120406;
  color: #ff5c6b;
  border-color: rgba(255, 74, 92, .32);
  text-transform: lowercase;
}

.owner-users-btn:hover {
  background: #21080d;
  border-color: rgba(255, 90, 110, .56);
}

.notification-undo {
  background: #080b09;
  border: 1px solid rgba(103, 213, 144, .3);
  color: #73d99a;
  border-radius: 8px;
  padding: 7px 10px;
  margin-bottom: 9px;
  cursor: pointer;
}

.notification-item {
  position: relative;
  padding-right: 30px;
}

.notification-delete {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #361015;
  color: #ff7187;
  cursor: pointer;
}

.account-settings-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-lg);
  min-height: 100vh;
}

.account-settings-page .glass-card,
.account-settings-page .btn,
.account-settings-page input,
.account-settings-page select,
.account-settings-page textarea,
.account-settings-page details,
.account-settings-page summary {
  border-radius: 0 !important;
}

.settings-header,
.modal-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.settings-card {
  padding: 22px;
}

.settings-card h2 {
  margin-bottom: 14px;
}

.account-meta {
  display: grid;
  grid-template-columns: 115px 1fr;
  gap: 7px 12px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.account-meta dt,
.settings-note {
  color: var(--text-muted);
  font-size: 12px;
}

.settings-form {
  display: grid;
  gap: 9px;
  margin-bottom: 18px;
}

.settings-form--password {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.settings-form--password #settings-old-password,
.settings-form--password .btn {
  grid-column: 1 / -1;
}

.settings-form--password .input-field {
  min-width: 0;
}

.statistics-title {
  margin-top: 28px;
}

.mode-statistics {
  border: 1px solid var(--surface-border);
  border-radius: 0;
  padding: 12px;
  margin-top: 9px;
  color: var(--text-secondary);
}

.mode-statistics summary {
  color: var(--text-primary);
  cursor: pointer;
}

.mode-stat-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.mode-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mode-stat-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.mode-stat-label {
  color: var(--text-muted);
}

.mode-stat-value {
  color: var(--text-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mode-stat-empty {
  margin: 10px 0 0;
  color: var(--text-muted);
}

.account-modal {
  width: min(480px, calc(100vw - 32px));
}

.online-users-list {
  margin-top: 14px;
  max-height: 380px;
  overflow-y: auto;
}

.admin-users-modal {
  width: min(760px, calc(100vw - 32px));
}

.admin-users-list {
  margin-top: 14px;
  max-height: 460px;
  overflow-y: auto;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.admin-user-main strong {
  display: block;
  color: var(--text-primary);
  letter-spacing: .04em;
}

.admin-user-meta,
.admin-user-links {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.admin-user-ban {
  margin-top: 7px;
  color: #ff687a;
  font-size: 11px;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
  align-content: flex-start;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 12px;
}

.admin-ban-field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-ban-field textarea {
  min-height: 110px;
  resize: vertical;
}

.admin-ban-duration {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.ban-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: #000;
  color: #ff1f38;
}

.ban-overlay.hidden {
  display: none;
}

.ban-reveal-btn {
  border: 1px solid rgba(255, 255, 255, .12);
  background: #060606;
  color: #f3f3f3;
  padding: 12px 18px;
  font-weight: 800;
  letter-spacing: .08em;
  cursor: pointer;
}

.ban-message {
  max-width: min(620px, calc(100vw - 40px));
  white-space: pre-wrap;
  text-align: center;
  color: #ff1f38;
  font-size: clamp(18px, 3vw, 34px);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: none;
  text-shadow: 0 0 28px rgba(255, 31, 56, .32);
}

.ban-message.hidden {
  display: none;
}

.online-user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--surface-border);
  padding: 10px 0;
}

.online-friend-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f1f1f1;
  color: #070707;
  cursor: default;
  opacity: 1;
}

.online-friend-chip::before {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid #080808;
  border-bottom: 2px solid #080808;
  transform: rotate(-45deg) translateY(-1px);
}

.online-friend-chip:disabled {
  opacity: 1;
}

.online-user-self {
  color: var(--text-muted);
  font-weight: 400;
}

.dashboard-mini-toast {
  position: fixed;
  right: 24px;
  bottom: 152px;
  z-index: 130;
  max-width: min(320px, calc(100vw - 32px));
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 8, 8, 0.94);
  color: var(--text-primary);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  font-size: 12px;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.dashboard-mini-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.rank-grandmaster .online-user-self,
.rank-lunatic .online-user-self,
.rank-hyperlunatic .online-user-self {
  -webkit-text-fill-color: var(--text-muted);
}

.rank-noob { color: #eadc91 !important; }
.rank-amateur { color: #ea8d3d !important; }
.rank-semi_pro { color: #55b881 !important; }
.rank-pro { color: #416dbb !important; }
.rank-grandmaster {
  background: linear-gradient(95deg, #d6dce4, #659ee8, #ecf1f5);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.rank-lunatic {
  background: linear-gradient(90deg, #aa68e4, #fafafa, #67c785);
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rank-pulse 2.7s ease-in-out infinite;
}
.rank-hyperlunatic {
  background: linear-gradient(100deg, #111, #de3348, #e4e7ec, #111);
  background-size: 250% auto;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rank-wave 1.8s linear infinite, rank-pulse 1.05s ease-in-out infinite;
}
@keyframes rank-pulse { 50% { transform: scale(1.025); filter: brightness(1.25); } }
@keyframes rank-wave { to { background-position: 250% center; } }

@media (max-width: 800px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-form--password { grid-template-columns: 1fr; }
}

.level-line {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.xp-track {
  width: 76px;
  height: 5px;
  background: #1b1b1b;
  border-radius: 999px;
  overflow: hidden;
}

.xp-bar {
  height: 100%;
  width: 0;
  background: #f2f2f2;
  transition: width 220ms ease;
}

.notification-center {
  position: fixed;
  right: var(--floating-dock-right);
  bottom: 20px;
  z-index: 500;
  width: var(--floating-dock-width);
}

.private-chat-center {
  position: fixed;
  right: var(--floating-dock-right);
  bottom: 68px;
  z-index: 500;
  width: var(--floating-dock-width);
}

.notification-center .notification-toggle,
.private-chat-center .notification-toggle {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.private-chat-panel {
  position: fixed;
  right: var(--floating-dock-right);
  bottom: 118px;
  width: min(370px, calc(100vw - 44px));
  height: min(470px, calc(100vh - 150px));
  max-height: 470px;
  padding: 13px;
  background: #090909;
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  box-shadow: 0 12px 42px rgba(0, 0, 0, .6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel-close-btn {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .12);
  background: #0d0d0d;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.panel-close-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, .28);
  background: #171717;
}

.busy-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.busy-toggle {
  width: 37px;
  height: 20px;
  padding: 2px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: #101010;
  cursor: pointer;
}

.busy-toggle-knob {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.busy-toggle--active .busy-toggle-knob {
  transform: translateX(17px);
  background: var(--accent-error);
  box-shadow: 0 0 7px rgba(255, 51, 102, .65);
}

.private-conversation-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.private-conversation-list::-webkit-scrollbar,
.private-thread-messages::-webkit-scrollbar {
  width: 7px;
}

.private-conversation-list::-webkit-scrollbar-track,
.private-thread-messages::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: var(--radius-full);
}

.private-conversation-list::-webkit-scrollbar-thumb,
.private-thread-messages::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border: 1px solid var(--scrollbar-track);
  border-radius: var(--radius-full);
}

.private-conversation-list::-webkit-scrollbar-thumb:hover,
.private-thread-messages::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.private-conversation {
  display: grid;
  width: 100%;
  text-align: left;
  gap: 3px;
  color: var(--text-secondary);
  background: #0e0e0e;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
}

.private-conversation strong {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-primary);
}

.private-conversation-badge {
  margin-left: auto;
}

.private-conversation span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.private-thread-title {
  margin: 8px 0 12px;
  font-size: 15px;
}

.private-thread {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.private-thread-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 11px;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.private-message {
  max-width: 82%;
  background: #101010;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 8px 10px;
}

.private-message--mine {
  align-self: flex-end;
  background: #171717;
}

.private-message p {
  color: var(--text-secondary);
  overflow-wrap: anywhere;
  margin-bottom: 4px;
}

.private-chat-form {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
  width: 100%;
}

.private-chat-form .input-field {
  min-width: 0;
  width: auto;
  flex: 1 1 0;
}

.private-chat-form .btn {
  flex: 0 0 auto;
  padding-inline: 18px;
}

.notification-toggle {
  color: var(--text-primary);
  background: #090909;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  min-height: 42px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.notification-badge {
  color: #fff;
  background: #d92939;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
}

.notification-panel {
  position: fixed;
  right: var(--floating-dock-right);
  bottom: 118px;
  width: min(370px, calc(100vw - 44px));
  max-height: min(390px, calc(100vh - 150px));
  padding: 13px;
  background: #090909;
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  box-shadow: 0 12px 42px rgba(0, 0, 0, .6);
  transition: opacity 260ms ease, transform 260ms ease;
}

.notification-panel--fade {
  opacity: 0;
  transform: translateY(5px);
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.text-btn {
  color: var(--text-muted);
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

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

.notification-sound-toggle {
  margin-bottom: 10px;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 300px;
}

.notification-item {
  background: #0e0e0e;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 10px;
  color: var(--text-secondary);
  font-size: 13px;
}

.notification-item--unread {
  border-color: rgba(255, 255, 255, .28);
}

.notification-item time {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
}

.notification-actions {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

.notification-empty {
  color: var(--text-muted);
  padding: 16px 6px;
  font-size: 13px;
}

@media (max-width: 560px) {
  .notification-center,
  .private-chat-center {
    right: 12px;
    width: min(142px, calc(50vw - 18px));
  }

  .notification-center {
    bottom: 12px;
  }

  .private-chat-center {
    bottom: 60px;
  }

  .notification-toggle {
    min-height: 38px;
    padding-inline: 9px;
    font-size: 12px;
  }

  .notification-panel,
  .private-chat-panel {
    right: 12px;
    width: calc(100vw - 24px);
    max-width: none;
  }

  .notification-panel {
    bottom: 106px;
    max-height: min(390px, calc(100vh - 136px));
  }

  .private-chat-panel {
    bottom: 106px;
    height: min(470px, calc(100vh - 136px));
  }

  .notification-panel-header {
    align-items: flex-start;
  }

  .panel-header-actions {
    gap: 5px;
  }
}

.lobby-player-card--actionable {
  cursor: pointer;
  position: relative;
}

.lobby-player-card--actionable:hover {
  border-color: rgba(255, 255, 255, .25);
}

.lobby-player-actions {
  display: flex;
  gap: 7px;
  margin-left: auto;
}

.lobby-player-actions button {
  background: #121212;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 7px 9px;
  font-size: 12px;
  cursor: pointer;
}

@media (max-width: 1320px), (max-height: 820px) {
  body.minesweeper-active {
    --floating-dock-width: 118px;
  }

  body.minesweeper-active .notification-toggle {
    min-height: 36px;
    padding-inline: 8px;
    font-size: 12px;
  }

  body.minesweeper-active .private-chat-center {
    bottom: 58px;
  }

  body.minesweeper-active .notification-center {
    bottom: 12px;
  }

  body.minesweeper-active .notification-panel,
  body.minesweeper-active .private-chat-panel {
    bottom: 102px;
  }
}
