/* SAO Reproductor de Radio – app instalable (/app/) */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #08181c; }
body.app {
	--text: #ffffff;
	--muted: #b9cdd1;
	--card: rgba(255, 255, 255, .055);
	--line: rgba(255, 255, 255, .13);
	--col: 725px;
	--tabs-h: 78px;
	--banner-h: 0px;
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	background: linear-gradient(180deg,
		color-mix(in srgb, var(--app-bg) 70%, #1d7d88) 0%,
		color-mix(in srgb, var(--app-bg) 85%, #0a1a1f) 40%,
		#08181c 100%) fixed;
	color: var(--text);
	font: 17px/1.4 "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
	padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px));
}
body.app.has-banner { --banner-h: 82px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.ico { display: block; width: 24px; height: 24px; flex: 0 0 auto; }
.sao-radio-ico { display: block; width: 24px; height: 24px; }

/* ---------- Banner de instalación ---------- */
.app-banner {
	position: sticky;
	top: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 66px;
	margin: 8px 8px 8px;
	padding: 10px 12px 10px 22px;
	border: 1.5px solid rgba(255, 255, 255, .55);
	border-radius: 14px;
	background: linear-gradient(90deg, color-mix(in srgb, var(--app-accent) 32%, #123d44), color-mix(in srgb, var(--app-accent) 18%, #10353b));
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	box-shadow: 0 0 0 8px color-mix(in srgb, var(--app-bg) 80%, #1d7d88);
}
.app-banner .ico { width: 24px; height: 24px; color: var(--app-accent); }
.app-banner p { flex: 1 1 auto; margin: 0; font-size: 17px; line-height: 1.3; }
.app-banner__btn {
	flex: 0 0 auto;
	height: 42px;
	padding: 0 18px;
	border-radius: 999px;
	background: #fff;
	color: #0b2a30;
	font-size: 17px;
	font-weight: 700;
}
.app-banner__btn:hover { background: #e9f6f8; }

/* ---------- Estructura ---------- */
.app-main { width: 100%; max-width: calc(var(--col) + 32px); margin: 0 auto; padding: 0 16px; }
.app-panel { padding-bottom: 120px; }
.app-sticky {
	position: sticky;
	top: var(--banner-h);
	z-index: 10;
	margin: 0 -16px;
	padding: 18px 16px 14px;
	background: color-mix(in srgb, var(--app-bg) 88%, #000);
}
.app-h2 { margin: 0 0 4px; font-size: 28px; font-weight: 700; line-height: 1.2; }
.app-empty { color: var(--muted); }

/* ---------- Radio ---------- */
.app-radio { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 8px; padding-bottom: 130px; }
.app-logo { display: block; width: auto; max-width: 320px; max-height: 150px; object-fit: contain; }
.app-logo--round { width: 96px; height: 96px; border-radius: 50%; background: #fff; object-fit: cover; }

.app-orb { position: relative; display: grid; place-items: center; width: 310px; height: 310px; margin-top: 22px; }
.app-orb__ring { position: absolute; border-radius: 50%; pointer-events: none; }
.app-orb__ring--1 { inset: 0; border: 2px solid color-mix(in srgb, var(--app-accent) 42%, transparent); }
.app-orb__ring--2 { inset: 37px; border: 1.5px solid color-mix(in srgb, var(--app-accent) 32%, transparent); }
.app-orb__ring--3 { inset: 76px; border: 1px solid color-mix(in srgb, var(--app-accent) 22%, transparent); box-shadow: 0 0 40px -6px color-mix(in srgb, var(--app-accent) 55%, transparent); }
body[data-state="playing"] .app-orb__ring--1 { animation: app-breathe 2.6s ease-in-out infinite; }
body[data-state="playing"] .app-orb__ring--2 { animation: app-breathe 2.6s ease-in-out -.9s infinite; }

.app-play {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 142px;
	height: 142px;
	border-radius: 50%;
	background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--app-accent) 85%, #fff), var(--app-accent) 45%, var(--app-accent2) 100%);
	color: var(--app-icon, #fff);
	box-shadow: 0 0 0 8px color-mix(in srgb, var(--app-accent) 12%, transparent), 0 18px 40px -12px var(--app-accent);
	transition: transform .15s ease;
}
.app-play:active { transform: scale(.96); }
.app-play__i { position: absolute; inset: 0; display: none; place-items: center; }
.app-play .sao-radio-ico { width: 36%; height: 36%; }
.app-play__i--play .sao-radio-ico { transform: translateX(7%); }
body[data-state="paused"] .app-play__i--play,
body[data-state="error"] .app-play__i--play,
body[data-state="playing"] .app-play__i--pause,
body[data-state="loading"] .app-play__i--load { display: grid; }
body[data-state="loading"] .app-play__i--load .sao-radio-ico { animation: app-spin .9s linear infinite; }
body.is-blocked .app-play { animation: app-pulse 1.6s ease-out infinite; }

.app-live {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 14px;
	padding: 5px 14px;
	border: 1.5px solid color-mix(in srgb, var(--app-live) 60%, transparent);
	border-radius: 999px;
	background: color-mix(in srgb, var(--app-live) 15%, transparent);
	color: color-mix(in srgb, var(--app-live) 80%, #fff);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	line-height: 1.2;
}
.app-live i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
body[data-state="playing"] .app-live i { animation: app-blink 1.4s ease-in-out infinite; }
.app-name { margin: 14px 0 4px; font-size: 30px; font-weight: 700; line-height: 1.15; }
.app-sub { margin: 0; color: var(--muted); font-size: 17px; }
.app-show { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; font-size: 17px; }
.app-badge {
	padding: 3px 10px;
	border-radius: 6px;
	background: color-mix(in srgb, var(--app-accent) 70%, #0b4e5a);
	color: #fff;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	line-height: 1.3;
}
.app-show__title { font-weight: 700; }
.app-next { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.app-msg { margin: 10px 0 0; color: #ffd4d7; font-size: 15px; }

.app-np {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	max-width: 525px;
	min-height: 58px;
	margin-top: 20px;
	padding: 12px 18px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: rgba(4, 22, 26, .45);
	font-size: 17px;
}
.app-np__text { color: var(--muted); }
.app-np__song { color: var(--text); }
.app-dots { display: inline-flex; align-items: flex-end; gap: 3px; height: 14px; flex: 0 0 auto; }
.app-dots i { display: block; width: 3px; height: 3px; border-radius: 1px; background: var(--app-accent); transform-origin: bottom; }
body[data-state="playing"] .app-dots i { height: 14px; animation: app-eq 1s ease-in-out infinite; }
body[data-state="playing"] .app-dots i:nth-child(2) { animation-delay: -.6s; animation-duration: .9s; }
body[data-state="playing"] .app-dots i:nth-child(3) { animation-delay: -.3s; animation-duration: 1.15s; }
body[data-state="playing"] .app-dots i:nth-child(4) { animation-delay: -.8s; animation-duration: .8s; }

.app-volume { display: none; align-items: center; gap: 14px; margin-top: 26px; }
@media (hover: hover) and (pointer: fine) { .app-volume { display: flex; } }
.app-mute { color: var(--muted); }
.app-mute .ico { width: 20px; height: 20px; }
.app-mute__off { display: none; }
body.is-muted .app-mute__on { display: none; }
body.is-muted .app-mute__off { display: block; }
.app-range {
	-webkit-appearance: none;
	appearance: none;
	width: min(362px, 68vw);
	height: 4px;
	margin: 0;
	border-radius: 4px;
	background: linear-gradient(to right, var(--app-accent) var(--vol, 80%), rgba(255, 255, 255, .22) var(--vol, 80%));
	cursor: pointer;
}
.app-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.app-range::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; }
body.is-muted .app-range { opacity: .5; }

/* ---------- Parrilla ---------- */
.app-days { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin-left: -41px; margin-right: -41px; padding-left: 41px; padding-right: 41px; }
.app-days::-webkit-scrollbar { display: none; }
.app-day {
	flex: 0 0 auto;
	height: 44px;
	padding: 0 18px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: rgba(255, 255, 255, .06);
	color: #d4e1e4;
	font-size: 17px;
	font-weight: 700;
	white-space: nowrap;
}
.app-day[aria-pressed="true"] { border-color: transparent; background: linear-gradient(180deg, var(--app-accent), var(--app-accent2)); color: #fff; }
.app-grid { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.app-slot {
	display: flex;
	align-items: center;
	min-height: 86px;
	padding: 12px 14px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--card);
}
.app-slot__time { display: flex; flex-direction: column; flex: 0 0 74px; line-height: 1.25; }
.app-slot__time b { font-size: 19px; }
.app-slot__time span { color: var(--muted); font-size: 16px; }
.app-slot__img { flex: 0 0 60px; width: 60px; height: 60px; margin: 0 15px 0 13px; border-radius: 8px; object-fit: cover; background: rgba(255, 255, 255, .1); display: grid; place-items: center; font-weight: 700; font-size: 22px; }
.app-slot__title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 19px; font-weight: 700; line-height: 1.25; }
.app-slot__title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.app-slot.is-past { opacity: .45; }
.app-slot.is-live { border: 1.5px solid var(--app-accent); background: color-mix(in srgb, var(--app-accent) 13%, transparent); }
.app-onair { padding: 3px 8px; border-radius: 4px; background: var(--app-live); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Noticias ---------- */
.app-news { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.app-news a { display: flex; align-items: stretch; min-height: 105px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.app-news img { flex: 0 0 135px; width: 135px; object-fit: cover; background: rgba(255, 255, 255, .08); }
.app-news__body { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; padding: 14px 16px; }
.app-news strong { font-size: 18px; line-height: 1.33; }
.app-news small { color: var(--muted); font-size: 15px; }
.app-news a:hover strong { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Más ---------- */
.app-more { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.app-more a, .app-more button {
	display: flex;
	align-items: center;
	gap: 18px;
	width: 100%;
	min-height: 80px;
	padding: 12px 22px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--card);
	text-align: left;
}
.app-more a:hover, .app-more button:hover { background: rgba(255, 255, 255, .09); }
.app-more .ico { color: var(--app-accent); }
.app-more span { display: flex; flex-direction: column; min-width: 0; }
.app-more strong { font-size: 18px; line-height: 1.3; }
.app-more small { color: var(--muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-foot { margin: 38px 0 0; text-align: center; color: var(--muted); font-size: 15px; }
.is-standalone .app-more__install, .is-popup .app-more__install { display: none; }

/* ---------- Mini reproductor ---------- */
.app-mini {
	position: fixed;
	left: 50%;
	bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 10px);
	z-index: 20;
	display: none;
	align-items: center;
	gap: 12px;
	width: min(calc(var(--col) + 25px), calc(100% - 16px));
	min-height: 82px;
	padding: 10px 16px 10px 10px;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: color-mix(in srgb, var(--app-bg) 30%, #06171b);
	box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
	transform: translateX(-50%);
}
body:not([data-tab="radio"]) .app-mini { display: flex; }
.app-mini__play { position: relative; flex: 0 0 50px; width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(180deg, var(--app-accent), var(--app-accent2)); color: var(--app-icon, #fff); }
.app-mini__play .sao-radio-ico { width: 42%; height: 42%; }
.app-mini__play .app-play__i--play .sao-radio-ico { transform: translateX(8%); }
.app-mini__text { display: flex; flex-direction: column; min-width: 0; font-size: 17px; line-height: 1.2; }
.app-mini__label { font-size: 16px; }
.app-mini__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Pestañas ---------- */
.app-tabs {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 25;
	display: flex;
	height: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px));
	padding-bottom: env(safe-area-inset-bottom, 0px);
	background: #07151a;
	border-top: 1px solid rgba(255, 255, 255, .08);
}
.app-tabs button { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #c9d6d9; font-size: 14px; }
.app-tabs .ico { width: 28px; height: 28px; }
.app-tabs button[aria-selected="true"] { color: var(--app-accent); }

/* ---------- Hojas de instalación ---------- */
.app-sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .55); }
.app-sheet__box { width: 100%; max-width: 480px; padding: 22px 22px calc(22px + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0; background: #fff; color: #13262b; animation: app-up .25s ease; }
.app-sheet h3 { margin: 0 0 8px; font-size: 20px; }
.app-sheet p { margin: 0 0 10px; }
.app-sheet ol { margin: 0 0 14px; padding-left: 22px; }
.app-sheet li { margin-bottom: 6px; }
.app-small { color: #5b6b70; font-size: 14px; }
.app-btn { display: block; width: 100%; height: 48px; margin-top: 8px; border-radius: 12px; background: #e9eff0; color: #13262b; font-weight: 700; }

/* ---------- Ventana emergente ---------- */
.is-popup .app-logo { max-width: 220px; }
.is-popup .app-orb { transform: scale(.78); margin: -14px 0 -20px; }

/* ---------- Móvil ---------- */
@media (max-width: 600px) {
	body.app { --tabs-h: 68px; font-size: 16px; }
	body.app.has-banner { --banner-h: 74px; }
	.app-banner { min-height: 58px; padding: 8px 8px 8px 14px; gap: 10px; }
	.app-banner p { font-size: 15px; }
	.app-banner__btn { height: 38px; padding: 0 14px; font-size: 15px; }
	.app-logo { max-width: 240px; max-height: 110px; }
	.app-orb { width: 260px; height: 260px; margin-top: 16px; }
	.app-orb__ring--2 { inset: 31px; }
	.app-orb__ring--3 { inset: 64px; }
	.app-play { width: 120px; height: 120px; }
	.app-name { font-size: 26px; }
	.app-np { font-size: 15px; }
	.app-h2 { font-size: 24px; }
	.app-days { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
	.app-day { height: 40px; padding: 0 15px; font-size: 15px; }
	.app-slot { min-height: 76px; padding: 10px 12px; }
	.app-slot__time { flex-basis: 58px; }
	.app-slot__time b { font-size: 16px; }
	.app-slot__time span { font-size: 14px; }
	.app-slot__img { flex-basis: 48px; width: 48px; height: 48px; margin: 0 12px 0 8px; }
	.app-slot__title { font-size: 15px; }
	.app-news img { flex-basis: 100px; width: 100px; }
	.app-news strong { font-size: 15.5px; }
	.app-news small { font-size: 13px; }
	.app-more a, .app-more button { min-height: 70px; padding: 10px 16px; gap: 14px; }
	.app-more strong { font-size: 16px; }
	.app-more small { font-size: 14px; }
	.app-mini { min-height: 70px; }
	.app-mini__text { font-size: 15px; }
	.app-mini__label { font-size: 14px; }
	.app-tabs .ico { width: 24px; height: 24px; }
	.app-tabs button { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}

@keyframes app-spin { to { transform: rotate(360deg); } }
@keyframes app-blink { 50% { opacity: .25; } }
@keyframes app-up { from { transform: translateY(30px); opacity: 0; } }
@keyframes app-breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: .55; } }
@keyframes app-eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
@keyframes app-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--app-accent) 60%, transparent); } 100% { box-shadow: 0 0 0 22px transparent; } }
