/* DUBROLLER FM — модульная сетка в стиле БЮРО 7,62 (референс Bitwig Grid: блоки + порты, без чужой палитры) */
:root {
	--bg: #0a0a0c;
	--bg2: #0e0e10;
	--bg3: #131316;
	--text: #eae8e2;
	--text-mid: #b0aead;
	--text-dim: #70737a;
	--accent: #ff4438;
	--accent-soft: rgba(255, 68, 56, 0.12);
	--accent-glow: rgba(255, 68, 56, 0.22);
	--border: #252528;
	--green: #2ecc40;
	--blue: #38bdf8;
	--purple: #c084fc;
	--yellow: #ffdc00;
	--font-terminal: 'Share Tech Mono', monospace;
	/* Canvas читает те же имена */
	--grid-scope-bg: #0a0a0c;
	--grid-scope-dim: #3a3a40;
	--grid-scope-line: #252528;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

.radio-body {
	background: var(--bg);
	color: var(--text);
	font-family: 'Rajdhani', sans-serif;
	min-height: 100vh;
	overflow-x: hidden;
}

::selection {
	background: var(--green);
	color: #000;
}

::-moz-selection {
	background: var(--green);
	color: #000;
}

a {
	color: var(--accent);
	text-decoration: none;
	transition: color 0.2s, border-color 0.2s;
}

a:hover {
	color: var(--text);
}

/* Сетка чертежа — как на главной / ШТАБ */
.radio-grid-bg {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background-image:
		linear-gradient(rgba(255, 68, 56, 0.02) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 68, 56, 0.02) 1px, transparent 1px);
	background-size: 60px 60px;
}

.radio-noise {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	opacity: 0.03;
	background: url('data:image/svg+xml,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence baseFrequency="0.9"/></filter><rect width="100%" height="100%" filter="url(%23n)"/></svg>');
}

.radio-app {
	position: relative;
	z-index: 1;
	min-height: 100vh;
	padding-bottom: 72px;
	display: flex;
	flex-direction: column;
}

/* —— Модуль: общая оболочка (как «патч» в Grid) —— */
.radio-mod {
	border: 1px solid var(--border);
	background: rgba(14, 14, 16, 0.55);
	position: relative;
}

.radio-mod-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-bottom: 1px solid var(--border);
	font-family: var(--font-terminal);
	font-size: 7px;
	letter-spacing: 3px;
	text-transform: uppercase;
	color: var(--text-dim);
	background: rgba(10, 10, 12, 0.6);
}

.radio-mod-port {
	color: var(--accent);
	min-width: 28px;
}

.radio-mod-sep {
	color: var(--text-dim);
	opacity: 0.7;
}

.radio-mod-name {
	color: var(--text-mid);
	letter-spacing: 2px;
}

.radio-mod-body {
	padding: 0;
}

/* Порты IN/OUT как на доске Grid */
.radio-mod-io {
	display: flex;
	align-items: stretch;
	gap: 0;
	min-height: 0;
}

.radio-mod-io-body {
	flex: 1;
	min-width: 0;
}

.radio-jack-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 28px;
	flex-shrink: 0;
	padding: 8px 4px;
	border-right: 1px solid var(--border);
	background: rgba(10, 10, 12, 0.4);
}

.radio-jack-wrap--out {
	border-right: none;
	border-left: 1px solid var(--border);
}

.radio-jack-label {
	font-family: var(--font-terminal);
	font-size: 6px;
	letter-spacing: 2px;
	color: var(--text-dim);
}

.radio-jack {
	display: block;
	width: 12px;
	height: 12px;
	border: 2px solid var(--border);
	background: var(--bg3);
	box-shadow: inset 0 0 0 1px rgba(255, 68, 56, 0.15);
	flex-shrink: 0;
}

.radio-jack--in {
	border-color: rgba(56, 189, 248, 0.45);
}

.radio-jack--out {
	border-color: rgba(255, 68, 56, 0.55);
}

.radio-mod-io--seq .radio-jack-spacer {
	width: 28px;
	flex-shrink: 0;
	border-left: 1px solid var(--border);
	background: rgba(10, 10, 12, 0.25);
}

.radio-level-meter {
	display: block;
	width: 100%;
	height: 48px;
	background: var(--grid-scope-bg);
	vertical-align: middle;
}

/* Header */
.radio-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	height: 56px;
	background: rgba(10, 10, 12, 0.92);
	backdrop-filter: blur(20px);
	border-bottom: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 0 24px;
}

.radio-header-mid {
	font-family: var(--font-terminal);
	font-size: 8px;
	letter-spacing: 2px;
	color: var(--text-dim);
	flex: 1;
	text-align: center;
}

@media (max-width: 700px) {
	.radio-header-mid {
		display: none;
	}
}

.radio-header-left {
	display: flex;
	align-items: center;
	gap: 14px;
}

.radio-mob-pl-toggle {
	display: none;
	padding: 6px 10px;
	border: 1px solid var(--border);
	background: transparent;
	font-family: var(--font-terminal);
	font-size: 8px;
	letter-spacing: 2px;
	color: var(--text-mid);
	cursor: pointer;
	text-transform: uppercase;
	transition: border-color 0.2s, color 0.2s;
}

.radio-mob-pl-toggle:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.radio-logo {
	font-family: 'Russo One', sans-serif;
	font-size: 14px;
	letter-spacing: 4px;
	color: var(--text);
}

.radio-logo-sep {
	color: var(--text-dim);
	font-weight: 400;
}

.radio-logo-sub {
	color: var(--accent);
}

.radio-back {
	font-family: var(--font-terminal);
	font-size: 8px;
	letter-spacing: 2px;
	color: var(--text-dim);
	padding: 6px 12px;
	border: 1px solid var(--border);
	transition: border-color 0.3s, color 0.3s;
	text-transform: uppercase;
	background: transparent;
}

.radio-back:hover {
	border-color: var(--accent);
	color: var(--accent);
}

/* Layout: доска как в grid-test.html */
.radio-shell {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding-top: 56px;
	min-height: calc(100vh - 56px);
	position: relative;
}

.radio-canvas {
	flex: 1;
	position: relative;
	min-height: 0;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}

.radio-canvas-bg {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(255, 68, 56, 0.03) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 68, 56, 0.03) 1px, transparent 1px);
	background-size: 24px 24px;
	pointer-events: none;
	z-index: 0;
}

.radio-canvas-board {
	position: relative;
	z-index: 1;
	min-width: 100%;
	min-height: 720px;
}

/* SVG кабели — первый слой доски, под модулями */
.radio-patch-wires {
	position: absolute;
	left: 0;
	top: 0;
	z-index: 2;
	pointer-events: none;
	overflow: visible;
}

.radio-cable-path--flow {
	animation: radioCableFlow 1.5s linear infinite;
}

@keyframes radioCableFlow {
	to {
		stroke-dashoffset: -26;
	}
}

/* Плавающие модули (как .mod в grid-test) */
.radio-mod-float {
	position: absolute;
	z-index: 10;
	width: 220px;
	max-width: calc(100vw - 20px);
	user-select: none;
	background: rgba(12, 12, 14, 0.96);
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.radio-mod-float.dragging {
	z-index: 50;
	box-shadow: 0 0 32px rgba(255, 68, 56, 0.18);
	opacity: 0.95;
}

.radio-mod-drag {
	cursor: grab;
}

.radio-mod-drag:active {
	cursor: grabbing;
}

.radio-mod-src {
	width: 220px;
}

.radio-mod-meta {
	width: 280px;
}

.radio-mod-meta-body {
	padding: 10px;
}

.radio-mod--wave {
	width: 440px;
}

.radio-mod--analyzer {
	width: 320px;
}

.radio-tracks-wrap {
	width: 420px;
	max-width: calc(100vw - 48px);
}

.radio-jack-float {
	position: absolute;
	right: -6px;
	top: 50%;
	margin-top: -6px;
	z-index: 12;
}

.radio-mod-slider {
	width: 100%;
	height: 4px;
	-webkit-appearance: none;
	appearance: none;
	background: var(--border);
	outline: none;
}

.radio-mod-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 10px;
	height: 14px;
	background: var(--accent);
	border: none;
	cursor: pointer;
}

.radio-mod-slider-row {
	padding: 6px 0 8px;
}

.radio-mod-slider-label {
	font-family: var(--font-terminal);
	font-size: 7px;
	letter-spacing: 1px;
	color: var(--text-dim);
	margin-bottom: 4px;
}

.radio-grid-toolbar {
	position: fixed;
	bottom: 72px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 85;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 8px 16px;
	background: rgba(10, 10, 12, 0.95);
	backdrop-filter: blur(16px);
	border: 1px solid var(--border);
	max-width: 96vw;
}

.radio-grid-toolbar-btn {
	padding: 6px 12px;
	border: 1px solid var(--border);
	background: transparent;
	color: var(--text-dim);
	font-family: var(--font-terminal);
	font-size: 8px;
	letter-spacing: 2px;
	cursor: pointer;
	text-transform: uppercase;
}

.radio-grid-toolbar-btn:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.radio-grid-toolbar-hint {
	font-family: var(--font-terminal);
	font-size: 7px;
	letter-spacing: 1px;
	color: var(--text-dim);
	opacity: 0.65;
}

@media (max-width: 600px) {
	.radio-grid-toolbar-hint {
		display: none;
	}
}

.radio-sidebar-scrim {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 199;
	background: rgba(0, 0, 0, 0.55);
	border: none;
	cursor: pointer;
}

.radio-sidebar-scrim[hidden] {
	display: none !important;
}

@media (max-width: 900px) {
	.radio-sidebar-scrim:not([hidden]) {
		display: block;
		position: fixed;
		top: 56px;
		bottom: 0;
		left: 0;
		right: 0;
	}
}

@media (max-width: 900px) {
	.radio-mod-src.radio-mod-src--open {
		position: fixed;
		left: 12px !important;
		right: 12px;
		top: 64px !important;
		width: auto !important;
		max-height: 70vh;
		overflow-y: auto;
		z-index: 200;
		box-shadow: 0 12px 48px rgba(0, 0, 0, 0.65);
	}
}

.radio-pl-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 10px 16px;
}

.radio-pl-item {
	display: block;
	width: 100%;
	text-align: left;
	padding: 10px 12px;
	border: 1px solid transparent;
	border-left: 2px solid transparent;
	background: transparent;
	font-family: var(--font-terminal);
	font-size: 9px;
	letter-spacing: 2px;
	color: var(--text-dim);
	cursor: pointer;
	transition: all 0.2s;
	text-transform: uppercase;
}

.radio-pl-item:hover {
	color: var(--text);
	background: rgba(255, 255, 255, 0.02);
	border-color: var(--border);
}

.radio-pl-item.active {
	color: var(--accent);
	border-left-color: var(--accent);
	border-color: rgba(255, 68, 56, 0.2);
	background: rgba(255, 68, 56, 0.03);
}

.radio-pl-title {
	display: block;
	margin-bottom: 4px;
}

.radio-pl-meta {
	font-size: 8px;
	letter-spacing: 1px;
	color: var(--text-dim);
	text-transform: none;
}

.radio-cover-wrap {
	margin-bottom: 0;
}

.radio-cover {
	width: 100%;
	max-width: 280px;
	aspect-ratio: 1;
	border: 1px solid var(--border);
	background: var(--bg2);
	position: relative;
	overflow: hidden;
}

.radio-cover-ph {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 16px;
	text-align: center;
}

.radio-cover-ph.hidden {
	display: none;
}

.radio-cover-ph-icon {
	width: 48px;
	height: 48px;
	border: 2px solid var(--border);
	box-shadow: inset 0 0 0 2px var(--bg);
}

.radio-cover-ph-title {
	font-family: 'Russo One', sans-serif;
	font-size: 12px;
	letter-spacing: 3px;
	color: var(--text-mid);
	line-height: 1.3;
}

.radio-cover-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.radio-cover-img.hidden {
	display: none;
}

.radio-meta-block {
	flex: 1;
	min-width: 200px;
	padding-top: 4px;
}

.radio-album-title {
	font-family: 'Russo One', sans-serif;
	font-size: 18px;
	letter-spacing: 4px;
	margin-bottom: 6px;
	color: var(--text);
}

.radio-album-meta {
	font-family: var(--font-terminal);
	font-size: 9px;
	letter-spacing: 2px;
	color: var(--text-dim);
	text-transform: uppercase;
}

.radio-mod--wave .radio-waveform-wrap {
	border: none;
	background: var(--grid-scope-bg);
	position: relative;
}

.radio-waveform-wrap {
	width: 100%;
}

.radio-waveform {
	display: block;
	width: 100%;
	height: 120px;
	cursor: pointer;
	vertical-align: middle;
}

.radio-waveform:hover {
	box-shadow: inset 0 0 0 1px rgba(255, 68, 56, 0.12);
}

.radio-tracks-head {
	display: grid;
	grid-template-columns: 36px 1fr 56px;
	gap: 8px;
	padding: 8px 12px;
	border-bottom: 1px solid var(--border);
	font-family: var(--font-terminal);
	font-size: 7px;
	letter-spacing: 3px;
	color: var(--text-dim);
	text-transform: uppercase;
	background: rgba(10, 10, 12, 0.35);
}

.radio-tracks-dur {
	text-align: right;
}

.radio-tracks {
	list-style: none;
	background: rgba(14, 14, 16, 0.35);
}

.radio-track {
	display: grid;
	grid-template-columns: 36px 1fr 56px;
	gap: 8px;
	align-items: center;
	padding: 12px 12px;
	border-bottom: 1px solid rgba(37, 37, 40, 0.6);
	font-family: 'Rajdhani', sans-serif;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.5px;
	cursor: pointer;
	transition: background 0.15s;
}

.radio-track:last-child {
	border-bottom: none;
}

.radio-track:hover {
	background: rgba(255, 68, 56, 0.03);
}

.radio-track.active {
	color: var(--accent);
}

.radio-track-num {
	font-family: var(--font-terminal);
	font-size: 10px;
	color: var(--text-dim);
	text-align: center;
}

.radio-track.active .radio-track-num {
	color: var(--accent);
}

.radio-track-dur {
	font-family: var(--font-terminal);
	font-size: 9px;
	color: var(--text-dim);
	text-align: right;
}

.radio-track.active .radio-track-dur {
	color: var(--accent);
}

.radio-track.muted {
	opacity: 0.45;
	cursor: not-allowed;
}

/* Player bar */
.radio-player {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 90;
	height: 72px;
	background: rgba(10, 10, 12, 0.95);
	backdrop-filter: blur(20px);
	border-top: 1px solid var(--border);
}

.radio-player-inner {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 20px 0 24px;
	gap: 16px;
	max-width: 1400px;
	margin: 0 auto;
}

.radio-player-ctrl {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
	padding: 6px 8px;
	border: 1px solid var(--border);
	background: rgba(14, 14, 16, 0.5);
}

.radio-player-tag {
	font-family: var(--font-terminal);
	font-size: 7px;
	letter-spacing: 2px;
	color: var(--text-dim);
	padding-right: 10px;
	margin-right: 2px;
	border-right: 1px solid var(--border);
	line-height: 1.2;
}

.radio-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 1px solid var(--border);
	color: var(--text-mid);
	font-family: var(--font-terminal);
	cursor: pointer;
	transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.radio-btn:hover:not(:disabled) {
	border-color: var(--accent);
	color: var(--accent);
}

.radio-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.radio-btn-sm {
	width: 36px;
	height: 36px;
	font-size: 14px;
}

.radio-btn-play {
	width: 44px;
	height: 44px;
	border-color: var(--accent);
	color: var(--accent);
	font-size: 16px;
}

.radio-btn-play:hover:not(:disabled) {
	background: var(--accent);
	color: #000;
}

.radio-btn-play.radio-btn-play--active {
	background: var(--accent);
	color: #000;
}

.radio-player-center {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
}

.radio-player-title-row {
	display: flex;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
}

.radio-player-track {
	font-family: 'Rajdhani', sans-serif;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.5px;
	color: var(--text);
}

.radio-player-artist {
	font-family: var(--font-terminal);
	font-size: 8px;
	letter-spacing: 2px;
	color: var(--text-dim);
	text-transform: uppercase;
}

.radio-mini-viz {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 32px;
	border: 1px solid var(--border);
	background: var(--grid-scope-bg);
}

.radio-player-progress {
	width: 100%;
}

.radio-player-bar {
	height: 4px;
	background: var(--border);
	cursor: pointer;
	position: relative;
}

.radio-player-bar-fill {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0%;
	background: linear-gradient(90deg, var(--accent), rgba(255, 68, 56, 0.75));
	pointer-events: none;
}

.radio-player-time {
	font-family: var(--font-terminal);
	font-size: 9px;
	letter-spacing: 1px;
	color: var(--text-dim);
}

.radio-player-time-sep {
	margin: 0 4px;
	opacity: 0.6;
}

.radio-player-vol {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
	width: 160px;
	padding: 6px 8px;
	border: 1px solid var(--border);
	background: rgba(14, 14, 16, 0.35);
}

.radio-vol-mute {
	width: 32px;
	height: 32px;
	border: 1px solid var(--border);
	background: transparent;
	font-family: var(--font-terminal);
	font-size: 12px;
	color: var(--text-dim);
	cursor: pointer;
	transition: border-color 0.2s, color 0.2s;
}

.radio-vol-mute:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.radio-vol-range {
	-webkit-appearance: none;
	appearance: none;
	flex: 1;
	height: 6px;
	background: var(--border);
	outline: none;
	cursor: pointer;
}

.radio-vol-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	background: var(--accent);
	border: 2px solid rgba(10, 10, 12, 0.9);
	cursor: pointer;
}

.radio-vol-range::-webkit-slider-runnable-track {
	height: 6px;
	background: var(--border);
}

.radio-vol-range::-moz-range-thumb {
	width: 14px;
	height: 14px;
	background: var(--accent);
	border: 2px solid rgba(10, 10, 12, 0.9);
	cursor: pointer;
	border-radius: 0;
}

.radio-vol-range::-moz-range-track {
	height: 6px;
	background: var(--border);
}

/* Mobile */
@media (max-width: 900px) {
	.radio-mob-pl-toggle {
		display: inline-block;
	}

	.radio-sidebar-scrim[hidden] {
		display: none !important;
	}

	.radio-player-vol {
		display: none;
	}

	.radio-player-inner {
		padding: 0 12px;
		gap: 12px;
	}

	.radio-player-center {
		min-width: 0;
	}

	.radio-mini-viz {
		height: 24px;
	}
}

@media (max-width: 480px) {
	.radio-logo .radio-logo-sub {
		display: none;
	}

	.radio-header {
		padding: 0 12px;
	}

	.radio-player-artist {
		display: none;
	}
}
