/* Play with Kurm (index.html, assets/js/demo.js): the gameplay clip as a "screen", a replica of the app's mini menu
   (QuickSettings.cs / kurm-rs MiniWindow) over it, and draggable overlays on the screen. */

.kd {
  position: relative;
  --kd-accent: #60cdff;
  --kd-ui: 'Segoe UI Variable Text', 'Segoe UI', var(--font-family-base);
}

/* The screen: the cards' frame with a faint blue glow. */
.kd-stage {
  position: relative;
  overflow: hidden;
  container-type: inline-size;
  background: #000;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 48px -16px color-mix(in srgb, var(--primary) 40%, transparent);
}

/* Stretched resolutions squash the frame instead of widening it, so all four edges stay on screen and everything still
   looks wider, as on a stretched monitor (1440 x 1080 shown at 16:9 = 0.75 tall, 1280 x 1024 = 0.7031). The game's
   health layer goes with the video. */
.kd-stage .hm-video, .kd-hud { transform-origin: center; }
.kd-stage[data-res='43'] :is(.hm-video, .kd-hud) { transform: scaleY(0.75); }
.kd-stage[data-res='54'] :is(.hm-video, .kd-hud) { transform: scaleY(0.7031); }

/* The game's own health bar (demo.js), exactly over it in the clip: 1920 x 1080 px 1644-1891 x 936-967, with the
   number 11 px in at 18 px. The colours match the canvas copy in demo.js (HUD). */
.kd-hud { position: absolute; inset: 0; pointer-events: none; }
.kd-hud__hp { position: absolute; left: 85.625%; top: 86.667%; width: 12.865%; height: 2.87%; overflow: hidden; background: #262a24; }
.kd-hud__hp i { position: absolute; inset: 0; background: #57cab7; transform-origin: left; transform: scaleX(var(--hp, 1)); transition: transform 500ms linear; }
.kd-hud__hp b {
  position: relative;
  display: block;
  padding-left: 4.45%;
  color: #eef7dc;
  font: 700 0.9375cqi/1.6146cqi 'Roboto Condensed', Bahnschrift, 'Arial Narrow', sans-serif;
}

.kd-defs { position: absolute; }

/* The bar note (demo.js paintBars): centred in the top bar, and at the right of the bottom one, away from the F9 chip.
   --kd-bar is the bar's height. */
.kd-bars {
  position: absolute;
  top: 0;
  left: 50%;
  translate: -50% 0;
  margin: 0;
  color: rgb(255 255 255 / 0.42);
  font: 500 11px/var(--kd-bar, 0) var(--font-family-base);
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
}
.kd-bars + .kd-bars { top: auto; bottom: 0; left: auto; right: 14px; translate: none; }

.kd-layer { position: absolute; inset: 0; pointer-events: none; font-family: var(--kd-ui); font-size: clamp(9px, 1.15cqi, 13px); }

/* ---------- overlays (centre-positioned by --x / --y, fractions of the screen) ---------- */
.kd-ov {
  position: absolute;
  left: calc(var(--x) * 100%);
  top: calc(var(--y) * 100%);
  translate: -50% -50%;
  scale: var(--s, 1);
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  user-select: none;
  white-space: nowrap;
}
.kd-ov:active { cursor: grabbing; }
.kd-ov:focus-visible { outline: 2px solid var(--kd-accent); outline-offset: 3px; }

/* The resize grip: bottom-right corner, shown on hover or focus (always on touch), the same size at any scale. */
.kd-ov__grip {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--kd-accent);
  border-radius: 3px;
  background: rgb(10 14 24 / 0.85);
  scale: calc(1 / var(--s, 1));
  cursor: nwse-resize;
  opacity: 0;
}
.kd-ov:hover .kd-ov__grip, .kd-ov:focus .kd-ov__grip { opacity: 1; }
@media (hover: none) {
  .kd-ov__grip { right: -11px; bottom: -11px; width: 22px; height: 22px; opacity: 1; }
}

/* The status pill (status.rs): #242424 body, #303030 edge, 11 px corners, dot · title · state. */
.kd-pill {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.55em 1.1em;
  border-radius: 11px;
  background: rgb(36 36 36 / 0.91);
  border: 1px solid #303030;
  color: #a2a2a2;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.kd-pill i { width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--dot, #52d480); }
.kd-pill .kd-sep { color: #414141; font-weight: 400; }
.kd-pill b { color: var(--dot, #52d480); }
.kd-pill.is-off { --dot: #6b6b6b; }

/* The Health Overlay: a canvas copy of the picked area (size and transparency set from demo.js). */
.kd-hpo canvas { display: block; width: 100%; height: 100%; }
.kd-hpo { box-shadow: 0 0 0 1px rgb(255 255 255 / 0.45), 0 4px 14px rgb(0 0 0 / 0.5); }
.kd-hpo.is-round, .kd-hpo.is-round canvas { border-radius: 6px; }

/* Rapid Fire's Move / Resize: the pill outlined, with its grip, until Done. */
.kd-ov.is-placing { outline: 2px dashed var(--kd-accent); outline-offset: 3px; }
.kd-ov.is-placing .kd-ov__grip { opacity: 1; }

/* Its area picker: the clip dimmed, the health bar suggested, the dragged box in white. */
.kd-pick { position: absolute; inset: 0; background: rgb(0 0 0 / 0.5); cursor: crosshair; touch-action: none; user-select: none; }
.kd-pick__tip {
  position: absolute;
  top: 8px;
  left: 50%;
  translate: -50% 0;
  margin: 0;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgb(10 14 24 / 0.88);
  color: #fff;
  font: 600 12px var(--font-family-base);
  white-space: nowrap;
  pointer-events: none;
}
.kd-pick__bar { position: absolute; outline: 2px dashed var(--kd-accent); outline-offset: 3px; pointer-events: none; animation: kd-pulse 1.2s ease-in-out infinite alternate; }
@keyframes kd-pulse { to { outline-color: rgb(96 205 255 / 0.35); } }
.kd-pick__box { position: absolute; border: 2px solid #fff; background: rgb(255 255 255 / 0.08); pointer-events: none; }

/* ---------- the F9 chip ---------- */
.kd-hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 7px 12px;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: var(--radius-full);
  background: rgb(10 14 24 / 0.78);
  color: #f1f4fa;
  font: 600 13px var(--font-family-base);
  cursor: pointer;
}
.kd-hint[hidden] { display: none; }
.kd-hint__tap { display: none; }
@media (hover: none) { .kd-hint__key { display: none; } .kd-hint__tap { display: inline; } }
.kd-hint:hover { background: rgb(20 30 52 / 0.9); border-color: color-mix(in srgb, var(--primary) 60%, transparent); }
.kd-hint kbd {
  padding: 1px 6px;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-bottom-width: 2px;
  border-radius: 4px;
  font: 600 12px var(--font-family-monospace);
}

/* ---------- the mini menu: kurm-rs MiniWindow (app.slint) and Slint's fluent-dark widgets, in its logical px ---------- */
/* 356 wide, #202020, DWM-round corners, 16 padding and 10 between the title row, the tab block, the scrolling page and
   the Music bar. The shadow is the site's own, so it reads over the game. */
.kd-menu {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 356px;
  height: min(908px, calc(100% - 24px));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 8px;
  background: #202020;
  box-shadow: 0 12px 40px -8px rgb(0 0 0 / 0.7);
  color: #fefefe;
  font: 13px/1.2 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  z-index: 2;
}
.kd-menu[hidden] { display: none; }
.kd-menu.is-wide { width: 712px; max-width: calc(100% - 24px); }
.kd-menu :is(button, input, select) { font: inherit; color: inherit; margin: 0; }
.kd-menu button { cursor: pointer; }
.kd-menu :focus-visible { outline: 2px solid #fefefe; outline-offset: 1px; }
.kd-i { flex: none; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; }

.kd-head { flex: none; height: 28px; display: flex; align-items: center; gap: 10px; cursor: move; touch-action: none; user-select: none; }
.kd-head__gear { width: 20px; height: 16px; color: #8f8aa8; }
.kd-head__title { flex: 1; font-size: 14px; font-weight: 700; }
.kd-x { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; }
.kd-menu .kd-x { color: #c1c1c1; }
.kd-x:hover { background: #ffffff14; }
/* Touch screens: a 44px hit area, drawn at the same size. */
@media (pointer: coarse) { .kd-x { position: relative; } .kd-x::before { content: ''; position: absolute; inset: -8px; } }

/* Tick: 20 x 20, radius 4; on = the accent with a black check, off = a #ffffff60 outline. */
.kd-tick, .kd-switch input {
  appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1px solid #ffffff60;
  border-radius: 4px;
  background: transparent center / 12px no-repeat;
  cursor: pointer;
  transition: background-color 100ms ease-out, border-color 100ms ease-out;
}
.kd-tick:hover, .kd-switch input:hover { background-color: #ffffff10; }
.kd-tick:checked, .kd-switch input:checked {
  border-color: #60cdff;
  background-color: #60cdff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='%23000' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transition-duration: 150ms;
}

/* The tab block: a 3-column grid of 104 x 30 pills, 6 apart, then the game picker. */
.kd-tabblock { flex: none; display: flex; flex-direction: column; gap: 6px; }
.kd-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kd-tabs button { height: 30px; padding: 0; border: 1px solid #ffffff1a; border-radius: 15px; background: #ffffff0a; font-size: 12px; white-space: nowrap; }
.kd-tabs button:hover { background: #ffffff14; }
.kd-tabs [aria-selected='true'], .kd-tabs [aria-selected='true']:hover { border-color: #60cdff; background: #60cdff22; color: #60cdff; }

/* The scrolling page: a 314 px column (10 px kept for the bar). The fluent bar: a 2 px #ffffff14 line 4 px in, wider on hover.
   scrollbar-color: auto undoes the one html inherits from site.css: with it set, Chromium skips ::-webkit-scrollbar and draws
   its own bar, an overlay one on phones and Windows 11 that the gutter can't keep off the sliders. Firefox's overlay bar takes
   no room either, so it gets the 10 px as padding. */
.kd-pages { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-color: auto; }
.kd-pages::-webkit-scrollbar { width: 10px; }
.kd-pages::-webkit-scrollbar-thumb { border: solid transparent; border-width: 0 4px; border-radius: 3px; background: #ffffff14 padding-box; }
.kd-pages::-webkit-scrollbar-thumb:hover { border-width: 0 4px 0 0; background-color: #ffffff40; }
.kd-pages::-webkit-scrollbar-track:hover { border-radius: 5px; background: #2c2c2c; }
@supports not selector(::-webkit-scrollbar) { .kd-pages { padding-right: 10px; scrollbar-width: thin; scrollbar-color: #ffffff30 transparent; } }
.kd-page { display: flex; flex-direction: column; gap: 10px; }
.kd-page[hidden] { display: none; }

.kd-headline { margin: 0; color: #8f8aa8; font-size: 10.5px; font-weight: 700; }
.kd-note { margin: 0; color: #8f8aa8; font-size: 11px; white-space: pre-wrap; }
.kd-status { margin: 0; color: #bebebe; font-size: 11.5px; white-space: pre-wrap; }
.kd-now { margin: 0; font-weight: 600; white-space: pre-wrap; }
.kd-hint-text { margin: 0; color: #999; font-size: 11px; }
.kd-bind { margin: 0; font-size: 12.5px; white-space: pre; }
.kd-contents { display: contents; }

.kd-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.kd-switch > span { flex: 1; }
.kd-switch:has(input:disabled) { color: #999; cursor: default; }
.kd-switch input:disabled { opacity: 0.4; cursor: default; }

/* MiniRow: label (or nothing), value, a 20 px reset box, then the slider 2 px under. */
.kd-row { display: grid; grid-template-columns: 1fr auto 20px; align-items: center; row-gap: 2px; }
.kd-row label { color: #bebebe; font-size: 12.5px; white-space: pre; }
.kd-row output { color: #a1a1a1; font-size: 12px; font-weight: 600; white-space: pre; }
.kd-reset { height: 15px; display: grid; place-items: center end; padding: 0; border: 0; background: none; }
.kd-reset .kd-i { width: 13px; height: 13px; stroke-width: 1.25; }
.kd-menu .kd-reset { color: #a1a1a1; }
.kd-menu .kd-reset:hover { color: #fff; }
.kd-row input { grid-column: 1 / -1; }

/* The fluent Slider: 20 tall; a 4 px #ffffff14 rail inset by the thumb's radius, filled in the Windows accent (grey #bfbfbf
   on the reference PC); a 20 px #454545 thumb with a 12 px accent dot (14 on hover, 10 held). --p is 0-1 (demo.js). */
.kd-row input[type='range'] {
  appearance: none;
  width: 100%;
  height: 20px;
  background:
    linear-gradient(#bfbfbf, #bfbfbf) 10px 50% / calc((100% - 20px) * var(--p, 0)) 4px no-repeat,
    linear-gradient(#ffffff14, #ffffff14) 10px 50% / calc(100% - 20px) 4px no-repeat;
  cursor: pointer;
}
.kd-row input[type='range']::-webkit-slider-thumb { appearance: none; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle, #bfbfbf 5.5px, #454545 6.2px); box-shadow: 0 0 0 1px #ffffff17; }
.kd-row input[type='range']:hover::-webkit-slider-thumb { background: radial-gradient(circle, #bfbfbfe6 6.5px, #454545 7.2px); }
.kd-row input[type='range']:active::-webkit-slider-thumb { background: radial-gradient(circle, #bfbfbfcc 4.5px, #454545 5.2px); }
.kd-row input[type='range']::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: radial-gradient(circle, #bfbfbf 5.5px, #454545 6.2px); box-shadow: 0 0 0 1px #ffffff17; }

/* Button, ComboBox and text field: the fluent-dark controls (32 tall, #ffffff0f, a #ffffff17 edge). */
.kd-btn, .kd-select, .kd-field {
  box-sizing: border-box;
  min-height: 32px;
  border: 1px solid #ffffff17;
  border-radius: 4px;
  background-color: #ffffff0f;
  font-size: 13px;
  transition: background-color 150ms;
}
.kd-btn { align-self: flex-start; padding: 5px 12px; white-space: pre; }
.kd-btn:hover:not(:disabled) { background-color: #ffffff14; }
.kd-menu .kd-btn:active:not(:disabled) { background-color: #ffffff08; color: #ffffffc9; }
.kd-menu .kd-btn:disabled { background-color: #ffffff0a; color: #ffffff5e; cursor: default; }
.kd-select {
  appearance: none;
  width: 100%;
  min-width: 0;
  padding: 0 34px 0 11px;
  border-radius: 3px;
  background: #ffffff0f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 5.5l5.5 5.5 5.5-5.5' fill='none' stroke='%23ffffffc9' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 11px center / 14px no-repeat;
  cursor: pointer;
}
.kd-select:hover { background-color: #ffffff14; }
.kd-select option { background: #2c2c2c; color: #fff; }
.kd-field { width: 100%; min-width: 0; padding: 0 12px; border-color: #ffffff14; border-bottom-color: #ffffff8a; }
.kd-field::placeholder { color: #ffffffc9; }
.kd-field:focus { outline: 0; background-color: #1e1e1eb3; box-shadow: inset 0 -2px #bfbfbf; }
.kd-label { display: flex; flex-direction: column; gap: 10px; color: #bebebe; font-size: 11.5px; }
.kd-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kd-btns .kd-btn { align-self: auto; }
.kd-name { display: flex; gap: 8px; }
.kd-name[hidden] { display: none; }
.kd-name .kd-btn { flex: none; }
.kd-key { font-size: 12.5px; font-weight: 600; }

/* ColorBlock: a 120 px saturation/value square, a 16 px hue strip, then the swatch and its hex. */
.kd-cb { display: flex; flex-direction: column; gap: 10px; }
.kd-cb__sv, .kd-cb__hue { position: relative; touch-action: none; cursor: crosshair; }
.kd-cb__sv { height: 120px; border-radius: 6px; background: linear-gradient(#1a1a1a00, #000), linear-gradient(90deg, #fff, #fff0), hsl(var(--h, 0) 100% 50%); }
.kd-cb__hue { height: 16px; border-radius: 8px; background: linear-gradient(90deg, #f00, #ff0 16.7%, #0f0 33.3%, #0ff 50%, #00f 66.7%, #f0f 83.3%, #f00); }
.kd-cb i { position: absolute; left: calc(var(--x, 0) * 100%); top: calc(var(--y, 0.5) * 100%); translate: -50% -50%; box-sizing: border-box; width: 13px; height: 13px; border: 2px solid #fff; border-radius: 50%; pointer-events: none; }
.kd-cb__hue i { width: 8px; height: 16px; border-radius: 4px; }
.kd-cb__row { display: flex; align-items: center; gap: 10px; }
.kd-cb__sw { flex: none; width: 26px; height: 26px; box-sizing: border-box; border: 1px solid #ffffff40; border-radius: 8px; background: var(--c); }
.kd-cb__row b { flex: 1; font-size: 12px; font-weight: 600; }

/* Task cards (#141416, a #242426 edge, 9 px corners). */
.kd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.kd-list li { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #242426; border-radius: 9px; background: #141416; }
.kd-list .kd-btn { flex: none; align-self: center; }
.kd-list li > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kd-list b { color: #e6e6e6; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd-list small { color: #848484; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: pre; }

/* Player Lookup's card (lookup.slint PCard). */
.kd-pl { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid #ffffff10; border-radius: 8px; background: #ffffff0d; }
.kd-pl[hidden] { display: none; }
.kd-pl__top { display: flex; align-items: center; gap: 10px; }
.kd-pl__top > span { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.kd-pl__top b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd-pl__top small { color: #c1c1c1; font-size: 11px; white-space: pre; }
.kd-pl__top small + small { color: #999; font-size: 10.5px; }
.kd-pl__av { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 6px; background: #1b2838; font-size: 18px; font-style: normal; font-weight: 700; }
.kd-pl dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; margin: 0; padding-top: 4px; border-top: 1px solid #ffffff10; font-size: 11.5px; }
.kd-pl dt { color: #c1c1c1; }
.kd-pl dd { max-width: 160px; margin: 0; text-align: end; }
.kd-pl .is-warn { color: #ff99a4; }

/* YouTube (youtube.slint YtMini): Ctl buttons, a two-column card grid, then the player. Thumbnails are crops of the
   clip's poster. */
.kd-yt-bar, .kd-yt-row, .kd-yt-top, .kd-yt-ctl { display: flex; align-items: center; gap: 8px; }
.kd-yt-row, .kd-yt-ctl { gap: 4px; }
.kd-yt-bar form { flex: 1; min-width: 0; }
.kd-ctl { flex: none; min-width: 36px; height: 32px; display: grid; place-items: center; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; font-size: 12.5px; font-weight: 600; }
.kd-ctl:hover { background: #ffffff1a; }
.kd-ctl .kd-i { width: 16px; height: 16px; }
.kd-menu .kd-ctl[data-yt-mute][aria-pressed='true'] { color: #ff0033; }
.kd-yt-row .kd-ctl[aria-pressed='true'] { background: #ffffff1a; }
.kd-yt-status { flex: 1; min-width: 0; color: #999; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd-yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 10px; }
.kd-yt-card { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 0 0 6px; border: 0; border-radius: 8px; background: none; text-align: start; }
.kd-yt-card:hover { background: #ffffff0d; }
.kd-yt-card :is(b, small) { margin: 0 4px; overflow: hidden; text-overflow: ellipsis; }
.kd-yt-card .kd-yt-thumb { margin-bottom: 5px; }
.kd-yt-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 8px; background: #000 url('../video/rust-loop-poster.webp') var(--bp, 50% 50%) / 300% no-repeat; }
.kd-yt-thumb > span { position: absolute; right: 6px; bottom: 6px; height: 18px; padding: 0 5px; border-radius: 4px; background: #000000c0; color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; }
.kd-yt-card b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-height: 36px; font-size: 13px; font-weight: 600; line-height: 18px; }
.kd-yt-card small { color: #c1c1c1; font-size: 11.5px; white-space: nowrap; }
.kd-yt-card small + small { color: #999; font-size: 11px; }
.kd-yt-top b { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd-yt-vid { display: grid; place-items: end start; border-radius: 6px; background-size: 160%; }
.kd-yt-vid > span { position: static; margin: 6px; }
.kd-yt-ctl { height: 32px; }
.kd-yt-ctl .kd-bar { --fill: #ff0033; --track: #ffffff30; --knob: #ff0033; flex: 1; min-width: 0; }
.kd-yt-ctl > span { color: #c1c1c1; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kd-yt-ctl.is-paused .kd-i-pause, .kd-yt-ctl:not(.is-paused) .kd-i-play, [data-yt-mute][aria-pressed='true'] .kd-i-on, [data-yt-mute]:not([aria-pressed='true']) .kd-i-off { display: none; }
.kd-yt-chan { color: #c1c1c1; font-size: 12px; font-weight: 600; }
.kd-yt-meta { color: #999; font-size: 11px; }
.kd-keys { display: flex; flex-direction: column; gap: 8px; }
.kd-keys .kd-headline { color: #999; font-size: 10px; }
.kd-keys > div { display: flex; align-items: center; gap: 8px; color: #c1c1c1; font-size: 12px; }
.kd-keys > div > span { flex: 1; }

/* The thin bars (MusicBar and the YouTube seek bar): a 4 px track, 6 px with its 12 px knob on hover. --p is 0-1. */
.kd-bar {
  --fill: #60cdff;
  --track: #ffffff26;
  --knob: #fefefe;
  --t: 4px;
  appearance: none;
  height: 22px;
  background: linear-gradient(var(--fill), var(--fill)) 0 50% / calc(100% * var(--p, 0)) var(--t) no-repeat, linear-gradient(var(--track), var(--track)) 0 50% / 100% var(--t) no-repeat;
  cursor: pointer;
}
.kd-bar:hover, .kd-bar:active { --t: 6px; }
.kd-bar::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--knob); opacity: 0; transition: opacity 120ms; }
.kd-bar:is(:hover, :active, :focus-visible)::-webkit-slider-thumb { opacity: 1; }
.kd-bar::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--knob); opacity: 0; }
.kd-bar:is(:hover, :active)::-moz-range-thumb { opacity: 1; }

/* ---------- Music, pinned under the page (MusicMini): cover and title | seek | ＋, the transport, the volume ---------- */
.kd-music { flex: none; display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid #ffffff1f; }
.kd-music__top { display: flex; align-items: center; gap: 12px; }
.kd-cover { flex: none; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 6px; background: var(--art, #ffffff10); color: #76718f; }
.kd-cover .kd-i { width: 21.6px; height: 21.6px; }
.kd-cover.has-art .kd-i { display: none; }
.kd-music__text { min-width: 0; display: flex; flex-direction: column; }
.kd-music__title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd-music__artist { color: #c1c1c1; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd-seek { display: flex; align-items: center; gap: 8px; color: #999; font-size: 11px; font-variant-numeric: tabular-nums; }
.kd-seek > span { flex: none; width: 34px; text-align: end; }
.kd-seek > span:last-child { text-align: start; }
.kd-seek .kd-bar { flex: 1; min-width: 0; }
.kd-music__ctl { display: flex; align-items: center; }
.kd-music__side { flex: none; width: 72px; display: flex; align-items: center; }
.kd-transport { flex: 1; display: flex; justify-content: center; gap: 4px; }
.kd-mb { position: relative; flex: none; width: 32px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8.12px; background: #ffffff0f; transition: color 120ms; }
.kd-mb:hover:not(:disabled) { background: #ffffff1f; }
.kd-mb:disabled { opacity: 0.4; cursor: default; }
.kd-mb .kd-i { width: 10px; height: 10px; stroke-width: 1.3; }
.kd-mb--play { width: 34px; height: 30px; border-radius: 8.7px; }
.kd-mb--play .kd-i { width: 11px; height: 11px; }
.kd-mb--text { width: auto; padding: 0 16px; font-size: 13px; }
.kd-mb[data-m='shuffle']:not([aria-pressed='true']), .kd-mb[data-m='repeat']:not([aria-pressed='true']) { opacity: 0.5; }
.kd-menu .kd-mb[aria-pressed='true'] { color: #60cdff; box-shadow: inset 0 0 0 1px #60cdff; }
.kd-mb[data-mode='one']::after { content: '1'; position: absolute; top: -5px; right: -5px; width: 13px; height: 13px; border-radius: 50%; background: #60cdff; color: #000; font-size: 9px; font-weight: 700; line-height: 13px; }
.kd-mb--play .kd-i-play, .kd-music.is-paused .kd-mb--play .kd-i-pause { display: none; }
.kd-music.is-paused .kd-mb--play .kd-i-play { display: block; }
.kd-vol { justify-content: flex-end; gap: 6px; }
.kd-vol__btn { width: 18px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; background: none; }
.kd-menu .kd-vol__btn { color: #c1c1c1; }
.kd-vol__btn .kd-i { width: 14px; height: 14px; }
.kd-vol__btn .kd-i-off, .kd-vol__btn[aria-pressed='true'] .kd-i-on { display: none; }
.kd-vol__btn[aria-pressed='true'] .kd-i-off { display: block; }
.kd-vol .kd-bar { width: 48px; }

/* The toast: 36 tall, 16 in from the sides and the bottom; rises in and leaves after 4 s (demo.js). */
.kd-toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  height: 36px;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #ffffff14;
  border-radius: 8px;
  background: #2b2b2b;
  font-size: 12px;
  text-align: center;
  opacity: 0;
  translate: 0 16px;
  pointer-events: none;
  transition: opacity 150ms, translate 150ms;
}
.kd-toast.is-on { opacity: 1; translate: 0 0; transition: opacity 200ms, translate 300ms ease-in-out; }


/* ---------- Discord (kurm-discord's mini view: #2b2b2b call card, green Connected, red Leave, blurple Watch) ---------- */
.kd-dc-av {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--c);
  background-clip: padding-box;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  transition: border-color 150ms ease;
}
.kd-dc-av.is-speaking { border-color: #23a55a; }
.kd-dc-call { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 6px; background: #2b2b2b; }
.kd-dc-call.is-shaking { animation: kd-shake 380ms ease; }
@keyframes kd-shake { 20% { translate: -6px 0; } 40% { translate: 6px 0; } 60% { translate: -4px 0; } 80% { translate: 3px 0; } }
.kd-dc-call__top { display: flex; align-items: center; gap: 10px; }
.kd-dc-call__top > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kd-dc-call__top b { color: #fff; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd-dc-call__top small { color: #23a55a; font-size: 11px; font-variant-numeric: tabular-nums; }
.kd-dc-users { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.kd-dc-row { display: flex; gap: 8px; }
.kd-dc-live { padding: 1px 5px; border-radius: 3px; background: #da373c; color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; }
.kd-dc-btn { padding: 5px 12px; border: 0; border-radius: 4px; background: #4e5058; color: #fff; font-size: 12.5px; font-weight: 600; }
.kd-dc-btn:hover:not(:disabled) { filter: brightness(1.12); }
.kd-dc-btn:disabled { opacity: 0.55; cursor: default; }
.kd-dc-btn[aria-pressed='true'] { background: rgb(218 55 60 / 0.28); color: #ff9a9d; }
.kd-dc-btn--red { background: #da373c; }
.kd-dc-btn--blue { background: #5865f2; }
.kd-dc-toast { margin: 0; padding: 6px 10px; border-radius: 6px; background: #111214; color: #f2f3f5; font-size: 12px; }

/* The stream pop-out (StreamWindow): over the game, dragged by its title bar, sized from its corner. The view is its
   own size container, so the shared screen scales with the window. */
.kd-stream {
  position: absolute;
  width: min(460px, 64%);
  aspect-ratio: 16 / 10;
  min-width: 180px;
  min-height: 112px;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  resize: both;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: #202020;
  box-shadow: 0 18px 40px -10px rgb(0 0 0 / 0.75);
  color: #e6e6e6;
  font: 12px/1.3 var(--kd-ui);
}
.kd-stream button { font: inherit; color: inherit; cursor: pointer; }
.kd-stream :focus-visible { outline: 2px solid var(--kd-accent); outline-offset: 2px; }
.kd-stream__head { display: flex; align-items: center; gap: 8px; padding: 2px 2px 2px 10px; background: #1a1a1a; cursor: move; touch-action: none; user-select: none; }
.kd-stream__head b { flex: 1; min-width: 0; color: #fff; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd-stream__q { color: #9a9a9a; font-size: 11px; white-space: nowrap; }
.kd-stream__view { flex: 1; min-height: 0; container-type: size; display: grid; place-items: center; padding: 3cqmin; background: radial-gradient(circle at 30% 20%, #1b2a4a, #070b14 70%); }
.kd-share {
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5cqmin;
  padding: 3.5cqmin 5cqmin;
  border: 1px solid #26314a;
  border-radius: 2.5cqmin;
  background: #10151f;
  text-align: center;
}
.kd-share p { margin: 0; }
.kd-share__bar { align-self: stretch; display: flex; align-items: center; gap: 1.2cqmin; color: #8f9bb3; font-size: clamp(7px, 4.5cqmin, 11px); }
.kd-share__bar i { width: 2.4cqmin; height: 2.4cqmin; border-radius: 50%; background: #ff5f57; }
.kd-share__bar i:nth-child(2) { background: #febc2e; }
.kd-share__bar i:nth-child(3) { background: #28c840; }
.kd-share__bar span { margin-inline-start: 1cqmin; }
.kd-share__label { color: #9fb0d0; font-size: clamp(8px, 5cqmin, 13px); letter-spacing: 0.08em; text-transform: uppercase; }
.kd-share__code {
  padding: 0.8cqmin 3cqmin;
  border: 2px dashed rgb(255 138 0 / 0.6);
  border-radius: 1.5cqmin;
  color: #ff8a00;
  font: 800 clamp(16px, 15cqmin, 46px)/1.1 var(--font-family-monospace);
  letter-spacing: 0.06em;
}
.kd-share__line { color: #f1f4fa; font-size: clamp(9px, 5.6cqmin, 16px); font-weight: 600; }
.kd-share__link { color: #7aa9ff; font-size: clamp(8px, 5cqmin, 13px); }

@media (prefers-reduced-motion: reduce) {
  .kd-hud__hp i, .kd-dc-av { transition: none; }
  .kd-pick__bar, .kd-dc-call.is-shaking { animation: none; }
  .kd-tick, .kd-switch input, .kd-toast, .kd-toast.is-on { transition: none; }
}

/* Up to 900 px wide the menu would cover most of the clip, so it becomes a sheet under it, still 356 wide; on phones
   the whole menu is scaled down so it fits a 360 px screen. */
@media (max-width: 900px) {
  .kd-menu { position: static; height: 640px; margin: 10px auto 0; box-shadow: none; }
  .kd-menu.is-wide { width: 356px; }
  .kd-head { cursor: default; }
  .kd-hint { left: 8px; bottom: 8px; padding: 5px 10px; font-size: 12px; }
}
@media (max-width: 400px) {
  .kd-menu { zoom: 0.9; }
}
