/* Radio / Tv — front-end styles (grey theme + animations, mobile-app first) */

.rt-player,
.rt-list,
.rt-sheet,
.rt-lightbox,
.rt-notice {
	--rt-bg: #1b1c1e;
	--rt-surface: #242629;
	--rt-surface-2: #2c2f33;
	--rt-raised: #33373c;
	--rt-text: #f4f5f6;
	--rt-text-2: #a7abb1;
	--rt-text-3: #7c8189;
	--rt-border: rgba(255, 255, 255, .08);
	--rt-border-2: rgba(255, 255, 255, .14);
	--rt-accent: #f4c14b;
	--rt-accent-2: #ffd873;
	--rt-accent-soft: rgba(244, 193, 75, .16);
	--rt-red: #ff6b5e;
	--rt-radius: 18px;
	--rt-shadow: 0 10px 40px rgba(0, 0, 0, .45);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--rt-text);
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}
.rt-player *, .rt-list *, .rt-lightbox *, .rt-notice * { box-sizing: border-box; }
.rt-player button, .rt-list button { -webkit-tap-highlight-color: transparent; }

/* ============================================================ RADIO PLAYER */
.rt-player.rt-radio {
	position: relative;
	background: linear-gradient(180deg, #26282b 0%, #202124 100%);
	border: 1px solid var(--rt-border);
	border-radius: 22px;
	box-shadow: var(--rt-shadow);
	padding: 22px;
	max-width: 560px;
	margin: 0 auto 24px;
	animation: rt-fade-up .5s ease both;
}
@keyframes rt-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Head row */
.rt-np-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.rt-np-head__l { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rt-np-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .18em; color: var(--rt-text-2); text-transform: uppercase; }

/* Stylish corner station-name chip */
.rt-corner-name {
	display: inline-block; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
	padding: 5px 12px; border-radius: 999px; color: #201a08;
	background: linear-gradient(135deg, var(--rt-accent-2), var(--rt-accent));
	box-shadow: 0 3px 10px rgba(244, 193, 75, .28);
}

.rt-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rt-red); box-shadow: 0 0 0 0 rgba(255, 107, 94, .55); animation: rt-pulse 1.8s infinite; }
@keyframes rt-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 107, 94, .5); } 70% { box-shadow: 0 0 0 8px rgba(255, 107, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 107, 94, 0); } }

.rt-listeners { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; background: var(--rt-surface-2); border: 1px solid var(--rt-border); color: var(--rt-text-2); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.rt-listeners svg { color: var(--rt-accent); }
.rt-listeners__count { color: var(--rt-text); font-variant-numeric: tabular-nums; }
.rt-listeners__count:empty::after { content: "–"; color: var(--rt-text-3); }

/* Main: art + info */
.rt-np-main { display: flex; gap: 18px; align-items: center; }
.rt-art { position: relative; flex: 0 0 auto; width: 88px; height: 88px; border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, #3a3f6b 0%, #2b2e4a 100%); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px var(--rt-border); }
.rt-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.rt-art__icon { color: var(--rt-accent); opacity: .9; }


.rt-np-info { flex: 1 1 auto; min-width: 0; }

/* Song title with marquee / scrolling effect */
.rt-np-song { margin: 0 0 4px; font-size: 18px; line-height: 1.3; font-weight: 700; overflow: hidden; white-space: nowrap; }
.rt-np-song__link { display: inline-block; white-space: nowrap; color: var(--rt-text); text-decoration: none; max-width: 100%; }
.rt-np-song__link:hover { color: var(--rt-accent); }
.rt-np-song__link.is-scrolling { animation: rt-marquee var(--rt-mq-dur, 12s) linear infinite alternate; }
@keyframes rt-marquee { from { transform: translateX(0); } to { transform: translateX(calc(var(--rt-mq, 0px) * -1)); } }

.rt-np-track { margin: 0; font-size: 13.5px; color: var(--rt-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-meta:empty { display: none; }
.rt-meta + .rt-meta:not(:empty)::before { content: " — "; color: var(--rt-text-3); }
.rt-np-fallback { font-size: 14px; color: var(--rt-text-2); }

/* Live bar */
.rt-livebar { display: flex; align-items: center; justify-content: center; gap: 9px; background: var(--rt-surface); border: 1px solid var(--rt-border); border-radius: 12px; padding: 12px; margin: 18px 0 4px; font-size: 14px; color: var(--rt-text-2); font-weight: 500; }

/* Play button + glow */
.rt-play-wrap { display: flex; justify-content: center; padding: 18px 0 6px; }
.rt-btn--play { position: relative; width: 76px; height: 76px; border-radius: 50%; border: none; cursor: pointer; background: radial-gradient(circle at 30% 25%, var(--rt-accent-2), var(--rt-accent)); color: #201a08; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(244, 193, 75, .35); transition: transform .14s ease, box-shadow .2s ease; }
.rt-btn--play:hover { transform: scale(1.05); }
.rt-btn--play:active { transform: scale(.95); }
.rt-btn--play:focus-visible { outline: 3px solid var(--rt-accent-soft); outline-offset: 4px; }
.rt-btn__glow { position: absolute; inset: -6px; border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 0 rgba(244, 193, 75, .5); opacity: 0; }
.rt-radio.is-playing .rt-btn__glow { animation: rt-glow 2s ease-out infinite; opacity: 1; }
@keyframes rt-glow { 0% { box-shadow: 0 0 0 0 rgba(244, 193, 75, .45); } 70% { box-shadow: 0 0 0 18px rgba(244, 193, 75, 0); } 100% { box-shadow: 0 0 0 0 rgba(244, 193, 75, 0); } }
.rt-btn__spinner { width: 26px; height: 26px; border: 3px solid rgba(32, 26, 8, .35); border-top-color: #201a08; border-radius: 50%; animation: rt-spin .8s linear infinite; }
@keyframes rt-spin { to { transform: rotate(360deg); } }

/* Volume row */
.rt-controls-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px 2px; }
.rt-volume__icon { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; color: var(--rt-text-2); }
.rt-mute { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; background: var(--rt-surface-2); border: 1px solid var(--rt-border); color: var(--rt-text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: color .15s, background .15s; }
.rt-mute:hover { color: var(--rt-text); background: var(--rt-raised); }
.rt-mute.is-muted { color: var(--rt-red); }
.rt-volume__range { -webkit-appearance: none; appearance: none; flex: 1 1 auto; height: 6px; border-radius: 999px; outline: none; cursor: pointer; background: linear-gradient(90deg, var(--rt-accent) 0%, var(--rt-accent) var(--rt-vol, 80%), var(--rt-surface-2) var(--rt-vol, 80%), var(--rt-surface-2) 100%); }
.rt-volume__range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.rt-volume__range::-moz-range-thumb { width: 18px; height: 18px; border: none; border-radius: 50%; background: #fff; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.rt-volume__pct { flex: 0 0 auto; min-width: 42px; text-align: right; font-size: 13px; color: var(--rt-text-2); font-variant-numeric: tabular-nums; }

.rt-status { min-height: 16px; text-align: center; font-size: 12.5px; color: var(--rt-text-3); margin-top: 6px; }
.rt-status.is-error { color: var(--rt-red); }
.rt-status.is-warn { color: var(--rt-accent); }

.rt-divider { border: none; border-top: 1px solid var(--rt-border); margin: 18px 0; }

/* Sleep timer — label + options on one responsive horizontal line */
.rt-sleep { display: flex; align-items: center; gap: 12px; }
.rt-sleep__head { display: flex; align-items: center; gap: 8px; margin: 0; flex: 0 0 auto; min-width: 0; }
.rt-sleep__label { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.rt-sleep__label svg { color: var(--rt-accent); flex: 0 0 auto; }
.rt-sleep__remaining { font-size: 13px; color: var(--rt-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rt-sleep__opts { display: flex; flex: 1 1 auto; min-width: 0; gap: 8px; align-items: stretch; }
.rt-sleep__opt { display: flex; align-items: center; justify-content: center; text-align: center; flex: 1 1 0; min-width: 0; height: 42px; padding: 0 4px; margin: 0; border-radius: 12px; cursor: pointer; background: var(--rt-surface); border: 1px solid var(--rt-border); color: var(--rt-text-2); font-size: 14px; font-weight: 600; line-height: 1; box-sizing: border-box; transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s ease; }
.rt-sleep__opt:hover { background: var(--rt-raised); color: var(--rt-text); }
.rt-sleep__opt:active { transform: scale(.96); }
.rt-sleep__opt.is-active { background: linear-gradient(180deg, var(--rt-accent-2), var(--rt-accent)); color: #201a08; border-color: transparent; box-shadow: 0 4px 14px rgba(244, 193, 75, .3); }

.rt-foot-note { text-align: center; font-size: 12px; color: var(--rt-text-3); margin: 18px 0 0; }

/* ==================================================== IONIC-STYLE ACTION SHEET */
.rt-lb-homes { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rt-sheet { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: flex-end; justify-content: center; overscroll-behavior: contain; }
.rt-sheet[hidden] { display: none; }
.rt-sheet__backdrop { position: absolute; inset: 0; background: rgba(8, 9, 11, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s ease; }
.rt-sheet.is-open .rt-sheet__backdrop { opacity: 1; }
.rt-sheet__panel {
	position: relative; width: 100%; max-width: 600px; max-height: 92vh; overflow: hidden;
	display: flex; flex-direction: column;
	background: linear-gradient(180deg, #26282b 0%, #202124 100%);
	border-radius: 22px 22px 0 0; border: 1px solid var(--rt-border); border-bottom: none;
	box-shadow: 0 -12px 44px rgba(0,0,0,.5); padding: 8px 18px 0;
	transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .9, .3, 1);
}
.rt-sheet.is-open .rt-sheet__panel { transform: translateY(0); }
.rt-sheet__grabber { flex: 0 0 auto; width: 40px; height: 5px; border-radius: 999px; background: var(--rt-border-2); margin: 8px auto 6px; cursor: pointer; }
/* Close button stays pinned to the panel (outside the scroll area) and uses a
   high-contrast surface so it's always clearly visible. */
/* High-contrast, always-visible close button (bright accent, dark glyph). */
.rt-sheet__close { position: absolute; top: 12px; right: 14px; z-index: 20; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; background: #f4c14b; background: var(--rt-accent, #f4c14b); border: none; color: #201a08; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,.5); opacity: 1; visibility: visible; transition: transform .15s ease, background .15s ease, color .15s ease; }
.rt-sheet__close:hover { transform: scale(1.06); background: var(--rt-red, #ff6b5e); color: #fff; }
.rt-sheet__close:focus-visible { outline: 3px solid rgba(244,193,75,.5); outline-offset: 2px; }
/* Only the body scrolls, so the grabber + close button never scroll away. */
.rt-sheet__body { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
.rt-sheet__body .rt-player.rt-radio { margin: 0; max-width: none; border: none; box-shadow: none; background: transparent; padding: 10px 0 0; animation: none; }
/* Reserve space at the top-right so the listeners chip never sits under the close button. */
.rt-sheet__body .rt-player.rt-radio .rt-np-head { padding-right: 46px; }
body.rt-lb-open { overflow: hidden; }

/* ============================================================== TV PLAYER */
.rt-tv { position: relative; background: #000; border: 1px solid var(--rt-border); border-radius: var(--rt-radius); box-shadow: var(--rt-shadow); max-width: 900px; margin: 0 auto 24px; overflow: hidden; }
.rt-video-wrap { position: relative; background: #000; aspect-ratio: 16 / 9; width: 100%; }
.rt-video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #000; }
.rt-live-badge { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 5px 10px; border-radius: 999px; }
.rt-video__status { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; color: #fff; font-size: 14px; padding: 20px; background: rgba(0,0,0,.55); }
.rt-video__status.is-visible { display: flex; }

/* ==================================================================== LISTS */
.rt-list { max-width: 1120px; margin: 0 auto 24px; }
.rt-list__toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.rt-list__search { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; max-width: 380px; background: var(--rt-surface); border: 1px solid var(--rt-border); border-radius: 12px; padding: 0 12px; color: var(--rt-text-2); }
.rt-list__search-input { border: none; background: transparent; padding: 12px 0; font-size: 15px; width: 100%; outline: none; color: var(--rt-text); }
.rt-list__search-input::placeholder { color: var(--rt-text-3); }
.rt-list__sort { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--rt-text-2); }
.rt-list__sort-select { border: 1px solid var(--rt-border); background: var(--rt-surface); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--rt-text); cursor: pointer; }

/* Cards: 1:1 thumbnails, capped at 230px wide */
.rt-grid { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-items: center; }
.rt-grid--1 { grid-template-columns: 1fr; }
.rt-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rt-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rt-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rt-grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.rt-card { display: block; width: 100%; max-width: 230px; text-align: left; padding: 0; background: var(--rt-surface); border: 1px solid var(--rt-border); border-radius: var(--rt-radius); overflow: hidden; text-decoration: none; color: inherit; cursor: pointer; font: inherit; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.rt-card:hover { transform: translateY(-4px); box-shadow: var(--rt-shadow); border-color: var(--rt-border-2); }
.rt-card:focus-visible { outline: 3px solid var(--rt-accent-soft); outline-offset: 2px; }
.rt-card__thumb { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; background: linear-gradient(135deg, #3a3f6b, #2b2e4a); }
.rt-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rt-card__thumb-fallback { font-size: 40px; color: var(--rt-accent); }
.rt-card__play { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(180deg, var(--rt-accent-2), var(--rt-accent)); color: #201a08; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.35); opacity: 0; transform: translateY(8px) scale(.9); transition: opacity .16s ease, transform .16s ease; }
.rt-card:hover .rt-card__play, .rt-card:focus-visible .rt-card__play { opacity: 1; transform: translateY(0) scale(1); }
.rt-card__title { display: block; padding: 13px 15px; font-size: 15px; font-weight: 600; }

.rt-list__empty, .rt-list__noresults { color: var(--rt-text-2); font-size: 15px; padding: 24px 0; text-align: center; }

/* Title-only cards (thumbnails disabled in Settings) — no empty coloured box. */
.rt-card--no-thumb { display: flex; align-items: center; min-height: 56px; }
.rt-card--no-thumb .rt-card__title { padding: 16px 18px; font-size: 16px; }

/* Front-end pagination (centered). */
.rt-list__pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 24px auto 0; }
.rt-list__pager:empty { display: none; margin: 0; }
.rt-list__pager .rt-page-btn { min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px; cursor: pointer; background: var(--rt-surface); border: 1px solid var(--rt-border); color: var(--rt-text-2); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.rt-list__pager .rt-page-btn:hover:not(:disabled) { background: var(--rt-raised); color: var(--rt-text); border-color: var(--rt-border-2); }
.rt-list__pager .rt-page-btn.is-active { background: linear-gradient(180deg, var(--rt-accent-2), var(--rt-accent)); color: #201a08; border-color: transparent; }
.rt-list__pager .rt-page-btn:disabled { opacity: .4; cursor: default; }
.rt-notice { border: 1px dashed var(--rt-red); background: rgba(255, 107, 94, .12); color: #ffb4ac; padding: 10px 14px; border-radius: 10px; font-size: 14px; }

/* ============================================== SINGLE-PAGE: NAV + RELATED */
.rt-nav { max-width: 560px; margin: 0 auto 16px; }
.rt-nav__label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--rt-text-2); margin-bottom: 8px; }
.rt-nav__wrap { position: relative; }
.rt-nav__select { -webkit-appearance: none; appearance: none; width: 100%; padding: 14px 44px 14px 16px; font-size: 15px; font-weight: 700; color: var(--rt-text); background: var(--rt-surface-2); border: 2px solid var(--rt-accent); border-radius: 14px; cursor: pointer; min-height: 52px; box-shadow: 0 4px 16px rgba(0, 0, 0, .35); transition: border-color .15s, box-shadow .15s; }
.rt-nav__select:hover { border-color: var(--rt-accent-2); box-shadow: 0 6px 20px rgba(244, 193, 75, .25); }
.rt-nav__select:focus-visible { outline: 3px solid var(--rt-accent-soft); outline-offset: 2px; }
/* Make the opened option list readable across browsers / themes. */
.rt-nav__select option { background: #ffffff; color: #17181a; font-weight: 600; }
.rt-nav__chev { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--rt-accent); pointer-events: none; }

.rt-related { max-width: 1120px; margin: 26px auto 0; }
.rt-related__title { font-size: 15px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--rt-text-2); margin: 0 0 14px; }
.rt-related__grid { gap: 16px; }

/* ================================================================= MOBILE */
@media (max-width: 560px) {
	.rt-player.rt-radio { padding: 18px; }
	.rt-np-main { gap: 14px; }
	.rt-art { width: 72px; height: 72px; }
	.rt-np-song { font-size: 16px; }
	.rt-grid, .rt-grid--3, .rt-grid--4, .rt-grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	/* Compact toolbar: search + sort share one row, smaller controls. */
	.rt-list__toolbar { flex-wrap: nowrap; gap: 8px; align-items: center; }
	.rt-list__search { flex: 1 1 auto; min-width: 0; max-width: none; border-radius: 10px; padding: 0 10px; }
	.rt-list__search-input { padding: 9px 0; font-size: 14px; }
	.rt-list__sort { flex: 0 0 auto; gap: 6px; }
	.rt-list__sort > span { display: none; }
	.rt-list__sort-select { padding: 8px 10px; font-size: 13px; border-radius: 10px; }
}
@media (max-width: 480px) {
	/* Keep the sleep timer on a single line on small screens: drop the text
	   label (the clock icon stays) and tighten the option buttons. */
	.rt-sleep { gap: 8px; }
	.rt-sleep__label-text, .rt-sleep__remaining { display: none; }
	.rt-sleep__opts { gap: 6px; }
	.rt-sleep__opt { font-size: 13px; height: 40px; }
}
@media (max-width: 380px) {
	.rt-grid, .rt-grid--3, .rt-grid--4, .rt-grid--5 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.rt-live-dot, .rt-eq i, .rt-btn__glow, .rt-lightbox__backdrop, .rt-lightbox__dialog, .rt-player.rt-radio, .rt-np-song__link.is-scrolling { animation: none !important; }
}
