/*
 * PPR Station Core — front-end components.
 * Colours come from CSS variables so any theme can restyle them.
 */
:root {
	--ppr-accent: #f5c400;
	--ppr-on-accent: #000;
	--ppr-bg: #000;
	--ppr-panel: #18181a;
	--ppr-rule: #2c2c30;
	--ppr-text: #f3f1ea;
	--ppr-muted: #a9a7a0;
	--ppr-live: #e5322d;
	--ppr-radius: 6px;
	--ppr-bar-h: 72px;
}

.ppr-icon { width: 1em; height: 1em; display: inline-block; vertical-align: middle; flex: none; }
.ppr-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- live dot + meter ---------- */
.ppr-live-dot {
	display: inline-block; width: .55em; height: .55em; border-radius: 50%;
	background: var(--ppr-muted); margin-right: .45em; vertical-align: .08em;
}
[data-ppr-player].is-playing .ppr-live-dot,
.ppr-onair.is-show-live .ppr-live-dot,
.ppr-countdown.is-live .ppr-live-dot,
.ppr-online .ppr-live-dot { background: var(--ppr-live); box-shadow: 0 0 0 3px rgba(229, 50, 45, .25); }

.ppr-meter { display: inline-flex; gap: 2px; align-items: flex-end; height: .9em; margin-left: .4em; vertical-align: -.05em; }
.ppr-meter i { width: 3px; height: 30%; background: var(--ppr-accent); border-radius: 1px; opacity: .35; }
[data-ppr-player].is-playing .ppr-meter i { opacity: 1; animation: ppr-level 1s ease-in-out infinite alternate; }
.ppr-meter i:nth-child(2n) { animation-duration: .7s !important; }
.ppr-meter i:nth-child(3n) { animation-duration: 1.3s !important; animation-delay: -.4s; }
.ppr-meter i:nth-child(5n) { animation-duration: .55s !important; }
@keyframes ppr-level { from { height: 20%; } to { height: 100%; } }

/* ---------- play button ---------- */
.ppr-play {
	--size: 48px;
	position: relative; width: var(--size); height: var(--size); flex: none;
	border-radius: 50%; border: 0; cursor: pointer; padding: 0;
	display: inline-grid; place-items: center;
	background: var(--ppr-accent); color: var(--ppr-on-accent);
	font-size: calc(var(--size) * .46);
	transition: transform .15s ease;
}
.ppr-play:hover { transform: scale(1.05); }
.ppr-play:active { transform: scale(.96); }
.ppr-play:focus-visible, .ppr-iconbtn:focus-visible { outline: 3px solid var(--ppr-text); outline-offset: 3px; }
.ppr-play > * { grid-area: 1 / 1; }
.ppr-play__icon-pause, .ppr-play__spinner { display: none; }
[data-ppr-player].is-playing .ppr-play__icon-play,
[data-ppr-player].is-connecting .ppr-play__icon-play { display: none; }
[data-ppr-player].is-playing .ppr-play__icon-pause { display: inline-block; }
[data-ppr-player].is-connecting .ppr-play__spinner {
	display: block; width: 46%; height: 46%; border-radius: 50%;
	border: 3px solid currentColor; border-right-color: transparent;
	animation: ppr-spin .8s linear infinite;
}
.ppr-play.is-resume { box-shadow: 0 0 0 0 rgba(245, 196, 0, .6); animation: ppr-pulse 1.6s ease-out 3; }
@keyframes ppr-spin { to { transform: rotate(360deg); } }
@keyframes ppr-pulse { to { box-shadow: 0 0 0 14px rgba(245, 196, 0, 0); } }

.ppr-iconbtn {
	display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
	background: transparent; border: 0; border-radius: 50%; color: inherit; cursor: pointer; font-size: 20px; padding: 0;
	text-decoration: none;
}
.ppr-iconbtn:hover { background: rgba(255, 255, 255, .08); color: var(--ppr-accent); }

/* ---------- volume ---------- */
.ppr-vol { display: flex; align-items: center; gap: 4px; }
.ppr-vol__off { display: none; }
.is-muted .ppr-vol__on { display: none; }
.is-muted .ppr-vol__off { display: inline-block; }
.ppr-vol input[type=range] {
	-webkit-appearance: none; appearance: none; width: 96px; height: 4px; border-radius: 2px; cursor: pointer;
	background: linear-gradient(to right, var(--ppr-accent) var(--ppr-fill, 80%), var(--ppr-rule) var(--ppr-fill, 80%));
}
.ppr-vol input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ppr-text); border: 0; }
.ppr-vol input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ppr-text); border: 0; }
.ppr-vol input[type=range]:focus-visible { outline: 2px solid var(--ppr-text); outline-offset: 4px; }

/* ---------- player bar ---------- */
body.has-ppr-bar { padding-bottom: var(--ppr-bar-h); }
.ppr-bar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990;
	background: var(--ppr-bg); color: var(--ppr-text);
	border-top: 2px solid var(--ppr-accent);
	padding-bottom: env(safe-area-inset-bottom);
}
.ppr-bar__inner {
	max-width: 1240px; margin: 0 auto; height: var(--ppr-bar-h);
	display: flex; align-items: center; gap: 14px; padding: 0 16px;
}
.ppr-bar__art { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; background: var(--ppr-panel); flex: none; }
.ppr-bar__meta { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.ppr-bar__status { font-size: 12px; color: var(--ppr-muted); }
.ppr-bar__title { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ppr-bar__listeners, .ppr-console__listeners { font-size: 13px; color: var(--ppr-muted); white-space: nowrap; }
.ppr-bar .ppr-vol { order: 5; }
.ppr-bar__popout { order: 6; }
@media (max-width: 640px) {
	.ppr-bar .ppr-vol, .ppr-bar__listeners { display: none; }
	.ppr-bar__inner { gap: 10px; }
}

/* ---------- console (in-page player) ---------- */
.ppr-console {
	display: flex; gap: 20px; align-items: center;
	background: var(--ppr-panel); color: var(--ppr-text);
	border-radius: var(--ppr-radius); padding: 20px;
}
.ppr-console__art img { width: 120px; height: 120px; object-fit: cover; border-radius: 4px; display: block; background: #000; }
.ppr-console__body { min-width: 0; flex: 1; }
.ppr-console__status { margin: 0 0 4px; font-size: 13px; color: var(--ppr-muted); }
.ppr-console__title { margin: 0 0 14px; font-size: 1.2rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.ppr-console__controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ppr-console__controls .ppr-play { --size: 56px; }
.ppr-console__history { margin-top: 18px; border-top: 1px solid var(--ppr-rule); padding-top: 12px; }
.ppr-console__history h3 { font-size: 13px; color: var(--ppr-muted); margin: 0 0 6px; font-weight: 600; }
.ppr-console__history ol { margin: 0; padding-left: 1.2em; font-size: 14px; line-height: 1.6; }
.ppr-console--compact { padding: 14px; gap: 14px; }
.ppr-console--compact .ppr-console__art img { width: 72px; height: 72px; }
.ppr-console--compact .ppr-console__title { font-size: 1rem; margin-bottom: 10px; }
.ppr-console--compact .ppr-play { --size: 44px; }
@media (max-width: 480px) {
	.ppr-console { flex-direction: column; align-items: stretch; text-align: left; }
	.ppr-console__art img { width: 100%; height: auto; aspect-ratio: 1; }
	.ppr-console--compact { flex-direction: row; align-items: center; }
	.ppr-console--compact .ppr-console__art img { width: 64px; height: 64px; }
}

/* ---------- on air ---------- */
.ppr-onair { display: grid; gap: 14px; }
.ppr-onair__label { display: block; font-size: 13px; color: var(--ppr-muted); margin-bottom: 2px; }
.ppr-onair__title { display: block; font-size: 1.05rem; line-height: 1.3; }
.ppr-onair__meta { display: block; font-size: 14px; color: var(--ppr-muted); }
.ppr-onair__meta:empty { display: none; }
.ppr-onair__next { border-top: 1px solid var(--ppr-rule); padding-top: 12px; }

/* ---------- countdown ---------- */
.ppr-countdown__show { margin: 0 0 10px; font-weight: 700; }
.ppr-countdown__when { display: block; font-weight: 400; color: var(--ppr-muted); font-size: 14px; }
.ppr-countdown__clock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.ppr-countdown__clock span { background: rgba(255, 255, 255, .06); border-radius: 4px; padding: 8px 4px; font-size: 12px; color: var(--ppr-muted); }
.ppr-countdown__clock b { display: block; font-size: 1.6rem; line-height: 1.1; color: var(--ppr-text); font-variant-numeric: tabular-nums; }
.ppr-countdown__live { margin: 0; font-weight: 700; }

/* ---------- upcoming ---------- */
.ppr-upcoming { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ppr-upcoming li { display: flex; gap: 12px; align-items: center; }
.ppr-upcoming time { flex: none; width: 50px; text-align: center; border: 1px solid var(--ppr-rule); border-radius: 4px; padding: 4px 0; line-height: 1.1; }
.ppr-upcoming__mon { display: block; font-size: 11px; color: var(--ppr-accent); }
.ppr-upcoming__day { display: block; font-size: 1.3rem; font-weight: 700; }
.ppr-upcoming a { font-weight: 600; }
.ppr-upcoming__time { display: block; font-size: 13px; color: var(--ppr-muted); }

/* ---------- schedule grid ---------- */
.ppr-schedule__note { color: var(--ppr-muted); }
.ppr-schedule__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ppr-schedule__day { border: 1px solid var(--ppr-rule); border-radius: var(--ppr-radius); padding: 12px; }
.ppr-schedule__day.is-today { border-color: var(--ppr-accent); }
.ppr-schedule__day h3 { margin: 0 0 8px; font-size: 1rem; }
.ppr-schedule__day.is-today h3 { color: var(--ppr-accent); }
.ppr-schedule__day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ppr-schedule__day time { display: block; font-size: 13px; color: var(--ppr-muted); }
.ppr-schedule__empty { margin: 0; font-size: 14px; color: var(--ppr-muted); }
.ppr-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 3px; margin-left: 4px; vertical-align: 1px; }
.ppr-badge--live { background: var(--ppr-live); color: #fff; }

.ppr-taken { list-style: none; padding: 0; margin: 0 0 1em; }
.ppr-taken li { padding: 6px 0; border-bottom: 1px solid var(--ppr-rule); }

/* ---------- platforms, sponsors, social ---------- */
.ppr-platforms, .ppr-sponsors, .ppr-social { list-style: none; margin: 0; padding: 0; }
.ppr-platforms { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.ppr-platforms a { display: grid; place-items: center; min-height: 56px; padding: 8px; border-radius: var(--ppr-radius); background: rgba(255, 255, 255, .04); border: 1px solid var(--ppr-rule); text-decoration: none; }
.ppr-platforms a:hover { border-color: var(--ppr-accent); }
.ppr-platforms img { max-height: 64px; width: auto; max-width: 100%; display: block; }
.ppr-sponsors { display: grid; gap: 12px; }
.ppr-sponsors img { display: block; width: 100%; height: auto; border-radius: 4px; }
.ppr-social { display: flex; flex-wrap: wrap; gap: 6px; }
.ppr-social a { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: inherit; border: 1px solid var(--ppr-rule); font-size: 17px; }
.ppr-social a:hover, .ppr-social a:focus-visible { background: var(--ppr-accent); color: var(--ppr-on-accent); border-color: var(--ppr-accent); }

.ppr-online { margin: 0; }

/* ---------- forms ---------- */
.ppr-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ppr-field--wide, .ppr-form__actions { grid-column: 1 / -1; }
@media (max-width: 600px) { .ppr-form { grid-template-columns: 1fr; } }
.ppr-field label, .ppr-field legend { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.ppr-field fieldset { border: 0; margin: 0; padding: 0; }
.ppr-req { color: var(--ppr-accent); }
.ppr-field input[type=text], .ppr-field input[type=email], .ppr-field input[type=tel], .ppr-field select, .ppr-field textarea {
	width: 100%; box-sizing: border-box; font: inherit; color: inherit;
	background: rgba(255, 255, 255, .04); border: 1px solid var(--ppr-rule); border-radius: 4px;
	padding: 11px 12px; min-height: 46px;
}
.ppr-field select option { color: #000; }
.ppr-field input:focus, .ppr-field select:focus, .ppr-field textarea:focus { outline: 2px solid var(--ppr-accent); outline-offset: 0; border-color: var(--ppr-accent); }
.ppr-radios { display: flex; gap: 18px; }
.ppr-radios label { font-weight: 400; display: inline-flex; gap: 6px; align-items: center; }
.ppr-form__fine { font-size: 13px; color: var(--ppr-muted); margin: 10px 0 0; }
.ppr-form__fine a { color: inherit; }
.ppr-form-wrap--newsletter .ppr-form { grid-template-columns: 1fr; gap: 10px; }
.ppr-button {
	display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; cursor: pointer;
	background: var(--ppr-accent); color: var(--ppr-on-accent); border: 0; border-radius: 4px;
	padding: 12px 22px; text-decoration: none; min-height: 46px;
}
.ppr-button:hover { filter: brightness(1.08); }
.ppr-button:focus-visible { outline: 3px solid var(--ppr-text); outline-offset: 2px; }
.ppr-notice { padding: 12px 14px; border-radius: 4px; margin: 0 0 16px; border-left: 4px solid var(--ppr-accent); background: rgba(255, 255, 255, .05); }
.ppr-notice--ok { border-left-color: #3fb950; }
.ppr-notice--error { border-left-color: var(--ppr-live); }

/* ---------- pop-out window ---------- */
body.ppr-popout {
	margin: 0; min-height: 100vh; background: var(--ppr-bg); color: var(--ppr-text);
	font-family: "Archivo Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.ppr-popout__main { max-width: 420px; margin: 0 auto; padding: 20px 16px 32px; display: grid; gap: 18px; }
.ppr-popout__logo { max-width: 220px; height: auto; display: block; }
.ppr-popout .ppr-console { flex-direction: column; align-items: stretch; }
.ppr-popout .ppr-console__art img { width: 100%; height: auto; aspect-ratio: 1; }
.ppr-popout .ppr-onair { background: var(--ppr-panel); border-radius: var(--ppr-radius); padding: 16px; }
.ppr-popout__back { text-align: center; font-size: 13px; margin: 0; }
.ppr-popout__back a { color: var(--ppr-muted); }

@media (prefers-reduced-motion: reduce) {
	.ppr-meter i, .ppr-play, .ppr-play.is-resume { animation: none !important; transition: none !important; }
	[data-ppr-player].is-playing .ppr-meter i { height: 70%; }
	[data-ppr-player].is-connecting .ppr-play__spinner { animation-duration: 2.4s; }
}

/* Artwork slots: show logos whole, album covers fill. */
img[data-ppr-field="art"] { object-fit: contain; background: #000; }
