/**
 * lobby.css - Lobby, Waiting Room, Profile, Leaderboard, Footer, and GDPR
 */

/* =========================================================
 * 1. LOBBY VIEW & AD PLACEMENTS
 * ========================================================= */
#view-lobby {
  position: relative;
  overflow-x: hidden;
}

.lobby-ad-skyscraper {
  display: none;
  position: absolute;
  top: 60px;
  width: 160px;
  min-height: 600px;
  z-index: 10;
}

@media (min-width: 1240px) {
  .lobby-ad-skyscraper {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .lobby-ad-left {
    left: calc(50% - 380px - 160px - 36px);
  }
  .lobby-ad-right {
    right: calc(50% - 380px - 160px - 36px);
  }
}

@media (min-width: 1440px) {
  .lobby-ad-left {
    left: calc(50% - 380px - 160px - 50px);
  }
  .lobby-ad-right {
    right: calc(50% - 380px - 160px - 50px);
  }
}

.lobby-ad-leaderboard {
  width: 100%;
  max-width: 728px;
  margin: 28px auto 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ad-slot-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 5px;
  user-select: none;
}

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ad-slot-skyscraper {
  width: 160px;
  min-height: 600px;
}

.ad-slot-leaderboard {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
}

.ad-slot-rectangle {
  width: 300px;
  min-height: 250px;
}

/* Match Details Support Card */
.match-support-card {
  margin-top: 14px;
  margin-bottom: 12px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(255, 221, 0, 0.09), rgba(251, 176, 59, 0.04));
  border: 1px solid rgba(255, 221, 0, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.match-support-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.match-support-icon {
  font-size: 24px;
}

.match-support-title {
  font-weight: 700;
  font-size: 13.5px;
  color: #FFDD00;
}

.match-support-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-bmc-match {
  background: #FFDD00;
  color: #111;
  font-weight: 700;
  font-size: 12.5px;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(255, 221, 0, 0.32);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.btn-bmc-match:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 221, 0, 0.45);
  filter: brightness(1.05);
}

.lobby-container {
  max-width: 760px;
  margin: 48px auto;
  padding: 0 20px;
  width: 100%;
}

.lobby-hero {
  text-align: center;
  margin-bottom: 20px;
}

.lobby-hero-banner {
  width: 100%;
  border-radius: 14px;
  display: block;
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 28px rgba(212, 175, 55, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.lobby-hero-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.7), 0 0 42px rgba(212, 175, 55, 0.22);
}

.lobby-tabs {
  display: flex;
  justify-content: stretch;
  gap: 4px;
  margin: 0 auto 18px;
  max-width: 100%;
  padding: 4px;
  background: oklch(0 0 0 / 0.28);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
}

.lobby-tab-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lobby-tab-btn:hover {
  background: oklch(1 0 0 / 0.04);
  color: var(--text-primary);
}

.lobby-tab-btn:active {
  transform: scale(0.98);
}

.lobby-tab-btn.active {
  background: var(--bg-surface-elevated);
  border-color: oklch(0.78 0.145 72 / 0.35);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.lobby-panel {
  background: oklch(0.185 0.014 264 / 0.72);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow-md);
}

.auth-modal-brand-header {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.auth-modal-logo {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(212, 175, 55, 0.25);
  border: 1.5px solid rgba(212, 175, 55, 0.35);
}

.auth-modal-box {
  max-width: 400px;
}

.auth-modal-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn-google-auth {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 550;
  background: oklch(1 0 0 / 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.btn-google-auth:hover {
  background: oklch(1 0 0 / 0.12);
  border-color: oklch(1 0 0 / 0.22);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-divider span {
  padding: 0 12px;
}

.auth-email-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-email-form .form-input {
  width: 100%;
}

.auth-btn-row {
  display: flex;
  gap: 10px;
}

.auth-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-user-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: oklch(1 0 0 / 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.auth-chip-text {
  font-weight: 550;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-chip-change {
  background: none;
  border: none;
  color: var(--gold-primary, #eab308);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  text-decoration: underline;
  transition: opacity var(--transition-fast);
}

.auth-chip-change:hover {
  opacity: 0.8;
}

.modal-subtext {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.auth-profile-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.header-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  border-radius: 9999px;
  background: var(--bg-surface-elevated, #1e293b);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  color: var(--text-primary, #ffffff);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-profile-badge:hover {
  background: var(--bg-surface-hover, #334155);
  border-color: var(--gold-primary, #d4af37);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.header-avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-surface, #0f172a);
  color: var(--gold-primary, #d4af37);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
  font-size: 14px;
  overflow: hidden;
}

.header-avatar-circle img,
.profile-avatar-hat img,
.hero-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.header-user-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.lobby-auth-hint,
.lobby-auth-status {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
}

body.match-active .auth-lobby-only {
  display: none !important;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
  margin-top: 10px;
}

.is-hidden {
  display: none !important;
}

.btn-submit-block {
  width: 100%;
  padding: 14px;
  font-size: 16px;
}

.room-code-input {
  text-transform: uppercase;
  font-family: ui-monospace, 'Geist', monospace;
  font-size: 18px;
  letter-spacing: 2px;
}

.muted-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.inline-actions {
  display: flex;
  gap: 10px;
}

.inline-actions-wide {
  display: flex;
  gap: 12px;
}

.btn-start-game {
  font-size: 16px;
  padding: 12px 24px;
}

.form-group label {
  font-size: 12px;
  font-weight: 550;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-input,
.form-select {
  background: oklch(0 0 0 / 0.28);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  height: 40px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-input:hover,
.form-select:hover {
  border-color: oklch(1 0 0 / 0.16);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: oklch(0.78 0.145 72 / 0.7);
  box-shadow: 0 0 0 3px oklch(0.78 0.145 72 / 0.2), 0 0 14px oklch(0.78 0.145 72 / 0.14);
  background: oklch(0 0 0 / 0.42);
}

.room-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.room-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.room-card:hover {
  background: var(--bg-surface-hover);
  border-color: oklch(0.78 0.145 72 / 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.38);
}

/* =========================================================
 * 2. WAITING ROOM VIEW
 * ========================================================= */
.waiting-container {
  max-width: 860px;
  margin: 28px auto;
  padding: 0 20px;
  width: 100%;
}

.waiting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: oklch(0.185 0.014 264 / 0.72);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.room-code-badge {
  font-family: ui-monospace, 'Geist', monospace;
  font-size: 22px;
  font-weight: 650;
  color: var(--gold-primary);
  letter-spacing: 0.22em;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.player-slot-card {
  background: oklch(0.185 0.014 264 / 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 14px 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.player-slot-card::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 0;
  width: 3px;
  height: calc(100% - 20px);
  border-radius: 999px;
  background: var(--player-color, var(--gold-primary));
}

.player-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-slot-name {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.slot-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.player-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: oklch(1 0 0 / 0.04);
  color: var(--text-secondary);
}

.player-badge.host-badge {
  color: var(--gold-primary);
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(217, 119, 6, 0.1);
}

.player-badge.bot-badge {
  color: var(--cyan-accent);
  border-color: rgba(2, 132, 199, 0.4);
  background: rgba(2, 132, 199, 0.1);
}

.ready-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}

.ready-badge.ready {
  background: rgba(22, 163, 74, 0.15);
  color: #4ade80;
  border: 1px solid rgba(22, 163, 74, 0.4);
}

.ready-badge.not-ready {
  background: rgba(220, 38, 38, 0.15);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.4);
}

.waiting-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}


/* =========================================================
/* =========================================================
 * PROFILE VIEW (HEXSETTLERS THEME)
 * ========================================================= */
.view-colonist-profile {
  position: fixed;
  inset: 0;
  top: 56px; /* below app header */
  background: radial-gradient(circle at 50% 10%, var(--bg-surface, #1e293b) 0%, var(--bg-primary, #0f172a) 100%);
  overflow-y: auto;
  z-index: 50;
  padding: 28px 32px 64px;
  color: var(--text-primary, #ffffff);
}

.profile-viewport {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Top bar */
.profile-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
}

.profile-user-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar-hat {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-surface-elevated, #1e293b);
  border: 2px solid var(--gold-primary, #d4af37);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary, #d4af37);
  font-size: 26px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.profile-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-username {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  margin: 0;
  line-height: 1.2;
}

.profile-top-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-profile-exit {
  background: var(--bg-surface-elevated, #1e293b);
  color: var(--text-primary, #ffffff);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s);
}

.btn-profile-exit:hover {
  background: var(--bg-surface-hover, #334155);
  border-color: var(--gold-primary, #d4af37);
  color: var(--gold-primary, #d4af37);
}

/* Guest notice */
.profile-guest-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 8px;
  background: var(--bg-surface-elevated, #1e293b);
  border: 1px solid var(--gold-subtle, rgba(212, 175, 55, 0.3));
}

.guest-notice-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary, #cbd5e1);
}

/* Main Layout */
.profile-body-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: start;
}

.profile-sidebar-ad {
  display: none;
  position: sticky;
  top: 76px;
  flex-direction: column;
  gap: 16px;
}

.profile-tab-ad-slot {
  margin-top: 32px;
  width: 100%;
  display: flex;
  justify-content: center;
}

@media (min-width: 1240px) {
  .profile-viewport {
    max-width: 1280px;
  }

  .profile-body-layout {
    grid-template-columns: 180px 1fr 300px;
  }

  .profile-sidebar-ad {
    display: flex;
  }
}

/* Sidebar Nav */
.profile-sidebar-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 18px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary, #94a3b8);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.profile-nav-btn:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.05));
  color: var(--text-primary, #ffffff);
}

.profile-nav-btn.active {
  background: var(--bg-surface-elevated, #1e293b);
  border-color: var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-left: 3px solid var(--gold-primary, #d4af37);
  color: var(--gold-primary, #d4af37);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-nav-icon {
  font-size: 18px;
  opacity: 0.85;
}

.profile-nav-btn.active .profile-nav-icon {
  opacity: 1;
  color: var(--gold-primary, #d4af37);
}

/* Content Area */
.profile-tab-contents {
  min-height: 480px;
}

.profile-tab-panel {
  display: none;
  animation: profileFadeIn 0.18s ease forwards;
}

.profile-tab-panel.active {
  display: block;
}

@keyframes profileFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-hero-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.hero-avatar-large {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface-elevated, #1e293b);
  border: 2px solid var(--gold-primary, #d4af37);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--gold-primary, #d4af37);
}

.panel-hero-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  margin: 0;
}

.profile-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  margin: 0 0 16px 0;
}

/* Overview Stat Cards Row (4 cards) */
.colonist-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: var(--bg-surface, #1e293b);
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  padding: 18px 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.colonist-stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  transition: transform var(--transition-fast) ease;
}

.colonist-stat-card:hover {
  transform: translateY(-1.5px);
}

.cstat-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cstat-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gold-primary, #d4af37);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px oklch(0.78 0.145 72 / 0.22);
}

.profile-sub-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.profile-sub-card {
  background: var(--bg-surface, #1e293b);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  padding: 16px 20px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform var(--transition-fast) ease, border-color var(--transition-fast) ease, box-shadow var(--transition-fast) ease;
}

.profile-sub-card:hover {
  transform: translateY(-1.5px);
  border-color: oklch(0.78 0.145 72 / 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.sub-card-label {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
}

.sub-card-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  font-variant-numeric: tabular-nums;
}

/* History Table */
.colonist-history-container {
  background: var(--bg-surface, #1e293b);
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  overflow-x: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.colonist-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.colonist-history-table thead {
  background: var(--bg-surface-elevated, #0f172a);
}

.colonist-history-table th {
  padding: 14px 18px;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  white-space: nowrap;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.colonist-history-table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
  vertical-align: middle;
  color: var(--text-secondary, #cbd5e1);
}

.colonist-history-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.colonist-history-table tbody tr:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.05));
}

.cell-date {
  color: var(--text-secondary, #cbd5e1);
  white-space: nowrap;
}

.cell-rank {
  font-weight: 700;
  white-space: nowrap;
}

.cell-rank.rank-win {
  color: var(--gold-primary, #d4af37);
  font-weight: 800;
}

.cell-opponents {
  color: var(--emerald-accent, #10b981);
  font-weight: 500;
  line-height: 1.4;
}

.cell-duration {
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
}

.cell-replay {
  text-align: center;
}

.colonist-history-table tbody tr[data-match-id] {
  cursor: pointer;
  transition: background 0.15s ease;
}

.colonist-history-table tbody tr[data-match-id]:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-replay-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 64px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.2));
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.08));
  color: var(--text-primary, #ffffff);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-replay-icon:hover {
  background: var(--gold-primary, #d4af37);
  border-color: var(--gold-primary, #d4af37);
  color: var(--gold-foreground, #1e293b);
  transform: translateY(-1px);
}

.history-empty-row td {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted, #94a3b8);
  font-style: italic;
}

/* Friends Container & System */
.friends-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.friends-panel-header .profile-section-title {
  margin: 0;
}

.friend-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  transition: transform 0.2s ease;
}

.friend-badge[hidden] {
  display: none !important;
}

.friends-guest-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.guest-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--gold-primary, #d4af37);
  flex-shrink: 0;
}

.guest-banner-body {
  flex: 1;
}

.guest-banner-body h5 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px 0;
}

.guest-banner-body p {
  font-size: 13px;
  color: var(--text-secondary, #cbd5e1);
  margin: 0;
}

.friends-search-section {
  position: relative;
  margin-bottom: 20px;
}

.friends-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface, #1e293b);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: 10px;
  padding: 6px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.friends-search-bar:focus-within {
  border-color: var(--gold-primary, #d4af37);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}

.friends-search-icon {
  font-size: 16px;
  color: var(--text-muted, #94a3b8);
  opacity: 0.85;
}

.friends-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 14px;
}

.friends-search-input::placeholder {
  color: var(--text-muted, #94a3b8);
}

.friends-search-clear {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.friends-search-clear:hover {
  color: #ffffff;
}

.friend-search-results {
  background: var(--bg-surface-elevated, #1e293b);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: 10px;
  margin-top: 8px;
  padding: 10px;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: profileFadeIn 0.15s ease forwards;
}

.friends-section {
  margin-bottom: 24px;
}

.friends-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.friends-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.friends-status-summary {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
  text-transform: none;
  letter-spacing: normal;
}

.friends-count-badge {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
  margin-left: 6px;
}

.friends-subgroup {
  margin-bottom: 14px;
}

.friends-subgroup-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: block;
}

.friends-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 10px;
}

.friend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface, #1e293b);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  padding: 10px 14px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.friend-card:hover {
  transform: translateY(-1.5px);
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.friend-user-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.friend-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.friend-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  display: block;
}

.friend-avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-surface-elevated, #334155);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--gold-primary, #d4af37);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  bottom: -1px;
  right: -1px;
  border: 2px solid var(--bg-surface, #1e293b);
}

.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.status-dot.offline {
  background: #64748b;
}

.friend-user-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.friend-user-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-user-status {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  gap: 4px;
}

.friend-user-status.is-online {
  color: #4ade80;
}

.friend-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.friends-sub-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted, #94a3b8);
  font-size: 13px;
  font-style: italic;
  background: rgba(30, 41, 59, 0.3);
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.friends-empty-box {
  background: var(--bg-surface, #1e293b);
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary, #cbd5e1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.friends-empty-box .ico {
  font-size: 40px;
  opacity: 0.5;
  color: var(--gold-primary, #d4af37);
}

/* Account Settings */
.account-settings-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 600px;
}

.account-card-form,
.account-card-info {
  background: var(--bg-surface, #1e293b);
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  padding: 22px 26px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.avatar-choice-btn {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
  background: var(--bg-surface-elevated, #1e293b);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-fast, 0.15s) ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-choice-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.avatar-choice-btn:hover {
  transform: scale(1.08);
  border-color: var(--gold-primary, #d4af37);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}

.avatar-choice-btn.active {
  border-color: var(--gold-primary, #d4af37);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.35), 0 4px 14px rgba(0, 0, 0, 0.4);
  transform: scale(1.05);
}

.avatar-choice-btn.active::after {
  content: '✓';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  background: var(--gold-primary, #d4af37);
  color: var(--gold-foreground, #1e293b);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface, #1e293b);
}

.input-with-action {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.input-with-action .form-input {
  flex: 1;
}

.field-hint {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  margin: 6px 0 0 0;
}

.account-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  font-size: 14px;
  color: var(--text-secondary, #cbd5e1);
}

.account-detail-row strong {
  color: var(--text-primary, #ffffff);
}

.account-detail-row:last-of-type {
  border-bottom: none;
}

.account-actions-row {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

/* Responsive adjustments */
@media (max-width: 860px) {
  .profile-body-layout {
    grid-template-columns: 1fr;
  }
  .profile-sidebar-tabs {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 6px;
  }
  .colonist-stat-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .view-colonist-profile {
    padding: 16px;
  }
}

/* Ranked Matchmaking Queue */
.ranked-queue-card {
  text-align: center;
  padding: 32px 16px;
}
.ranked-queue-icon {
  font-size: 42px;
  margin-bottom: 12px;
}
.ranked-queue-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 8px;
}
.ranked-queue-desc {
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 20px auto;
  font-size: 13px;
}
.ranked-player-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
}
.btn-ranked-find {
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 700;
}
.ranked-queue-status-box {
  margin-top: 20px;
}
.ranked-queue-spinner {
  margin: 0 auto 12px auto;
}
.ranked-queue-status-text {
  font-weight: 600;
  font-size: 15px;
  color: var(--gold-primary);
}
.ranked-queue-subtext {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.btn-ranked-cancel {
  margin-top: 14px;
}
.auth-forgot-sent {
  text-align: center;
  padding: 12px 0;
}
.auth-forgot-sent-msg {
  color: #86efac;
  margin: 0;
}

/* Password Input with Visibility Toggle */
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrap .form-input {
  width: 100%;
  padding-right: 42px !important;
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm, 6px);
  transition: color var(--transition-fast, 0.15s ease), background var(--transition-fast, 0.15s ease), transform var(--transition-fast, 0.15s ease);
  z-index: 2;
}

.btn-toggle-password:hover {
  color: var(--text-primary, #ffffff);
  background: oklch(1 0 0 / 0.08);
}

.btn-toggle-password:active {
  transform: translateY(-50%) scale(0.92);
}

.btn-toggle-password:focus-visible {
  outline: 2px solid var(--accent, #6366f1);
  outline-offset: 2px;
}

/* Hide native browser password reveal buttons (Edge / IE) to prevent duplicate icons */
input::-ms-reveal,
input::-ms-clear {
  display: none;
}

.btn-toggle-password svg {
  display: block;
  pointer-events: none;
}

.btn-toggle-password .icon-eye {
  display: block;
}

.btn-toggle-password .icon-eye-off {
  display: none;
}

.btn-toggle-password.is-revealed .icon-eye {
  display: none;
}

.btn-toggle-password.is-revealed .icon-eye-off {
  display: block;
}

.auth-reset-subtext {
  text-align: center;
  margin-bottom: 4px;
}

/* =========================================================
 * RANKED ELO LEADERBOARD
 * ========================================================= */
.ranked-leaderboard-card {
  background: var(--bg-surface, #1e293b);
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  padding: 20px 24px;
  margin-top: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.leaderboard-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.leaderboard-trophy-icon {
  color: var(--gold-primary, #d4af37);
  font-size: 1.25rem;
}

.leaderboard-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  margin: 0;
}

.leaderboard-table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.leaderboard-table thead {
  background: var(--bg-surface-elevated, #0f172a);
}

.leaderboard-table th {
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.leaderboard-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.04));
  vertical-align: middle;
  color: var(--text-secondary, #cbd5e1);
}

.leaderboard-table tbody tr:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.04));
}

.leaderboard-table tbody tr.leaderboard-current-user {
  background: rgba(212, 175, 55, 0.08) !important;
  border-left: 3px solid var(--gold-primary, #d4af37);
}

.leaderboard-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
}

.leaderboard-rank-badge.rank-gold {
  background: linear-gradient(135deg, #ffd700, #b8860b);
  color: #1e1b4b;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.leaderboard-rank-badge.rank-silver {
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
  color: #0f172a;
  box-shadow: 0 0 6px rgba(226, 232, 240, 0.3);
}

.leaderboard-rank-badge.rank-bronze {
  background: linear-gradient(135deg, #f59e0b, #b45309);
  color: #ffffff;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.3);
}

.leaderboard-player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
}

.leaderboard-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-subtle, rgba(255, 255, 255, 0.2));
  background: var(--bg-surface-elevated, #0f172a);
}

.leaderboard-elo-val {
  font-weight: 700;
  color: var(--gold-primary, #d4af37);
}

.you-chip {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  background: var(--gold-primary, #d4af37);
  color: #1e1b4b;
  text-transform: uppercase;
  margin-left: 6px;
}


/* =========================================================
 * PAGINATION CONTROLS (Public Rooms & Leaderboard)
 * ========================================================= */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
  padding: 8px 0;
}

.pagination-btn {
  min-width: 80px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.pagination-info {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  letter-spacing: 0.5px;
}

/* =========================================================
 * RANKED UNLOCK PROGRESS & FAIR PLAY
 * ========================================================= */
.ranked-unlock-box {
  display: none;
  flex-direction: column;
  gap: 8px;
  background: oklch(0.24 0.04 260 / 0.7);
  border: 1px solid oklch(0.65 0.15 250 / 0.4);
  border-radius: var(--radius-md, 8px);
  padding: 12px 16px;
  margin: 12px auto;
  max-width: 440px;
  width: 100%;
  box-sizing: border-box;
}

.ranked-unlock-box.active {
  display: flex;
}

.ranked-unlock-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-primary, #ffffff);
}

.ranked-unlock-header .unlock-text {
  flex: 1;
  text-align: left;
}

.ranked-unlock-header .unlock-count {
  font-weight: 700;
  color: var(--gold-primary, #e2b93b);
}

.ranked-unlock-progress-track {
  width: 100%;
  height: 6px;
  background: oklch(1 0 0 / 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.ranked-unlock-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 999px;
  transition: width 0.3s ease;
}


/* =========================================================
 * GDPR Cookie Consent Banner & Lobby Footer
 * ========================================================= */
.cookie-consent-banner {
  position: fixed;
  bottom: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 760px);
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 16px 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(240, 180, 41, 0.1);
  backdrop-filter: blur(14px);
  z-index: 10000;
  transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.cookie-consent-banner.active {
  bottom: 24px;
  opacity: 1;
  pointer-events: auto;
}

.cookie-consent-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.cookie-consent-text {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.5;
  flex: 1 1 340px;
}

.cookie-consent-text a {
  color: var(--gold-primary, #e2b93b);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.cookie-consent-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-close-btn {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 1.3rem;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.lobby-footer {
  margin-top: 36px;
  padding: 18px 0 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted, #94a3b8);
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-muted, #94a3b8);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--gold-primary, #e2b93b);
}

.footer-separator {
  color: rgba(255, 255, 255, 0.2);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.auth-legal-notice {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  text-align: center;
  line-height: 1.4;
}

.auth-legal-notice a {
  color: var(--gold-primary, #e2b93b);
  text-decoration: underline;
}

/* =========================================================
 * ACCOUNT DANGER ZONE & DELETE ACCOUNT MODAL
 * ========================================================= */
.account-danger-zone {
  margin-top: 24px;
  padding: 18px 22px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.danger-zone-header {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f87171;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.danger-zone-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.danger-zone-desc {
  font-size: 0.88rem;
  color: #cbd5e1;
  margin: 0;
  flex: 1 1 260px;
  line-height: 1.5;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2) !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
  color: #fca5a5 !important;
  transition: all var(--transition-fast, 0.15s) ease;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.4) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-danger:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.delete-account-modal-box {
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 24px rgba(239, 68, 68, 0.15) !important;
}

.delete-warning-text {
  font-size: 0.92rem;
  color: #e2e8f0;
  margin-bottom: 10px;
}

.delete-consequences-list {
  margin: 0 0 14px 0;
  padding-left: 20px;
  font-size: 0.86rem;
  color: #fca5a5;
  line-height: 1.6;
}

.delete-consequences-list li {
  margin-bottom: 4px;
}

.delete-reassure-text {
  font-size: 0.84rem;
  color: #94a3b8;
  margin: 0 0 16px 0;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 6px;
}

.delete-confirm-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.delete-confirm-input-wrap label {
  font-size: 0.85rem;
  color: #cbd5e1;
}

.delete-confirm-input-wrap .form-input {
  border-color: rgba(239, 68, 68, 0.4);
}

.delete-confirm-input-wrap .form-input:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.delete-error-msg {
  font-size: 0.85rem;
  color: #f87171;
  margin-bottom: 12px;
}

.modal-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* =========================================================
 * FRIEND GAME INVITE MODAL
 * ========================================================= */
.friend-invite-modal-box {
  text-align: center;
}

.friend-invite-icon {
  font-size: 2.4rem;
  color: var(--gold-primary, #d4af37);
  margin-bottom: 6px;
}

.friend-invite-room {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 14px 0 4px 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.friend-invite-room-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted, #94a3b8);
}

.friend-invite-room-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold-primary, #d4af37);
}

.friend-invite-modal-box .modal-actions-row {
  justify-content: center;
}

.btn-invite-friend:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* =========================================================
 * FRIENDS: ROOM-AWARE INVITES
 * ========================================================= */
.invite-friends-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--gold-primary, #d4af37);
  color: #10161f;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.friends-room-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.friends-room-banner .guest-banner-icon {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #cbd5e1);
}

.friends-room-banner .guest-banner-body {
  flex: 1;
  min-width: 0;
}

.friend-slot-action {
  display: flex;
  align-items: center;
  gap: 6px;
}

.friend-picker-modal-box {
  text-align: center;
}

.friend-picker-list {
  margin-top: 14px;
  text-align: left;
  max-height: 52vh;
  overflow-y: auto;
}

.friend-picker-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-primary, #d4af37);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.friend-picker-chip.is-sent {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.35);
  color: #4ade80;
}

.friend-picker-chip.is-muted {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-muted, #94a3b8);
}

.friend-invite-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.friend-invite-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--gold-primary, #d4af37);
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(212, 175, 55, 0.35);
}

.friend-invite-avatar .friend-avatar-img,
.friend-invite-avatar .friend-avatar-placeholder {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 50%;
}

.friend-invite-room-name {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text-primary, #f8fafc);
}

.friend-invite-room-players {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
}

.friend-invite-countdown {
  height: 3px;
  width: 100%;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.friend-invite-countdown span {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: var(--gold-primary, #d4af37);
}

/* =========================================================
 * FRIENDS: LOADING SKELETON
 * ========================================================= */
.friend-card-skeleton {
  pointer-events: none;
}

.skeleton-block {
  display: block;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 25%,
    rgba(255, 255, 255, 0.14) 37%,
    rgba(255, 255, 255, 0.06) 63%
  );
  background-size: 400% 100%;
  animation: skeletonShimmer 1.4s ease infinite;
  border-radius: 6px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-line {
  height: 10px;
  margin: 4px 0;
}

.skeleton-line-lg {
  width: 120px;
}

.skeleton-line-sm {
  width: 70px;
}

.skeleton-pill {
  width: 72px;
  height: 30px;
  border-radius: 8px;
}

@keyframes skeletonShimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* =========================================================
 * FRIENDS: RESPONSIVE (mobile / small screens)
 * ========================================================= */
@media (max-width: 640px) {
  .friends-search-bar {
    flex-wrap: wrap;
  }

  .friends-search-input {
    flex: 1 1 100%;
    order: -1;
  }

  .friends-search-bar .btn-glass {
    flex: 1 1 auto;
    min-height: 42px;
  }

  .friends-card-list {
    grid-template-columns: 1fr;
  }

  .friend-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .friend-card-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .friend-card-actions .btn-glass {
    min-height: 42px;
  }

  .friend-invite-modal-box {
    width: calc(100vw - 24px);
  }

  .friend-invite-modal-box .modal-actions-row {
    flex-direction: column-reverse;
  }

  .friend-invite-modal-box .modal-actions-row .btn-glass {
    width: 100%;
    min-height: 46px;
  }
}



