/* DJ Arty Player (prototipo) */
.djp {
	--djp-ink: #F5EFF8;
	--djp-muted: #A99FB5;
	--djp-line: #2D2538;
	--djp-surface: #15111D;
	--djp-on-grad: #160B12;
	--djp-grad: linear-gradient(100deg, #BB62F1 0%, #EE4B4B 52%, #FFBD13 100%);
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 14px;
	color: var(--djp-ink);
	font-family: "Figtree", system-ui, sans-serif;
}
.djp-play {
	width: 56px;
	height: 56px;
	flex: none;
	border: 0;
	border-radius: 50%;
	background: var(--djp-grad);
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: transform .15s ease;
}
.djp-play:hover { transform: scale(1.04); }
.djp-play:active { transform: scale(.97); }
.djp-play:focus-visible, .djp-mute:focus-visible, .djp-resume:focus-visible { outline: 2px solid #FFBD13; outline-offset: 3px; }
.djp-play__icon { width: 0; height: 0; border-left: 17px solid var(--djp-on-grad); border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 5px; }
.djp.is-on .djp-play__icon { border: 0; margin: 0; width: 18px; height: 20px; background: linear-gradient(90deg, var(--djp-on-grad) 0 6px, transparent 6px 12px, var(--djp-on-grad) 12px); }
.djp[data-state="connecting"] .djp-play,
.djp[data-state="reconnecting"] .djp-play,
.djp[data-state="buffering"] .djp-play { animation: djp-breathe 1.2s ease-in-out infinite; }
.djp-info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 160px; }
.djp-state { font-family: "DM Mono", ui-monospace, monospace; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--djp-muted); }
.djp[data-state="playing"] .djp-state { color: #FF8095; }
.djp-now { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.djp-vol { display: flex; align-items: center; gap: 8px; flex: 0 1 170px; }
.djp-vol input { width: 100%; accent-color: #EE4B4B; }
.djp-vol.no-volume input { display: none; }
.djp-mute { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--djp-line); background: transparent; position: relative; cursor: pointer; flex: none; }
.djp-mute span { position: absolute; left: 10px; top: 13px; width: 6px; height: 8px; background: var(--djp-ink); }
.djp-mute span::after { content: ""; position: absolute; left: 3px; top: -4px; border-right: 9px solid var(--djp-ink); border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.djp-mute.is-muted::after { content: ""; position: absolute; left: 7px; right: 7px; top: 17px; height: 2px; background: #FF3B5C; transform: rotate(-35deg); }
.djp-resume { flex-basis: 100%; border: 1px dashed #4A3F57; background: transparent; color: var(--djp-ink); border-radius: 999px; padding: 10px 16px; font-weight: 700; cursor: pointer; }
.djp-resume[hidden] { display: none; }

/* Panel de pruebas */
.djp-tests { margin-top: 32px; padding: 20px; border: 1px solid #2D2538; border-radius: 16px; background: #15111D; color: #F5EFF8; font-family: "Figtree", system-ui, sans-serif; }
.djp-tests h2 { font-family: "Syne", sans-serif; font-size: 22px; margin: 0 0 12px; }
.djp-tests__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 6px 16px; margin: 0 0 16px; font-size: 14px; }
.djp-tests__grid dt { color: #A99FB5; }
.djp-tests__grid dd { margin: 0; overflow-wrap: anywhere; }
.djp-tests__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.djp-tests__actions button { border: 1px solid #4A3F57; background: transparent; color: #F5EFF8; border-radius: 999px; padding: 10px 16px; font-weight: 600; cursor: pointer; }
.djp-tests__label { display: block; font-size: 13px; color: #A99FB5; margin-bottom: 4px; }
.djp-tests input[type="text"] { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid #2D2538; background: #0B0910; color: #F5EFF8; }
.djp-tests__log { margin: 14px 0 0; padding-left: 20px; max-height: 260px; overflow: auto; font-family: "DM Mono", ui-monospace, monospace; font-size: 12px; color: #D9CFE3; }
@keyframes djp-breathe { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .djp-play { transition: none; } .djp[data-state] .djp-play { animation: none; } }
@media (max-width: 480px) { .djp-tests__grid { grid-template-columns: 1fr; } .djp-vol { flex-basis: 100%; } }

/* ---------- Botón "Abrir en ventana" ---------- */
.djp-window { display: inline-flex; align-items: center; gap: 8px; flex: none; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--djp-line); color: var(--djp-ink); text-decoration: none; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.djp-window:hover { border-color: var(--djp-ink); color: var(--djp-ink); }
.djp-window:focus-visible { outline: 2px solid #FFBD13; outline-offset: 3px; }
.djp-window__icon { width: 14px; height: 12px; border: 1.5px solid currentColor; border-radius: 2px; position: relative; }
.djp-window__icon::after { content: ""; position: absolute; right: -5px; top: -5px; width: 7px; height: 7px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; background: var(--djp-surface); }

/* ---------- Variante tarjeta (dentro de la radio del hero) ---------- */
.djp--card { gap: 12px; flex-wrap: nowrap; }
.djp--card .djp-info { display: none; }
.djp--card .djp-vol { flex: 1 1 auto; }
.djp--card .djp-resume { flex-basis: auto; }
.djp--card.has-resume { flex-wrap: wrap; }
.djp-dockinfo { display: none; }

/* ---------- Barra inferior (el mismo reproductor, fijado al bajar) ---------- */
.djp.is-docked {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 300;
	flex-wrap: nowrap;
	padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
	background: rgba(21, 17, 29, .96);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border-top: 1px solid var(--djp-line);
	box-shadow: 0 -12px 30px rgba(5, 3, 9, .45);
	animation: djp-dock-in .25s ease-out;
}
.djp.is-docked .djp-dockinfo { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; order: -1; }
.djp.is-docked .djp-dockinfo img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: #1E1829; }
.djp-dockinfo__text { display: flex; flex-direction: column; min-width: 0; }
.djp-dockinfo__text strong { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.djp-dockinfo__text span { font-size: 13px; color: var(--djp-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.djp.is-docked .djp-play { width: 46px; height: 46px; }
.djp.is-docked .djp-vol { flex: 0 1 180px; }
.djp.is-docked .djp-resume { display: none; }
html.djp-has-dock body { padding-bottom: 72px; }
@keyframes djp-dock-in { from { transform: translateY(100%); } to { transform: none; } }

@media (max-width: 600px) {
	.djp--card .djp-window__text { display: none; }
	.djp--card .djp-window { padding: 0 11px; }
	.djp.is-docked .djp-vol { display: none; }
	.djp.is-docked .djp-window__text { display: none; }
}
@media (prefers-reduced-motion: reduce) { .djp.is-docked { animation: none; } }

/* Mientras la barra está fija, la tarjeta del hero ya no está a la vista:
   se quitan los efectos que harían que "fixed" se calcule respecto a la tarjeta o quede detrás de otras secciones. */
html.djp-has-dock .djh-radio { -webkit-backdrop-filter: none; backdrop-filter: none; }
html.djp-has-dock .e-con.dja-hero { isolation: auto; }
html.djp-has-dock .dja-hero__radio { z-index: 400 !important; }
