:root {
	--bg: #0a0a0a;
	--fg: #ffffff;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
	margin: 0;
	height: 100%;
	height: 100svh;
	overflow: hidden;
	background: var(--boot-list, var(--bg));
	color: var(--fg);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	overscroll-behavior: none;
}

/* First paint: keep the last visit colour. No navy→teal blend on refresh.
   Player must still be able to slide in. */
html.is-booting,
html.is-booting body {
	transition: none !important;
}
html.is-booting .player {
	transition: transform var(--slide-ms) var(--slide-ease) !important;
}

.screen {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 100%;
	height: 100svh;
	max-height: 100svh;
}

/* ---------- Station list ---------- */

.list {
	display: flex;
	flex-direction: column;
	z-index: 1;
}

.band {
	flex: 1 1 0;
	min-height: 0;
	display: grid;
	grid-template-columns: minmax(4.8rem, auto) minmax(0, 1fr);
	align-items: center;
	column-gap: clamp(10px, 2.5vw, 28px);
	padding:
		0
		max(16px, env(safe-area-inset-right, 0px), clamp(16px, 5vw, 64px))
		0
		max(16px, env(safe-area-inset-left, 0px), clamp(16px, 5vw, 64px));
	background: var(--band-bg);
	color: var(--band-fg);
	border: 0;
	width: 100%;
	text-align: left;
	cursor: pointer;
	font-family: inherit;
	outline: none;
	-webkit-tap-highlight-color: transparent;
	transition: transform .18s ease, filter .18s ease;
	transform-origin: center;
	opacity: 0;
	animation: bandIn .45s ease forwards;
	animation-delay: var(--delay, 0ms);
}
.band.is-boot {
	opacity: 1;
	animation: none;
}

@keyframes bandIn {
	from { opacity: 0; transform: translateY(26px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Desktop hover = ascetic effect; mobile press */
@media (hover: hover) {
	.band:hover { filter: brightness(1.06); transform: scale(1.012); }
}
.band:active { transform: scale(.985); filter: brightness(.97); }

.band__name {
	grid-column: 1;
	font-size: clamp(28px, 8.5vw, 84px);
	font-weight: 900;
	letter-spacing: -0.02em;
	line-height: 1;
	min-width: 0;
	white-space: nowrap;
}

.band__genre {
	grid-column: 2;
	justify-self: end;
	font-size: clamp(9px, 1.25vw, 13px);
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1.35;
	text-align: right;
	max-width: 100%;
	min-width: 0;
	overflow-wrap: anywhere;
	hyphens: auto;
	transition: opacity .25s ease, filter .25s ease, color .25s ease;
}

/* List share removed — share lives in the player only */
.band__share {
	display: none !important;
}

/* Phone / narrow */
@media (max-width: 767.98px) {
	.band {
		grid-template-columns: minmax(4.2rem, 22%) minmax(0, 1fr);
		column-gap: 10px;
		padding-left: max(14px, env(safe-area-inset-left, 0px));
		padding-right: max(14px, env(safe-area-inset-right, 0px));
	}
	.band__name {
		font-size: clamp(26px, 8vw, 36px);
	}
	.band__genre {
		font-size: 9px;
		letter-spacing: 0.07em;
		line-height: 1.3;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
	}
	.weather-chip {
		padding-left: max(14px, env(safe-area-inset-left, 0px));
		padding-right: max(44px, calc(env(safe-area-inset-right, 0px) + 40px));
		font-size: 8px;
		letter-spacing: 0.1em;
		text-align: left;
	}
	.cornerbtn {
		right: max(10px, env(safe-area-inset-right, 0px));
	}
}

/* Very narrow phones */
@media (max-width: 360px) {
	.band {
		grid-template-columns: minmax(3.6rem, 24%) minmax(0, 1fr);
		column-gap: 8px;
	}
	.band__name { font-size: 24px; }
	.band__genre { font-size: 8px; letter-spacing: 0.05em; }
}

/* Every station keeps its colour: the live one is marked, not the rest muted. */
.band { position: relative; }

/* Tuner bar on the leading edge of the live station. */
.band::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 7px;
	background: currentColor;
	opacity: 0;
	pointer-events: none;
	z-index: 1;
}

.list.has-live .band.is-live::before { opacity: 1; }

/* The live band also claims a bit more height — hierarchy without dimming. */
.list.has-live .band.is-live {
	flex-grow: 1.3;
	z-index: 2;
}

/* ---------- Player ---------- */

.player {
	--slide-ease: cubic-bezier(0.2, 0.9, 0.2, 1);
	--slide-ms: 320ms;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--fg);
	padding:
		max(12px, env(safe-area-inset-top))
		max(20px, env(safe-area-inset-right))
		max(16px, env(safe-area-inset-bottom))
		max(20px, env(safe-area-inset-left));
	z-index: 20;
	transform: translate3d(100%, 0, 0);
	/* Do not transition background/color: iOS freezes var(--bg) on a composited layer. */
	transition: transform var(--slide-ms) var(--slide-ease);
	pointer-events: none;
	visibility: hidden;
}

.player.is-visible {
	visibility: visible;
}

.player.is-open {
	transform: translate3d(0, 0, 0);
	pointer-events: auto;
}

.player.is-instant {
	transition: none !important;
}

.player.is-open:not(.is-leaving) .player__header,
.player.is-open:not(.is-leaving) .player__center,
.player.is-open:not(.is-leaving) .player__footer {
	animation: playerMorphIn .32s var(--slide-ease) both;
}

.player.is-open:not(.is-leaving) .player__center { animation-delay: 40ms; }
.player.is-open:not(.is-leaving) .player__footer { animation-delay: 70ms; }

.player.is-leaving .player__header,
.player.is-leaving .player__center,
.player.is-leaving .player__footer {
	animation: playerMorphOut .28s var(--slide-ease) both;
}

.player.is-leaving .player__center { animation-delay: 20ms; }
.player.is-leaving .player__footer { animation-delay: 40ms; }

@keyframes playerMorphIn {
	from { opacity: 0; transform: translateX(22px); filter: blur(1.5px); }
	to   { opacity: 1; transform: none; filter: none; }
}

@keyframes playerMorphOut {
	from { opacity: 1; transform: none; filter: none; }
	to   { opacity: 0; transform: translateX(18px); filter: blur(1.5px); }
}

.player__header {
	--back-size: 30px;
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	padding-top: 4px;
	min-height: var(--back-size);
}

.backbtn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
	height: var(--back-size);
	line-height: 0;
}
.backbtn:active { opacity: .75; }
.backbtn:active .iconbtn { transform: scale(.92); }

.iconbtn {
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	padding: 0;
	margin: 0;
	width: var(--back-size);
	height: var(--back-size);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 var(--back-size);
	line-height: 0;
	overflow: visible;
	transition: transform .15s ease, opacity .15s ease;
}
.iconbtn:focus,
.iconbtn:focus-visible {
	outline: none;
}
.iconbtn svg {
	width: var(--back-size);
	height: var(--back-size);
	display: block;
	flex-shrink: 0;
}

.player__wordmark {
	font-weight: 900;
	letter-spacing: 0.06em;
	font-size: var(--back-size);
	line-height: 1;
	height: var(--back-size);
	display: inline-flex;
	align-items: center;
	/* optical center vs chevron stroke */
	transform: translateY(0.5px);
}

.player__center {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0;
	text-align: center;
	width: 100%;
}

.player__cover {
	width: min(42vw, 220px);
	height: min(42vw, 220px);
	object-fit: cover;
	margin: 0 0 18px;
	border: 1px solid currentColor;
	opacity: 0.96;
	flex-shrink: 0;
	background: transparent;
	transition: border-color .25s ease;
}
.player__cover.is-empty {
	opacity: 0;
	visibility: hidden;
	border-color: transparent;
	transition: none;
	/* Native broken-image glyph must never show through. */
	object-position: -9999px;
}
@media (min-width: 768px) {
	.player__cover {
		width: min(28vw, 260px);
		height: min(28vw, 260px);
		margin-bottom: 22px;
	}
}

/* Mobile-first: title + rule share one centered box (rule = text width) */
.player__titleblock {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: fit-content;
	max-width: min(88vw, 34ch);
	margin: 0 auto;
}
.player__titleblock:not(.has-track) .player__rule {
	opacity: 0;
}

.player__track {
	font-size: clamp(20px, 5.2vw, 28px);
	font-weight: 800;
	line-height: 1.25;
	margin: 0;
	padding: 0 0 16px;
	max-width: min(88vw, 34ch);
	min-height: calc(1.25em * 2);
	text-align: center;
	transition: opacity .3s ease;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.player__rule {
	width: 100%;
	height: 1.5px;
	background: currentColor;
	opacity: .9;
	margin: 0 0 40px;
	flex: 0 0 auto;
}

/*
 * HARD LIMIT — WEB ONLY (min-width 768px).
 * Short titles stay one line (fit-content); long ones wrap at max line width.
 * Rule still matches the title block width.
 */
@media (min-width: 768px) {
	.player__titleblock {
		max-width: min(92vw, 1100px);
	}

	.player__track {
		white-space: normal;
		max-width: min(92vw, 1100px);
		font-size: clamp(22px, 2.2vw, 30px);
		padding-bottom: 22px;
		overflow-wrap: anywhere;
		word-break: break-word;
	}

	.player__rule {
		margin-bottom: 52px;
	}
}

.playbtn {
	flex: 0 0 auto;
	width: 96px;
	height: 96px;
	border-radius: 50%;
	border: 2px solid currentColor;
	background: none;
	color: inherit;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s ease;
}
.playbtn:active { transform: scale(.96); }
.playbtn.playing #playIcon { animation: none; }

@keyframes pulse {
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.08); }
}

.player__footer {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex: 0 0 auto;
	min-height: 44px;
	padding-bottom: max(4px, env(safe-area-inset-bottom));
	width: 100%;
	text-align: center;
}

.player__listeners {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	opacity: .75;
	/* reserve one line always — avoid genre jump on start/stop */
	min-height: 1.2em;
	line-height: 1.2;
	height: 1.2em;
	overflow: hidden;
	font-variant-numeric: tabular-nums;
}

.player__genre {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.2em;
	opacity: .85;
	text-align: center;
	max-width: 90%;
	line-height: 1.5;
}

/* ---------- Apps download ---------- */

/* Thin strip under the last station — always the lowest row on the list. */
.appsbar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 26px;
	height: auto;
	padding:
		8px 12px
		max(8px, env(safe-area-inset-bottom));
	margin: 0;
	border: 0;
	border-top: 1px solid rgba(198, 240, 0, 0.4);
	/* distinct from DNB red — soft charcoal + lime light */
	background: #121212;
	color: #C6F000;
	font: inherit;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	cursor: pointer;
	outline: none;
	-webkit-tap-highlight-color: transparent;
	opacity: 0;
	animation: bandIn .45s ease forwards;
	animation-delay: 320ms;
	text-shadow:
		0 0 10px rgba(198, 240, 0, 0.35),
		0 0 22px rgba(198, 240, 0, 0.12);
	transition: filter .18s ease, color .18s ease, text-shadow .18s ease;
}
.appsbar:hover {
	filter: brightness(1.12);
	color: #D4FF33;
	text-shadow:
		0 0 14px rgba(198, 240, 0, 0.55),
		0 0 28px rgba(198, 240, 0, 0.2);
}
.appsbar:active { filter: brightness(0.95); }
.appsbar:focus,
.appsbar:focus-visible {
	outline: none;
	box-shadow: none;
}

.apps-modal[hidden] { display: none !important; }

.apps-modal {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: grid;
	place-items: center;
	padding: 20px;
}

.apps-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.62);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	animation: appsFade .22s ease;
}

.apps-modal__panel {
	position: relative;
	width: min(400px, 100%);
	background: #0A0A0A;
	color: #F3ECD9;
	padding: 28px 24px 24px;
	border: 1px solid rgba(243, 236, 217, 0.14);
	border-radius: 16px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
	animation: appsIn .28s ease;
}

.apps-modal__x {
	position: absolute;
	top: 10px;
	right: 12px;
	border: 0;
	background: none;
	color: inherit;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.55;
	padding: 4px 8px;
	outline: none;
}
.apps-modal__x:hover { opacity: 1; }

.apps-modal__eyebrow {
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.22em;
	color: #C6F000;
}

.apps-modal__title {
	margin: 0;
	font-size: 28px;
	font-weight: 900;
	letter-spacing: 0.02em;
}

.apps-modal__sub {
	margin: 8px 0 22px;
	font-size: 13px;
	opacity: 0.65;
}

.apps-modal__list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.apps-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 13px 16px;
	text-decoration: none;
	color: inherit;
	border: 1px solid rgba(243, 236, 217, 0.14);
	border-radius: 10px;
	background: rgba(243, 236, 217, 0.025);
	transition: background .16s ease, border-color .16s ease, transform .16s ease;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}
.apps-row:focus,
.apps-row:focus-visible {
	outline: none;
}
.apps-row:hover {
	background: rgba(198, 240, 0, 0.09);
	border-color: rgba(198, 240, 0, 0.5);
	transform: translateY(-1px);
}
.apps-row--soon {
	opacity: 0.4;
	cursor: default;
}
.apps-row--soon:hover {
	background: rgba(243, 236, 217, 0.025);
	border-color: rgba(243, 236, 217, 0.14);
	transform: none;
}

.apps-row__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.apps-row__name {
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1;
}
.apps-row__meta {
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.13em;
	opacity: 0.5;
	text-transform: uppercase;
	white-space: nowrap;
	line-height: 1;
}
.apps-row__arrow {
	flex-shrink: 0;
	font-size: 18px;
	line-height: 1;
	opacity: 0.35;
	transition: transform .16s ease, opacity .16s ease, color .16s ease;
}
.apps-row:hover .apps-row__arrow {
	opacity: 1;
	color: #C6F000;
	transform: translateY(2px);
}

.apps-cli {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid rgba(243, 236, 217, 0.12);
}
.apps-cli__label {
	margin: 0 0 4px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: #C6F000;
}
.apps-cli__hint {
	margin: 0 0 10px;
	font-size: 12px;
	line-height: 1.35;
	opacity: 0.55;
}
.apps-cli__cmd {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
	width: 100%;
	margin: 0 0 8px;
	padding: 12px 14px;
	border: 1px solid rgba(243, 236, 217, 0.14);
	border-radius: 10px;
	background: rgba(243, 236, 217, 0.025);
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: background .16s ease, border-color .16s ease, transform .16s ease;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}
.apps-cli__cmd:focus,
.apps-cli__cmd:focus-visible {
	outline: none;
}
.apps-cli__cmd:last-child { margin-bottom: 0; }
.apps-cli__cmd:hover {
	background: rgba(198, 240, 0, 0.09);
	border-color: rgba(198, 240, 0, 0.5);
	transform: translateY(-1px);
}
.apps-cli__os {
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	opacity: 0.5;
	line-height: 1;
}
.apps-cli__code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	line-height: 1.4;
	white-space: pre-wrap;
	word-break: break-word;
	color: #C6F000;
}
.apps-cli__go {
	align-self: flex-end;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	opacity: 0.45;
	line-height: 1;
}
.apps-cli__cmd:hover .apps-cli__go,
.apps-cli__cmd.is-copied .apps-cli__go {
	opacity: 1;
	color: #C6F000;
}

/*
 * HARD LIMIT — MOBILE WEB ONLY (max-width 767px).
 * Get App: only Android (APK) + iOS (soon). No Windows/macOS/CLI.
 * Version stays visible for the mobile (APK) build.
 */
@media (max-width: 767.98px) {
	.apps-row--desktop-only { display: none !important; }
}


@keyframes appsFade {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes appsIn {
	from { opacity: 0; transform: translateY(12px) scale(.98); }
	to { opacity: 1; transform: none; }
}

/* ---------- Settings entry (sits in weather strip; floats on first band if no weather) ---------- */

.cornerbtn {
	position: absolute;
	top: 50%;
	right: max(12px, env(safe-area-inset-right));
	z-index: 7;
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, 0.3);
	background: rgba(0, 0, 0, 0.35);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	color: #f3ecd9;
	cursor: pointer;
	opacity: 0;
	transform: translateY(-50%);
	animation: cornerIn .45s ease forwards;
	animation-delay: 340ms;
	transition: background .14s ease, transform .14s ease;
}
.cornerbtn:hover { background: rgba(0, 0, 0, 0.55); }
.cornerbtn:active { transform: translateY(-50%) scale(.92); }

@keyframes cornerIn {
	from { opacity: 0; transform: translateY(-50%) scale(0.92); }
	to   { opacity: 1; transform: translateY(-50%); }
}

/* Weather ticker at the top; GET APP stays in-flow at the bottom of the list */
.list-head {
	position: relative;
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	z-index: 6;
	order: -1;
	min-height: 0;
}

.list-foot {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	width: 100%;
	z-index: 6;
	/* When mini is open, leave a slot above GET APP for the fixed player strip. */
	transition: margin-top .26s cubic-bezier(0.2, 0.9, 0.2, 1);
}
.list.has-mini .list-foot {
	margin-top: 56px;
}

.weather-chip {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	box-sizing: border-box;
	min-height: 36px;
	padding:
		max(8px, env(safe-area-inset-top))
		48px
		8px
		14px;
	margin: 0;
	border: 0;
	background: #121212;
	color: #C6F000;
	font: inherit;
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
	opacity: 0;
	animation: bandIn .45s ease forwards;
	animation-delay: 80ms;
	text-shadow:
		0 0 10px rgba(198, 240, 0, 0.28),
		0 0 20px rgba(198, 240, 0, 0.1);
}
.weather-chip[hidden] { display: none !important; }

/* No weather line: collapse head, keep settings floating over first band */
.list-head:not(:has(.weather-chip:not([hidden]))) {
	height: 0;
	min-height: 0;
	overflow: visible;
	background: transparent;
}
.list-head:not(:has(.weather-chip:not([hidden]))) .cornerbtn {
	top: max(10px, env(safe-area-inset-top));
	transform: none;
	animation-name: bandIn;
}
.list-head:not(:has(.weather-chip:not([hidden]))) .cornerbtn:active {
	transform: scale(.92);
}

/* ---------- Player tools (volume + repaint) ---------- */

.player__tools {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 6px;
	overflow: visible;
}

.player__tool {
	opacity: 0.65;
	transition: opacity .15s ease, transform .15s ease, filter .15s ease, color .15s ease;
	overflow: visible;
}
.player__tool:hover { opacity: 1; }
.player__tool:active { transform: scale(.9); }
.player__tool svg { width: auto; height: auto; }
.player__tool.is-spinning svg { animation: repaintSpin .5s ease; }
.player__tool.is-flash {
	opacity: 1;
	background: color-mix(in srgb, currentColor 18%, transparent);
}
.player__tool.is-on {
	opacity: 1;
}
#pCoverMatch.is-on {
	opacity: 1;
}

.player__tool .tool-strike {
	opacity: 0;
}
.player__tool.is-struck .tool-strike {
	opacity: 1;
}
.player__tool.is-struck {
	opacity: 0.4;
}
.player__tool.is-struck:hover {
	opacity: 0.7;
}

/* Padlock: shackle hinged on the left, swings open to the other side. */
#pShareNodl {
	overflow: visible;
}
#pShareNodl .lock-icon {
	overflow: visible;
}
#pShareNodl .lock-shackle {
	transform-box: view-box;
	transform-origin: 8px 11px;
	transition: transform .42s cubic-bezier(0.22, 1.45, 0.36, 1);
}
#pShareNodl:not(.is-on) .lock-shackle {
	transform: rotate(-128deg);
}
#pShareNodl.lock-snap .lock-shackle {
	transition: none;
}

/* Video mode is built, but the entry button is off on prod for now. */
#pVisual { display: none !important; }

@keyframes repaintSpin {
	from { transform: rotate(0); }
	to   { transform: rotate(360deg); }
}

.vol-mute { display: none; }
.is-muted .vol-waves { display: none; }
.is-muted .vol-mute { display: block; }

/* ---------- Volume popover ---------- */

.volpop {
	position: fixed;
	z-index: 8000;
	width: 96px;
	height: 184px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 14px 0 16px;
	background: #0a0a0a;
	color: #f3ecd9;
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
	opacity: 0;
	transform: translateY(-6px) scale(0.98);
	transition: opacity .14s ease, transform .16s cubic-bezier(0.2, 0.9, 0.2, 1);
	user-select: none;
	-webkit-user-select: none;
}
.volpop.is-open { opacity: 1; transform: none; }

.volpop__value {
	font-size: 30px;
	font-weight: 900;
	letter-spacing: -0.03em;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.volpop__label {
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 0.18em;
	opacity: 0.5;
}

.volpop__track {
	position: relative;
	flex: 1 1 auto;
	width: 48px;
	cursor: ns-resize;
	outline: none;
	touch-action: none;
}

.volpop__track::before {
	content: "";
	position: absolute;
	left: 19px;
	width: 10px;
	top: 0;
	bottom: 0;
	background: rgba(243, 236, 217, 0.2);
}

.volpop__fill {
	position: absolute;
	left: 19px;
	width: 10px;
	bottom: 0;
	height: 100%;
	background: currentColor;
}

.volpop__fill::after {
	content: "";
	position: absolute;
	left: -7px;
	right: -7px;
	top: -3px;
	height: 6px;
	background: currentColor;
}


/* ---------- Mini bar (fixed just above in-flow GET APP) ---------- */

.minibar {
	position: fixed;
	left: 0;
	right: 0;
	/* Measured from #appsBtn so the strip sits flush above GET APP. */
	bottom: var(--apps-dock-h, 42px);
	z-index: 30;
	display: flex;
	align-items: center;
	gap: 2px;
	height: 56px;
	padding:
		0 max(6px, env(safe-area-inset-right))
		0
		max(6px, env(safe-area-inset-left));
	background: var(--mini-bg, #0a0a0a);
	color: var(--mini-fg, #f3ecd9);
	/* Thin, clearly visible hairline — player vs stations. */
	border-top: 1px solid rgba(243, 236, 217, 0.9);
	box-shadow:
		0 -1px 0 rgba(0, 0, 0, 0.55),
		0 -6px 18px rgba(0, 0, 0, 0.25);
	transform: translateY(calc(100% + var(--apps-dock-h, 42px)));
	transition: transform .26s cubic-bezier(0.2, 0.9, 0.2, 1),
		bottom .2s ease;
}
.minibar.is-open { transform: none; }

.minibar__nav,
.minibar__action {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
	opacity: 0.85;
	transition: opacity .12s ease, transform .12s ease;
}
.minibar__nav:hover,
.minibar__action:hover { opacity: 1; }
.minibar__nav:active,
.minibar__action:active { transform: scale(.9); }

.minibar__body {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 8px;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	overflow: hidden;
}
.minibar__cover {
	width: 36px;
	height: 36px;
	object-fit: cover;
	flex: 0 0 36px;
	border: 1px solid currentColor;
	opacity: 0.95;
}

.minibar__name {
	display: block;
	max-width: 100%;
	font-size: 17px;
	font-weight: 900;
	letter-spacing: 0.02em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Long track titles scroll instead of being cut in half. */
.minibar__name.is-marquee {
	text-overflow: clip;
	-webkit-mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
	mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
}
.minibar__name.is-marquee > span {
	display: inline-block;
	padding-right: 48px;
	animation: miniMarquee var(--marquee-ms, 9s) linear infinite;
}

@keyframes miniMarquee {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

/* ---------- Settings screen ---------- */

.settings {
	--slide-ease: cubic-bezier(0.2, 0.9, 0.2, 1);
	display: flex;
	flex-direction: column;
	background: #0a0a0a;
	color: #f3ecd9;
	padding-top: max(10px, env(safe-area-inset-top));
	z-index: 40;
	transform: translate3d(100%, 0, 0);
	transition: transform 300ms var(--slide-ease);
	pointer-events: none;
	visibility: hidden;
	will-change: transform;
}
.settings.is-visible { visibility: visible; }
.settings.is-open { transform: none; pointer-events: auto; }

.settings__header {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px max(16px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
}

.settings__wordmark {
	font-size: 15px;
	font-weight: 900;
	letter-spacing: 0.2em;
	opacity: 0.55;
}

.settings__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.set-group {
	margin: 20px 0 0;
	padding: 0 18px 6px;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	opacity: 0.38;
}

.set-row {
	width: 100%;
	min-height: 46px;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 18px;
	background: transparent;
	border: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.07);
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: background .12s ease;
}
.set-row:hover { background: rgba(255, 255, 255, 0.04); }
.set-row--static { cursor: default; }
.set-row--static:hover { background: transparent; }
.set-row--action .set-row__label { color: #C6F000; }

.set-row__label {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 13px;
	font-weight: 600;
}

.set-row__key {
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	opacity: 0.5;
	padding: 3px 7px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	white-space: nowrap;
}

.set-switch {
	flex: 0 0 auto;
	position: relative;
	width: 38px;
	height: 20px;
	border: 1.5px solid rgba(255, 255, 255, 0.28);
	transition: background .15s ease, border-color .15s ease;
}
.set-switch::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 12px;
	height: 12px;
	background: rgba(255, 255, 255, 0.6);
	transition: transform .15s ease, background .15s ease;
}
.set-row[aria-checked="true"] .set-switch {
	background: #C6F000;
	border-color: #C6F000;
}
.set-row[aria-checked="true"] .set-switch::after {
	transform: translateX(18px);
	background: #111;
}

.set-seg {
	flex: 0 0 auto;
	display: flex;
	border: 1px solid rgba(255, 255, 255, 0.22);
}
.set-seg__btn {
	min-width: 46px;
	padding: 5px 8px;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.1em;
	opacity: 0.5;
	cursor: pointer;
	transition: background .12s ease, color .12s ease, opacity .12s ease;
}
.set-seg__btn + .set-seg__btn { border-left: 1px solid rgba(255, 255, 255, 0.22); }
.set-seg__btn:hover { opacity: 0.85; }
.set-seg__btn[aria-checked="true"] {
	background: #C6F000;
	color: #111;
	opacity: 1;
}

.set-seg--fill {
	flex: 1 1 auto;
}
.set-seg--fill .set-seg__btn {
	flex: 1;
	min-width: 0;
	padding: 6px 4px;
	font-size: 9px;
	letter-spacing: 0.08em;
}
.set-seg.is-disabled {
	opacity: 0.42;
}
.set-row--modes {
	padding-top: 0;
}

/* Palette preview: one bar per station, so repainting needs no trip back. */
.set-palette {
	display: flex;
	gap: 5px;
	height: 104px;
	padding: 12px 18px 0;
}

.set-palette__bar {
	flex: 1 1 0;
	min-width: 0;
	border: 0;
	padding: 0 0 9px;
	background: var(--bar-bg, #1a1a1a);
	color: var(--bar-fg, #f3ecd9);
	display: flex;
	align-items: flex-end;
	justify-content: center;
	cursor: pointer;
	transition: transform .14s ease;
}
.set-palette__bar:hover { transform: translateY(-3px); }
.set-palette__bar:active { transform: scale(0.96); }

.set-palette__name {
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.16em;
	white-space: nowrap;
	overflow: hidden;
}

.set-palette.is-fresh .set-palette__bar {
	animation: paletteBarIn .4s cubic-bezier(0.2, 0.9, 0.2, 1) both;
	animation-delay: calc(var(--i) * 45ms);
}

@keyframes paletteBarIn {
	from { transform: scaleY(0.12); opacity: 0.15; }
	to   { transform: none; opacity: 1; }
}

.set-hint {
	margin: 10px 0 0;
	padding: 0 18px;
	font-size: 11px;
	line-height: 1.4;
	opacity: 0.38;
}

@media (min-width: 768px) {
	.settings__body { max-width: 560px; width: 100%; margin: 0 auto; }
	.settings__header { max-width: 560px; width: 100%; margin: 0 auto; }
}

/* ---------- Video mode ---------- */

.visual {
	position: fixed;
	inset: 0;
	z-index: 60;
	background: #000;
	opacity: 0;
	transition: opacity .24s ease;
}
.visual.is-open { opacity: 1; }

.visual__canvas {
	display: block;
	width: 100%;
	height: 100%;
}

/* HUD hides itself like a video player once the pointer settles. */
.visual__hud {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding:
		max(14px, env(safe-area-inset-top))
		max(16px, env(safe-area-inset-right))
		max(16px, env(safe-area-inset-bottom))
		max(16px, env(safe-area-inset-left));
	pointer-events: none;
	opacity: 1;
	transition: opacity .3s ease;
}
.visual.is-idle .visual__hud { opacity: 0; }

.visual__meta {
	align-self: flex-start;
	display: flex;
	flex-direction: column;
	gap: 3px;
	max-width: min(70vw, 640px);
	padding: 7px 10px;
	color: #f3ecd9;
	background: rgba(0, 0, 0, 0.5);
	border: 1px solid rgba(243, 236, 217, 0.18);
}

.visual__name {
	font-size: 13px;
	font-weight: 900;
	letter-spacing: 0.22em;
}

.visual__track {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	opacity: 0.8;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.visual__tools {
	align-self: flex-end;
	display: flex;
	align-items: center;
	gap: 6px;
	pointer-events: auto;
}

.visual__badge {
	margin-right: 4px;
	padding: 5px 9px;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.18em;
	color: #f3ecd9;
	background: rgba(0, 0, 0, 0.5);
	border: 1px solid rgba(243, 236, 217, 0.22);
	cursor: pointer;
	font-family: inherit;
}
.visual__badge:hover { background: rgba(0, 0, 0, 0.75); }
.visual__badge--silent { border-color: rgba(230, 0, 126, 0.6); }

.visual__btn {
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(243, 236, 217, 0.22);
	background: rgba(0, 0, 0, 0.5);
	color: #f3ecd9;
	cursor: pointer;
	transition: background .12s ease, transform .12s ease;
}
.visual__btn:hover { background: rgba(0, 0, 0, 0.75); }
.visual__btn:active { transform: scale(.92); }
.visual__btn.is-on {
	border-color: rgba(96, 165, 250, 0.85);
	box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.45);
}
.visual__btn.is-flash {
	border-color: rgba(198, 240, 0, 0.9);
	box-shadow: inset 0 0 0 1px rgba(198, 240, 0, 0.55);
	background: rgba(198, 240, 0, 0.18);
}

.visual-toast {
	position: fixed;
	left: 50%;
	bottom: max(6.25rem, calc(env(safe-area-inset-bottom) + 5.5rem));
	transform: translateX(-50%) translateY(12px);
	z-index: 9000;
	max-width: min(90vw, 22rem);
	padding: 10px 16px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: center;
	color: #0a0a0a;
	background: #c6f000;
	border: 1px solid rgba(10, 10, 10, 0.2);
	opacity: 0;
	pointer-events: none;
	transition: opacity 160ms ease, transform 160ms ease;
}
.visual-toast.is-show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.visual__time {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 38px;
	padding: 0 8px 0 10px;
	background: rgba(0, 0, 0, 0.5);
	border: 1px solid rgba(243, 236, 217, 0.22);
	color: #f3ecd9;
}
.visual__range {
	width: 88px;
	height: 4px;
	margin: 0;
	accent-color: #f3ecd9;
	cursor: pointer;
}
.visual__time-label {
	min-width: 2.4em;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.08em;
	opacity: 0.85;
}


@media (prefers-reduced-motion: reduce) {
	.visual { transition: none; }
}

.rndm-tip {
	position: fixed;
	z-index: 80;
	max-width: min(260px, calc(100vw - 16px));
	padding: 6px 10px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1.3;
	/* Own palette — station --fg/--bg can both be dark (BOC, UTAH, …). */
	background: #141414;
	color: #f5f2ec;
	border: 1px solid rgba(255, 255, 255, 0.28);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
	pointer-events: none;
	white-space: normal;
}

/* Stage loudness lab — markup is injected only on stage.random-fm.ru */
.loud-lab-hud {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 0 12px;
}
.loud-lab-hud .set-seg {
	width: min(100%, 360px);
}
.loud-lab-hud__meter,
.loud-lab__meter {
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.04em;
	opacity: 0.72;
}
