/* Telemeriendas: the TV page's set, seen from the front, wherever else a TV is shown (owner,
   2026-11-06: "Haz coherente la tv en todas las páginas de forma que siempre tenga el aspecto de
   la tv de la main page. Debe verse igual en el Catálogo, quiz, imagen para compartir..."): the
   quiz's page, the question under the TV and the catalogue's video window. nav.php's tmTvLook()
   writes the markup; tele.js's drawPostcard() draws the same set, buttons included, for the
   shared picture.
   The measures are tele.css's (the TV page's set on a desktop), in --u: a thousandth of the
   set's width, at least 0.5px and at most 1.3px, so a smaller set is the same set scaled down.
   The panel has no buttons (owner, the same day: "Elimina los botones de la tele del quiz y del
   catálogo"): the badge, the knobs and their names, the speaker and the light, all drawn.
   Below 480px across, the TV page's phone look: a thin cabinet; there the panel (only buttons
   on the TV page) is left out. No 3D and no turning: that is only the TV page's. */

.tvl {
	container-type: inline-size;
	position: relative;
	width: 100%;
}
/* (cqw only measures the container from inside it, so --u is set on what is inside) */
.tvl * {
	--u: clamp(0.5px, 0.1cqw, 1.3px);
}

/* Rabbit-ear antenna on a small dark dome (tele.css's .tv-antenna, flat), standing on the
   cabinet's top edge; the cabinet's top margin is its room, inside the box so the page's spacing holds */
.tvl-antenna {
	position: absolute;
	top: calc(96 * var(--u));
	left: 24%;  /* (38% until 2026-11-13, then 20%, as tele.css's; 34% under 480px) */
	width: 0;
	height: 0;
}
.tvl-antenna::after {
	content: "";
	position: absolute;
	bottom: calc(-4 * var(--u));
	left: calc(-25 * var(--u));
	width: calc(50 * var(--u));
	height: calc(20 * var(--u));
	background: linear-gradient(#4a2c1d, #24140c);
	border-radius: calc(25 * var(--u)) calc(25 * var(--u)) calc(4 * var(--u)) calc(4 * var(--u));
}
/* Curly, 120 long at -56 and 52 degrees, as tele.css's (owner, 2026-11-12: "Las antenas deben ser
   más largas y rizadas en desktop y todos los devices", then "alarga la longitud"; straight, 84 at
   -34 and 26 until then). Lying out sideways at -84 and 84 since 2026-11-13 (owner: "Recupera las
   antenas de la tele pero que se desplieguen de forma horizontal"; none on 2026-11-12; -56 and 52
   before). Since later that day straight and flat, as tele.css's (owner: "Pero rectas (sin
   rizo)... la antena de la izquierda más corta que la de la derecha, y que salgan totalmente
   horizontal"): 107 and 187 long (80 and 140 until a third longer); since later still 6 wide with 14 balls, at -83 and 83 (4 wide with 10 balls at -90 and 90 for an hour) */
.tvl-antenna i {
	position: absolute;
	bottom: calc(12 * var(--u));
	left: calc(-4.5 * var(--u));
	width: calc(9 * var(--u));
	height: calc(214 * var(--u));
	/* Telescopic, as tele.css's (owner, 2026-11-13: "Las antenas deben ser telescópicas"): three
	   sections, 7, 5 and 3 wide, and collars 9 and 7 wide at the joints, light (darker for an hour); a plain 6 wide rod before */
	background:
		linear-gradient(90deg, #9aa0a6, #f4f6f8, #9aa0a6) center 33% / calc(7 * var(--u)) calc(3 * var(--u)) no-repeat,
		linear-gradient(90deg, #9aa0a6, #f4f6f8, #9aa0a6) center 66% / calc(9 * var(--u)) calc(3 * var(--u)) no-repeat,
		linear-gradient(90deg, #7d838a, #f2f4f6, #7d838a) center top / calc(3 * var(--u)) 36% no-repeat,
		linear-gradient(90deg, #7d838a, #eef0f2, #7d838a) center 50% / calc(5 * var(--u)) 34% no-repeat,
		linear-gradient(90deg, #7d838a, #e6e9ec, #7d838a) center bottom / calc(7 * var(--u)) 36% no-repeat;
	transform-origin: bottom center;
	rotate: -83deg;
}
.tvl-antenna i + i {
	height: calc(374 * var(--u));
	rotate: 83deg;
}
.tvl-antenna i::before {
	content: "";
	position: absolute;
	top: calc(-7 * var(--u));
	left: calc(-2.5 * var(--u));
	width: calc(14 * var(--u));
	height: calc(14 * var(--u));
	background: #c8392b;
	border-radius: 50%;
	box-shadow: inset 0 calc(1 * var(--u)) calc(2 * var(--u)) rgba(0, 0, 0, 0.45);
}

.tvl-cabinet {
	position: relative;
	display: flex;
	gap: calc(22 * var(--u));
	margin-top: calc(96 * var(--u));
	padding: calc(26 * var(--u));
	background-color: #6b3d22;
	background-image:
		repeating-linear-gradient(93deg, rgba(255, 255, 255, 0.05) 0 3px, transparent 3px 11px),
		repeating-linear-gradient(87deg, rgba(0, 0, 0, 0.09) 0 2px, transparent 2px 15px),
		linear-gradient(180deg, #8d5432, #5a321c);
	border: max(2px, calc(3 * var(--u))) solid #3a2013;
	border-radius: calc(30 * var(--u));
	box-shadow:
		inset 0 2px 0 rgba(255, 255, 255, 0.18),
		inset 0 calc(-8 * var(--u)) calc(14 * var(--u)) rgba(0, 0, 0, 0.35),
		0 calc(26 * var(--u)) calc(44 * var(--u)) rgba(46, 27, 16, 0.45);
}
.tvl-bezel {
	position: relative;
	flex: 1;
	min-width: 0;
	padding: calc(18 * var(--u));
	background: linear-gradient(#2c2c2c, #101010);
	border-radius: calc(26 * var(--u));
	box-shadow: inset 0 0 0 2px #454545, inset 0 calc(4 * var(--u)) calc(12 * var(--u)) rgba(0, 0, 0, 0.8);
}
.tvl-screen {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: #050805;
	border-radius: calc(34 * var(--u)) / calc(40 * var(--u));
	box-shadow: inset 0 0 calc(40 * var(--u)) rgba(0, 0, 0, 0.9);
}
/* The tube's glass over whatever the page puts on the screen: its darker edges and a reflection
   (tele.css's .tv-glass and the postcard's) */
.tvl-screen::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 5;
	background:
		radial-gradient(ellipse at 30% 12%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 45%),
		radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, 0.4));
	border-radius: inherit;
	pointer-events: none;
}

/* Side panel: champagne metal with the badge, the knobs, the speaker and the light */
.tvl-panel {
	display: flex;
	flex: 0 0 calc(176 * var(--u));
	flex-direction: column;
	align-items: center;
	gap: calc(14 * var(--u));
	padding: calc(18 * var(--u)) calc(12 * var(--u));
	background: linear-gradient(180deg, #e6dac6, #b9a78b);
	border-radius: calc(16 * var(--u));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 calc(-3 * var(--u)) calc(6 * var(--u)) rgba(0, 0, 0, 0.25);
	color: #3a2013;
	line-height: 1.2;
}
.tvl-badge {
	padding: calc(3 * var(--u)) calc(10 * var(--u));
	background: linear-gradient(#f7d77a, #c99a2e);
	border-radius: calc(4 * var(--u));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
	color: #4a2a10;
	font-family: var(--font-display);
	font-size: calc(12 * var(--u));
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}
.tvl-control {
	display: grid;
	justify-items: center;
	gap: calc(7 * var(--u));
}
.tvl-label {
	font-size: calc(11 * var(--u));
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}
.tvl-knob {
	position: relative;
	display: block;
	width: calc(76 * var(--u));
	height: calc(76 * var(--u));
	background:
		repeating-conic-gradient(from 0deg, rgba(0, 0, 0, 0.2) 0 4deg, transparent 4deg 10deg),
		radial-gradient(circle at 35% 30%, #fbfbfb, #c4c4c4 45%, #6a6a6a 100%);
	border-radius: 50%;
	box-shadow: 0 calc(4 * var(--u)) calc(8 * var(--u)) rgba(0, 0, 0, 0.45), inset 0 calc(-3 * var(--u)) calc(6 * var(--u)) rgba(0, 0, 0, 0.35);
}
.tvl-knob::before {
	content: "";
	position: absolute;
	inset: 22%;
	background: radial-gradient(circle at 35% 30%, #f2f2f2, #a9a9a9);
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
/* The red mark at the knob's top, turned a little as on the TV page */
.tvl-knob::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(#c8392b, #c8392b) center calc(5 * var(--u)) / calc(4 * var(--u)) calc(15 * var(--u)) no-repeat;
	border-radius: 50%;
	rotate: 20deg;
}
.tvl-knob-volume {
	width: calc(56 * var(--u));
	height: calc(56 * var(--u));
}
.tvl-knob-volume::after {
	background-position: center calc(4 * var(--u));
	background-size: calc(4 * var(--u)) calc(11 * var(--u));
	rotate: 40deg;
}
/* The speaker grille takes the height between the knobs and the light */
.tvl-speaker {
	flex: 1 0 calc(24 * var(--u));
	width: 100%;
	background: repeating-linear-gradient(to bottom, #3a2a20 0 calc(3 * var(--u)), #cdbca0 calc(3 * var(--u)) calc(7 * var(--u)));
	border-radius: calc(10 * var(--u));
	box-shadow: inset 0 calc(2 * var(--u)) calc(4 * var(--u)) rgba(0, 0, 0, 0.4);
}
/* The light, where the TV page's sits beside its power button: bottom right; on, as while a
   programme plays */
.tvl-power {
	display: flex;
	align-self: stretch;
	justify-content: flex-end;
	padding-right: calc(4 * var(--u));
}
.tvl-led {
	width: calc(10 * var(--u));
	height: calc(10 * var(--u));
	background: #ff3b2f;
	border-radius: 50%;
	box-shadow: 0 0 calc(8 * var(--u)) #ff3b2f;
}

/* Narrow: the TV page's phone look (tele.css, max-width 760px): a thin cabinet, the screen alone
   (that panel is only buttons there), its antenna in px as there (44px rods) */
@container (max-width: 479px) {
	.tvl-cabinet {
		margin-top: 60px;
		padding: 8px;
		border-width: 2px;
		border-radius: 18px;
	}
	.tvl-bezel {
		padding: 6px;
		border-radius: 13px;
	}
	.tvl-screen {
		border-radius: 16px / 19px;
	}
	.tvl-panel {
		display: none;
	}
	.tvl-antenna {
		top: 60px;
		left: 34%;  /* (the doubled left rod fits from there) */
	}
	/* (the TV page's phone antenna since 2026-11-12: a 30 x 12px dome and the curly rods lying
	   out sideways, 72px at -84 and 84 degrees; until then the 50 x 20px dome and 44px rods; since
	   2026-11-13 straight, 59px and 112px (44px and 84px until a third longer), 6px wide, at -83 and 83 degrees) */
	.tvl-antenna::after {
		bottom: -4px;
		left: -15px;
		width: 30px;
		height: 12px;
		border-radius: 15px 15px 3px 3px;
	}
	.tvl-antenna i {
		bottom: 6px;
		left: -4.5px;
		width: 9px;
		height: 89px;  /* (a quarter less than doubled, as tele.css's phones; 118px and 224px for a while) */
		background-size: 7px 3px, 9px 3px, 3px 36%, 5px 34%, 7px 36%;  /* (the telescopic sections and collars in px) */
	}
	.tvl-antenna i + i {
		height: 168px;
	}
	.tvl-antenna i::before {
		top: -7px;
		left: -2.5px;
		width: 14px;
		height: 14px;
	}
}
