/* Spotify stream counter and playlist followers (/spotify-stream-counter/, /spotify-playlist-followers/),
   on top of entity.css: the Spotify accent, the count card with the cover and its record, the live
   equalizer, the milestone bar, the facts, the song lists, the follower chart. */
:root.p-spotify { --accent: #117A3A; --accent-soft: rgba(29, 185, 84, .13); --ss-green: #1DB954; --ss-groove: #1E1E21; --ss-groove-2: #2B2B30; }
:root.p-spotify[data-theme="dark"] { --accent: #1ED760; --accent-soft: rgba(30, 215, 96, .14); --ss-green: #1ED760; --ss-groove: #050506; --ss-groove-2: #222227; }
:root.p-spotify[data-theme="dark"] .ss-disc { box-shadow: 0 0 0 1px rgba(255, 255, 255, .09), 0 8px 18px -10px rgba(0, 0, 0, .8); }

/* the three Spotify links need about 600 px next to the logo: below 700 they live in the footer */
@media (max-width: 699.98px) {
    .p-spotify .head-nav { display: none; }
    .p-spotify .head-tools { margin-inline-start: auto; }
}

/* ---------- paste box ---------- */
.ss-form { margin-top: 22px; max-width: 640px; }
.ss-form .search-box input { font-size: 16px; }
/* one line kept for the message, so the page does not move when it shows */
.ss-msg { min-height: 20px; margin-top: 6px; color: var(--bad); font-size: 13px; }

/* ---------- the count card ---------- */
.ss-card { padding-bottom: 20px; }
.ss-card::before { background: var(--ss-green); }
.ss-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ss-cover { position: relative; flex: none; display: block; width: 84px; height: 84px; margin-inline-end: 20px; border-radius: 8px; }
.ss-cover img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; border-radius: 8px; object-fit: cover; background: var(--sunken); box-shadow: 0 10px 22px -16px var(--ss-tint, rgba(0, 0, 0, .5)); }
/* the record sliding out of its sleeve: grooves, a label in the cover's own colour, a sheen that turns while the count is live */
.ss-disc { position: absolute; z-index: 0; top: 5%; bottom: 5%; inset-inline-start: 26%; aspect-ratio: 1 / 1; border-radius: 50%;
    background:
        radial-gradient(circle, var(--surface) 0 4%, var(--ss-tint, var(--ss-green)) 4.5% 30%, var(--ss-groove) 31% 33%, transparent 34%),
        repeating-radial-gradient(circle, var(--ss-groove) 0 1.6px, var(--ss-groove-2) 1.6px 3.2px);
    box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .55); }
.ss-disc::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 20deg, transparent 0 16%, rgba(255, 255, 255, .13) 21%, transparent 27% 66%, rgba(255, 255, 255, .09) 71%, transparent 77%); }
.ss-card.is-live .ss-disc { animation: ss-spin 4.8s linear infinite; }
@keyframes ss-spin { to { transform: rotate(1turn); } }
.ss-cover.is-pl img { border-radius: 6px; }
.ss-who { min-width: 0; }
.ss-title { display: -webkit-box; overflow: hidden; font-size: 17px; font-weight: 750; line-height: 1.28; letter-spacing: -.01em; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ss-by { margin-top: 4px; color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.ss-by a { color: var(--ink); font-weight: 650; text-decoration: none; }
.ss-by a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ss-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.ss-sub bdi { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.ss-desc { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.ss-desc bdi { white-space: normal; }
.ss-e { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 3px; background: var(--muted); color: var(--surface); font-size: 10px; font-weight: 800; line-height: 1; }
.ss-card .now-kicker { margin-top: 16px; }
.ss-card .now-count { margin-top: 8px; }
.ss-card .now-asof b { color: var(--ink-2); font-weight: 650; font-variant-numeric: tabular-nums; }
/* four bars that bounce while the number is live */
.ss-eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 17px; height: 14px; }
.ss-eq i { display: block; flex: 1; height: 100%; border-radius: 1px; background: var(--ss-green); transform: scaleY(.3); transform-origin: 50% 100%; }
.ss-eq.is-on i { animation: ss-eq 1.15s ease-in-out infinite; }
.ss-eq.is-on i:nth-child(2) { animation-duration: .9s; animation-delay: -.35s; }
.ss-eq.is-on i:nth-child(3) { animation-duration: 1.3s; animation-delay: -.7s; }
.ss-eq.is-on i:nth-child(4) { animation-duration: 1s; animation-delay: -.2s; }
@keyframes ss-eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
.ss-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.ss-mini dt { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.ss-mini dd { margin-top: 1px; overflow: hidden; font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ss-mini .is-up { color: var(--good); }
.ss-mini .is-down { color: var(--bad); }
/* the way to the next round number */
.ss-goal { margin-top: 14px; }
.ss-goal-bar { height: 8px; overflow: hidden; border-radius: var(--r-pill); background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); }
.ss-goal-bar i { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--ss-green); transform-origin: 0 50%; transition: transform 1s linear; }
[dir="rtl"] .ss-goal-bar i { transform-origin: 100% 50%; }
.ss-goal-t { margin-top: 6px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
/* the time to the next check (playlists): a hairline along the bottom of the card */
.ss-next { position: absolute; inset: auto 0 0 0; height: 3px; overflow: hidden; }
.ss-next i { display: block; width: 100%; height: 100%; background: var(--ss-green); opacity: .45; transform: scaleX(0); transform-origin: 0 50%; }
.ss-next.is-run i { animation: ss-next var(--ss-every, 60s) linear forwards; }
@keyframes ss-next { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.ss-card.is-empty { padding: 22px 24px; }
.ss-card.is-empty::before { background: var(--line-2); }

.ss-note { max-width: 720px; margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* ---------- first ad: a fixed 300 x 250 (728 x 90 from 1000 px), so nothing moves when it fills ---------- */
div.ad.ad-counter { display: block; min-height: 270px; margin: 28px auto 0; text-align: center; overflow: hidden; }
.ad-counter ins[data-lc-slot] { display: inline-block; width: 300px; max-width: 100%; height: 250px; vertical-align: top; }
.ad-counter:has(ins[data-ad-status="unfilled"]) .ad-label { visibility: hidden; }
@media (max-width: 339px) { div.ad.ad-counter { overflow: visible; } .ad-counter ins[data-lc-slot] { max-width: none; margin: 0 calc((100% - 300px) / 2); } }
@media (min-width: 1000px) { div.ad.ad-counter { min-height: 112px; } .ad-counter ins[data-lc-slot] { width: 728px; height: 90px; } }
.ad-bottom { min-height: 130px; }
.ad-bottom:has(ins[data-ad-status="unfilled"]) .ad-label { visibility: hidden; }

/* ---------- about ---------- */
.ss-about { margin-top: 28px; padding: 18px 20px 20px; }
.ss-about .card-title { margin-bottom: 14px; }
.ss-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.ss-facts dt { color: var(--muted); font-size: 12px; font-weight: 600; }
.ss-facts dd { min-width: 0; margin-top: 3px; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.ss-facts dd a { color: inherit; text-decoration: none; }
.ss-facts dd a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ss-facts dd small { display: block; margin-top: 1px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.ss-about .ent-actions { margin-top: 18px; }
.ss-player { margin-top: 14px; }
.ss-player iframe { display: block; width: 100%; height: 152px; border: 0; border-radius: 12px; }

/* ---------- song lists ---------- */
.ss-list { margin-top: 16px; }
.ss-ol li { min-height: 60px; }
.ss-ol li.is-current { margin-inline: -10px; padding-inline: 10px; border-radius: var(--r-sm); background: var(--accent-soft); }
.ss-ol li.is-current + li { border-top-color: transparent; }
.ss-sq { width: 40px; height: 40px; border-radius: 6px; font-size: 15px; }
.ss-ol .t-nm bdi { display: -webkit-box; overflow: hidden; white-space: normal; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ss-ol .t-num { min-width: 96px; }
.ss-ol .t-bar { background: var(--ss-green); opacity: .75; }
.ss-share { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.ss-list + .spacenode-promo-card, .ss-about + .spacenode-promo-card, .ss-live + .spacenode-promo-card { max-width: none; margin-top: 16px; }
#ss-chart.ss-list { margin-top: 36px; }

/* ---------- followers since the page opened ---------- */
.ss-live { margin-top: 16px; }
.ss-chart { position: relative; height: 150px; margin: 6px 0 4px; }
.ss-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ss-chart .c-line { stroke: var(--ss-green); stroke-width: 2.25; }
.ss-chart .c-area { fill: var(--accent-soft); }
.ss-chart .c-jump { fill: var(--surface); stroke: var(--ss-green); stroke-width: 2; }
.ss-chart .c-now { fill: var(--ss-green); }
.ss-chart .c-glow { fill: var(--ss-green); opacity: .25; transform-box: fill-box; transform-origin: center; animation: ss-glow 2.4s ease-out infinite; }
@keyframes ss-glow { 0% { transform: scale(1); opacity: .35; } 100% { transform: scale(3.2); opacity: 0; } }
.ss-chart-wait { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13.5px; text-align: center; }
.ss-chart-wait[hidden] { display: none; }
.ss-chart-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ss-live .stats { margin-top: 14px; }
.ss-live .stat dd { font-variant-numeric: tabular-nums; }

/* ---------- the explainer's day-by-day picture ---------- */
.ss-steps { display: block; width: 100%; max-width: 520px; height: auto; margin: 14px 0 4px; color: var(--accent); }
.ss-steps .s-grid { stroke: var(--grid); stroke-width: 1; }
.ss-steps .s-line { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linejoin: round; }
.ss-steps .s-est { fill: none; stroke: var(--ss-green); stroke-width: 2; stroke-dasharray: 6 5; }
.ss-steps .s-dot { fill: var(--surface); stroke: currentColor; stroke-width: 2; }
.ss-steps text { fill: var(--muted); font: 600 11px var(--font); }

.ss-src { max-width: 720px; margin-top: 18px; color: var(--muted); font-size: 12.5px; }
.prose a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }

@media (min-width: 760px) {
    .ss-card:not(.is-empty) { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 72px; align-items: start; }
    .ss-head { display: contents; }
    .ss-cover { grid-row: 1 / span 7; width: 200px; height: 200px; margin: 4px 0 0; border-radius: 10px; }
    .ss-cover img { border-radius: 10px; }
    .ss-who, .ss-card .now-kicker, .ss-card .now-count, .ss-card .now-asof, .ss-mini, .ss-goal { grid-column: 2; }
    .ss-title { font-size: 21px; }
    .ss-by { font-size: 15px; }
    .ss-card .now-kicker { margin-top: 14px; }
}
@media (max-width: 640px) {
    .ss-form { margin-top: 18px; }
    .ss-card { padding: 18px 16px 18px; }
    .ss-cover { width: 76px; height: 76px; margin-inline-end: 18px; }
    .ss-title { font-size: 15.5px; }
    .ss-by { font-size: 13.5px; }
    .ss-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ss-about { padding: 16px 14px 18px; }
    .ss-ol .t-num { min-width: 84px; font-size: 14px; }
    .ss-mini dd { font-size: 14px; }
    .lede .lede-2, .ss-lede-d { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ss-card.is-live .ss-disc, .ss-eq.is-on i, .ss-chart .c-glow, .ss-next.is-run i { animation: none; }
    .ss-eq.is-on i { transform: scaleY(.7); }
    .ss-goal-bar i { transition: none; }
}
