/* One flag, no text: open the compact language picker from the right edge. */
.language-picker {
  display:grid;place-items:center;flex:none;width:44px;height:44px;min-width:44px;
  padding:0;border-radius:8px;border:1px solid #38506a;background:#0c2036;
  color:#fff;cursor:pointer;touch-action:manipulation;
}
.language-picker:hover {background:#17334d;border-color:#ff862e}
.language-picker:focus-visible {outline:3px solid #ff862e;outline-offset:2px}
.language-picker .language-flag {width:25px;height:18px;display:block;border-radius:2px;box-shadow:0 0 0 1px #ffffff35}
.language-dialog {
  color:#111e30;background:#fff;border:0;border-radius:14px;
  width:min(390px,calc(100% - 28px));max-height:85dvh;padding:0;overflow:auto;
  box-shadow:0 18px 85px #0008;font:inherit
}
.language-dialog:not([open]) {display:none}
.language-dialog::backdrop {background:#05101bb8}
.language-dialog-head {
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:15px 18px;border-bottom:1px solid #dce5ef;color:#081423;
  background:#fff;position:sticky;top:0;z-index:2
}
.language-dialog-head h2 {font:800 1.45rem/1.2 Inter,system-ui,sans-serif;margin:0;text-transform:none}
.language-close {
  display:grid;place-items:center;flex:none;width:44px;height:44px;border:0;border-radius:8px;
  background:#fff0e5;color:#081423;cursor:pointer
}
.language-close svg {width:23px;height:23px}
.language-options {display:grid;gap:6px;padding:12px 16px 16px}
.language-option {
  min-height:49px;display:flex;align-items:center;gap:13px;width:100%;text-align:start;
  border:1px solid #dce5ef;border-radius:8px;background:#fff;color:#081423;
  padding:8px 12px;font:700 1rem/1.3 Inter,system-ui,sans-serif;cursor:pointer
}
.language-option .language-flag {width:30px;height:20px;flex:none;border-radius:2px;box-shadow:0 0 0 1px #08142326}
.language-option[aria-pressed=true] {background:#fff0e5;border-color:#ff862e}
.language-option:hover {background:#fff5ed}
.language-name {flex:1}
.language-check {color:#a44809;font-weight:900;font-size:1.2rem}
.language-option:focus-visible,.language-close:focus-visible {outline:3px solid #a44809;outline-offset:1px}
@media(max-width:720px) {
  .language-dialog {margin:auto auto 0;width:100%;max-width:100%;max-height:88dvh;border-radius:15px 15px 0 0}
  .language-options {padding-bottom:calc(16px + env(safe-area-inset-bottom))}
}

/* Keep the original WAKO logo / download / refresh controls in a single
   mobile row; the new language flag is always physically furthest right. */
.has-language-picker .top-inner {direction:ltr;grid-template-columns:auto minmax(0,1fr) auto}
.has-language-picker .top-inner:has(.app-install[hidden]),
html.is-standalone.has-language-picker .top-inner {grid-template-columns:minmax(0,1fr) auto}
.has-language-picker .top-right {gap:10px}
.has-language-picker .top-right .language-picker {grid-area:language;justify-self:end}
html[dir=rtl] .top-inner .desktop {direction:rtl}
@media(max-width:1250px) {
  .has-language-picker .top-inner {
    grid-template-columns:auto minmax(0,1fr) auto auto;
    grid-template-areas:"brand install refresh language" "navigation navigation navigation navigation";
    gap:5px 7px;padding-block:8px 5px;
  }
  .has-language-picker .top-inner:has(.app-install[hidden]),
  html.is-standalone.has-language-picker .top-inner {
    grid-template-columns:minmax(0,1fr) auto auto;
    grid-template-areas:"brand refresh language" "navigation navigation navigation";
  }
  .has-language-picker .top-right {display:contents}
  .has-language-picker .top-right .desktop {grid-area:navigation;justify-content:center;gap:clamp(12px,3vw,30px)}
  .has-language-picker .top-right .refresh-page {grid-area:refresh;justify-self:end}
}
@media(max-width:720px) {
  .has-language-picker .top-inner {grid-template-areas:"brand install refresh language";gap:5px;padding-block:8px}
  .has-language-picker .top-inner:has(.app-install[hidden]),
  html.is-standalone.has-language-picker .top-inner {
    grid-template-areas:"brand refresh language";row-gap:0
  }
  .has-language-picker .top-right .desktop {display:none}
  .has-language-picker .language-picker {width:40px;min-width:40px}
  .has-language-picker .app-install {max-width:100%;white-space:nowrap;gap:3px;padding-inline:6px}
  .has-language-picker .app-install svg {width:15px;height:15px}
  .has-language-picker .top-inner:has(.app-install[hidden]) > .brand,
  html.is-standalone.has-language-picker .top-inner > .brand {flex-direction:row;align-items:center;gap:7px}
  /* Longer translated CTA/nav names remain inside their compact cells. */
  .has-language-picker .mobile a,.has-language-picker .mobile button {overflow-wrap:anywhere;line-height:1.12}
  .has-language-picker .mobile .timer-label {white-space:normal;overflow-wrap:anywhere}
}
@media(max-width:390px) {
  .has-language-picker .top-inner:not(:has(.app-install[hidden])) .brand {font-size:1.19rem;gap:5px}
  .has-language-picker .top-inner:not(:has(.app-install[hidden])) .brand img {width:78px}
  html.is-standalone.has-language-picker .top-inner > .brand {font-size:1.4rem}
}
@media(max-width:349px) {
  .has-language-picker .top-inner:not(:has(.app-install[hidden])) .brand {flex-direction:column;align-items:flex-start;font-size:1.04rem;gap:3px}
  .has-language-picker .top-inner:has(.app-install[hidden]) > .brand,
  html.is-standalone.has-language-picker .top-inner > .brand {font-size:1.28rem;flex-direction:row;align-items:center;gap:5px}
}
.has-language-picker .timer-header-inner {direction:ltr;gap:8px}
.has-language-picker .timer-header-inner .brand {margin-right:auto}
.has-language-picker .timer-header-inner .back-link {font-size:.8rem;gap:5px;min-width:40px;justify-content:center}
@media(max-width:400px){.has-language-picker .timer-header-inner .back-link span{display:none}}
.has-language-picker body[data-wako-release] .header {direction:ltr;gap:10px}
.has-language-picker body[data-wako-release] .header .language-picker {margin-left:auto}
.has-language-picker body[data-wako-release] .header .header-tag {white-space:normal}
@media(max-width:600px){.has-language-picker body[data-wako-release] .header .header-tag{display:none}}

/* Arabic sections respect their script direction while logos, flags, the
   clock and other numerical displays retain their readable orientation. */
html[dir=rtl] :is(h1,h2,h3) {font-family:system-ui,sans-serif;letter-spacing:0;line-height:1.13}
html[dir=rtl] .brand,html[dir=rtl] .eyebrow.flag {direction:ltr}
html[dir=rtl] .language-dialog {direction:rtl}
html[dir=rtl] :is(.clock,.countdown,.countdown-unit,.ranking-rank,.ranking-points,.sport-wheel-scroll) {direction:ltr}
html[dir=rtl] .ranking-table-labels {direction:rtl}
@media(max-width:720px) {
  html[dir=rtl] .hero h1 {font-size:clamp(2.2rem,9vw,3.5rem)}
}

/* Let longer localized headlines and cards wrap naturally, even while a
   downloaded display font is unavailable. */
html:not([lang=nl]) :is(h1,h2,h3,h4) {max-width:100%;overflow-wrap:anywhere;hyphens:auto}
html:not([lang=nl]) :is(.discipline,.two > *, .section-head > *) {min-width:0}
html:not([lang=nl]) .hero h1 {max-width:100%}
@media(max-width:720px) {
  html:not([lang=nl]) .two {grid-template-columns:minmax(0,1fr)}
}
@media(max-width:349px) {
  .has-language-picker .top-inner:has(.app-install[hidden]) > .brand,
  html.is-standalone.has-language-picker .top-inner > .brand {font-size:1.03rem;gap:5px}
  .has-language-picker .top-inner:has(.app-install[hidden]) > .brand img,
  html.is-standalone.has-language-picker .top-inner > .brand img {width:76px}
}
