/*
 * Classic Stock Jukebox: a retro cabinet. Colours are custom properties, so a
 * theme can restyle it, e.g. .cs-jukebox { --jb-neon: #ff3d7f; }.
 */
.cs-jukebox {
	--jb-wood: #5b2f1a;
	--jb-wood-dark: #34190c;
	--jb-chrome: #e9edf2;
	--jb-chrome-dark: #8a96a3;
	--jb-neon: #ff4f9a;
	--jb-neon-2: #34e3ff;
	--jb-amber: #ffbf3c;
	--jb-cream: #fff6dc;
	--jb-ink: #2a1a10;
	--jb-screen: #0d0b14;
	--jb-radius: 22px;

	box-sizing: border-box;
	/* The script widens the jukebox to the window (width="wide", up to 1440px). */
	max-width: 1440px;
	margin: 1.5em auto;
	/* Layout follows the jukebox's own width (see the @container rules below). */
	container: jukebox / inline-size;
	padding: 0 18px 18px;
	color: var(--jb-cream);
	font-family: inherit;
	background:
		repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 9px),
		linear-gradient(180deg, var(--jb-wood) 0%, var(--jb-wood-dark) 100%);
	border-radius: 200px 200px var(--jb-radius) var(--jb-radius) / 120px 120px var(--jb-radius) var(--jb-radius);
	box-shadow: inset 0 0 0 6px var(--jb-chrome-dark), inset 0 0 0 9px var(--jb-chrome), 0 18px 40px rgba(0, 0, 0, 0.35);
}

.cs-jukebox *,
.cs-jukebox *::before,
.cs-jukebox *::after {
	box-sizing: border-box;
}

/* Themes often style every button (capitals, letter spacing, large text);
   the jukebox's own controls set their own. */
.cs-jukebox__strip,
.cs-jukebox__key,
.cs-jukebox__btn,
.cs-jukebox__page,
.cs-jukebox__shelf,
.cs-jukebox__tab,
.cs-jukebox__queue-remove {
	letter-spacing: normal;
	text-transform: none;
	line-height: 1.2;
	font-size: 1rem;
}

/* ---- Arch, name and chasing lights ---- */

.cs-jukebox__arch {
	position: relative;
	padding: 34px 40px 14px;
	text-align: center;
}

.cs-jukebox__name {
	margin: 0;
	font-size: clamp(1.4rem, 3.5vw, 2.4rem);
	font-weight: 800;
	font-style: italic;
	letter-spacing: 0.04em;
	color: #fff;
	text-shadow: 0 0 6px var(--jb-neon), 0 0 18px var(--jb-neon), 0 0 30px var(--jb-neon);
}

.cs-jukebox__bulbs {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 auto 12px;
	max-width: 620px;
}

.cs-jukebox__bulbs span {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--jb-amber);
	opacity: 0.35;
	box-shadow: 0 0 4px var(--jb-amber);
}

.cs-jukebox.fx-lights .cs-jukebox__bulbs span {
	animation: cs-jb-chase 1.8s linear infinite;
	animation-delay: calc(var(--i) * 0.1s);
	animation-play-state: paused;
}

.cs-jukebox.fx-lights.is-playing .cs-jukebox__bulbs span {
	animation-play-state: running;
}

@keyframes cs-jb-chase {
	0%, 60%, 100% { opacity: 0.3; box-shadow: 0 0 3px var(--jb-amber); }
	10% { opacity: 1; box-shadow: 0 0 12px var(--jb-amber), 0 0 22px var(--jb-amber); }
}

/* ---- Script-off list (also the Credits panel) ---- */

.cs-jukebox__list {
	margin: 0 0 12px;
	padding: 14px 18px 14px 40px;
	color: var(--jb-ink);
	background: var(--jb-cream);
	border-radius: 10px;
}

.cs-jukebox__item {
	margin: 0 0 8px;
}

.cs-jukebox__code {
	display: inline-block;
	min-width: 2.4em;
	font-weight: 800;
	color: #b3122a;
}

.cs-jukebox__artist {
	margin-left: 0.4em;
	opacity: 0.75;
}

.cs-jukebox__credit {
	display: block;
	opacity: 0.8;
}

.cs-jukebox__list a,
.cs-jukebox__np-credit a {
	color: inherit;
}

.cs-jukebox__empty {
	margin: 0 0 12px;
	padding: 18px;
	text-align: center;
	color: var(--jb-ink);
	background: var(--jb-cream);
	border-radius: 10px;
}

.cs-jukebox.is-ready > .cs-jukebox__list {
	display: none;
}

.cs-jukebox__credits {
	margin-top: 14px;
	padding: 0 6px;
	color: var(--jb-cream);
	font-size: 0.85em;
}

.cs-jukebox__credits summary {
	cursor: pointer;
	font-weight: 700;
}

.cs-jukebox__credits .cs-jukebox__list {
	margin-top: 8px;
}

/* ---- Stage: tubes and screen ---- */

.cs-jukebox__body {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
}

.cs-jukebox__stage {
	display: grid;
	grid-template-columns: 34px 1fr 34px;
	gap: 14px;
	align-items: stretch;
}

.cs-jukebox__tube {
	position: relative;
	overflow: hidden;
	border-radius: 17px;
	background: linear-gradient(90deg, rgba(255, 79, 154, 0.55), rgba(255, 191, 60, 0.75) 50%, rgba(255, 79, 154, 0.55));
	box-shadow: inset 0 0 0 3px var(--jb-chrome), inset 0 0 12px rgba(0, 0, 0, 0.4);
}

.cs-jukebox__tube--right {
	background: linear-gradient(90deg, rgba(52, 227, 255, 0.5), rgba(160, 255, 200, 0.7) 50%, rgba(52, 227, 255, 0.5));
}

.cs-jukebox__tube span {
	position: absolute;
	bottom: -14px;
	left: calc(20% + (var(--i) * 9%));
	width: 9px;
	height: 9px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.85);
	opacity: 0;
}

.cs-jukebox.fx-bubbles.is-playing .cs-jukebox__tube span {
	animation: cs-jb-bubble 3.4s ease-in infinite;
	animation-delay: calc(var(--i) * 0.48s);
}

@keyframes cs-jb-bubble {
	0% { transform: translateY(0) scale(0.6); opacity: 0; }
	15% { opacity: 0.9; }
	100% { transform: translateY(-420px) scale(1.1); opacity: 0; }
}

.cs-jukebox__screen {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: 14px;
	background: radial-gradient(circle at 50% 45%, #2a1f3d 0%, var(--jb-screen) 70%);
	box-shadow: inset 0 0 0 4px var(--jb-chrome), 0 0 0 2px var(--jb-chrome-dark);
}

.cs-jukebox.fx-pulse.is-playing .cs-jukebox__screen {
	animation: cs-jb-pulse 1s ease-in-out infinite;
}

@keyframes cs-jb-pulse {
	0%, 100% { box-shadow: inset 0 0 0 4px var(--jb-chrome), 0 0 0 2px var(--jb-chrome-dark), 0 0 10px rgba(255, 79, 154, 0.25); }
	50% { box-shadow: inset 0 0 0 4px var(--jb-chrome), 0 0 0 2px var(--jb-chrome-dark), 0 0 34px rgba(255, 79, 154, 0.7); }
}

/* The record. */
.cs-jukebox__record {
	position: absolute;
	top: 50%;
	left: 50%;
	height: 88%;
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background:
		radial-gradient(circle, transparent 0 31%, rgba(255, 255, 255, 0.06) 31.5% 32%, transparent 32.5%),
		repeating-radial-gradient(circle, #111 0 2px, #1d1d1d 2px 3px),
		#111;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6), inset 0 0 0 2px #000;
}

.cs-jukebox__record::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: conic-gradient(from 30deg, transparent 0 20%, rgba(255, 255, 255, 0.1) 25%, transparent 30% 70%, rgba(255, 255, 255, 0.07) 75%, transparent 80%);
}

.cs-jukebox__label {
	--label-hue: 40;
	position: absolute;
	top: 50%;
	left: 50%;
	width: 36%;
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8%;
	border-radius: 50%;
	background-color: hsl(var(--label-hue), 70%, 50%);
	background-size: cover;
	background-position: center;
	color: #fff;
	text-align: center;
	font-size: clamp(0.55rem, 1.4vw, 0.85rem);
	font-weight: 700;
	line-height: 1.2;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
	z-index: 1;
}

.cs-jukebox__label::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 7%;
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: var(--jb-chrome);
}

.cs-jukebox__label.has-cover .cs-jukebox__label-title {
	display: none;
}

.cs-jukebox__label-title {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cs-jukebox.fx-spin.is-playing .cs-jukebox__record {
	animation: cs-jb-spin 1.8s linear infinite;
}

@keyframes cs-jb-spin {
	from { transform: translate(-50%, -50%) rotate(0deg); }
	to { transform: translate(-50%, -50%) rotate(360deg); }
}

.cs-jukebox.is-idle .cs-jukebox__record {
	opacity: 0.55;
}

/* Video. */
.cs-jukebox__video {
	position: absolute;
	inset: 4px;
	width: calc(100% - 8px);
	height: calc(100% - 8px);
	display: none;
	object-fit: contain;
	background: #000;
	border-radius: 10px;
}

.cs-jukebox.is-video .cs-jukebox__video {
	display: block;
}

.cs-jukebox.is-video .cs-jukebox__record {
	display: none;
}

.cs-jukebox__audio {
	display: none;
}

/* Poster (films). */
.cs-jukebox__poster {
	position: absolute;
	inset: 4px;
	display: none;
	background: center / cover no-repeat;
	border-radius: 10px;
}

.cs-jukebox--video .cs-jukebox__poster.has-image {
	display: block;
}

.cs-jukebox--video.is-idle .cs-jukebox__poster.has-image {
	filter: brightness(0.55) saturate(0.8);
}

/* ---- Picture effects ---- */

.cs-jukebox.fx-vignette .cs-jukebox__screen::before,
.cs-jukebox.fx-scanlines .cs-jukebox__screen::after {
	content: "";
	position: absolute;
	inset: 4px;
	border-radius: 10px;
	pointer-events: none;
	z-index: 3;
}

.cs-jukebox.fx-vignette .cs-jukebox__screen::before {
	background: radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.6) 100%);
}

.cs-jukebox.fx-scanlines .cs-jukebox__screen::after {
	background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
	mix-blend-mode: multiply;
}

.cs-jukebox__grain {
	position: absolute;
	inset: -50%;
	display: none;
	pointer-events: none;
	z-index: 3;
	opacity: 0.14;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cs-jukebox.fx-grain.is-playing .cs-jukebox__grain {
	display: block;
	animation: cs-jb-grain 0.9s steps(5) infinite;
}

@keyframes cs-jb-grain {
	0% { transform: translate(0, 0); }
	20% { transform: translate(-6%, 4%); }
	40% { transform: translate(5%, -7%); }
	60% { transform: translate(-3%, -5%); }
	80% { transform: translate(7%, 3%); }
	100% { transform: translate(0, 0); }
}

/* Projector flicker: a few dips in brightness at set moments of an 8-second cycle. */
.cs-jukebox.fx-flicker.is-playing .cs-jukebox__video,
.cs-jukebox.fx-flicker.is-playing .cs-jukebox__record {
	animation-name: cs-jb-flicker;
	animation-duration: 8s;
	animation-iteration-count: infinite;
}

.cs-jukebox.fx-flicker.fx-spin.is-playing .cs-jukebox__record {
	animation-name: cs-jb-spin, cs-jb-flicker;
	animation-duration: 1.8s, 8s;
	animation-timing-function: linear, ease;
}

@keyframes cs-jb-flicker {
	0%, 11%, 14%, 47%, 49%, 76%, 79%, 100% { filter: brightness(1); }
	12% { filter: brightness(0.82); }
	48% { filter: brightness(1.12); }
	77% { filter: brightness(0.86); }
}

/* Full screen keeps the effects, edge to edge. */
.cs-jukebox__screen:fullscreen {
	aspect-ratio: auto;
	width: 100%;
	height: 100%;
	border-radius: 0;
	background: #000;
}

.cs-jukebox__screen:fullscreen .cs-jukebox__video,
.cs-jukebox__screen:fullscreen .cs-jukebox__poster,
.cs-jukebox__screen:fullscreen::before,
.cs-jukebox__screen:fullscreen::after {
	inset: 0;
	width: 100%;
	height: 100%;
	border-radius: 0;
}

.cs-jukebox__full[hidden] {
	display: none;
}

.cs-jukebox__thumb {
	flex: none;
	width: 68px;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	background: #222;
	border-radius: 3px;
}

/* ---- The video jukebox: a picture house in a cabinet ---- */

.cs-jukebox--video {
	--jb-neon: #ffcf4a;
	--jb-neon-2: #ff5a5a;
}

.cs-jukebox--video .cs-jukebox__stage {
	grid-template-columns: 1fr;
}

.cs-jukebox--video .cs-jukebox__tube,
.cs-jukebox--video .cs-jukebox__record {
	display: none;
}

/* Theatre curtains while nothing is showing. */
.cs-jukebox--video .cs-jukebox__screen {
	background:
		radial-gradient(ellipse at 50% -10%, rgba(255, 220, 140, 0.35), transparent 60%),
		repeating-linear-gradient(90deg, #6d0f17 0 18px, #8f1621 18px 30px, #5a0b12 30px 44px);
}

.cs-jukebox--video.is-video .cs-jukebox__screen {
	background: #000;
}

.cs-jukebox--video .cs-jukebox__strip {
	min-height: 60px;
}

.cs-jukebox--video .cs-jukebox__strip-badge {
	display: none;
}

/* Sparkles. */
.cs-jukebox__sparkles {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 2;
}

.cs-jukebox__spark {
	position: absolute;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	background: radial-gradient(circle, #fff 0 18%, rgba(255, 255, 255, 0) 20%),
		linear-gradient(0deg, transparent 45%, #fff 48% 52%, transparent 55%),
		linear-gradient(90deg, transparent 45%, #fff 48% 52%, transparent 55%);
	filter: drop-shadow(0 0 4px var(--jb-neon-2));
	opacity: 0;
	animation: cs-jb-spark 1.2s ease-out forwards;
}

@keyframes cs-jb-spark {
	0% { opacity: 0; transform: scale(0.2) rotate(0deg); }
	30% { opacity: 1; transform: scale(1.2) rotate(45deg); }
	100% { opacity: 0; transform: scale(0.4) rotate(90deg); }
}

/* ---- Now playing ---- */

.cs-jukebox__now {
	padding: 12px 16px;
	color: var(--jb-ink);
	background: linear-gradient(180deg, var(--jb-chrome) 0%, #c7cfd8 100%);
	border-radius: 12px;
	box-shadow: inset 0 1px 0 #fff;
}

.cs-jukebox__np-heading {
	margin: 0 0 2px;
	font-size: 0.72em;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #b3122a;
}

.cs-jukebox__np-line {
	margin: 0;
	font-size: 1.15em;
	font-weight: 800;
}

.cs-jukebox__np-code {
	display: inline-block;
	margin-right: 0.5em;
	padding: 0 6px;
	color: #fff;
	background: #b3122a;
	border-radius: 4px;
}

.cs-jukebox__np-code:empty {
	display: none;
}

.cs-jukebox__np-artist {
	display: block;
	font-weight: 600;
	opacity: 0.8;
}

.cs-jukebox__np-credit {
	display: block;
	margin-top: 4px;
	font-size: 0.8em;
	opacity: 0.85;
}

.cs-jukebox__progress {
	height: 6px;
	margin: 10px 0 8px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.15);
	border-radius: 3px;
}

.cs-jukebox__progress-bar {
	display: block;
	width: 0;
	height: 100%;
	background: linear-gradient(90deg, var(--jb-neon), var(--jb-amber));
	transition: width 0.25s linear;
}

.cs-jukebox__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.cs-jukebox__time {
	margin-left: auto;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

.cs-jukebox__btn,
.cs-jukebox__key,
.cs-jukebox__page {
	min-height: 36px;
	padding: 6px 14px;
	font: inherit;
	font-weight: 800;
	color: #fff;
	cursor: pointer;
	background: linear-gradient(180deg, #e2334f 0%, #9e0f25 100%);
	border: 0;
	border-radius: 18px;
	box-shadow: 0 3px 0 #5e0715, inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.cs-jukebox__btn:active,
.cs-jukebox__key:active,
.cs-jukebox__page:active {
	transform: translateY(2px);
	box-shadow: 0 1px 0 #5e0715;
}

.cs-jukebox__btn:disabled,
.cs-jukebox__page:disabled {
	opacity: 0.45;
	cursor: default;
}

.cs-jukebox button:focus-visible,
.cs-jukebox summary:focus-visible,
.cs-jukebox a:focus-visible {
	outline: 3px solid var(--jb-neon-2);
	outline-offset: 2px;
}

/* ---- Selection wall and keypad ---- */

.cs-jukebox__panel {
	display: grid;
	grid-template-columns: 1fr 220px;
	gap: 14px;
	align-items: start;
}

.cs-jukebox__selector {
	padding: 12px;
	background: linear-gradient(180deg, var(--jb-chrome) 0%, #aeb8c4 100%);
	border-radius: 12px;
}

.cs-jukebox__wall-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
	color: var(--jb-ink);
	font-weight: 800;
	letter-spacing: 0.08em;
}

.cs-jukebox__wall {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px;
}

.cs-jukebox__strip {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 52px;
	padding: 6px 8px;
	font: inherit;
	text-align: left;
	color: var(--jb-ink);
	cursor: pointer;
	background:
		linear-gradient(180deg, #c8102e 0 3px, transparent 3px calc(100% - 3px), #1b4f9c calc(100% - 3px)),
		var(--jb-cream);
	border: 0;
	border-radius: 3px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.cs-jukebox__strip:hover,
.cs-jukebox__strip.is-current {
	background:
		linear-gradient(180deg, #c8102e 0 3px, transparent 3px calc(100% - 3px), #1b4f9c calc(100% - 3px)),
		#fff1b8;
}

.cs-jukebox__strip-code {
	flex: 0 0 auto;
	min-width: 2.6em;
	padding: 2px 4px;
	font-weight: 900;
	text-align: center;
	color: #fff;
	background: #1b4f9c;
	border-radius: 3px;
}

.cs-jukebox__strip.is-current .cs-jukebox__strip-code {
	background: #c8102e;
}

.cs-jukebox__strip-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.cs-jukebox__strip-title {
	overflow: hidden;
	font-weight: 800;
	white-space: nowrap;
	text-overflow: ellipsis;
	text-transform: uppercase;
	font-size: 0.82em;
}

.cs-jukebox__strip-artist {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: 0.75em;
	opacity: 0.75;
}

.cs-jukebox__strip-badge {
	margin-left: auto;
	padding: 1px 5px;
	font-size: 0.65em;
	font-weight: 800;
	color: #fff;
	text-transform: uppercase;
	background: #6b2bd9;
	border-radius: 3px;
}

.cs-jukebox__keypad {
	padding: 12px;
	color: var(--jb-ink);
	background: linear-gradient(180deg, var(--jb-chrome) 0%, #aeb8c4 100%);
	border-radius: 12px;
}

.cs-jukebox__keypad-title {
	margin: 0 0 6px;
	font-size: 0.72em;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.cs-jukebox__display {
	display: block;
	margin-bottom: 10px;
	padding: 6px 10px;
	font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	font-size: 1.6em;
	font-weight: 700;
	text-align: center;
	color: #ff6a4a;
	background: #1a0b06;
	border-radius: 6px;
	text-shadow: 0 0 6px #ff6a4a;
}

.cs-jukebox__keys {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 6px;
}

.cs-jukebox__key {
	min-height: 34px;
	padding: 4px;
	border-radius: 8px;
}

.cs-jukebox__key--letter {
	background: linear-gradient(180deg, #3b74d1 0%, #1b4f9c 100%);
	box-shadow: 0 3px 0 #0d2b58, inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.cs-jukebox__key--wide {
	grid-column: span 5;
}

.cs-jukebox__key--enter {
	background: linear-gradient(180deg, #2fb36b 0%, #1a7a45 100%);
	box-shadow: 0 3px 0 #0e4727, inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ---- Queue ---- */

.cs-jukebox__queue {
	padding: 10px 16px;
	color: var(--jb-ink);
	background: var(--jb-cream);
	border-radius: 12px;
}

.cs-jukebox__queue-heading {
	margin: 0 0 6px;
	font-size: 0.72em;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #1b4f9c;
}

.cs-jukebox__queue-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cs-jukebox__queue-list li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	border-top: 1px dashed rgba(42, 26, 16, 0.2);
}

.cs-jukebox__queue-list li:first-child {
	border-top: 0;
}

.cs-jukebox__queue-code {
	min-width: 2.6em;
	font-weight: 900;
	color: #b3122a;
}

.cs-jukebox__queue-title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.cs-jukebox__queue-remove {
	width: 28px;
	height: 28px;
	font-size: 1.1em;
	line-height: 1;
	color: var(--jb-ink);
	cursor: pointer;
	background: transparent;
	border: 1px solid rgba(42, 26, 16, 0.3);
	border-radius: 50%;
}

.cs-jukebox__queue-empty {
	font-style: italic;
	opacity: 0.7;
}

.cs-jukebox__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.cs-jukebox__admin-note {
	margin: 0 0 12px;
	padding: 10px 14px;
	font-size: 0.9em;
	color: var(--jb-ink);
	background: #fff8c5;
	border: 2px dashed #b38600;
	border-radius: 8px;
}

.cs-jukebox__admin-note a {
	color: #1b4f9c;
	font-weight: 700;
}

.cs-jukebox__badge {
	padding: 1px 6px;
	font-size: 0.65em;
	font-weight: 800;
	color: #fff;
	text-transform: uppercase;
	background: #1b4f9c;
	border-radius: 3px;
}

.cs-jukebox__letters {
	display: contents;
}

.cs-jukebox__panel.is-search-only {
	grid-template-columns: minmax(0, 1fr);
}

/* ---- Online search ---- */

.cs-jukebox__search-hint {
	margin: 6px 0 0;
	font-size: 0.78em;
	opacity: 0.8;
}

.cs-jukebox__shelves {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
}

.cs-jukebox__shelves[hidden] {
	display: none;
}

.cs-jukebox__shelves-label {
	margin-right: 2px;
	font-size: 0.72em;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #1b4f9c;
}

.cs-jukebox__shelf {
	min-height: 32px;
	padding: 4px 12px;
	font: inherit;
	font-size: 0.85em;
	font-weight: 700;
	color: var(--jb-ink);
	cursor: pointer;
	background: var(--jb-cream);
	border: 2px solid #1b4f9c;
	border-radius: 16px;
}

.cs-jukebox__shelf[aria-pressed="true"] {
	color: #fff;
	background: #1b4f9c;
}

.cs-jukebox__shelf:focus-visible {
	outline: 3px solid var(--jb-neon-2);
	outline-offset: 2px;
}

.cs-jukebox__search {
	margin-bottom: 14px;
	padding: 12px 16px;
	color: var(--jb-ink);
	background: linear-gradient(180deg, var(--jb-chrome) 0%, #c7cfd8 100%);
	border-radius: 12px;
}

.cs-jukebox__search-heading {
	margin: 0 0 6px;
	font-size: 0.72em;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #b3122a;
}

.cs-jukebox__search-label {
	display: block;
	margin-bottom: 4px;
	font-weight: 700;
}

.cs-jukebox__search-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.cs-jukebox__search-input,
.cs-jukebox__search-source {
	min-height: 36px;
	padding: 4px 10px;
	font: inherit;
	color: var(--jb-ink);
	background: #fff;
	border: 2px solid var(--jb-chrome-dark);
	border-radius: 8px;
}

.cs-jukebox__search-input {
	flex: 1 1 14em;
	min-width: 0;
}

.cs-jukebox__search-source {
	flex: 0 1 auto;
	max-width: 100%;
}

.cs-jukebox__search-input:focus-visible,
.cs-jukebox__search-source:focus-visible {
	outline: 3px solid var(--jb-neon-2);
	outline-offset: 1px;
}

.cs-jukebox__search-status {
	margin: 8px 0 4px;
	font-size: 0.9em;
	font-weight: 700;
}

.cs-jukebox__search-status:empty {
	display: none;
}

.cs-jukebox__results {
	max-height: 32em;
	margin: 0;
	padding: 0 4px 4px 0;
	overflow-y: auto;
	list-style: none;
	overscroll-behavior: contain;
}

.cs-jukebox__result {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 6px;
	padding: 8px;
	background:
		linear-gradient(180deg, #c8102e 0 3px, transparent 3px calc(100% - 3px), #1b4f9c calc(100% - 3px)),
		var(--jb-cream);
	border-radius: 3px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.cs-jukebox__result-text {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.cs-jukebox__result-title {
	font-weight: 800;
	overflow-wrap: anywhere;
}

.cs-jukebox__result-meta {
	font-size: 0.8em;
	opacity: 0.8;
}

.cs-jukebox__result-credit {
	font-size: 0.75em;
	opacity: 0.75;
	overflow-wrap: anywhere;
}

.cs-jukebox__result-credit a {
	color: inherit;
}

.cs-jukebox__result-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: flex-end;
}

.cs-jukebox__btn--quiet {
	color: var(--jb-ink);
	background: linear-gradient(180deg, #fff 0%, #dde3ea 100%);
	box-shadow: 0 3px 0 var(--jb-chrome-dark), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.cs-jukebox__more {
	display: block;
	margin: 10px auto 0;
}

.cs-jukebox__more[hidden] {
	display: none;
}

.cs-jukebox__search-note {
	margin: 10px 0 0;
	font-size: 0.75em;
	opacity: 0.75;
}

/* ---- Tabs: selections, search and the queue share one panel ---- */

.cs-jukebox__side-inner {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.cs-jukebox__tabs {
	display: flex;
	gap: 4px;
	padding: 0 6px;
}

.cs-jukebox__tab {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 6px 14px;
	font: inherit;
	font-size: 0.85em;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--jb-cream);
	cursor: pointer;
	background: rgba(0, 0, 0, 0.28);
	border: 2px solid rgba(255, 255, 255, 0.18);
	border-bottom: 0;
	border-radius: 10px 10px 0 0;
}

.cs-jukebox__tab[aria-selected="true"] {
	color: var(--jb-ink);
	background: var(--jb-chrome);
	border-color: var(--jb-chrome);
}

.cs-jukebox__tab:focus-visible {
	outline: 3px solid var(--jb-neon-2);
	outline-offset: -3px;
}

.cs-jukebox__tab-count:empty {
	display: none;
}

.cs-jukebox__tab-count {
	min-width: 1.6em;
	padding: 0 6px;
	font-size: 0.85em;
	line-height: 1.6em;
	text-align: center;
	color: #fff;
	background: #b3122a;
	border-radius: 0.8em;
}

.cs-jukebox__tab.is-bumped .cs-jukebox__tab-count {
	animation: cs-jb-bump 0.6s ease-out;
}

@keyframes cs-jb-bump {
	0% { transform: scale(1); }
	40% { transform: scale(1.5); }
	100% { transform: scale(1); }
}

.cs-jukebox__tabpanel {
	padding: 10px;
	background: var(--jb-chrome);
	border-radius: 0 12px 12px 12px;
}

.cs-jukebox__tabpanel[hidden] {
	display: none;
}

/* Panels inside the tab sheet drop their own frames. */
.cs-jukebox__tabpanel > .cs-jukebox__search,
.cs-jukebox__tabpanel > .cs-jukebox__queue {
	margin: 0;
	background: transparent;
	padding: 4px 6px;
}

.cs-jukebox__tabpanel > .cs-jukebox__queue {
	background: var(--jb-cream);
	border-radius: 10px;
	padding: 10px 14px;
}

.cs-jukebox__main {
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
}

/* ---- Landscape: computer screens ---- */

@container jukebox (min-width: 860px) {
	.cs-jukebox__arch {
		padding: 18px 40px 8px;
	}

	.cs-jukebox__bulbs {
		margin-bottom: 6px;
	}

	.cs-jukebox__name {
		font-size: clamp(1.4rem, 2.6cqi, 2.2rem);
	}

	/* Screen and controls on the left, the tabs on the right, side by side. */
	.cs-jukebox__body {
		grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr);
		align-items: stretch;
	}

	/* The picture is as big as the window's height allows, so the whole
	   jukebox fits on one screen. */
	.cs-jukebox__screen {
		justify-self: center;
		width: min(100%, max(360px, calc((100vh - 340px) * 16 / 9)));
		width: min(100%, max(360px, calc((100svh - 340px) * 16 / 9)));
	}

	.cs-jukebox__tube {
		max-height: calc(100svh - 340px);
	}

	/* The tab sheet is exactly as tall as the screen side and scrolls inside. */
	.cs-jukebox__side {
		position: relative;
		min-height: 440px;
	}

	.cs-jukebox__side-inner {
		position: absolute;
		inset: 0;
	}

	.cs-jukebox__tabpanel {
		flex: 1;
		min-height: 0;
		overflow: auto;
		overscroll-behavior: contain;
	}

	.cs-jukebox__panel {
		grid-template-columns: minmax(0, 1fr) 176px;
	}

	.cs-jukebox__panel.is-search-only {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Two columns of compact strips: a whole page of ten without scrolling. */
	.cs-jukebox__wall {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 5px;
	}

	.cs-jukebox__strip {
		position: relative;
		min-height: 44px;
		padding: 4px 6px;
		font-size: 0.95rem;
	}

	/* The video tag moves to the strip's corner, leaving room for the title. */
	.cs-jukebox__strip-badge {
		position: absolute;
		right: 3px;
		bottom: 5px;
		padding: 0 4px;
		font-size: 0.55em;
	}

	.cs-jukebox--video .cs-jukebox__strip {
		min-height: 48px;
	}

	/* With a poster, the code sits on the poster's corner to leave room for the title. */
	.cs-jukebox__strip:has(.cs-jukebox__thumb) {
		position: relative;
	}

	.cs-jukebox__strip:has(.cs-jukebox__thumb) .cs-jukebox__strip-code {
		position: absolute;
		top: 3px;
		left: 3px;
		min-width: 0;
		padding: 0 4px;
		font-size: 0.72em;
		z-index: 1;
	}

	.cs-jukebox__strip-title {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		white-space: normal;
		line-height: 1.15;
	}

	.cs-jukebox__thumb {
		width: 52px;
	}

	.cs-jukebox__wall-nav {
		margin-bottom: 6px;
	}

	.cs-jukebox__selector,
	.cs-jukebox__keypad {
		padding: 8px;
	}

	.cs-jukebox__results {
		max-height: none;
		overflow: visible;
	}

	/* Compact result rows, so a good handful show at once. */
	.cs-jukebox__result {
		gap: 8px;
		margin-top: 5px;
		padding: 5px 8px;
	}

	.cs-jukebox__result-title {
		font-size: 0.92em;
		line-height: 1.2;
	}

	.cs-jukebox__result-meta,
	.cs-jukebox__result-credit {
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.cs-jukebox__result-actions {
		flex-direction: column;
		flex-wrap: nowrap;
		gap: 4px;
	}

	.cs-jukebox__result-actions .cs-jukebox__btn {
		min-height: 28px;
		padding: 2px 10px;
		font-size: 0.78em;
		border-radius: 14px;
	}

	.cs-jukebox__search-hint {
		display: none;
	}
}

/* ---- Narrow screens ---- */

@media (max-width: 720px) {
	.cs-jukebox {
		border-radius: 90px 90px var(--jb-radius) var(--jb-radius);
		padding: 0 10px 12px;
	}

	.cs-jukebox__arch {
		padding: 24px 24px 10px;
	}

	.cs-jukebox__stage {
		grid-template-columns: 1fr;
	}

	.cs-jukebox__tube {
		display: none;
	}

	.cs-jukebox__bulbs {
		flex-wrap: nowrap;
		gap: 6px;
		overflow: hidden;
	}

	.cs-jukebox__bulbs span {
		flex: none;
		width: 9px;
		height: 9px;
	}

	.cs-jukebox__bulbs span:nth-child(n+13) {
		display: none;
	}

	.cs-jukebox__panel {
		grid-template-columns: 1fr;
	}

	.cs-jukebox__wall {
		grid-template-columns: 1fr;
	}

	.cs-jukebox__result {
		flex-wrap: wrap;
	}

	.cs-jukebox__result-actions {
		flex-basis: 100%;
	}

	.cs-jukebox__tabs {
		padding: 0;
	}

	.cs-jukebox__tab {
		flex: 1;
		justify-content: center;
		padding: 6px 6px;
		font-size: 0.72em;
		letter-spacing: 0.02em;
		white-space: nowrap;
	}
}

/* ---- Less motion: a still jukebox ---- */

@media (prefers-reduced-motion: reduce) {
	.cs-jukebox *,
	.cs-jukebox *::before,
	.cs-jukebox *::after {
		animation: none !important;
		transition: none !important;
	}

	.cs-jukebox__sparkles {
		display: none;
	}
}
