:root {
	--wood-dark: #231914;
	--wood-mid: #3d2b22;
	--wood-light: #5a4335;
	--bronze-dark: #4e3a25;
	--bronze-mid: #7a5a35;
	--bronze-light: #aa8454;
	--linen-dark: #2f2822;
	--linen-mid: #423830;
	--panel-dark: #161412;
	--panel-mid: #221f1b;
	--panel-light: #332c26;
	--steel-dark: #4f4a44;
	--steel-mid: #726b63;
	--steel-light: #958d83;
	--text-ivory: #e4d8c1;
	--text-warm: #c8ad82;
	--text-dim: #a99271;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	display: grid;
	place-items: center;
	min-height: 100vh;
	padding: 1.2rem;
	background:
		radial-gradient(900px 540px at 14% 10%, rgba(172, 118, 60, 0.18), transparent 55%),
		radial-gradient(820px 520px at 86% 88%, rgba(58, 33, 20, 0.28), transparent 58%),
		linear-gradient(160deg, #13100f 0%, #1b1614 45%, #110f0e 100%);
	color: var(--text-ivory);
	font-family: "Spectral", "Baskerville Old Face", "Book Antiqua", serif;
}

form {
	position: relative;
	display: grid;
	grid-template-rows: minmax(180px, 1fr) auto auto auto;
	gap: 0.9rem;
	width: min(960px, 94vw);
	min-height: min(92vh, 920px);
	padding: clamp(0.75rem, 2vw, 1.4rem);
	border-radius: 24px;
	border: 4px solid #17120f;
	background:
		linear-gradient(180deg, rgba(238, 198, 136, 0.12), transparent 22%),
		linear-gradient(130deg, var(--wood-light), var(--wood-mid) 48%, var(--wood-dark));
	box-shadow:
		inset 0 1px 0 rgba(246, 217, 164, 0.14),
		inset 0 0 0 1px rgba(241, 205, 154, 0.1),
		inset 0 -10px 20px rgba(0, 0, 0, 0.24),
		0 18px 34px rgba(0, 0, 0, 0.5),
		0 4px 0 rgba(12, 9, 8, 0.9);
	overflow: hidden;
}

form::after {
	content: "";
	position: absolute;
	inset: 10px;
	border-radius: 18px;
	pointer-events: none;
	border: 1px solid rgba(236, 199, 140, 0.2);
	box-shadow:
		inset 0 0 16px rgba(0, 0, 0, 0.18),
		inset 0 -4px 6px rgba(0, 0, 0, 0.16);
}

#grille {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	padding: 0.8rem;
	border-radius: 12px;
	border: 1px solid rgba(244, 220, 169, 0.34);
	background:
		repeating-linear-gradient(
			90deg,
			var(--linen-dark) 0,
			var(--linen-dark) 2px,
			var(--linen-mid) 2px,
			var(--linen-mid) 6px
		),
		repeating-linear-gradient(
			0deg,
			rgba(0, 0, 0, 0.17) 0,
			rgba(0, 0, 0, 0.17) 2px,
			transparent 2px,
			transparent 10px
		);
	box-shadow:
		inset 0 0 13px rgba(0, 0, 0, 0.34),
		inset 0 0 0 1px rgba(236, 199, 140, 0.16);
}

#grille::before,
#grille::after {
	content: "";
	position: absolute;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background:
		radial-gradient(circle at 35% 35%, var(--metal-light) 0, var(--metal-mid) 35%, var(--metal-dark) 100%);
	box-shadow:
		inset 0 1px 1px rgba(255, 255, 255, 0.28),
		0 1px 2px rgba(0, 0, 0, 0.45);
	opacity: 0.9;
}

#grille::before {
	top: 8px;
	right: 8px;
}

#grille::after {
	left: 8px;
	bottom: 8px;
}

#grille p {
	margin: 0;
	padding: 0.42rem 0.68rem;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-size: clamp(0.96rem, 2vw, 1.35rem);
	letter-spacing: 0.05em;
	line-height: 1.25;
	text-transform: uppercase;
	font-weight: 600;
	color: #2c231b;
	background:
		repeating-linear-gradient(90deg, rgba(80, 50, 25, 0.05) 0, rgba(80, 50, 25, 0.05) 2px, transparent 2px, transparent 7px),
		linear-gradient(180deg, #d3b179 0%, #9d7442 100%);
	border-radius: 7px;
	border: 1px solid rgba(85, 56, 30, 0.34);
	box-shadow:
		inset 0 1px 0 rgba(255, 240, 209, 0.2),
		0 1px 4px rgba(0, 0, 0, 0.24);
}

.brand-logo {
	width: 24px;
	height: 24px;
	filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.badge-logo {
	width: 1.2em;
	height: 1.2em;
	flex: 0 0 auto;
	--logo-shell: #7b746b;
	--logo-center: #7b746b;
	filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.25));
}

.link {
	text-decoration: none;
	color: #3f2a19;
}

#tuner {
	position: relative;
	overflow: hidden;
	padding: clamp(0.9rem, 1.8vw, 1.25rem);
	border-radius: 12px;
	border: 2px solid rgba(255, 214, 135, 0.2);
	background:
		radial-gradient(circle at 50% 0%, rgba(226, 192, 130, 0.16), transparent 44%),
		linear-gradient(180deg, var(--panel-light) 0%, var(--panel-mid) 58%, var(--panel-dark) 100%);
	box-shadow:
		inset 0 1px 8px rgba(255, 226, 165, 0.05),
		inset 0 -14px 18px rgba(0, 0, 0, 0.3),
		0 1px 2px rgba(0, 0, 0, 0.2);
	font-family: "IBM Plex Mono", "Lucida Console", Monaco, monospace;
	font-weight: 700;
	color: var(--text-ivory);
	text-shadow: 0 0 4px rgba(255, 235, 180, 0.12);
}

#tuner::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0.2;
	background:
		repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0, rgba(255, 255, 255, 0.06) 1px, transparent 1px, transparent 5px),
		radial-gradient(circle at 20% 10%, rgba(255, 227, 160, 0.16), transparent 36%);
}

#tuner::after {
	content: "";
	position: absolute;
	left: 12px;
	right: 12px;
	top: 10px;
	height: 28px;
	pointer-events: none;
	border-radius: 999px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0));
	opacity: 0.35;
}

#tuner .glass {
	position: absolute;
	width: min(42vw, 320px);
	height: 230px;
	left: 38%;
	top: -96px;
	z-index: 3;
	pointer-events: none;
	opacity: 0.22;
	background: linear-gradient(130deg, rgba(255, 255, 255, 0.96) 4%, rgba(255, 255, 255, 0.1) 55%, rgba(255, 255, 255, 0) 75%);
	transform: rotate(-13deg);
	animation: glass-drift 7s ease-in-out infinite alternate;
}

@keyframes glass-drift {
	from {
		transform: translateX(-8px) rotate(-13deg);
	}
	to {
		transform: translateX(10px) rotate(-11deg);
	}
}

#station,
#frequency {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 0.8rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--text-warm);
	font-size: clamp(0.84rem, 1.35vw, 1.01rem);
	letter-spacing: 0.08em;
}

#station {
	padding-left: 0.2rem;
	margin-bottom: 0.45rem;
	text-transform: uppercase;
}

.scale {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	width: 100%;
	min-width: 0;
}

.station-scale span,
.frequency-scale span {
	font-variant-numeric: tabular-nums;
	opacity: 0.82;
}

.station-scale span.active {
	color: #ffe3a4;
	opacity: 1;
	text-shadow: 0 0 6px rgba(255, 214, 125, 0.32);
}

#tuneTrack {
	position: relative;
	height: 14px;
	margin: 0.2rem 0 0.35rem;
	border-radius: 999px;
	border: 1px solid rgba(255, 222, 155, 0.22);
	background: linear-gradient(90deg, rgba(29, 22, 18, 0.85), rgba(111, 83, 48, 0.78), rgba(29, 22, 18, 0.85));
	overflow: hidden;
	box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.45);
}

#tuneTrack::before {
	content: "";
	position: absolute;
	inset: 2px 8px;
	border-radius: 999px;
	background: repeating-linear-gradient(90deg, rgba(255, 226, 160, 0.16) 0, rgba(255, 226, 160, 0.16) 1px, transparent 1px, transparent 12px);
	opacity: 0.4;
}

#tuneNeedle {
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 12px;
	height: 20px;
	border-radius: 4px;
	border: 1px solid rgba(62, 42, 15, 0.85);
	background: linear-gradient(180deg, #ffe5af 0%, #d3a65d 60%, #8f632b 100%);
	box-shadow:
		0 0 8px rgba(255, 214, 120, 0.24),
		0 2px 6px rgba(0, 0, 0, 0.4);
}

#tuneNeedle.motion-step {
	transition: none;
}

#tuneNeedle.motion-smooth {
	transition: left 180ms ease;
}

#tuneNeedle.motion-analog {
	transition: none;
}

#frequency {
	margin-top: 0.45rem;
	text-transform: uppercase;
}

#tuner strong {
	margin-left: auto;
	padding-left: 0.7rem;
	font-size: 0.85em;
	font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
	color: #f4d58d;
	text-shadow: none;
	letter-spacing: 0.07em;
}

.bar {
	margin: 0.35rem 0;
	padding: 0.18rem 0.35rem;
	font-family: "IBM Plex Mono", "Courier New", Courier, monospace;
	font-size: clamp(0.8rem, 1.25vw, 0.95rem);
	line-height: 1;
	color: #d6ba7f;
	background: linear-gradient(180deg, rgba(29, 22, 18, 0.72), rgba(12, 10, 8, 0.6));
	border-radius: 4px;
	overflow: hidden;
	border: 1px solid rgba(255, 222, 155, 0.13);
	text-shadow: 0 0 6px rgba(251, 220, 145, 0.22);
}

.station-title {
	margin: 0;
	padding: 0.32rem 0.52rem;
	height: 2.2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	line-height: 1.1;
	font-size: clamp(0.96rem, 1.9vw, 1.24rem);
	letter-spacing: 0.02em;
	font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
	font-weight: 600;
	background: linear-gradient(180deg, rgba(56, 43, 33, 0.62), rgba(25, 20, 16, 0.48));
	border: 1px solid rgba(245, 213, 142, 0.12);
	border-radius: 10px;
	box-shadow: inset 0 1px 0 rgba(255, 233, 184, 0.08);
	overflow: hidden;
}

.station-title a,
.station-title span {
	display: block;
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.1;
	border-bottom: 1px dashed transparent;
}

.station-title a {
	color: #f4dcaa;
	text-decoration: none;
	border-bottom: 1px dashed rgba(244, 220, 170, 0.5);
	transition: color 120ms ease;
}

.station-title a:hover {
	color: #ffe6b8;
}

#controls {
	display: grid;
	grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
	gap: 0.8rem;
	align-items: stretch;
	padding: 0.75rem;
	border-radius: 12px;
	background: linear-gradient(180deg, rgba(20, 16, 13, 0.86), rgba(15, 12, 10, 0.92));
	border: 1px solid rgba(255, 220, 150, 0.26);
}

.control-hero {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 0.9rem;
	align-items: stretch;
	padding: 0.65rem;
	border-radius: 10px;
	border: 1px solid rgba(255, 215, 140, 0.2);
	background: linear-gradient(160deg, rgba(90, 65, 39, 0.72), rgba(27, 22, 18, 0.92));
}

.transport-group {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 0.7rem;
	min-width: 84px;
}

.control-columns {
	display: grid;
	grid-template-columns: repeat(2, minmax(130px, 1fr));
	grid-template-rows: repeat(4, minmax(0, auto));
	gap: 0.65rem 0.8rem;
}

.control-column {
	display: grid;
	grid-template-rows: subgrid;
	grid-row: 1 / -1;
	gap: 0.65rem;
}

.control-group {
	display: grid;
	gap: 0.35rem;
	min-width: 0;
	height: 100%;
	padding: 0.45rem 0.5rem;
	border-radius: 8px;
	background: linear-gradient(180deg, rgba(102, 75, 47, 0.58), rgba(20, 16, 13, 0.92));
	border: 1px solid rgba(255, 225, 170, 0.2);
	align-content: start;
}

.control-group label {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-size: 0.78rem;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--text-warm);
	font-family: "Spectral", "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

.control-group label span {
	color: #ffe0a2;
	font-variant-numeric: tabular-nums;
}

.tri-hints {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	font-size: 0.66rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: rgba(237, 203, 147, 0.72);
	margin-top: 0.2rem;
}

.tri-hints span:nth-child(2) {
	text-align: center;
}

.tri-hints span:last-child {
	text-align: right;
}

.tri-switch {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.32rem;
}

.dual-switch {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tri-switch button {
	appearance: none;
	border: 1px solid rgba(255, 218, 153, 0.2);
	border-radius: 6px;
	padding: 0.34rem 0.3rem;
	font-size: clamp(0.58rem, 1.45vw, 0.67rem);
	font-family: "Spectral", "Palatino Linotype", "Book Antiqua", Palatino, serif;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	line-height: 1.15;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: center;
	min-width: 0;
	color: #d6bc91;
	background: linear-gradient(180deg, rgba(34, 27, 22, 0.62), rgba(18, 14, 11, 0.78));
	box-shadow: inset 0 1px 0 rgba(255, 240, 209, 0.03);
	cursor: pointer;
	transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.tri-switch button:hover {
	border-color: rgba(255, 218, 153, 0.34);
}

.tri-switch button.active {
	color: #251a11;
	border-color: rgba(90, 60, 30, 0.55);
	background: linear-gradient(180deg, #bd9660 0%, #90673a 100%);
	box-shadow: inset 0 1px 0 rgba(255, 241, 212, 0.22);
}

.tri-switch button:active {
	filter: brightness(0.96);
}

.volume-knob-group {
	align-content: start;
	justify-items: center;
	padding-top: 0.35rem;
}

.volume-dial {
	--dial-fill: 0deg;
	--dial-angle: -135deg;
	position: relative;
	width: clamp(92px, 11vw, 120px);
	height: clamp(92px, 11vw, 120px);
	border-radius: 50%;
	padding: 10px;
	background:
		conic-gradient(
			from -135deg,
			rgba(191, 147, 81, 0.94) 0deg,
			rgba(191, 147, 81, 0.94) var(--dial-fill),
			rgba(40, 31, 24, 0.94) var(--dial-fill),
			rgba(40, 31, 24, 0.94) 270deg,
			transparent 270deg 360deg
		),
		radial-gradient(circle, #7b5a33 0%, #5f4529 55%, #34261a 100%);
	box-shadow:
		inset 0 0 0 1px rgba(255, 228, 179, 0.2),
		inset 0 -7px 10px rgba(0, 0, 0, 0.38),
		0 4px 10px rgba(0, 0, 0, 0.35),
		0 0 0 2px rgba(66, 45, 25, 0.35);
}

.volume-dial::before {
	content: "";
	position: absolute;
	inset: 13px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #cda66a 0%, #8e6534 48%, #4f371f 100%);
	box-shadow: inset 0 2px 8px rgba(255, 232, 181, 0.24), inset 0 -8px 14px rgba(0, 0, 0, 0.35);
}

.volume-dial::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 3px;
	height: 34%;
	border-radius: 999px;
	background: linear-gradient(180deg, #fff3cf 0%, #d2a75f 65%, #8b622f 100%);
	transform-origin: 50% 90%;
	transform: translate(-50%, -90%) rotate(var(--dial-angle));
	box-shadow: 0 0 5px rgba(255, 225, 164, 0.6);
	z-index: 2;
}

.volume-dial-value {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	z-index: 3;
	font-size: 0.76rem;
	letter-spacing: 0.08em;
	color: #ffebbf;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
	font-variant-numeric: tabular-nums;
	pointer-events: none;
}

.volume-slider {
	margin-top: 0.4rem;
}

#playButton {
	appearance: none;
	border: 1px solid #4a3522;
	padding: 0.55rem 1rem;
	border-radius: 999px;
	font-family: "Cinzel", Georgia, "Times New Roman", serif;
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #241810;
	background: linear-gradient(180deg, #b88f58 0%, #956a3c 60%, #744e2d 100%);
	box-shadow:
		inset 0 1px 2px rgba(255, 242, 205, 0.3),
		0 1px 4px rgba(0, 0, 0, 0.28);
	cursor: pointer;
	transition: filter 120ms ease;
}

#playButton:hover {
	filter: brightness(1.06);
}

#playButton:active {
	filter: brightness(0.95);
}

input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 9px;
	border: 0;
	background: transparent;
	outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
	height: 9px;
	border-radius: 999px;
	border: 1px solid rgba(255, 222, 157, 0.2);
	background: linear-gradient(90deg, #2a221c, #584432 38%, #735838 62%, #2a221c);
	box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.35);
}

input[type="range"]::-moz-range-track {
	height: 9px;
	border-radius: 999px;
	border: 1px solid rgba(255, 222, 157, 0.2);
	background: linear-gradient(90deg, #2a221c, #584432 38%, #735838 62%, #2a221c);
	box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.35);
}

input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	margin-top: -6px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid #352211;
	background: radial-gradient(circle at 30% 30%, #e8d0a0 0%, #b88a4d 58%, #684a28 100%);
	box-shadow:
		inset 0 1px 1px rgba(255, 255, 255, 0.22),
		0 1px 4px rgba(0, 0, 0, 0.4);
	cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
	appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid #352211;
	background: radial-gradient(circle at 30% 30%, #e8d0a0 0%, #b88a4d 58%, #684a28 100%);
	box-shadow:
		inset 0 1px 1px rgba(255, 255, 255, 0.22),
		0 1px 4px rgba(0, 0, 0, 0.4);
	cursor: pointer;
}

#audioBank {
	display: none;
}

.led {
	width: 2.05rem;
	height: 2.05rem;
	border-radius: 50%;
	cursor: pointer;
	background: radial-gradient(circle at 30% 30%, rgba(218, 213, 206, 0.88), rgba(170, 163, 154, 0.38) 38%, rgba(125, 120, 113, 0.3) 72%);
	box-shadow: inset 0 -2px 6px rgba(0, 0, 0, 0.35), 0 0 1px rgba(0, 0, 0, 0.65);
	transition: box-shadow 120ms ease, transform 120ms ease;
}

.led:hover {
	transform: scale(1.03);
}

.led.red {
	background: radial-gradient(circle at 30% 30%, #f0b3a6 0%, #d44d3d 38%, #7f1f18 100%);
	box-shadow:
		inset 0 -3px 9px rgba(65, 5, 2, 0.48),
		0 0 9px rgba(227, 56, 31, 0.32),
		0 0 1px rgba(0, 0, 0, 0.85);
}

@media (max-width: 1100px) {
	#controls {
		grid-template-columns: 1fr;
	}

	.control-hero {
		width: 100%;
	}

	.transport-group {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		align-items: center;
		width: 100%;
		max-width: 420px;
		min-width: 0;
	}

	#playButton {
		width: 100%;
		min-width: 0;
		padding: 0.5rem 0.82rem;
		font-size: 0.9rem;
		letter-spacing: 0.05em;
		white-space: nowrap;
	}

	.tri-switch {
		gap: 0.26rem;
	}

	.tri-switch button {
		padding: 0.33rem 0.22rem;
		font-size: clamp(0.56rem, 1.15vw, 0.64rem);
		letter-spacing: 0.01em;
	}

	.control-group label {
		font-size: 0.76rem;
		letter-spacing: 0.06em;
	}
}

@media (max-width: 860px) {
	form {
		grid-template-rows: minmax(150px, 1fr) auto auto auto;
		width: min(980px, 97vw);
		min-height: 90vh;
	}

	.control-hero {
		grid-template-columns: 1fr;
		justify-items: center;
		padding-left: 0;
		padding-right: 0;
	}

	.transport-group {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 0.48rem;
		width: 100%;
		max-width: 300px;
	}

	.control-columns {
		grid-template-columns: 1fr;
		grid-template-rows: none;
	}

	.control-column {
		grid-template-rows: none;
		grid-row: auto;
		gap: 0.65rem;
	}

	#playButton {
		padding: 0.36rem 0.58rem;
		font-size: 0.86rem;
		letter-spacing: 0.06em;
	}

	.led {
		width: 1.9rem;
		height: 1.9rem;
	}

	.tri-switch {
		gap: 0.24rem;
	}

	.tri-switch button {
		padding: 0.32rem 0.2rem;
		font-size: clamp(0.54rem, 2.1vw, 0.62rem);
	}

	.control-group label {
		font-size: 0.74rem;
	}

	#tuner .glass {
		left: 48%;
	}
}

@media (max-width: 520px) {
	.transport-group {
		max-width: none;
	}

	#playButton {
		font-size: 0.8rem;
		padding: 0.3rem 0.45rem;
	}

	.tri-switch button {
		font-size: 0.56rem;
		padding: 0.3rem 0.18rem;
	}
}
