.language-toggle {
  border: 1px solid rgba(237, 211, 145, .62);
  background: rgba(9, 35, 37, .88);
  color: #f4dda6;
  border-radius: 999px;
  min-width: 44px;
  height: 30px;
  padding: 0 10px;
  font: 800 12px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .04em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .24);
  cursor: pointer;
  z-index: 8;
}
.language-toggle:active { transform: scale(.96); }
.brand .language-toggle--top { margin-left: auto; margin-right: 7px; flex: 0 0 auto; }
.secondary-actions { position: relative; }
.secondary-actions .language-toggle--history {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 38px;
  height: 25px;
  padding: 0 7px;
  font-size: 10px;
  min-height: 25px !important;
  width: auto;
  display: block;
  gap: 0;
}
.secondary-actions > button:nth-child(3) { padding-right: 42px; }
.secondary-actions .language-toggle--history:active { transform: translateY(-50%) scale(.96); }
.language-choice-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(2, 12, 14, .76);
  backdrop-filter: blur(12px);
}
.language-choice {
  width: min(100%, 360px);
  padding: 26px 22px 22px;
  border: 1px solid rgba(232, 207, 143, .45);
  border-radius: 24px;
  color: #f7e8bd;
  text-align: center;
  background: linear-gradient(160deg, #153a3a, #071e23 72%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .48);
}
.language-choice h2 { margin: 0 0 8px; font-size: 24px; }
.language-choice p { margin: 0 0 20px; color: rgba(255, 244, 213, .74); line-height: 1.55; }
.language-choice__buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.language-choice__buttons button {
  min-height: 52px;
  border: 1px solid rgba(232, 207, 143, .5);
  border-radius: 15px;
  color: #f9e8b7;
  font: 800 15px/1.2 system-ui, sans-serif;
  background: rgba(229, 199, 118, .1);
}
.language-choice__buttons button:last-child { background: linear-gradient(135deg, #b54c38, #7c291f); }
html[lang="vi"] body { font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif; }
html[lang="vi"] .game-card strong,
html[lang="vi"] .welcome-block h1 { letter-spacing: -.025em; }
html[lang="vi"] .lobby-page .brand { gap: 5px; }
html[lang="vi"] .brand > div:nth-child(2) { flex: 0 0 auto; min-width: 0; }
html[lang="vi"] .brand > div:nth-child(2) > span { display: none; }
html[lang="vi"] .brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(15px, 4.35vw, 17px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}
html[lang="vi"] .brand strong small { display: none; }
html[lang="vi"] .brand .brand__profile { flex: 1 1 0; min-width: 0; max-width: 40%; }
html[lang="vi"] .brand .language-toggle--top { min-width: 38px; padding: 0 7px; margin-right: 2px; }
html[lang="vi"] .lobby-page .welcome-block h1 { font-size: 28px; line-height: 1.08; }
html[lang="vi"] .lobby-page .welcome-block h1 br { display: block; }
@media (max-width: 390px) {
  .brand .language-toggle--top { min-width: 38px; padding: 0 7px; margin-right: 4px; }
}

/* v33: keep puzzle navigation visible in short Telegram WebViews. */
.social-page:has(.puzzle-challenge) { padding-top:10px; padding-bottom:8px; }
.social-page:has(.puzzle-challenge) .social-header { min-height:38px; margin-bottom:3px; gap:7px; }
.social-page:has(.puzzle-challenge) .social-header .home-button { min-height:34px; padding:6px 9px; }
.social-page:has(.puzzle-challenge) .social-header .icon-button { width:34px; height:34px; }
.social-page:has(.puzzle-challenge) .social-header h1 { margin:1px 0; font-size:19px; line-height:1.05; }
.social-page:has(.puzzle-challenge) > .social-tabs { margin:2px 0 4px; }
.social-page:has(.puzzle-challenge) > .social-tabs button { min-height:32px; padding:5px 7px; }
.puzzle-toolbar { margin:0 0 2px; min-height:20px; }
.puzzle-toolbar button { padding:2px 0; font-size:10px; }
.puzzle-toolbar > span { font-size:9px; }
.puzzle-challenge { padding:0; }
.puzzle-challenge > .eyebrow { display:inline; margin:0 6px 0 0; font-size:9px; line-height:1.2; }
.puzzle-challenge > h2 { display:inline; margin:0; font-size:17px; line-height:1.18; }
.puzzle-challenge > .eyebrow + h2 + p { display:-webkit-box; overflow:hidden; -webkit-box-orient:vertical; -webkit-line-clamp:2; margin:3px 0 4px; font-size:10px; line-height:1.3; }
.puzzle-challenge .daily-board { margin:5px auto; }
.puzzle-challenge .daily-board--xiangqi { width:min(100%, calc((var(--app-height, 100dvh) - 265px) * .9), 330px); }
.puzzle-challenge .daily-board--gomoku { width:min(100%, calc(var(--app-height, 100dvh) - 265px), 330px); }
.puzzle-challenge > .social-note, .puzzle-challenge > .daily-feedback { margin:4px 0; padding-block:5px; line-height:1.3; }
.puzzle-challenge > .social-tabs { margin:5px 0 0; }
.puzzle-challenge > .social-tabs button { min-height:34px; padding:6px 5px; }
@media (max-height:620px) {
  .social-page:has(.puzzle-challenge) .social-header .eyebrow { display:none; }
}


