/* Language selector popup + header centering */

/* Center the language/chat bar in the top header */
[class*="mui-style-ltr-19z57j7"],
header > div > div:last-child {
  justify-content: center !important;
}

/* Language popup overlay */
.lang-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.lang-overlay.hidden { display: none; }

.lang-popup {
  background: #0f1923;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.lang-popup h2 {
  text-align: center;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.lang-popup .close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  opacity: .7;
}
.lang-popup .close-btn:hover { opacity: 1; }

.lang-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.lang-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 10px 4px;
  border-radius: 10px;
  transition: background .15s;
}
.lang-item:hover { background: rgba(255,255,255,.08); }
.lang-item.active { background: rgba(59,130,246,.2); border: 1px solid rgba(59,130,246,.4); }

.lang-item .flag {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.15);
}

.lang-item span {
  color: #c9d1d9;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

/* Make the language button in header clickable */
.lang-trigger {
  cursor: pointer !important;
  user-select: none;
}
.lang-trigger:hover {
  opacity: .8;
}

@media (max-width: 480px) {
  .lang-grid { grid-template-columns: repeat(3, 1fr); }
  .lang-popup { padding: 20px; }
}
