.language-switcher { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .4rem; color: #eef5ff; }
.language-switcher select { font: inherit; color: inherit; background: #182638; border: 1px solid #59718e; border-radius: 6px; padding: .4rem; min-height: 36px; max-width: 160px; }
.game-language-bar { display: flex; justify-content: flex-end; position: sticky; top: 0; z-index: 90; background: var(--bg-primary, #0a0e1a); }
.currency-settings { display: inline-flex; align-items: center; gap: 2px; min-width: 0; padding-right: 4px; }
.currency-switcher { display: inline-flex; align-items: center; gap: .3rem; min-width: 0; color: #eef5ff; font-family: system-ui, sans-serif; }
.currency-switcher select { font: inherit; color: inherit; background: #182638; border: 1px solid #59718e; border-radius: 6px; padding: .4rem; min-height: 36px; width: 185px; max-width: 100%; }
.currency-rate-info { position: relative; color: #c3d4ea; }
.currency-rate-info > summary { cursor: pointer; list-style: none; padding: 5px; }
.currency-rate-panel { position: absolute; right: 0; top: 100%; width: min(340px, calc(100vw - 16px)); padding: 12px; background: #182638; border: 1px solid #59718e; border-radius: 8px; box-shadow: 0 5px 18px #0008; font-size: .78rem; line-height: 1.6; }
.currency-rate-panel p { margin: 0 0 8px; }
.currency-rate-panel a { color: #b1e995; }
@media (max-width: 480px) {
  .game-language-bar { gap: 2px; }
  .game-language-bar .language-switcher { min-width: 0; padding: 3px; gap: 2px; flex: 1 1 42%; }
  .game-language-bar .language-switcher select { min-width: 0; max-width: 100%; width: 100%; }
  .currency-settings { flex: 1 1 58%; }
  .currency-switcher { flex: 1 1 auto; }
  .currency-switcher select { min-width: 0; width: 100%; }
}
html:not([lang="ja"]) { --font-main: Inter, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; }
html:not([lang="ja"]) button, html:not([lang="ja"]) label, html:not([lang="ja"]) h1, html:not([lang="ja"]) h2, html:not([lang="ja"]) h3, html:not([lang="ja"]) summary { overflow-wrap: anywhere; hyphens: auto; }
html:not([lang="ja"]) .start-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html:not([lang="ja"]) .start-choice-button, html:not([lang="ja"]) .start-difficulty-button { white-space: normal; height: auto; min-height: 48px; }
html:not([lang="ja"]) .start-field-block { min-width: 0; }
html:not([lang="ja"]) .start-setup-panel { overflow: visible; }
html:not([lang="ja"]) .nav-tab, html:not([lang="ja"]) .page-tab { flex-shrink: 0; }
html:not([lang="ja"]) .table-scroll table { width: max-content; min-width: 100%; }
html:not([lang="ja"]) th { white-space: normal; max-width: 160px; }
html:not([lang="ja"]) .modal-content { overflow-wrap: anywhere; }
@media (max-width: 480px) { html:not([lang="ja"]) .start-choice-grid { grid-template-columns: 1fr; } }
html[lang="zh-Hans"] { --font-main: 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', system-ui, sans-serif; line-break: strict; }
html[lang="th"] { --font-main: 'Leelawadee UI', 'Thonburi', 'Noto Sans Thai', Tahoma, system-ui, sans-serif; }
html[lang="th"] button, html[lang="th"] label, html[lang="th"] th, html[lang="th"] td { line-height: 1.65; word-break: normal; hyphens: none; }
html[lang="zh-Hans"] button, html[lang="zh-Hans"] label { word-break: normal; hyphens: none; }
.language-switcher { flex-shrink: 0; font-family: system-ui, 'Microsoft YaHei', 'Leelawadee UI', sans-serif; }
.language-switcher [role="status"] { max-width: 260px; font-size: .75rem; }
html:not([lang="ja"]) body { font-family: var(--font-main); }
html[lang="th"] button, html[lang="th"] input, html[lang="th"] select, html[lang="th"] textarea { font-family: var(--font-main); }
.header { flex-wrap: wrap; gap: 12px; }
.header .brand { margin-right: auto; }
.header nav { order: 2; width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 12px 22px; }
html:has(.header) { scroll-padding-top: var(--site-header-offset, 180px); }
html:not([lang="ja"]) .dashboard-player-career-inline-content { flex-wrap: wrap; }
html:not([lang="ja"]) .dashboard-player-career-stats { flex: 0 1 auto; flex-wrap: wrap; }
html:not([lang="ja"]) .dashboard-player-career-bar { flex-shrink: 0; }
html:not([lang="ja"]) .dashboard-player-career-head-copy :is(.card-title,.card-subtitle),
html:not([lang="ja"]) .dashboard-player-career-identity { white-space: normal; overflow: visible; }
/* Reserve the language row inside the viewport. A second page scrollbar must
   not scroll the language selector underneath the higher-z-index club rail. */
#root:has(> .app-container.has-main-page-nav),
#root:has(> .app-container.is-season-result-layout) {
  display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden;
}
#root:has(> .app-container.has-main-page-nav) > .game-language-bar,
#root:has(> .app-container.is-season-result-layout) > .game-language-bar { position: relative; flex-shrink: 0; }
#root > .app-container.has-main-page-nav,
#root > .app-container.is-season-result-layout { flex: 1 1 0; height: auto; min-height: 0; }

/* Share the club toolbar's scroll state rather than adding a second scroll
   listener. Collapsing the row returns its height to the game viewport; hidden
   selectors are also removed from keyboard focus by visibility:hidden. */
#root:has(> .app-container.has-main-page-nav) > .game-language-bar {
  max-height: 52px; opacity: 1;
  transition: max-height .2s ease, opacity .15s ease;
}
#root:has(.main-page-nav.is-scroll-hidden) > .game-language-bar {
  max-height: 0; opacity: 0; overflow: hidden; visibility: hidden; pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  #root > .game-language-bar { transition: none !important; }
}

/* Keep tournament names and winners readable in every language. The winner
   gets a full second row instead of squeezing both names beside a badge. */
.season-result-page .season-title-results-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) !important;
}
.season-result-page .season-title-results-grid > .season-title-result-row {
  grid-template-columns: minmax(0, 1fr) max-content !important;
  align-items: start !important;
}
.season-result-page .season-title-result-row > strong {
  white-space: normal; word-break: normal; overflow-wrap: break-word;
}
.season-result-page .season-title-result-row > .season-title-result-champion {
  grid-column: 1 / -1; grid-row: 2;
  white-space: normal; overflow: visible; text-overflow: clip;
  overflow-wrap: break-word;
}
