/* HUSKY TV (prototype) — see husky-tv.js. Two looks: [data-look="monitor"] and [data-look="channel"]. */
html.htv-open, html.htv-open body { overflow: hidden !important; }
.htv {
	--htv-font: Helvetica, "Helvetica Neue", Arial, sans-serif;
	position: fixed; inset: 0; z-index: 2147483000;
	display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
	background: #000; color: #fff;
	font-family: var(--htv-font);
	opacity: 0; transition: opacity .26s ease;
}
.htv[hidden] { display: none; }
.htv.is-on { opacity: 1; }
.htv button { appearance: none; -webkit-appearance: none; background: none; border: 0; border-radius: 0; margin: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.htv button:focus-visible, .htv input:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* top: the station ident */
.htv-brand { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px 12px; font: 700 12px/1 var(--htv-font); letter-spacing: .2em; }
.htv-live { display: inline-flex; align-items: center; gap: 8px; color: #8a8a8a; }
.htv-live i { width: 7px; height: 7px; border-radius: 50%; background: #ff1f3d; animation: htv-blink 1.6s steps(2, start) infinite; }
.htv.is-paused .htv-live i { animation: none; background: #555; }
@keyframes htv-blink { to { visibility: hidden; } }

/* the picture: always whole, never stretched */
.htv-screen { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 24px; }
.htv-video { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: #000; cursor: pointer; }
.htv-static { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; opacity: 0; pointer-events: none; }
.htv-wait { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; padding: 8px 12px; background: rgba(0, 0, 0, .75); font: 700 11px/1 var(--htv-font); letter-spacing: .18em; text-transform: uppercase; }

/* bottom bar */
.htv-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; padding: 14px 24px 20px; }
.htv-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0; min-width: 0; font: 700 12px/1.3 var(--htv-font); letter-spacing: .14em; text-transform: uppercase; }
.htv-ch { color: #8a8a8a; font-variant-numeric: tabular-nums; }
.htv-title { color: #fff; }
.htv-sub { color: #8a8a8a; font-weight: 400; letter-spacing: .08em; text-transform: none; }
.htv-ctrls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.htv-b { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; }
.htv-b svg { width: 14px; height: 14px; fill: currentColor; stroke: currentColor; stroke-width: 1.4; }
.htv-x svg { fill: none; stroke-width: 1.8; }
.htv-play .htv-i-play { display: none; }
.htv.is-paused .htv-play .htv-i-play { display: inline; }
.htv.is-paused .htv-play .htv-i-pause { display: none; }
.htv-t { font: 700 11px/1 var(--htv-font) !important; letter-spacing: .16em; text-transform: uppercase; color: #8a8a8a !important; padding: 10px 0 !important; transition: color .2s ease; }
.htv-t:hover, .htv-t:focus-visible, .htv-t[aria-pressed="true"] { color: #fff !important; }
.htv.is-loud .htv-snd { color: #00f0ff !important; }
.htv-look { display: inline-flex; gap: 8px; color: #444; }
.htv-look[hidden] { display: none; }
.htv-vol input { width: 84px; accent-color: #00f0ff; vertical-align: middle; }

/* ---- MONITOR: quiet broadcast monitor — thin frame, a dip to black between programmes ---- */
.htv[data-look="monitor"] .htv-video { outline: 1px solid #222; }
.htv[data-look="monitor"] .htv-logo { color: #fff; }
.htv[data-look="monitor"].is-changing .htv-video { opacity: 0; transition: opacity .2s ease; }
.htv[data-look="monitor"] .htv-video { transition: opacity .25s ease; }

/* ---- CHANNEL: playful experimental channel — RGB logo, scanlines, static + RGB split on change ---- */
.htv[data-look="channel"] .htv-logo {
	background: linear-gradient(90deg, #ff1f3d, #ffe600, #00e64d, #00f0ff, #3d5cff, #ff2bd6, #ff1f3d);
	background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
	animation: htv-logo 8s linear infinite;
}
@keyframes htv-logo { to { background-position: 300% 0; } }
.htv[data-look="channel"] .htv-screen::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px);
	mix-blend-mode: multiply;
}
.htv[data-look="channel"] .htv-title { color: #00f0ff; }
.htv[data-look="channel"] .htv-ch { color: #ff2bd6; }
.htv[data-look="channel"].is-changing .htv-static { opacity: .9; }
.htv[data-look="channel"].is-changing .htv-video { filter: drop-shadow(-6px 0 0 rgba(255, 31, 61, .8)) drop-shadow(6px 0 0 rgba(0, 240, 255, .8)) saturate(2.2); }

@media (prefers-reduced-motion: reduce) {
	.htv, .htv * { transition: none !important; animation: none !important; }
	.htv-static { display: none; }
}

/* phones: everything reachable with a thumb, the picture as big as the screen allows */
@media (max-width: 599px) {
	.htv-brand { padding: 14px 16px 10px; }
	.htv-screen { padding: 0; }
	.htv-bar { padding: 12px 16px 18px; gap: 10px; }
	.htv-ctrls { width: 100%; justify-content: space-between; gap: 4px 10px; }
	.htv-b { width: 44px; height: 44px; }
	.htv-vol { display: none; }                       /* phones use their own volume buttons */
	.htv-t { padding: 14px 0 !important; }
}

/* the button that opens it (WORK capabilities line) */
button.hg-tv {
	appearance: none; -webkit-appearance: none;
	background: none !important; border: 0; border-radius: 0; margin: 0 0 0 18px !important; padding: 0 0 2px !important;
	color: #8a8a8a !important; font-size: inherit !important; font-weight: 700 !important; letter-spacing: inherit !important;
	cursor: pointer; white-space: nowrap;
}
button.hg-tv .hg-tv-dot { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #ff1f3d; vertical-align: 1px; }
button.hg-tv:hover, button.hg-tv:focus-visible { color: #fff !important; }
button.hg-tv:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
@media (max-width: 599px) { button.hg-tv { margin-left: 14px !important; padding: 6px 0 !important; margin-top: -6px !important; margin-bottom: -6px !important; } }
