/* System fallbacks cover Cyrillic, Chinese and Korean without downloading large font families. */
:root:lang(ru) { --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
:root:lang(zh) { --font: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; }
:root:lang(ko) { --font: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", sans-serif; word-break: keep-all; }
#languagePicker { border: 1px solid rgba(255,214,120,.5); padding: 0; border-radius: 1.35rem; width: min(29rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); color: #fff; background: #10264c; box-shadow: 0 1rem 5rem rgba(6,20,45,.5); font-family: var(--font); }
#languagePicker::backdrop { background: rgba(8,20,42,.76); backdrop-filter: blur(6px); }
.language-sheet { padding: 1.5rem; display: flex; flex-direction: column; gap: .7rem; }
.language-logo { align-self: center; border-radius: 1rem; }
.language-brand, .language-sheet h1, .language-subtitle, .language-hint, .language-status { margin: 0; }
.language-brand { text-align: center; font-size: .72rem; letter-spacing: .16em; font-weight: 800; color: #ffc42e; }
.language-brand span { color: #c7d4e8; }
.language-sheet h1 { text-align: center; font-size: 1.5rem; line-height: 1.3; }
.language-subtitle { text-align: center; font-size: .84rem; color: #c7d4e8; line-height: 1.5; }
.language-options { display: grid; gap: .5rem; margin: .35rem 0; }
.language-option { position: relative; display: flex; align-items: center; gap: .9rem; min-height: 2.7rem; padding: .4rem .85rem; border: 1px solid rgba(255,255,255,.18); border-radius: .7rem; background: rgba(255,255,255,.06); cursor: pointer; }
.language-option img { width: 2.6rem; height: 1.75rem; object-fit: fill; border-radius: .2rem; box-shadow: 0 0 0 1px rgba(255,255,255,.2); flex: none; }
.language-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.language-option:has(input:checked) { border-color: #ffc42e; background: rgba(255,196,46,.13); }
.language-option:has(input:focus-visible) { outline: 2px solid #ffc42e; outline-offset: 3px; }
.language-option > span[lang] { font-size: 1rem; font-weight: 700; }
.language-check { margin-left: auto; color: #ffc42e; visibility: hidden; }
.language-option:has(input:checked) .language-check { visibility: visible; }
.language-hint { font-size: .74rem; line-height: 1.5; color: #c7d4e8; text-align: center; }
.language-status { color: #ffdb86; font-size: .8rem; line-height: 1.4; }
.language-status:empty { display: none; }
.language-actions { display: flex; gap: .6rem; }
.language-actions .main { flex: 1; }
.language-cancel { padding: .65rem 1rem; border: 1px solid rgba(255,255,255,.25); border-radius: 2rem; }
.language-menu { display: flex; align-items: center; justify-content: center; gap: .5rem; }
#mapActions { flex-wrap: wrap; }
@media (max-height: 580px) { .language-sheet { padding: 1rem; gap: .4rem; } .language-logo { display: none; } .language-options { grid-template-columns: repeat(2,minmax(0,1fr)); } .language-option { gap: .5rem; padding: .35rem .6rem; } }
/* Longer translated labels can wrap while the touch targets keep their minimum size. */
:root:not(:lang(vi)) .tile { min-width: 3.2rem; width: auto; max-width: 5.5rem; padding-inline: .35rem; overflow-wrap: anywhere; }
:root:not(:lang(vi)) #place { max-width: calc(100% - 12rem); }
:root:not(:lang(vi)) #place b, :root:not(:lang(vi)) #place span { overflow-wrap: anywhere; }
:root:not(:lang(vi)) #place span { white-space: normal; }
