/* A fixed-height header keeps the sticky strip in the same place in every state. */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(13, 15, 21, .96); backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--line);
	transition: transform .25s ease;
}
/* /watch includes the nav INSIDE its page .shell, so the header's own .shell padded a
   second time and its right edge stopped short of the player and rail (item 1275). */
.shell > .site-header > .shell { padding-inline: 0; }
.strip {
	position: sticky;
	top: var(--site-header-height, 73px);
	z-index: 40;
	transition: top .25s ease;
}
.strip .day-filter-rows { flex-direction: column; align-items: stretch; gap: 6px; }
.strip .day-filter-rows > .chip-row-frame { flex: none; width: 100%; order: initial; }
.strip .show-label { display: inline; }
.strip .rail-label {
	/* The script measures the longest translated name once and shares its width
	   across all six rows. max-content keeps every name readable before it runs. */
	width: var(--filter-label-width, max-content);
	position: static;
	background: var(--bg);
	white-space: nowrap;
}

/* Sticky header slide-away on scroll, every screen size (items 1238/1239; item 1291 dropped
   the old (max-width: 999px), (max-height: 800px) condition so tall desktop windows slide
   too). The header is sticky, so moving it with transform takes nothing out of the flow and
   the list does not jump; the strip just re-pins at the top. */
body.header-hidden .site-header,
.site-header.header-hidden {
	transform: translateY(-100%);
	pointer-events: none;
}
body.header-hidden .strip {
	top: 0;
}
/* Multiview (board #1585, measured 21 Oct 2026): the header does not stick or slide there. A
   sticky header lying over the top of a Twitch player, even slid out of view, counts to Twitch
   as covering it ("style visibility"): scrolling 180 px to reach the bottom row's speaker
   buttons paused the top row's Twitch stream every time. With the header in the page flow,
   the same scrolls left all four streams playing. */
body:has(.multi-shell) .site-header,
body:has(.multi-shell) .site-header.header-hidden {
	position: static;
	transform: none;
	pointer-events: auto;
}
/* Reduced motion: show or hide at once, no slide. */
@media (prefers-reduced-motion: reduce) {
	.site-header,
	.strip { transition: none; }
}

/* Phone header layout: compact brand, collapsed nav-menu under burger toggle (width < 1000px) */
@media (max-width: 999px) {
	.strip {
		top: var(--site-header-height, 47px);
	}
	.site-header .top { flex-wrap: wrap; gap: 8px; padding: 5px 0; position: relative; }
	.site-header .brand { flex: 0 0 auto; order: 1; }
	.site-header .brand img { height: 30px; }
	.site-header .brand .word { display: none; }
	.site-header .search {
		order: 2; flex: 1 1 auto; flex-basis: auto; min-width: 0;
		max-width: none; margin-left: 0;
	}
	.site-header .search input { padding-top: 6px; padding-bottom: 6px; }
	.site-header .nav-toggle {
		display: inline-flex; order: 3; flex: 0 0 38px;
		height: 36px; margin-left: auto;
	}
	.site-header .nav-menu {
		display: none; position: absolute; top: 100%; right: 0; z-index: 60;
		flex-direction: column; align-items: stretch; gap: 12px; min-width: 200px;
		padding: 14px; background: var(--bg-raise); border: 1px solid var(--line-strong);
		border-radius: var(--r); box-shadow: 0 18px 40px rgba(0,0,0,.55);
	}
	.site-header .top.nav-open .nav-menu { display: flex; }
	.site-header .nav-menu .mainnav { flex-direction: column; gap: 8px; }
	.site-header .nav-menu .locale { flex-direction: row; align-items: center; gap: 8px; }
	.site-header .nav-menu .locale label { display: inline-flex; align-items: center; justify-content: center; }
	.site-header .nav-menu .locale select { flex: 1 1 auto; width: auto; }
	.site-header .nav-menu-sep {
		height: 1px;
		background: var(--line, rgba(255, 255, 255, .08));
		margin: 2px 0;
	}
	.site-header .nav-menu .time-zone {
		display: flex;
		justify-content: space-between;
		align-items: center;
		flex-wrap: wrap;
		background: #1e2533;
		border: 1px solid var(--line, rgba(255, 255, 255, .08));
		border-radius: 9px;
		padding: 10px 12px;
		font-size: 13px;
		white-space: normal;
	}
	.site-header .nav-menu .time-zone #time-zone-label {
		color: var(--ink-dim, #8a93a6);
		font-size: 12px;
	}
	.site-header .nav-menu .time-zone button#time-zone-change {
		color: var(--sky, #29abe2);
		background: transparent;
		border: none;
		padding: 0;
		font-size: 12.5px;
		font-weight: 700;
		cursor: pointer;
		min-height: auto;
	}
	.site-header .nav-menu .time-zone form:not([hidden]) {
		position: static;
		flex-basis: 100%;
		display: flex;
		flex-direction: column;
		gap: 8px;
		padding: 10px 0 2px;
		background: transparent;
		border: none;
		box-shadow: none;
		max-width: none;
	}
	.site-header .nav-menu .time-zone form:not([hidden]) input {
		width: 100%;
		box-sizing: border-box;
		background: var(--bg-raise, #14171f);
		border: 1px solid var(--line-strong, rgba(255, 255, 255, .16));
		border-radius: 6px;
		padding: 6px 8px;
		color: var(--ink, #eef0f5);
		font: inherit;
		font-size: 12px;
	}
	.site-header .nav-menu .time-zone form:not([hidden]) button[type="submit"] {
		background: var(--sky, #29abe2);
		color: #fff;
		border: none;
		border-radius: 6px;
		padding: 6px 12px;
		font-weight: 600;
		cursor: pointer;
	}
	.site-header .nav-menu .time-zone form:not([hidden]) #time-zone-auto {
		background: transparent;
		color: var(--ink-dim, #97a0b2);
		border: 1px solid var(--line, rgba(255, 255, 255, .08));
		border-radius: 6px;
		padding: 6px 12px;
		cursor: pointer;
	}
	.site-header .nav-menu .time-zone .time-zone-options {
		position: static;
		width: 100%;
		box-sizing: border-box;
		max-height: 180px;
		background: var(--bg-raise, #14171f);
		border: 1px solid var(--line-strong, rgba(255, 255, 255, .16));
		border-radius: 6px;
		box-shadow: none;
	}
}

/* Desktop header at 1000px+ (item 1275, Richard 5 Oct 2026: "put language right justified
   and space out Stream and the search box appropriately").
   One row, three groups: logo + Streams on the left, the search box in the middle, the
   Language picker on the right-hand edge. Every gap is the same 24px.

   THE RIGHT EDGE IS THE SHELL'S EDGE. .site-header > .shell is the same 1320px .shell the
   page content uses, so the picker being the last flex item is what lines it up with the
   hero cards below -- no extra offset to keep in step.

   The search box grows into the spare width up to 720px (wider just stretches the
   placeholder across a 1920px screen); past that the leftover is split equally either
   side of it by margin-inline:auto, so it sits centred between Streams and Language
   rather than leaving all the slack in one lump. Auto margins resolve to 0 when there
   is no slack, so narrower screens just get the 24px gaps.

   WHY NO 1000-1399px BURGER ANY MORE. That band used to tuck the pickers behind the menu
   button because Region + Time + Language would not fit beside the search box. Item 1274
   took Region and Time off the page; Language alone fits at 1000px with ~480px left for
   search, so it stays in plain sight on every desktop width and the burger is phone and
   tablet only (below 1000px, unchanged). */
@media (min-width: 1000px) {
	.site-header .top {
		flex-wrap: nowrap;
		gap: 12px;
		padding: 6px 0;
	}
	.site-header .brand,
	.site-header .mainnav {
		flex: 0 0 auto;
	}
	.site-header .brand img {
		height: 38px;
	}
	.site-header .mainnav a {
		padding: 6px 10px;
		font-size: 13.5px;
	}
	.site-header .search {
		flex: 1 1 auto;
		min-width: 120px;
		max-width: none;
		margin: 0;
	}
	.site-header .locale {
		order: 4; display: flex; flex: 0 0 auto; gap: 6px; align-items: center;
	}
	.site-header .locale label {
		display: inline-flex; align-items: center; justify-content: center;
		color: var(--ink-dim); cursor: pointer; flex-shrink: 0;
	}
	.site-header .locale label svg {
		display: block;
	}
	.site-header .locale select#locale-language {
		width: auto; max-width: none; flex-shrink: 0; text-overflow: clip;
		padding: 5px 24px 5px 9px; font-size: 12px;
	}
	.site-header .nav-menu-sep {
		display: none;
	}
	.site-header .time-zone {
		order: 5; display: flex; align-items: center; gap: 6px; flex: 0 0 auto;
		white-space: nowrap; padding: 0; font-size: 11px;
		position: relative;
		background: transparent;
		border: none;
		border-radius: 0;
		margin-top: 0;
	}
	.site-header .time-zone button {
		padding: 2px 7px;
		font-size: 11px;
	}
	.site-header .time-zone form:not([hidden]) {
		position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
		background: var(--bg-raise, #151821);
		border: 1px solid var(--line-strong, rgba(255, 255, 255, .16));
		border-radius: var(--r, 8px); box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
		padding: 12px; width: max-content; max-width: 420px;
	}
	.site-header .nav-toggle {
		display: none;
	}
}

@media (min-width: 1200px) {
	.site-header .top {
		flex-wrap: nowrap;
		gap: 12px;
	}
	.site-header .mainnav a {
		padding: 6px 10px;
		font-size: 13.5px;
	}
}

@media (min-width: 1000px) {
	/* Item 2082: On all devices keep each filter row on one line and scroll it sideways with left and right arrows. */
	.strip .chip-row-frame { gap: 8px; }
	.strip .chip-row { flex-wrap: nowrap; overflow-x: auto; }
	.strip .row-more, .strip .row-back { display: grid; flex: 0 0 32px; width: 32px; height: 32px; font-size: 15px; }
	.strip .row-more[hidden], .strip .row-back[hidden] { display: none; }
}

/* Compact filter chips on phone / narrow widths (width < 1000px) */
@media (max-width: 999px) {
	.strip {
		margin-top: 0;
		padding: 5px 0 5px;
	}
	.strip .shell,
	.strip > .shell {
		padding-top: 0;
		padding-bottom: 0;
		gap: 4px;
	}
	.strip .day-filter-rows {
		gap: 4px;
	}
	.strip .chip-row-frame {
		gap: 4px;
	}
	.strip .chip-row {
		gap: 4px;
		flex-wrap: nowrap;
		overflow-x: auto;
	}
	.strip .rail-label {
		font-size: 9px;
		letter-spacing: .04em;
		flex: 0 0 auto;
		white-space: nowrap;
	}
	.strip .chip {
		font-size: 11px;
		line-height: 14px;
		padding: 3px 7px;
		gap: 4px;
		flex-shrink: 0;
		white-space: nowrap;
	}
	.strip .chip img {
		width: 12px;
		height: 12px;
	}
	.strip .chip .n {
		font-size: 10px;
	}
	.strip .chip.day .n {
		padding: 0 4px;
		font-size: 10px;
		line-height: 1.2;
		min-width: 0;
	}
	.strip .row-more,
	.strip .row-back {
		flex: 0 0 22px;
		width: 22px;
		height: 22px;
		border-radius: 50%;
		border: 1px solid var(--line-strong);
		background: var(--bg-raise);
		color: var(--ink);
		font-size: 13px;
		line-height: 1;
		display: grid;
		place-items: center;
		cursor: pointer;
		opacity: .72;
		transition: opacity .13s, border-color .13s, color .13s;
	}
	.strip .row-more:hover,
	.strip .row-more:focus-visible,
	.strip .row-back:hover,
	.strip .row-back:focus-visible {
		opacity: 1;
		border-color: var(--sky);
		color: var(--sky);
	}
	.strip .row-more[hidden],
	.strip .row-back[hidden] {
		display: none;
	}
}

@media (hover: none) and (max-width: 999px) {
	.strip .shell,
	.strip > .shell {
		gap: 4px;
	}
}

/* Item 1261 (Richard, 5 Oct 2026): on phones the six rows together are 200px tall, not 163px
   -- "slightly too small", "make it 200px". Phone widths only: tablets keep the 999px rules
   above. 6 rows x 28px + 5 gaps x 4px + 11px padding + 1px border = 200px, so the chips,
   labels and arrows all scale by 28/22 to match, and each group stays on one row. */
@media (max-width: 600px) {
	.strip { padding: 6px 0 5px; }
	.strip .chip-row-frame { gap: 5px; }
	.strip .chip-row { gap: 5px; flex-wrap: nowrap; overflow-x: auto; }
	.strip .rail-label { font-size: 11px; }
	.strip .chip { font-size: 14px; line-height: 18px; padding: 4px 9px; gap: 5px; }
	.strip .chip img { width: 15px; height: 15px; }
	.strip .chip .n,
	.strip .chip.day .n { font-size: 12.5px; }
	.strip .row-more,
	.strip .row-back { flex: 0 0 28px; width: 28px; height: 28px; font-size: 16px; }
}

/* Item 1261: the sound note sits directly under the featured player it is about on phones,
   where the stage shows one slot (app.js moves it there). */
.audio-note.at-stage { margin: 8px 0 0; }

/* Item 1285 (Richard, 6 Oct 2026): desktop filter rows reduced height; item 2364 (Richard,
   15 Nov 2026: "try WA as 32px then like MTVG"): on desktop and laptop widths each filter
   button and round scroll arrow is exactly 32px tall (6 x 32 + 5 x 4 = 212px), text centred
   and readable, with the 4px gap between rows unchanged.
   Desktop only (1000px and up): tablets and phones keep the 999px and 600px rules above.
   The gap is restated for (hover: none) too, which v2.css widens to 8px on touch laptops. */
@media (min-width: 1000px) {
	.strip .shell,
	.strip > .shell,
	.strip .day-filter-rows { gap: 4px; }
	.strip .chip { height: 32px; line-height: 16px; }
}

/* Item 1292 (Richard, 6 Oct 2026: "170 both"): on a tablet the six rows are 170px tall
   whichever way it is held. Upright a tablet got the 999px rules (22px rows, 11px text,
   152px); on its side the desktop rule above (30px rows, 200px). Here every row is 25px
   with 4px between rows: 6 x 25 + 5 x 4 = 170px, text 12px. The chip's (border-box) height
   is stated, not left to the line box, for the same 125%-scaling reason as item 1285.

   WHICH SCREENS ARE A TABLET. Width alone cannot tell a tablet on its side from a small
   laptop (1280x800 against 1280x720), so this asks for a touch-only primary pointer:
   (hover: none) and (pointer: coarse). A laptop with a mouse or trackpad reports a fine
   pointer that can hover and keeps the 200px desktop rule, touchscreen or not.
     min-width: 601px   phones upright keep item 1261's rule (600px and narrower);
     min-height: 481px  phones on their side (at most ~430px tall) keep the 999px rule,
                        while the shortest tablet on its side, a 7" at 960x600 less the
                        browser bar, is still taller than this;
     max-width: 1399px  a large touch monitor keeps the desktop rule. */
@media (hover: none) and (pointer: coarse) and (min-width: 601px) and (min-height: 481px) and (max-width: 1399px) {
	.strip { margin-top: 0; padding: 5px 0; }
	.strip .shell,
	.strip > .shell {
		padding-top: 0;
		padding-bottom: 0;
		gap: 4px;
	}
	.strip .day-filter-rows { gap: 4px; }
	.strip .chip-row-frame { gap: 4px; }
	.strip .chip-row { gap: 5px; flex-wrap: nowrap; overflow-x: auto; }
	.strip .rail-label {
		font-size: 10px;
		letter-spacing: .04em;
		flex: 0 0 auto;
		white-space: nowrap;
	}
	.strip .chip {
		height: 25px;
		font-size: 12px;
		line-height: 15px;
		padding: 4px 8px;
		gap: 5px;
		flex-shrink: 0;
		white-space: nowrap;
	}
	.strip .chip img { width: 13px; height: 13px; }
	.strip .chip .n { font-size: 11px; }
	.strip .chip.day .n { padding: 0 4px; font-size: 11px; line-height: 1.2; min-width: 0; }
	.strip .row-more,
	.strip .row-back { display: grid; flex: 0 0 25px; width: 25px; height: 25px; font-size: 14px; }
	.strip .row-more[hidden],
	.strip .row-back[hidden] { display: none; }
}

/* Item 2082: On all devices keep each filter row on one line and scroll it sideways.
   The plus-N-more button and fold menu are removed. */

/* Item 2392 (Richard: thumbnails above the fold on desktop). On a short laptop window
   (1280x720, 1366x768) the stage, six filter rows and day heading pushed the first row of
   stream thumbnails below the bottom of the screen. The filter rows keep their 32px height
   (item 2364), so the stage gives way: below about 900px of window height its width is
   capped from the window height, which keeps both slots 16:9 and centres them. 520px reserves room for
   everything that is not the stage between the top of the page and the middle of the
   first thumbnail (header, heading, filters, day heading and half a thumbnail). Taller
   windows keep the full-width stage, and the cap never goes below 200px of stage height. Short windows also use tighter heading margins
   to leave more room for the first card row. */
@media (min-width: 1000px) {
	.stage {
		max-width: calc(max(100vh - 520px, 200px) * 32 / 9 + 14px);
		margin-inline: auto;
	}
	.stage[data-count="1"] { max-width: calc(max(100vh - 520px, 200px) * 16 / 9); }
	/* The commentator menu is at most 64% of a slot that is now shorter, so its list
	   scrolls inside the menu instead of running past the menu's clipped bottom. */
	.stage .stage-picker:not([hidden]) { display: flex; flex-direction: column; }
	.stage .stage-views { flex: 1 1 auto; min-height: 0; }
}

@media (min-width: 1000px) and (max-height: 800px) {
	.pitch { margin-block: 10px; }
}

/* Item 1786 (Richard, 23 Oct 2026): "Halloween 7" and one or two other buttons were cut off
   at the bottom. A row that scrolls sideways (overflow-x: auto) or folds (overflow: hidden)
   also clips UP AND DOWN at its own edge, and each row is exactly one chip tall. So any chip
   content taller than the chip's line box -- the seasonal icon, an emoji or a script whose
   font has deep ascenders, which some browsers measure from the fallback font -- had nowhere
   to go and was cut. Three parts, for every chip in every language:
   1. Every chip is one stated height at every width (desktop 32px and tablet 25px already
      were; the 999px and phone rules now say 22px and 28px), never wraps, and centres its
      contents; an icon is a fixed box that cannot stretch the row.
   2. Each row gets 3px of room above and below inside its clipping edge, taken back with a
      negative margin, so the block heights from items 1261/1285/1292 do not change.
   3. A folded row clips only sideways; nothing it holds can spill vertically past item 2. */
.strip .chip { white-space: nowrap; justify-content: center; }
.strip .chip > img { flex: none; display: block; }
.strip .chip-row { padding-block: 3px; margin-block: -3px; }
@media (max-width: 999px) {
	.strip .chip { height: 22px; }
}
@media (max-width: 600px) {
	.strip .chip { height: 28px; }
}
@media (min-width: 1000px) {
	.strip .chip { height: 32px; }
}
@media (hover: none) and (pointer: coarse) and (min-width: 601px) and (min-height: 481px) and (max-width: 1399px) {
	.strip .chip { height: 25px; }
}

/* Empty choices keep readable text, but lose the active chips' gold counts and
   bright frames. Selected empty filters remain clearable in their selected colour. */
.strip .chip.zero:not(.on),
.strip .chip.zero:not(.on):hover {
	color: var(--ink-faint);
	border-color: var(--line);
	border-style: dashed;
	background: var(--bg);
}
.strip .chip.zero:not(.on) .n { color: inherit; }
.strip .chip.zero:not(.on) img { filter: grayscale(1); }

/* Item 2292: keep phone targets usable in portrait and landscape. These follow
   the compact chip rules so neither the 600px nor touch-tablet override shrinks them. */
@media (max-width: 999px) {
	.strip .chip { height: auto; min-height: 40px; }
	.strip .row-more,
	.strip .row-back { flex-basis: 40px; width: 40px; height: 40px; }
	.time-zone button { min-height: 40px; }

	/* Let wrapped titles, facts and actions set the minimum card height instead
	   of spilling above an absolutely positioned overlay and being clipped. */
	.stage-slot { display: grid; min-width: 0; aspect-ratio: auto; }
	.stage-slot::before { content: ""; grid-area: 1 / 1; padding-top: 56.25%; pointer-events: none; }
	.stage-overlay { position: relative; grid-area: 1 / 1; align-self: end; padding-top: 44px; }
	.stage-facts { min-width: 0; overflow-wrap: anywhere; }
	.stage-cta { max-width: 100%; }
	.stage-pick-btn, .stage-cta a { white-space: normal; }
}

/* Item 2393: every tappable item in the phone and tablet header and filter rows is at least
   44px to tap, on every page that uses the shared header. The logo picture stays 30px; its
   link grows around it. The header row is 44px (the search box) with 3px above and below,
   only 4px taller than before. The search box starts from no width and takes what is left,
   so at 320px the burger stays on the logo's row instead of wrapping to a row of its own
   (it did that before this item too). Filter buttons stay 40px tall and are at least 44px
   wide, so a short name in any language still has room; the round scroll arrows become 44px
   wide pills. No filter row grows. */
@media (max-width: 999px) {
	.site-header .top { padding: 3px 0; }
	.site-header .brand { min-width: 44px; min-height: 44px; justify-content: center; }
	.site-header .search { flex: 1 1 0; }
	.site-header .search input { height: 44px; }
	.site-header .nav-toggle { flex: 0 0 44px; width: 44px; height: 44px; }
	.site-header .nav-menu .locale label { min-width: 44px; min-height: 44px; }
	.strip .chip { min-width: 44px; }
	.strip .row-more,
	.strip .row-back { flex-basis: 44px; width: 44px; border-radius: 999px; }
}

/* Item 2534 (Richard, 24 Nov 2026): "keep a slightly larger tap area, but not so it overlaps
   other filters - but smaller visible buttons". Items 2292 and 2393 made every phone and
   tablet filter button at least 40px tall and 44px wide, so the six rows grew from 200px to
   about 260px. Below 1000px the visible buttons and round arrows are back to their sizes
   before those items: 28px on phones upright, 22px on other widths under 1000px, 25px on
   touch tablets. Each one taps 2px further above and below and 1.5px further either side
   than it looks (an empty ::after inside the button, so a tap there is the button's own).
   The rows are 6px apart instead of 4px, so the tap areas of two rows stay 2px apart; the
   buttons in a row are 4-5px apart, so side by side they stay at least 1px apart. Each row
   already keeps 3px inside its scrolling edge above and below, so nothing is cut off.
   Check: tests/browser/filter-tap-areas-2534.js. */
@media (max-width: 999px) {
	.strip { --tap-y: 2px; --tap-x: 1.5px; }
	.strip .shell,
	.strip > .shell,
	.strip .day-filter-rows { gap: 6px; }
	.strip .chip { height: 22px; min-height: 0; min-width: 0; }
	.strip .row-more,
	.strip .row-back { flex-basis: 22px; width: 22px; height: 22px; border-radius: 50%; }
	.strip .chip,
	.strip .row-more,
	.strip .row-back { position: relative; }
	.strip .chip::after,
	.strip .row-more::after,
	.strip .row-back::after {
		content: ""; position: absolute;
		inset: calc(-1px - var(--tap-y)) calc(-1px - var(--tap-x));
	}
}
@media (max-width: 600px) {
	.strip .chip { height: 28px; }
	.strip .row-more,
	.strip .row-back { flex-basis: 28px; width: 28px; height: 28px; }
}
@media (hover: none) and (pointer: coarse) and (min-width: 601px) and (min-height: 481px) and (max-width: 999px) {
	.strip .chip { height: 25px; }
	.strip .row-more,
	.strip .row-back { flex-basis: 25px; width: 25px; height: 25px; }
}
