/* WWP player (assets/js/listen.js) and the /listen/ song page. */

[data-wwp-yt] { position: relative; overflow: hidden; background: #000 var(--poster, none) center / cover no-repeat; }
[data-wwp-yt] .wwp-yt-host,
[data-wwp-yt] iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* YouTube's frame never takes a tap: its overlay links out of the site. */
[data-wwp-yt] iframe,
.wwp-yt iframe { pointer-events: none; }
.wwp-yt-shield { position: absolute; inset: 0 0 56px; z-index: 2; cursor: pointer; }
[data-wwp-yt].is-loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px; border-radius: 50%; border: 3px solid rgba(246,210,122,.25); border-top-color: #f6d27a; animation: wwp-yt-spin .8s linear infinite; z-index: 3; }
@keyframes wwp-yt-spin { to { transform: rotate(360deg); } }

.wwp-yt-bar { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 14px; background: rgba(4, 10, 12, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 0 0 1px rgba(246, 210, 122, .25), 0 8px 24px rgba(0, 0, 0, .45); color: #fff; font: 700 12px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.wwp-yt-play,
.wwp-yt-full { all: unset; cursor: pointer; flex: 0 0 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; }
.wwp-yt-play { color: #2a1a00; background: linear-gradient(180deg, #fff2c4, #f6d27a 45%, #d4a84b); }
.wwp-yt-full { color: #f6d27a; font-size: 16px; }
.wwp-yt-play:focus-visible, .wwp-yt-full:focus-visible, .wwp-yt-rail:focus-visible { outline: 2px solid #2ec4b6; outline-offset: 3px; }
.wwp-yt-time { flex: 0 0 auto; opacity: .9; }
.wwp-yt-rail { position: relative; flex: 1; height: 28px; cursor: pointer; touch-action: none; }
.wwp-yt-rail::before, .wwp-yt-fill { content: ""; position: absolute; left: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; }
.wwp-yt-rail::before { right: 0; background: rgba(255, 255, 255, .28); }
.wwp-yt-fill { background: linear-gradient(90deg, #2ec4b6, #f6d27a); box-shadow: 0 0 10px rgba(246, 210, 122, .6); }
.wwp-yt-knob { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #f6d27a; box-shadow: 0 0 0 3px rgba(0, 0, 0, .35), 0 0 12px rgba(246, 210, 122, .8); }
[data-wwp-yt]:fullscreen { background: #000; }

/* --- the song page --- */
.wwp-listen { display: block; box-sizing: border-box; flex: 1 1 100%; width: 100%; max-width: 980px; margin: 0 auto; padding: 76px 16px 48px; color: #f2f5f5; }
.wwp-listen > * { width: 100%; box-sizing: border-box; }
.wwp-listen-player { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5), 0 0 0 1px rgba(46, 196, 182, .2); }
.wwp-listen-start { all: unset; cursor: pointer; position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; color: #2a1a00; background: linear-gradient(180deg, #fff2c4, #f6d27a 45%, #d4a84b); box-shadow: 0 0 0 4px rgba(4, 71, 70, .6), 0 0 40px rgba(246, 210, 122, .5); z-index: 4; }
.wwp-listen-start:focus-visible { outline: 3px solid #2ec4b6; outline-offset: 4px; }
.wwp-yt.is-on .wwp-listen-start, .wwp-yt.is-on .wwp-rx-btn, [data-wwp-yt].is-loading .wwp-listen-start { display: none; }
.wwp-listen-head { margin: 18px 0 8px; }
.wwp-listen-head h1 { margin: 0 0 6px; font-size: clamp(22px, 4vw, 34px); line-height: 1.2; }
.wwp-listen-by { margin: 0; font-size: 17px; font-weight: 700; }
.wwp-listen-by a { color: inherit; text-decoration: none; }
.wwp-listen-made { color: #f6d27a; }
.wwp-listen-meta { margin: 4px 0 0; opacity: .65; font-size: 14px; }
.wwp-listen-about, .wwp-listen-more { margin-top: 22px; padding: 18px 20px; border-radius: 14px; background: rgba(3, 71, 70, .18); box-shadow: 0 0 0 1px rgba(46, 196, 182, .18); }
.wwp-listen-about h2, .wwp-listen-more h2 { margin: 0 0 10px; font-size: 18px; color: #f6d27a; }
.wwp-listen-about p { margin: 0 0 10px; line-height: 1.6; }
.wwp-listen-about.is-pending { opacity: .7; font-style: italic; }
.wwp-listen-sources { font-size: 13px; opacity: .7; }
.wwp-listen-sources a { color: #7ff3e6; }
.wwp-listen-more ul { margin: 0; padding-left: 18px; }
.wwp-listen-more a { color: #7ff3e6; }
.wwp-listen .wwp-rx { padding: 22px 0 0; }
.wwp-yt-snd { font-size: 15px; }
.wwp-yt-snd.is-muted { background: #f6d27a; color: #2a1a00; animation: wwp-yt-pulse 1.6s ease-in-out infinite; }
@keyframes wwp-yt-pulse { 50% { box-shadow: 0 0 0 6px rgba(246, 210, 122, .25); } }

/* Ready but not started: the poster and big button stay; the bar waits. */
.wwp-yt:not(.is-on) .wwp-yt-bar, .wwp-yt:not(.is-on) .wwp-yt-shield { display: none; }
.wwp-rx-play .wwp-rx-btn { z-index: 4; }

/* A post's own video, taken over in place (King's 16:9 box, floating mini player). */
.wwp-yt-attached .wwp-yt-shield { z-index: 2; }
.wwp-yt-attached .wwp-yt-bar { z-index: 3; }
.wwp-yt-attached .wwp-listen-start { width: 64px; height: 64px; margin: -32px; font-size: 24px; }
.wwp-yt-skip { font-size: 13px; }
@media (max-width: 480px) { .wwp-yt-bar { gap: 6px; padding: 6px 8px; } .wwp-yt-time { font-size: 11px; } .wwp-yt-skip { display: none; } }
.wwp-yt-bar:not(.has-list) .wwp-yt-skip { display: none; }
