/* StreamKEK's website: the home page, the privacy policy and the support page. Plain CSS, no build.

   Its colors are the extension's. palettes.css beside this file is a copy of
   src/features/themes/palettes.css, unchanged, and whichever theme <html> names gives the page its
   colors, as it does on the extension's own pages. theme.js changes it from the picker on the
   home page, which also loads effects.css, the extension's motion for the seasons and specials.

   The home page's drawings are the extension's own interface rebuilt in HTML. Their rules are
   copied from the extension's stylesheets, each named above its part, and keep its class names, so
   a change there can be carried over. Only what a caption says works can be pressed. */

@font-face {
  font-family: Inter;
  src: url('assets/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

/* The page's colors, worked out from the theme's the way src/extension-pages/page.css does it.
   accent is the button's color made lighter, so it can be text on a dark page. */
:root {
  color-scheme: dark;
  --bg: var(--skek-t-bg);
  --base: var(--skek-t-base);
  --raised: var(--skek-t-raised);
  --text: var(--skek-t-text);
  --link: var(--skek-t-link);
  --muted: color-mix(in oklab, var(--skek-t-bg) 22%, var(--skek-t-text));
  --line: rgb(from var(--skek-t-text) r g b / 0.15);
  --rule: rgb(from var(--skek-t-text) r g b / 0.34);
  --card: rgb(from var(--skek-t-text) r g b / 0.08);
  --hover: rgb(from var(--skek-t-text) r g b / 0.15);
  --selected: rgb(from var(--skek-t-accent) r g b / 0.22);
  --accent: oklch(from var(--skek-t-accent) max(l, calc(min(l, 0.6) + 0.15)) calc(c * 0.85) h);
  --focus: oklch(from var(--skek-t-accent) max(l, calc(min(l, 0.6) + 0.07)) c h);
  --input-border: rgb(from var(--skek-t-text) r g b / 0.8);
  --button: var(--skek-t-accent);
  --button-hover: oklch(from var(--skek-t-accent) calc(l - 0.05) c h);
  --on-button: var(--skek-t-on-accent);

  /* The column of section names down the left of a wide page, and the space beside it. */
  --rail: 200px;
  --gap: 48px;
}
/* On a light page they're made darker instead. */
:root[data-skek-theme-base='light'] {
  color-scheme: light;
  --accent: oklch(from var(--skek-t-accent) calc(min(l, 0.6) - 0.15) calc(c * 0.9) h);
  --focus: oklch(from var(--skek-t-accent) min(l, 0.6) c h);
  --input-border: rgb(from var(--skek-t-text) r g b / 0.55);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* The theme's backdrop shows where the page is empty, as it does behind Twitch's pages: see
   src/features/themes/twitch-colors.css. It's under the layers that move, from effects.css. */
html::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--skek-t-backdrop, none);
  pointer-events: none;
}

body {
  margin: 0;
  color: var(--text);
  font: 16px/1.55 Inter, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  overflow-wrap: break-word;
}

[hidden] { display: none !important; }

h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-weight: 600; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--card);
  font: 0.9em/1 ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace;
}
kbd {
  display: inline-block;
  min-width: 22px;
  padding: 0 6px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--rule);
  font: 600 12px/20px Inter, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  text-align: center;
  white-space: nowrap;
}

.wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }
.small { color: var(--muted); font-size: 13px; line-height: 1.45; }

/* The icons the drawings use, which each one takes from here by name. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* --- top bar ---------------------------------------------------------------- */

/* With the line in the theme's two colors under it, which the extension draws under Twitch's top
   bar: see src/features/themes/twitch-colors.css. */
.top {
  position: relative;
  /* Bats and gulls cross it from beyond its right end. */
  overflow-x: clip;
  background: linear-gradient(90deg, var(--skek-t-accent), var(--skek-t-accent-2)) 0 100% / 100% 2px no-repeat;
}
/* What effects.css puts in Twitch's top bar is pinned to the window there, since that bar never
   moves and is 5rem of Twitch's tall. This one scrolls away, so here the string of lights hangs
   on its line, and the bats and gulls cross it and leave with it. */
html[data-skek-on~='themeAnimations'][data-skek-theme='christmas'] .top-nav__menu::before,
html[data-skek-on~='themeAnimations'][data-skek-theme='christmas'] .top-nav__menu::after {
  position: absolute;
  top: auto;
  bottom: -7px;
}
html[data-skek-on~='themeAnimations']:is([data-skek-theme='halloween'], [data-skek-theme='summer']) .top-nav__menu::before {
  position: absolute;
  height: 100%;
}
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 60px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
}
.brand img { display: block; width: 28px; height: 28px; border-radius: 7px; }
/* The links look like the settings window's list of categories, laid on its side. */
.top nav { display: flex; gap: 2px; margin-right: -10px; }
.top nav a {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.top nav a:hover { background: var(--card); }
.top nav a[aria-current='page'] { background: var(--selected); color: var(--accent); }

/* --- buttons ---------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  background: var(--button);
  color: var(--on-button);
  font-weight: 600;
  text-decoration: none;
}
.button:hover { background: var(--button-hover); }
.button--quiet { background: var(--card); color: var(--text); }
.button--quiet:hover { background: var(--hover); }

/* --- the top of the home page ----------------------------------------------- */

.hero { padding-block: 52px 36px; }
.hero h1 {
  font-size: clamp(30px, 20px + 2.4vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.hero__row {
  display: grid;
  /* The button's column is as wide as chat's in the drawing under it, so the two line up. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  align-items: start;
  gap: 24px 64px;
  margin-top: 20px;
}
.hero__lead { max-width: 60ch; font-size: 18px; line-height: 1.5; text-wrap: pretty; }
.hero__get { display: grid; gap: 10px; justify-items: start; }
.hero__get .small { max-width: 300px; }
.hero__get .small + .small { margin-top: -4px; }

/* --- sections --------------------------------------------------------------- */

/* A line across the page, the section's name under it on the left and what it's about beside it.
   The name stays at the top while its section scrolls by, as a category's does in the settings
   window. */
.section {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  column-gap: var(--gap);
  align-items: start;
  padding-block: 20px 64px;
  border-top: 1px solid var(--rule);
}
.section > h2 { position: sticky; top: 20px; font-size: 18px; line-height: 1.3; }
/* A drawing as wide as the page would pass under the name. */
.section:has(.figure--wide) > h2 { position: static; }
.section__body > * + * { margin-top: 16px; }
.section__body > p { max-width: 64ch; }

/* What it does, one line for each: its name, then the sentence about it. */
.spec__row {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  column-gap: 32px;
  padding-block: 13px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.5;
}
.spec__row:first-child { padding-top: 2px; border-top: 0; }
.spec__row:last-child { padding-bottom: 0; }
.spec dt { font-weight: 600; }
.keys { margin-left: 4px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.keys kbd { margin-inline: 2px; color: var(--text); }
.spec dd { max-width: 60ch; }
.spec .off { color: var(--muted); }

/* A row of the settings window that's a link, from src/settings-window/settings-window.css. */
.linkrows { display: grid; gap: 8px; max-width: 620px; }
.linkrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--card);
  color: inherit;
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
}
.linkrow:hover { background: var(--hover); }
.linkrow:focus-visible { outline-offset: -2px; border-radius: 8px; }
.linkrow__text { min-width: 0; display: flex; flex-direction: column; }
.linkrow__label { font-weight: 600; }
.linkrow__hint { color: var(--muted); }
.linkrow svg { flex: 0 0 auto; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }

/* --- drawings --------------------------------------------------------------- */

.figure--wide { margin-left: calc(-1 * (var(--rail) + var(--gap))); }
figcaption { max-width: 78ch; margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.45; }

/* One drawing. --color-* are Twitch's own names for its colors, which the extension's rules for
   Twitch's pages use, set here to what src/features/themes/twitch-colors.css makes them in a
   theme. */
.shot {
  --color-background-body: var(--bg);
  --color-background-base: var(--base);
  --color-background-interactable-hover: light-dark(
    rgb(from color-mix(in oklab, var(--base) 62%, var(--text)) r g b / 0.35),
    rgb(from color-mix(in oklab, var(--base) 68%, var(--text)) r g b / 0.48)
  );
  --color-border-base: var(--color-background-interactable-hover);
  --color-text-base: var(--text);
  --color-text-alt-2: color-mix(in oklab, var(--base) 18%, var(--text));
  --color-text-link: var(--link);
  --color-text-live: light-dark(#971311, #ff8280);
  --color-fill-live: #eb0400;
  --color-text-button-primary: var(--on-button);

  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--base);
  font-size: 14px;
  line-height: 1.4;
  cursor: default;
  user-select: none;
}

/* Where something of a site's own goes: its video, which is black until it plays, or its chat or
   list. */
.theirs {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 8px;
  overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--line) 0 1px, transparent 1px 9px);
  color: var(--color-text-alt-2);
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
}
.theirs--video {
  background: repeating-linear-gradient(135deg, rgb(255 255 255 / 0.07) 0 1px, transparent 1px 9px) #000;
  color: rgb(255 255 255 / 0.7);
}

/* A made-up channel's picture: its first letter on a color. */
.av {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}
.av--1 { background: #476fa8; }
.av--2 { background: #b65a3c; }
.av--3 { background: #4d8a5c; }
.av--4 { background: #85579b; }
.av--5 { background: #2f858c; }
.av--6 { background: #a84d74; }

/* A dot in a site's color, where the extension shows the site's logo. */
.site { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; }
.site--twitch { background: #9147ff; }
.site--youtube { background: #f00; }
.site--kick { background: #53fc18; }

/* From src/twitch/base.css. */
.skek-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9000px;
  color: var(--color-text-base);
}
.skek-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  border-radius: 9000px;
  color: var(--color-text-button-primary);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* Twitch's sidebar, with the sections the extension adds to it. From sidebar.css and favorites.css
   in src/features/streams/twitch/. */
.tw-side { flex: 0 0 240px; min-width: 0; padding-bottom: 10px; background: var(--raised); }
.tw-side .theirs { height: 58px; margin: 2px 8px 0; border-radius: 6px; }

.skek-section { margin-bottom: 8px; }
.skek-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  padding: 0 8px;
  margin: 8px 0;
}
.skek-section__title { font-size: 14px; font-weight: 600; line-height: 1.4; }
.skek-section__add { width: 24px; height: 24px; }

.skek-card {
  position: relative;
  display: flex;
  align-items: center;
  height: 45px;
  padding: 5px 8px;
}
.skek-card--active,
.skek-card--hover { background: var(--color-background-interactable-hover); }
.skek-card__avatar { position: relative; flex: 0 0 30px; width: 30px; height: 30px; margin-right: 8px; }
.skek-card__img { width: 30px; height: 30px; }
.skek-card__platform {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--raised);
}
.skek-card__platform--twitch { background: #9147ff; }
.skek-card__platform--youtube { background: #f00; }
.skek-card__platform--kick { background: #53fc18; }
.skek-card__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.skek-card__name-row { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.skek-card__name,
.skek-card__meta { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.skek-card__name { font-size: 14px; font-weight: 600; line-height: 1.1; }
.skek-card__meta { font-size: 14px; line-height: 1.4; color: var(--color-text-alt-2); }
.skek-card__live {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  align-self: flex-start;
  margin-left: 4px;
  font-size: 14px;
  line-height: 1.1;
}
.skek-dot { width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--color-fill-live); }
/* The star and the hide button take the viewer count's place on the card under the mouse. */
.skek-star,
.skek-card__hide {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
}
.skek-card__hide ~ .skek-star,
.skek-star:has(~ .skek-card__hide) { right: 34px; }
.skek-card--hover .skek-card__live { visibility: hidden; }

/* The stream view: a YouTube or Kick stream inside Twitch. From stream-view.css in the same
   folder. */
.skek-view { flex: 1 1 auto; min-width: 0; display: flex; background: var(--color-background-body); }
.skek-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.skek-player { flex: 1 1 auto; min-height: 200px; }

.skek-info { flex: 0 0 auto; display: flex; gap: 8px; padding: 16px; }
.skek-info__avatar { position: relative; flex: 0 0 64px; width: 64px; height: 64px; }
.skek-info__img {
  display: flex;
  width: 64px;
  height: 64px;
  padding: 2px;
  border: 2px solid var(--color-fill-live);
  border-radius: 50%;
}
.skek-info__img .av { flex: 1 1 auto; font-size: 22px; }
.skek-info__badge {
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--color-fill-live);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.skek-info__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.skek-info__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.skek-info__name { overflow: hidden; font-size: 18px; font-weight: 500; line-height: 32px; white-space: nowrap; text-overflow: ellipsis; }
.skek-info__actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.skek-button--youtube { background: #ff0000; }
.skek-button--icon {
  justify-content: center;
  width: 32px;
  padding: 0;
  background: var(--color-background-interactable-hover);
  color: var(--color-text-base);
}
.skek-info__text { min-width: 0; }
.skek-info__title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; font-weight: 600; line-height: 1.4; }
.skek-info__category { font-size: 14px; line-height: 1.4; color: var(--color-text-link); }
.skek-info__stats { flex: 0 0 auto; display: flex; gap: 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.skek-stat { display: inline-flex; align-items: center; gap: 4px; }
.skek-stat--viewers { color: var(--color-text-live); font-weight: 600; }

.skek-chat {
  flex: 0 0 340px;
  width: 340px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--color-border-base);
  background: var(--color-background-base);
}
.skek-chat__head {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  border-bottom: 1px solid var(--color-border-base);
}
.skek-chat__title { font-size: 14px; font-weight: 600; line-height: 1.4; }
.skek-chat__spacer { width: 32px; }
.skek-chat__body { flex: 1 1 auto; }

/* The first drawing: the sidebar with a stream open beside it. Chat goes when there's no room for
   it, as it does in the extension, and on a phone the stream goes under the sidebar. */
.figure--stream { container-type: inline-size; margin-bottom: 56px; }
/* Nothing of the drawing's own is behind the sidebar, so when effects.css makes it see-through the
   page's snow shows behind it, as Twitch's does. */
.figure--stream .shot { display: flex; background: none; }
@container (max-width: 1099px) {
  .figure--stream .skek-info__row { flex-wrap: wrap; gap: 4px 16px; }
}
@container (max-width: 899px) {
  .figure--stream .skek-chat { display: none; }
}
@container (max-width: 639px) {
  .figure--stream .shot { flex-direction: column; }
  .figure--stream .tw-side { flex-basis: auto; }
  .figure--stream .skek-player { flex: 0 0 auto; min-height: 0; aspect-ratio: 16 / 9; }
  .figure--stream .skek-button--icon { display: none; }
}

/* Multi-stream. From multi-view.css in the same folder. There the streams are placed by
   multi-layout.js; here the same sums are in the rules under these. */
.skek-multi { display: flex; flex-direction: column; background: var(--color-background-body); }
.skek-multi__bar,
.skek-multi__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-background-base);
}
.skek-multi__bar { height: 36px; padding: 0 8px 0 12px; border-bottom: 1px solid var(--color-border-base); }
.skek-multi__title { font-size: 14px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.skek-multi__hint { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; color: var(--color-text-alt-2); }
.skek-multi__spacer { flex: 1 1 auto; min-width: 0; }
.skek-multi__button { flex: 0 0 auto; width: 24px; height: 24px; }
.skek-multi__button--on { color: var(--color-text-link); }
.skek-multi__button svg { width: 18px; height: 18px; }

/* The stream with the sound shows moving bars instead of a speaker. */
.skek-sound-bar {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: skek-sound-bar 0.8s ease-in-out infinite alternate;
}
.skek-sound-bar:nth-child(2) { animation-duration: 0.55s; animation-delay: -0.3s; }
.skek-sound-bar:nth-child(3) { animation-duration: 0.9s; animation-delay: -0.6s; }
.skek-sound-bar:nth-child(4) { animation-duration: 0.65s; animation-delay: -0.15s; }
@keyframes skek-sound-bar {
  from { transform: scaleY(0.3); }
  to { transform: scaleY(1); }
}

.skek-multi__stage { display: flex; background: #000; }
.skek-multi__cell { min-width: 0; min-height: 0; display: flex; flex-direction: column; outline: 1px solid var(--color-background-base); }
.skek-multi__head { height: 28px; padding: 0 2px 0 6px; }
.skek-multi__name { overflow: hidden; font-size: 13px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.skek-multi__viewers { flex: 0 0 auto; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--color-text-live); }
.skek-multi__player { flex: 1 1 auto; }
.skek-multi__chat { min-width: 0; background-color: var(--color-background-base); outline: 1px solid var(--color-border-base); }
.skek-multi__picker { flex: 0 0 40px; display: flex; align-items: stretch; gap: 2px; padding: 4px; background: var(--color-background-base); }
.skek-multi__tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 13px;
}
.skek-multi__tab--active { background: var(--color-background-interactable-hover); font-weight: 600; }
.skek-multi__tab-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* How many streams the drawing shows: the settings window's control for picking one of a few
   values, from src/settings-window/settings-window.css. */
.multi__ask { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.choices { flex: 0 0 auto; display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--card); }
.choice { position: relative; }
.choice input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.choice span { display: block; padding: 4px 14px; border-radius: 6px; font-weight: 600; }
.choice input:hover + span { background: var(--hover); }
.choice input:checked + span { background: var(--button); color: var(--on-button); }
.choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }

/* Where the streams go, as multi-layout.js works it out: each is a 16:9 video under a 28px bar.
   --streams is how wide their part of the view is, and its height follows from that, so the
   streams fill it exactly. Three get one twice the size of the others, which with the bars makes
   it (2w + 49.78px) / 3 wide. Two each keep their own chat under them. More share one, beside
   the streams, with a tab for each. */
.figure--multi { container-type: inline-size; }
.multi__streams {
  --streams: calc(100cqw - 342px);
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template: 1fr 1fr / calc((200% + 49.78px) / 3) calc((100% - 49.78px) / 3);
  height: calc(var(--streams) * 0.375 + 37.33px);
  overflow: hidden;
  transition: height 0.2s ease;
}
.multi__side { flex: 0 0 340px; min-width: 0; display: flex; flex-direction: column; }
.multi__side .skek-multi__chat { flex: 1 1 auto; }
.multi__streams > :nth-child(1) { grid-row: 1 / 3; }
.multi__streams > :nth-child(4),
.multi__streams > .skek-multi__chat,
.multi__streams > :nth-child(1) .multi__enlarge { display: none; }

.figure--multi:has([value='4']:checked) .multi__streams {
  grid-template: 1fr 1fr / 1fr 1fr;
  height: calc(var(--streams) * 0.5625 + 56px);
}
.figure--multi:has([value='4']:checked) .multi__streams > :nth-child(1) { grid-row: auto; }
.figure--multi:has([value='4']:checked) .multi__streams > :nth-child(4) { display: flex; }
.figure--multi:has([value='4']:checked) .multi__enlarge,
.figure--multi:has([value='4']:checked) .multi__hint-add,
.figure--multi:has([value='3']:checked) .skek-multi__tab:nth-child(4) { display: none; }

.figure--multi:has([value='2']:checked) .multi__streams {
  --streams: calc(100cqw - 2px);
  grid-template: 1fr 150px / 1fr 1fr;
  height: calc(var(--streams) * 0.28125 + 178px);
}
.figure--multi:has([value='2']:checked) .multi__streams > :nth-child(1) { grid-row: auto; }
.figure--multi:has([value='2']:checked) .multi__streams > .skek-multi__chat { display: flex; }
.figure--multi:has([value='2']:checked) .multi__streams > :nth-child(3),
.figure--multi:has([value='2']:checked) .multi__side,
.figure--multi:has([value='2']:checked) .multi__enlarge,
.figure--multi:has([value='2']:checked) .multi__chat-button { display: none; }

/* The two small streams' bars have no room for their viewers. */
@container (max-width: 1099px) {
  .figure--multi:has([value='3']:checked) .multi__streams > :nth-child(n + 2) .skek-multi__viewers { display: none; }
}
/* Under 900px the shared chat goes under the streams. */
@container (max-width: 899px) {
  .figure--multi .skek-multi__stage { flex-direction: column; }
  .figure--multi .multi__streams { --streams: calc(100cqw - 2px); flex: 0 0 auto; }
  .figure--multi .multi__side { flex: 0 0 150px; }
  .figure--multi .skek-multi__hint { display: none; }
}
/* And on a phone three have the big one on top, and two go one above the other and share a chat. */
@container (max-width: 559px) {
  .figure--multi .multi__streams {
    grid-template: calc(var(--streams) * 0.5625 + 28px) 1fr / 1fr 1fr;
    height: calc(var(--streams) * 0.84375 + 56px);
  }
  .figure--multi .multi__streams > :nth-child(1) { grid-area: 1 / 1 / 2 / 3; }
  .figure--multi:has([value='4']:checked) .multi__streams > :nth-child(1) { grid-area: auto; }
  .figure--multi:has([value='4']:checked) .multi__streams {
    grid-template: 1fr 1fr / 1fr 1fr;
    height: calc(var(--streams) * 0.5625 + 56px);
  }
  .figure--multi:has([value='2']:checked) .multi__streams {
    grid-template: 1fr 1fr / 1fr;
    height: calc(var(--streams) * 1.125 + 56px);
  }
  .figure--multi:has([value='2']:checked) .multi__streams > :nth-child(1) { grid-area: auto; }
  .figure--multi:has([value='2']:checked) .multi__streams > .skek-multi__chat { display: none; }
  .figure--multi:has([value='2']:checked) .multi__side { display: flex; }
  .figure--multi:has([value='2']:checked) .multi__chat-button { display: inline-flex; }
  .figure--multi:has([value='2']:checked) .skek-multi__tab:nth-child(n + 3) { display: none; }
  .figure--multi .skek-multi__viewers { display: none; }
}

/* Twitch's chat with what the extension changes in it. The highlighted and deleted messages are
   from chat-words.css and deleted-messages.css in src/features/chat/, the answer to /followed from
   followed.css, the emote's name in the chat box from latest-emote.css and the button beside it
   from emote-picker.css. */
.twchat { display: flex; flex-direction: column; }
.twchat .skek-chat__head { justify-content: center; }
.twchat__lines { padding: 6px 0; font-size: 13px; line-height: 20px; }
.twchat__line { padding: 5px 20px; }
.twchat__line b { font-weight: 700; }
.twchat__line--highlight { background: rgba(255, 179, 26, 0.18); box-shadow: inset 3px 0 0 #ffb31a; }
.twchat__line mark { background: #ffb31a; color: #000; }
.twchat__line--deleted span { opacity: 0.55; text-decoration: line-through; }
.twchat__name--1 { color: light-dark(#0d61c2, #6aaeff); }
.twchat__name--2 { color: light-dark(#b0431f, #ff8c61); }
.twchat__name--3 { color: light-dark(#28783c, #74d28c); }
.twchat__name--4 { color: light-dark(#8a3fa8, #d48cf0); }
.twchat__input { padding: 0 10px 10px; }
.skek-followed {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--color-border-base);
  border-radius: 6px;
  background: var(--raised);
  font-size: 13px;
  line-height: 1.5;
}
.skek-followed__text { flex: 1; align-self: center; }
.skek-followed__close { flex: none; width: 24px; height: 24px; font-size: 12px; line-height: 24px; text-align: center; }
.twchat__box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 4px 0 12px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--color-border-base);
}
.skek-latest-emote { color: rgb(from var(--text) r g b / 0.7); font-size: 14px; }
.skek-picker-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; }

/* Floating chat, from src/features/player/floating-window.css: the window's bar, and chat under it
   on a background that fades. --skek-float-opacity is what the slider on the bar sets, in theme.js
   here. The text keeps a halo in the page's color, from src/features/player/modes.css. */
.float-shot { --skek-float-opacity: 0.7; position: relative; height: 322px; }
.float-shot__video { position: absolute; inset: 0; padding-left: 428px; }
.skek-float { position: absolute; top: 24px; left: 24px; width: 380px; max-width: calc(100% - 48px); }
.skek-float__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px 6px 0 0;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.skek-float__title { flex: 1 1 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.skek-float__opacity {
  flex: 0 0 90px;
  width: 90px;
  margin: 0;
  accent-color: oklch(from var(--skek-t-accent) min(l, 0.6) c h);
  cursor: pointer;
}
.skek-float__opacity:disabled { cursor: default; }
.skek-float__chat {
  padding: 6px 0;
  background: rgb(from var(--base) r g b / var(--skek-float-opacity));
  font-size: 13px;
  line-height: 20px;
  text-shadow: 0 0 3px light-dark(#fff, #000), 0 1px 2px light-dark(#fff, #000);
}
@media (max-width: 799px) {
  .float-shot { height: 356px; }
  .float-shot__video { align-items: flex-end; padding: 0 8px 12px; }
}

/* The Chat section: what it does on the left, and chat on the right, where Twitch has it. */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; column-gap: 40px; align-items: start; }
.split .figure { position: sticky; top: 20px; }
.split .spec__row { grid-template-columns: 176px minmax(0, 1fr); column-gap: 24px; }

/* The settings window, from src/settings-window/settings-window.css, and its switch from
   src/extension-pages/page.css. */
.sw { display: flex; }
.sw-nav {
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  padding: 16px 12px 12px;
  /* With the theme's backdrop, as Twitch's page has it. */
  background: var(--skek-t-backdrop, none), var(--skek-t-bg);
}
.sw-brand { display: flex; align-items: center; gap: 8px; padding: 0 4px 14px; font-weight: 600; }
.sw-brand img { width: 24px; height: 24px; border-radius: 6px; }
.sw-search { display: flex; align-items: center; height: 32px; padding: 0 10px; border-radius: 6px; background: var(--card); color: var(--muted); }
.sw-categories { flex: 1 1 auto; margin-top: 12px; }
.sw-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  margin-bottom: 2px;
  padding: 0 10px;
  border-radius: 6px;
  font-weight: 600;
}
.sw-link--current { background: var(--selected); color: var(--accent); }
.sw-link svg { flex: 0 0 auto; }
.sw-divider { margin: 8px 0 10px; border-top: 1px solid var(--hover); }
.sw-feedback { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--hover); color: var(--muted); }
.sw-feedback .sw-link:last-child { margin-bottom: 0; }

.sw-content { flex: 1 1 auto; min-width: 0; padding: 0 20px 20px; }
.sw-title {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--hover);
  font-size: 18px;
  font-weight: 600;
}
.sw-title svg { flex: 0 0 auto; color: var(--accent); }
.sw-card { margin-bottom: 8px; padding: 12px 14px; border-radius: 8px; background: var(--card); user-select: text; }
.sw-card:last-child { margin-bottom: 0; }
.sw-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.sw-setting:hover { background: var(--hover); }
.sw-card__text { min-width: 0; display: flex; flex-direction: column; }
.sw-card__label { font-weight: 600; }
.sw-card__hint { color: var(--muted); }

.skek-switch {
  appearance: none;
  position: relative;
  flex: 0 0 36px;
  width: 36px;
  height: 20px;
  margin: 0;
  border-radius: 9000px;
  background: var(--hover);
  box-shadow: inset 0 0 0 2px var(--input-border);
  cursor: pointer;
  transition: background 0.1s ease;
}
.skek-switch::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.1s ease;
}
.skek-switch:checked { background: var(--button); box-shadow: none; }
.skek-switch:checked::before { background: var(--on-button); transform: translateX(16px); }
.skek-switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 9000px; }

/* Pick a theme: radio buttons drawn as small pictures of each one. Each picture has
   data-skek-theme, so palettes.css gives it that theme's colors. */
.swatches__group { margin: 14px 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.swatches__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.swatch { position: relative; display: flex; flex-direction: column; gap: 5px; }
.swatch input { position: absolute; inset: 0; z-index: 1; margin: 0; opacity: 0; cursor: pointer; }
.swatch__preview { display: flex; height: 60px; border-radius: 8px; overflow: hidden; outline: 1px solid var(--hover); outline-offset: -1px; transition: transform 0.1s ease; }
.swatch input:hover + .swatch__preview { transform: translateY(-2px); }
.swatch input:checked + .swatch__preview { outline: 2px solid var(--focus); outline-offset: 2px; }
.swatch input:focus-visible + .swatch__preview { outline: 2px solid var(--text); outline-offset: 2px; }
.swatch__scene { position: relative; flex: 1 1 0; display: flex; background: var(--skek-t-backdrop, none), var(--skek-t-bg); }
/* The line under Twitch's top bar. */
.swatch__scene::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--skek-t-accent), var(--skek-t-accent-2)); }
.swatch__panel { flex: 0 0 26%; background: var(--skek-t-base); }
.swatch__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: 10px 8px 8px; }
.swatch__text { width: 75%; height: 5px; border-radius: 3px; background: var(--skek-t-text); }
.swatch__text--link { width: 45%; background: var(--skek-t-link); }
.swatch__button { align-self: flex-end; width: 26px; max-width: 100%; height: 10px; margin-top: auto; border-radius: 9000px; background: var(--skek-t-accent); }
.swatch__name { font-size: 13px; font-weight: 600; text-align: center; }
.swatch input:checked ~ .swatch__name { color: var(--accent); }

/* --- the privacy policy and the support page -------------------------------- */

.doc__head { padding-block: 52px 36px; }
.doc__head h1 { font-size: clamp(30px, 22px + 1.9vw, 44px); line-height: 1.12; letter-spacing: -0.022em; }
.doc__head > * + * { margin-top: 14px; }
.doc__head > p { max-width: 64ch; }
.doc__head .small { margin-top: 6px; }
.doc__lead { font-size: 18px; line-height: 1.5; }

.prose > * + * { margin-top: 12px; }
.prose > p,
.prose > ul { max-width: 68ch; }
.prose h3 { margin-top: 24px; font-size: 16px; }
.prose h3:first-child { margin-top: 0; }
.prose ul { padding-left: 20px; }
.prose li + li { margin-top: 6px; }

/* --- foot ------------------------------------------------------------------- */

.foot { padding-block: 24px 40px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 14px; }
.foot__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 48px; }
.foot p { max-width: 62ch; }
.foot p + p { margin-top: 8px; }
.foot nav { display: grid; grid-template-columns: auto auto; gap: 4px 28px; align-content: start; }

/* --- narrower windows ------------------------------------------------------- */

/* Beside chat's drawing there's only room for a name over its sentence. */
@media (max-width: 1179px) {
  .split .spec__row { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
}

@media (max-width: 959px) {
  .section { display: block; }
  .section > h2 { position: static; margin-bottom: 16px; font-size: 20px; }
  .figure--wide { margin-left: 0; }
  .spec__row:first-child { padding-top: 0; }
}

@media (max-width: 799px) {
  .hero__row { grid-template-columns: minmax(0, 1fr); }
  .hero__get .small { max-width: 420px; }
  /* Chat's drawing goes above what it shows. */
  .split { display: flex; flex-direction: column; }
  .split .figure { position: static; order: -1; width: 100%; max-width: 420px; margin-bottom: 28px; }
  /* The settings window without its left column. */
  .sw-nav { display: none; }
  .foot__in { grid-template-columns: minmax(0, 1fr); }
  .foot nav { justify-content: start; }
}

@media (max-width: 599px) {
  .wrap { width: calc(100% - 32px); }
  .hero,
  .doc__head { padding-block: 32px 28px; }
  .hero__lead,
  .doc__lead { font-size: 17px; }
  .section { padding-block: 18px 44px; }
  .spec__row,
  .split .spec__row { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .top__jump { display: none; }
  .sw-content { padding: 0 12px 12px; }
}

/* The smallest phones: the links go under the name. */
@media (max-width: 359px) {
  .top__in { flex-wrap: wrap; row-gap: 0; padding-block: 10px 8px; }
  .top nav { margin-left: -10px; }
}
