/**
 * OGame Utilities — shared language picker (hub + tools)
 * Inspired by modern dark UIs; not a clone of any third party.
 */
.site-lang {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.site-lang__trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(0, 210, 255, 0.28);
  background: rgba(0, 0, 0, 0.35);
  color: #e6edf3;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.site-lang__trigger:hover {
  border-color: rgba(0, 210, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.1);
}

.site-lang__trigger:focus-visible {
  outline: 2px solid #00d2ff;
  outline-offset: 2px;
}

.site-lang__flag {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.site-lang__flag-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.site-lang__chev {
  font-size: 0.65rem;
  opacity: 0.75;
  margin-left: 2px;
}

/* Backdrop */
.site-lang__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10040;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.site-lang__backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Panel: position set by JS near trigger */
.site-lang__panel {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10050;
  width: min(420px, calc(100vw - 16px));
  max-height: min(80vh, 440px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid rgba(0, 210, 255, 0.22);
  background: linear-gradient(165deg, #121820 0%, #0c1016 100%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
  opacity: 0;
  pointer-events: none;
  transform: none;
  transition: opacity 0.18s ease;
}

.site-lang__panel.is-open {
  opacity: 1;
  pointer-events: auto;
}

.site-lang__panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.site-lang__panel-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #00d2ff;
  margin: 0;
}

.site-lang__close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #c9d1d9;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.site-lang__close:hover {
  border-color: rgba(248, 81, 73, 0.4);
  color: #ff7b72;
}

.site-lang__grid-wrap {
  padding: 12px 14px 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.site-lang__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}

@media (min-width: 480px) {
  .site-lang__grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.site-lang__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 10px 6px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
  color: #e6edf3;
  font-size: 0.74rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  line-height: 1.2;
}

.site-lang__cell:hover {
  border-color: rgba(0, 210, 255, 0.35);
  background: rgba(0, 210, 255, 0.06);
}

.site-lang__cell:focus-visible {
  outline: 2px solid #00d2ff;
  outline-offset: 2px;
}

.site-lang__cell.is-active {
  border-color: rgba(0, 210, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(0, 210, 255, 0.15);
  background: rgba(0, 210, 255, 0.1);
}

.site-lang__cell-flag {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.site-lang__cell-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Hub: larger trigger */
.home-body .site-lang__trigger {
  padding: 10px 18px;
  font-size: 0.9rem;
}
