.site-header .mast {
  display: grid;
  width: min(1440px, calc(100% - clamp(40px, 3.6vw, 64px)));
  grid-template-columns: auto minmax(0, max-content) auto auto;
  grid-template-areas: "brand nav channels actions";
  justify-content: center;
  gap: 0 clamp(14px, 1.2vw, 20px);
  min-height: 0;
  align-items: center;
}
.site-header .brand { grid-area: brand; justify-self: start; min-width: 0; margin-block: 10px; }
.site-header .brand span:last-child { min-width: 0; }
.site-header .brand b { overflow-wrap: anywhere; }
.site-header .brand .mark { flex-shrink: 0; }
.site-header .head-actions { grid-area: actions; justify-self: end; min-width: 0; }
.header-resources { grid-area: channels; display: flex; align-items: center; gap: 16px; }
.channel-list { display: flex; align-items: center; gap: 2px; }
.channel-link { display: grid; place-items: center; width: 32px; height: 34px; color: var(--muted); border-radius: 3px; }
.channel-link:hover, .channel-link:focus-visible { color: var(--ink); background: #282d2b; }
.channel-link svg { width: 17px; height: 17px; }
.header-steam {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding-inline: 12px;
  background: var(--accent);
  color: #1d1b17;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
}
.header-steam:hover { background: #ff8c69; }
.site-header .mast nav {
  grid-area: nav;
  justify-content: start;
  min-width: 0;
  gap: clamp(12px, 1.1vw, 18px);
  overflow-x: auto;
  margin: 0;
  scrollbar-width: thin;
}
.site-header .mast nav a { flex: none; padding-block: 10px; }
.site-header .mast nav a:focus-visible { outline-offset: -2px; }
.site-header .mast nav a[aria-current]::after { bottom: 3px; }
.language-picker { position: relative; }
.language-picker summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #444945;
  border-radius: 3px;
  color: #d2d3cc;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  list-style: none;
}
.language-picker summary::-webkit-details-marker { display: none; }
.language-picker summary:focus-visible { outline: 2px solid #ffa789; outline-offset: 3px; }
.language-picker summary svg { width: 16px; height: 16px; }
.language-picker summary i {
  width: 6px;
  height: 6px;
  margin-inline: 2px;
  border-inline-end: 1px solid;
  border-bottom: 1px solid;
  transform: rotate(45deg) translateY(-1px);
}
.language-picker[open] summary i { transform: rotate(225deg) translate(-1px, -1px); }
.language-options {
  position: absolute;
  z-index: 3;
  inset-block-start: calc(100% + 7px);
  inset-inline-end: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(282px, calc(100vw - 44px));
  max-height: min(430px, 67vh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #4c524d;
  border-radius: 5px;
  background: #202523;
  box-shadow: 0 9px 26px #0007;
}
.language-options a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 36px;
  padding: 5px 10px;
  border-radius: 2px;
  color: var(--ink);
  font-size: 14px;
}
.language-options a[aria-current="page"] { color: #ffa383; background: #342924; }
.language-options a[lang="ar"] { flex-direction: row-reverse; }
.language-options a[aria-current="page"]::after { content: "✓"; font-size: 12px; }
.language-options a:hover, .language-options a:focus-visible { background: #333a35; }
.language-options a:focus-visible { outline-offset: -2px; }
@media (min-width: 1232px) {
  .site-header .brand { max-inline-size: 220px; }
}
@media (min-width: 1232px) and (max-width: 1440px) {
  .site-header .mast { width: calc(100% - 48px); column-gap: 14px; }
  .site-header .brand { max-width: 180px; }
  .site-header .mast nav { gap: 12px; }
  .header-resources { gap: 8px; }
  .channel-link { width: 26px; }
  .site-header .search-link { padding-inline: 8px; }
}
@media (min-width: 1232px) and (max-width: 1320px) {
  .site-header .search-link span { display: none; }
}
@media (max-width: 1231px) {
  .site-header .mast {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "brand channels actions" "nav nav nav";
  }
  .site-header .menu-btn { display: grid; place-items: center; }
  .site-header .mast nav { display: none; position: static; padding: 0; background: transparent; border: 0; }
  .site-header .mast nav.open { display: flex; gap: 20px; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .site-header .mast {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions" "nav nav" "channels channels";
    column-gap: 7px;
  }
  .site-header .brand { margin-block: 9px; }
  .site-header .head-actions { gap: 5px; }
  .header-resources { justify-content: space-between; gap: 5px; border-top: 1px solid var(--line); padding-block: 4px; }
  .header-steam { max-width: 48%; padding-inline: 8px; text-align: center; }
  .language-options { width: min(270px, calc(100vw - 78px)); }
  .channel-link { width: clamp(28px, 7.5vw, 36px); height: 35px; }
}
@media (max-width: 390px) {
  .site-header .mast { width: calc(100% - 24px); }
  .site-header .brand { gap: 5px; }
  .site-header .brand b { font-size: 15px; }
  .site-header .head-actions { gap: 4px; }
  .site-header .search-link, .site-header .menu-btn { padding: 6px; }
  .language-picker summary { padding: 5px; gap: 4px; }
}
