/*
 * Language selector: a small glass pill in the top corner of the page (both pages link this file).
 * The real <select> sits invisibly on top of the pill, so keyboards, screen readers and the phone's native
 * picker all behave as they do for any dropdown; the pill underneath is only what you see.
 * Phones show the two-letter code ("EN") instead of the language name to keep clear of the logo.
 */
.lang {
  position: absolute;
  top: clamp(12px, 2vw, 22px);
  inset-inline-end: clamp(12px, 2vw, 22px);
  z-index: 20;
}
.lang-label { /* read by screen readers, not shown */
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.lang-select {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px; /* 16px or more stops iOS from zooming in when it opens */
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px 0 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background-color 0.15s;
}
.lang-pill svg {
  flex: none;
  width: 16px;
  height: 16px;
}
.lang-pill .lang-chevron {
  width: 13px;
  height: 13px;
  opacity: 0.8;
}
.lang-code { display: none; }
.lang:hover .lang-pill { background: rgba(255, 255, 255, 0.18); }
.lang-select:focus-visible + .lang-pill {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}
@media (max-width: 479px) {
  .lang-name { display: none; }
  .lang-code { display: inline; }
  .lang-pill { padding: 0 8px 0 10px; }
}

/* Japanese wraps at natural phrase boundaries where the browser supports it (Chrome); elsewhere it wraps per character as usual */
:lang(ja) h1,
:lang(ja) .q-text,
:lang(ja) .invite { word-break: auto-phrase; }
