.language-switch {
  position: fixed;
  top: calc(6px + env(safe-area-inset-top, 0px));
  left: calc(6px + env(safe-area-inset-left, 0px));
  display: none;
  gap: 4px;
  z-index: 500;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-2);
}
body:has(.lobby-shell, #online-form):not(:has(.modal-overlay, .bidui-overlay)) .language-switch { display: flex; }
.language-switch button {
  min-width: 40px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  background: var(--bg-2);
  cursor: pointer;
}
.language-switch button[aria-pressed="true"] { color: var(--ink); background: var(--accent); }
.language-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#language-notice:empty { display: none; }
#language-notice { max-width: 220px; font-size: 12px; color: var(--text); }

/* English uses text overlays; the original Chinese artwork is never modified. */
html[lang="en"] .lobby-stage-frame::after {
  content: "Stacked Factions";
  position: absolute;
  left: 41.8%;
  top: 6.1%;
  width: 22.3%;
  height: 10.4%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  box-sizing: border-box;
  border-radius: 12px;
  background: linear-gradient(#6a3817, #3c1f0f);
  color: var(--accent);
  font: 700 clamp(14px, calc(36px * var(--lobby-scale)), 36px) Georgia, serif;
  text-align: center;
  text-shadow: 1px 2px 2px #160b04;
  pointer-events: none;
}
html[lang="en"] .btn.primary.btn--pass-end,
html[lang="en"] .btn.primary.btn--pass-end:hover:not(:disabled) {
  font-size: clamp(12px, calc(19px * var(--scene-scale)), 19px);
  color: var(--ink);
  background: linear-gradient(#fff2be, #e9ac35);
  border: 2px solid var(--accent-deep);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px #fff1be;
}
html[lang="en"] .tutorial-slide-title { overflow-wrap: anywhere; }
html[lang="en"] .tutorial-slide-content {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-deep) transparent;
}
html[lang="en"] .tutorial-slide-content::-webkit-scrollbar { width: 8px; }
html[lang="en"] .tutorial-slide-content::-webkit-scrollbar-thumb { background: var(--accent-deep); border-radius: 4px; }
html[lang="en"] .tutorial-slide-body { line-height: 1.45; }
html[lang="en"] .scene-frame .side-title { letter-spacing: 0; }
html[lang="en"] .scene-frame .log-box {
  max-height: var(--i18n-log-height, 160px);
  padding: 0 4px;
  overflow-wrap: anywhere;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}
html[lang="en"] .scene-frame .log-box > div { margin-bottom: 1.4em; }
html[lang="en"] .scene-frame .log-box > div:last-child { margin-bottom: 0; }
@media (min-width: 1001px), (min-height: 501px) {
  html[lang="en"] .tutorial-slide-illustration { flex: 0 0 auto; }
}
html[lang="en"] .tutorial-verdict-head,
html[lang="en"] .tutorial-dominance-note { overflow-wrap: anywhere; }
html[lang="en"] .bidui-table,
html[lang="en"] .rank-table { overflow-wrap: anywhere; }
html[lang="en"] .bidui-title { min-width: 0; }
html[lang="en"] .lobby-ov-mode-blurb { margin: 0; }
html[lang="en"] .online-room-options { grid-template-columns: 1fr; }
html[lang="en"] .online-room-options .online-capacity-options span { padding: 4px; }
html[lang="en"] .seat-pod .cpu-bubble {
  flex-direction: row; gap: .4em; min-width: 0;
  padding: .45em .8em; line-height: 1.2;
}
html[lang="en"] .seat-pod .cpu-bubble__txt { font-size: 1.15em; letter-spacing: 0; }
html[lang="en"] .seat-pod .cpu-bubble__meta { font-size: 1.05em; }
html[lang="en"] .seat-pod .cpu-bubble.to-right { left: calc(50% + 63px + 18px / var(--bs)); }
html[lang="en"] .seat-pod .cpu-bubble.to-left { right: calc(50% + 63px + 18px / var(--bs)); }
html[lang="en"] .seat-pod .seat-pill { padding-inline: 12px; }
html[lang="en"] .bidui-badge { padding-inline: .85em; }
@media (max-width: 1100px) {
  .online-active .online-lobby-header h1 { padding-inline-start: 104px; }
}
@media (max-width: 1000px) and (max-height: 500px) and (orientation: landscape) {
  html[lang="en"] .lobby-ov-mode-blurb { font-size: 11px; line-height: 1.25; }
  html[lang="en"] .lobby-ov-input { font-size: 11px; padding-inline: 2px; }
  html[lang="en"] .lobby-ov-select { font-size: 11px; }
  html[lang="en"] .lobby-ov-tutorial,
  html[lang="en"] .lobby-ov-settings { font-size: 11px; gap: 3px; }
  html[lang="en"] .lobby-ov-tutorial svg,
  html[lang="en"] .lobby-ov-settings svg { display: none; }
  html[lang="en"] .scene-frame .player-header .seat-name { max-width: 90px; }
  html[lang="en"] .tutorial-slide-title { font-size: 16px; }
  html[lang="en"] .tutorial-slide-body { line-height: 1.35; }
  html[lang="en"] .tutorial-slide-nav-btn { font-size: 14px; }
  html[lang="en"] .table-center-info { max-width: 65%; font-size: 11px; }
  html[lang="en"] .table-center-info--error { max-width: min(360px, 100%); font-size: 13px; }
  html[lang="en"] .online-capacity-options { flex-wrap: wrap; }
}
