/* —— country picker (flag + name dropdown) —— */
.country-picker {
  position: relative;
  width: 100%;
  min-width: 0;
  z-index: 6;
}

.country-picker__trigger {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 10px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.country-picker__trigger:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.country-picker.is-open .country-picker__trigger,
.country-picker__trigger[aria-expanded='true'] {
  border-color: rgba(91, 140, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.14);
}

.country-picker__face {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.country-picker__flag {
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
  width: 1.35em;
  text-align: center;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.country-picker__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.country-picker__name {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-picker__lang {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.country-picker__chevron {
  flex: 0 0 auto;
  opacity: 0.55;
  transition: transform 0.15s ease;
}

.country-picker.is-open .country-picker__chevron {
  transform: rotate(180deg);
}

.country-picker__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(340px, 48vh);
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #12151c;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  z-index: 40;
}

.country-picker__menu[hidden] {
  display: none !important;
}

.country-picker__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.country-picker__option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.country-picker__option.is-active {
  background: rgba(91, 140, 255, 0.16);
}

.country-picker__option .country-picker__flag {
  font-size: 20px;
}

.country-picker__check {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  flex: 0 0 auto;
}

.country-picker__option.is-active .country-picker__check {
  background: #5b8cff;
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.25);
}

/* Compact variant inside game cards */
.country-picker--compact {
  z-index: 7;
  max-width: 220px;
  flex: 1 1 160px;
}

.country-picker--compact .country-picker__trigger {
  min-height: 36px;
  padding: 5px 10px 5px 8px;
  border-radius: 10px;
  gap: 8px;
}

.country-picker--compact .country-picker__flag {
  font-size: 18px;
}

.country-picker--compact .country-picker__name {
  font-size: 12.5px;
}

.country-picker--compact .country-picker__lang {
  font-size: 10px;
}

.country-picker--compact .country-picker__menu {
  min-width: 240px;
  right: auto;
  width: max(100%, 260px);
}

/* Show inside GPT / template rows when parent is on */
.game-gpt-langs.country-picker-slot,
.game-gpt-langs:has(.country-picker) {
  overflow: visible !important;
  max-width: min(260px, 48vw);
  min-width: 140px;
}

.game-gpt-block.is-on .game-gpt-langs.country-picker-slot,
.game-tpl-toggle.is-on .game-gpt-langs.country-picker-slot,
.game-gpt-block.is-on .game-gpt-langs:has(.country-picker),
.game-tpl-toggle.is-on .game-gpt-langs:has(.country-picker) {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.game-gpt-main {
  overflow: visible;
}

.game-gpt-block,
.game-footer-row,
.game-row-footer,
.game-row-body,
.game-row {
  overflow: visible;
}

.country-picker__menu {
  z-index: 10000;
}
