/* Anti Radio Player — frontend styles
 *
 * Every selector is scoped under .arp so theme styles cannot collide with it.
 * Typography is Poppins throughout, exposed as --arp-font so a theme can
 * override the whole player with a single declaration.
 *
 * @package   Anti Radio Player
 * @author    Abdulrahman Alili
 * @copyright 2026 Anti Radio
 * @license   GPL-2.0-or-later
 */

.arp{
  --arp-accent:#FF2E88;
  --arp-accent2:#2B34FF;
  --arp-paper:#DEDCD2;
  --arp-ink:#101010;
  --arp-dim:rgba(16,16,16,.58);
  --arp-line:rgba(16,16,16,.2);
  --arp-font:'Poppins',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;

  position:relative;
  box-sizing:border-box;
  margin:1.5em 0;
  background:var(--arp-paper);
  color:var(--arp-ink);
  border:2px solid var(--arp-ink);
  font-family:var(--arp-font);
  font-size:15px;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
}
.arp *,.arp *::before,.arp *::after{box-sizing:border-box}
.arp p{margin:0}
.arp b{font-weight:600}

/* in case the theme never defines this class */
.arp .screen-reader-text{
  position:absolute !important;
  width:1px;height:1px;overflow:hidden;
  clip:rect(1px,1px,1px,1px);clip-path:inset(50%);
  white-space:nowrap;border:0;padding:0;margin:-1px;
}

/* ---------- header ---------- */
.arp__head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:8px 14px;
  background:var(--arp-ink); color:var(--arp-paper);
  font-size:10.5px; letter-spacing:.18em; text-transform:uppercase;
}
.arp__eyebrow{white-space:nowrap}
.arp__state{display:inline-flex;align-items:center;gap:7px;white-space:nowrap}
.arp__dot{width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.35);flex:none}
.arp__state[data-arp-state="1"] .arp__dot{
  background:var(--arp-accent);
  animation:arp-pulse 2s infinite;
}
@keyframes arp-pulse{
  0%{box-shadow:0 0 0 0 rgba(255,46,136,.6)}
  70%{box-shadow:0 0 0 8px rgba(255,46,136,0)}
  100%{box-shadow:0 0 0 0 rgba(255,46,136,0)}
}

/* ---------- body ---------- */
.arp__body{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:18px;
  align-items:center;
  padding:18px;
}
.arp__art{
  width:96px; height:96px; flex:none;
  border:2px solid var(--arp-ink);
  background:var(--arp-ink);
  object-fit:cover; display:block;
  margin:0; border-radius:0; max-width:none;
  /* Purely decorative — block clicks/taps so no theme lightbox or native
     tooltip pops up the alt text over the artwork. */
  pointer-events:none;

  /* The beat scale and the tilt of the card are combined in a single
     transform, otherwise one would overwrite the other. */
  transform:rotate(var(--arp-art-rot,0deg)) scale(calc(1 + var(--arp-beat,0) * 0.03));
  transition:transform .1s cubic-bezier(.2,.7,.3,1);
}
.arp__now{min-width:0}
.arp__label{
  font-size:10.5px; letter-spacing:.2em; text-transform:uppercase;
  color:var(--arp-dim); margin-bottom:5px !important;
}
.arp__track{
  font-size:clamp(17px,2.6vw,24px);
  font-weight:700; line-height:1.12; letter-spacing:-.01em;
  overflow-wrap:anywhere;
}
.arp__artist{margin-top:4px !important;font-size:13.5px;color:var(--arp-dim);overflow-wrap:anywhere}
/* ---------- button ---------- */
.arp__play{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  width:96px; height:96px; flex:none; padding:0;
  background:var(--arp-accent); color:var(--arp-ink);
  border:2px solid var(--arp-ink); border-radius:0;
  font-family:inherit; font-size:10.5px; font-weight:600;
  letter-spacing:.14em; text-transform:uppercase; text-align:center;
  cursor:pointer;
  box-shadow:4px 4px 0 var(--arp-ink);
  transition:transform .09s cubic-bezier(.2,0,.2,1),
             box-shadow .09s cubic-bezier(.2,0,.2,1),
             background-color .18s ease,
             color .18s ease;
  /* cancels the 300ms tap delay and the blue highlight on mobile */
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
  -webkit-user-select:none; user-select:none;
  will-change:transform;
}
.arp__play:hover{transform:translate(2px,2px);box-shadow:2px 2px 0 var(--arp-ink)}
.arp__play:active,
.arp__play.arp-pressed{transform:translate(4px,4px);box-shadow:0 0 0 var(--arp-ink)}
.arp__play:focus-visible{outline:3px solid var(--arp-accent2);outline-offset:3px}
.arp__play[data-on="1"]{background:var(--arp-accent2);color:#fff}

/* icon and spinner share the same box so the swap never jumps */
.arp__ico{
  position:relative; display:flex; align-items:center; justify-content:center;
  width:26px; height:26px; flex:none;
}
.arp__ico svg{
  width:24px;height:24px;fill:currentColor;display:block;
  transition:opacity .12s ease,transform .12s ease;
}
/* Play (▶) and pause (❚❚) live in the same <svg> and cross-fade + rotate
   into one another instead of swapping instantly. transform-origin is set
   in the SVG's own 24x24 coordinate space, which is exactly the icon's
   center, so the rotate/scale never drifts off-axis. */
.arp__icoplay,.arp__icopause{
  transform-origin:12px 12px;
  transition:opacity .22s cubic-bezier(.34,1.15,.4,1),
             transform .22s cubic-bezier(.34,1.15,.4,1);
}
.arp__icopause{opacity:0;transform:scale(.4) rotate(-50deg)}
.arp__play[data-on="1"] .arp__icoplay{opacity:0;transform:scale(.4) rotate(50deg)}
.arp__play[data-on="1"] .arp__icopause{opacity:1;transform:scale(1) rotate(0deg)}

.arp__ring{
  position:absolute; inset:1px;
  border:2px solid currentColor; border-top-color:transparent; border-radius:50%;
  opacity:0; transform:scale(.7);
  transition:opacity .12s ease,transform .12s ease;
}
/* loading: the colour stays, only the icon turns into a ring */
.arp__play[data-on="2"] svg{opacity:0;transform:scale(.7)}
.arp__play[data-on="2"] .arp__ring{opacity:1;transform:scale(1);animation:arp-spin .7s linear infinite}
@keyframes arp-spin{to{transform:rotate(360deg)}}

/* The label pops in fresh every time data-on changes. The rule only matches
   the instant the attribute flips to a new value, which is what makes the
   animation restart on every toggle instead of running once and freezing. */
.arp__playtext{display:block;min-width:5.5em}
/* A column flex item is as wide as its text, so a long label ("Playing in the
   window") ran out of the square button. Keep it inside and let it wrap. */
.arp__playtext{max-width:100%;box-sizing:border-box;padding:0 6px;white-space:normal;line-height:1.3;overflow-wrap:break-word}
.arp__play:disabled .arp__playtext{letter-spacing:.08em}
.arp__play[data-on="0"] .arp__playtext,
.arp__play[data-on="1"] .arp__playtext,
.arp__play[data-on="2"] .arp__playtext{
  animation:arp-label-pop .22s cubic-bezier(.2,.7,.3,1);
}
@keyframes arp-label-pop{
  0%{opacity:0;transform:translateY(4px)}
  100%{opacity:1;transform:translateY(0)}
}

/* ---------- foot ---------- */
.arp__foot{
  display:flex; align-items:center; gap:18px; flex-wrap:wrap;
  padding:10px 18px;
  border-top:2px solid var(--arp-ink);
  font-size:10.5px; letter-spacing:.18em; text-transform:uppercase;
  color:var(--arp-dim);
}
.arp__vu{display:inline-flex;align-items:flex-end;gap:2px;height:24px;flex:none}
.arp__vu i{
  width:3px;height:20%;background:var(--arp-ink);display:block;opacity:.45;
  transform-origin:bottom;
}

/* Fallback: a decorative animation runs when audio analysis is unavailable */
.arp__vu[data-on="1"] i{opacity:1;animation:arp-bounce .8s ease-in-out infinite alternate}
.arp__vu i:nth-child(2n){animation-duration:.62s}
.arp__vu i:nth-child(3n){animation-duration:1.05s}
.arp__vu i:nth-child(5n){animation-duration:.47s}
@keyframes arp-bounce{from{height:14%}to{height:100%}}

/* Once the live meter is attached the animation stops and JS drives the
   height. This is not decoration but a real readout of the audio, so it
   keeps running under reduced motion as well. */
.arp__vu.arp-vu-live i{
  animation:none !important;
  opacity:1;
  transition:height .07s linear;
}
.arp__vu.arp-vu-live[data-on="0"] i{opacity:.45;height:20% !important}

.arp__vol{display:inline-flex;align-items:center;gap:8px;margin:0}
.arp__volicon{width:16px;height:16px;fill:var(--arp-dim);flex:none}
.arp__vol input[type=range]{
  -webkit-appearance:none;appearance:none;
  width:110px;height:2px;margin:0;padding:0;
  background:var(--arp-ink);cursor:pointer;border:0;
}
.arp__vol input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none;width:14px;height:14px;
  background:var(--arp-accent);border:2px solid var(--arp-ink);border-radius:0;
}
.arp__vol input[type=range]::-moz-range-thumb{
  width:14px;height:14px;background:var(--arp-accent);
  border:2px solid var(--arp-ink);border-radius:0;
}
.arp__vol input[type=range]:focus-visible{outline:3px solid var(--arp-accent2);outline-offset:4px}

.arp__listeners{margin-left:auto;white-space:nowrap}
.arp__listeners b{color:var(--arp-ink)}

.arp__close{
  background:none;border:0;padding:0 2px;margin-left:8px;
  font-size:20px;line-height:1;color:var(--arp-dim);cursor:pointer;
}
.arp__close:hover{color:var(--arp-ink)}

/* ---------- tilted card ---------- */
.arp--tilt{
  transform:rotate(-.5deg);
  box-shadow:12px 12px 0 var(--arp-accent2);
  margin-bottom:2.2em;
}
/* The text inside the tilted card is not counter-rotated — the whole block
   leans, like a riso print. Only the artwork is straightened so it stays sharp: */
.arp--tilt{--arp-art-rot:.5deg}

@media (max-width:600px){
  .arp--tilt{transform:none;box-shadow:8px 8px 0 var(--arp-accent2);margin-bottom:1.6em}
  .arp--tilt{--arp-art-rot:0deg}
}

/* ---------- compact ---------- */
.arp--compact .arp__body{grid-template-columns:auto 1fr auto;gap:12px;padding:12px}
.arp--compact .arp__art{width:56px;height:56px}
.arp--compact .arp__play{width:56px;height:56px;gap:0;box-shadow:3px 3px 0 var(--arp-ink)}
.arp--compact .arp__play span{display:none}
.arp--compact .arp__play svg{width:22px;height:22px}
.arp--compact .arp__track{font-size:15px}
.arp--compact .arp__artist{font-size:12px}

/* ---------- bar ---------- */
.arp--bar{
  margin:0;
  border:0;
  border-top:2px solid var(--arp-ink);
}
.arp--bar .arp__body{
  grid-template-columns:auto 1fr auto;
  gap:14px; padding:10px 16px;
}
.arp--bar .arp__art{width:48px;height:48px}
.arp--bar .arp__play{
  width:48px;height:48px;gap:0;box-shadow:3px 3px 0 var(--arp-ink);order:-1;
}
.arp--bar .arp__play span{display:none}
.arp--bar .arp__play svg{width:20px;height:20px}
.arp--bar .arp__track{font-size:15px}
.arp--bar .arp__artist{font-size:12px}
.arp--bar .arp__foot{padding:6px 16px}

.arp.arp-is-sticky{
  position:fixed; left:0; right:0; bottom:0; z-index:99990;
  margin:0;
  box-shadow:0 -6px 24px rgba(0,0,0,.14);
  transform:translateY(100%);
  transition:transform .28s ease;
}
.arp.arp-is-sticky.arp-in{transform:translateY(0)}
.arp.arp-is-sticky.arp-dismissed{display:none}

/* ---------- small screens ---------- */
@media (max-width:600px){
  .arp__body{
    grid-template-columns:auto 1fr;
    grid-template-areas:"art now" "btn btn";
    row-gap:14px;
  }
  .arp__art{grid-area:art;width:72px;height:72px}
  .arp__now{grid-area:now}
  .arp__play{grid-area:btn;width:100%;height:auto;padding:14px;flex-direction:row;gap:10px}
  .arp__play span{display:inline}
  .arp__listeners{margin-left:0}

  .arp--bar .arp__body,
  .arp--compact .arp__body{
    grid-template-columns:auto 1fr auto;
    grid-template-areas:none;
    row-gap:0;
  }
  .arp--bar .arp__play,
  .arp--compact .arp__play{width:48px;height:48px;padding:0;flex-direction:column}
  .arp--bar .arp__play span,
  .arp--compact .arp__play span{display:none}
  .arp--bar .arp__foot{gap:12px}
  .arp--bar .arp__vol{display:none}
}

@media (prefers-reduced-motion:reduce){
  .arp *,.arp{animation:none !important;transition:none !important}
  /* the soft transition is kept so the live meter does not freeze */
  .arp__vu.arp-vu-live i{transition:height .07s linear !important}
}

/* ---------- popup button ---------- */
.arp__popup{
  display:inline-flex;align-items:center;gap:7px;
  background:none;border:0;padding:2px 0;margin:0;
  font-family:inherit;font-size:10.5px;font-weight:600;
  letter-spacing:.16em;text-transform:uppercase;
  color:var(--arp-dim);cursor:pointer;
  border-bottom:1.5px solid transparent;
  transition:color .15s ease,border-color .15s ease;
  touch-action:manipulation;-webkit-tap-highlight-color:transparent;
}
.arp__popup:hover{color:var(--arp-ink);border-bottom-color:var(--arp-ink)}
.arp__popup:focus-visible{outline:3px solid var(--arp-accent2);outline-offset:3px}
.arp__popup svg{width:14px;height:14px;fill:currentColor;flex:none}
.arp__popup[data-open="1"]{color:var(--arp-accent2);border-bottom-color:var(--arp-accent2)}

.arp__play:disabled{opacity:.45;cursor:default;box-shadow:4px 4px 0 var(--arp-ink)}
.arp__play:disabled:hover{transform:none;box-shadow:4px 4px 0 var(--arp-ink)}

/* ---------- standalone window page ---------- */
body.arp-popup-page{
  margin:0;padding:14px;
  background:var(--arp-paper,#DEDCD2);
  min-height:100vh;
  display:flex;align-items:center;justify-content:center;
}
body.arp-popup-page .arp{margin:0;width:100%;max-width:420px}
body.arp-popup-page .arp__body{grid-template-columns:1fr;justify-items:center;text-align:center;gap:16px}
body.arp-popup-page .arp__art{width:150px;height:150px}
body.arp-popup-page .arp__now{width:100%}
body.arp-popup-page .arp__play{width:100%;height:auto;padding:15px;flex-direction:row;gap:10px}
body.arp-popup-page .arp__foot{justify-content:center;gap:14px}
body.arp-popup-page .arp__listeners{margin-left:0}

@media (max-height:520px){
  body.arp-popup-page .arp__art{width:96px;height:96px}
}

/* ---------- search links ---------- */
.arp__links{display:inline-flex;align-items:center !important;flex-wrap:nowrap;gap:6px;vertical-align:middle}
.arp__links--now{margin-top:8px;display:inline-flex;flex-wrap:nowrap;align-items:center}
.arp__link{
  display:inline-flex;align-items:center;justify-content:center;
  width:22px;height:22px;flex:none;
  border:1.5px solid var(--arp-line);
  color:var(--arp-dim);text-decoration:none;
  transition:color .15s ease,border-color .15s ease,background .15s ease;
}
.arp__link svg{width:13px;height:13px;fill:currentColor}
.arp__link:hover{color:var(--arp-paper);background:var(--arp-ink);border-color:var(--arp-ink)}
.arp__link--sp:hover{background:#1DB954;border-color:#1DB954;color:#fff}
.arp__link--yt:hover{background:#FF0000;border-color:#FF0000;color:#fff}
.arp__link:focus-visible{outline:2px solid var(--arp-accent2);outline-offset:2px}

/* ---------- recent tracks ---------- */
.arp__history{border-top:2px solid var(--arp-ink)}
.arp__histtoggle{
  display:flex;align-items:center;gap:8px;width:100%;
  padding:9px 18px;margin:0;
  background:none;border:0;
  font-family:inherit;font-size:10.5px;font-weight:600;
  letter-spacing:.18em;text-transform:uppercase;
  color:var(--arp-dim);cursor:pointer;text-align:left;
  touch-action:manipulation;-webkit-tap-highlight-color:transparent;
}
.arp__histtoggle:hover{color:var(--arp-ink)}
.arp__histtoggle:focus-visible{outline:3px solid var(--arp-accent2);outline-offset:-3px}
.arp__chev{width:14px;height:14px;fill:currentColor;flex:none;transition:transform .3s cubic-bezier(.25,.1,.25,1)}
.arp__history[data-open="1"] .arp__chev{transform:rotate(180deg)}
.arp__history[data-open="1"] .arp__histtoggle{color:var(--arp-ink)}

.arp__histcount{
  margin-left:auto;
  font-size:10px;letter-spacing:.1em;
  color:var(--arp-dim);
  border:1.5px solid var(--arp-line);
  padding:1px 6px;
}
.arp__history[data-open="1"] .arp__histcount{border-color:var(--arp-ink);color:var(--arp-ink)}

/* collapsed is the default state — it only opens on click */
.arp__histbox{
  max-height:0;
  overflow:hidden;
  transition:max-height .3s cubic-bezier(.25,.1,.25,1);
}

.arp__histlist{
  list-style:none;margin:0;padding:0 18px 14px;
  display:flex;flex-direction:column;gap:2px;
}
.arp__histitem{
  display:flex;align-items:center;gap:10px;
  padding:7px 0;
  border-top:1px dashed var(--arp-line);
  font-size:13px;
}
.arp__histitem:first-child{border-top:0}
.arp__histart{
  width:34px;height:34px;flex:none;display:block;margin:0;
  border:1.5px solid var(--arp-ink);object-fit:cover;border-radius:0;max-width:none;
}
.arp__histmeta{display:flex;flex-direction:column;min-width:0;flex:1;line-height:1.25}
.arp__histtitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.arp__histartist{font-size:11.5px;color:var(--arp-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.arp__histago{
  font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;
  color:var(--arp-dim);flex:none;white-space:nowrap;
}

@media (max-width:600px){
  .arp__histago{display:none}
  .arp__histlist{padding:0 14px 12px}
}

body.arp-popup-page .arp__histbox.arp-histopen .arp__histlist{max-height:230px;overflow-y:auto}
body.arp-popup-page .arp__histitem{text-align:left}

/* for visitors with animation turned off: open and close instantly */
@media (prefers-reduced-motion:reduce){
  .arp__histbox{transition:none}
}

/* ---------- beat pulse ---------- */
/* JS raises the --arp-beat variable to 1 whenever a kick is detected. */

.arp__dot{
  transform:scale(calc(1 + var(--arp-beat,0) * 0.7));
  transition:transform .1s cubic-bezier(.2,.7,.3,1);
}

.arp__play{
  outline-offset:calc(var(--arp-beat,0) * 3px);
}
.arp__play[data-on="1"]{
  box-shadow:
    4px 4px 0 var(--arp-ink),
    0 0 0 calc(var(--arp-beat,0) * 4px) var(--arp-accent-soft, rgba(255,46,136,.45));
  transition:box-shadow .12s ease-out, transform .09s cubic-bezier(.2,0,.2,1), background-color .18s ease, color .18s ease;
}

/* The meter bars brighten slightly on the beat as well */
.arp__vu.arp-vu-live i{
  background:var(--arp-ink);
  opacity:calc(0.78 + var(--arp-beat,0) * 0.22);
}

/* The pulse is decorative and is switched off under reduced motion.
   The level meter itself carries information, so it keeps working. */
@media (prefers-reduced-motion:reduce){
  .arp{--arp-beat:0 !important}
}


/* ═══════════════════════════════════════════════════════════════════
   DARK MODE — Atlas theme: body.site-dark / body.site-light
   + universal dark classes + the system prefers-color-scheme
   ═══════════════════════════════════════════════════════════════════ */

html.site-dark .arp,
.site-dark .arp,
body.dark .arp,
body.dark-mode .arp,
body.dark-theme .arp,
body[data-theme="dark"] .arp,
body[data-theme="Dark"] .arp {
  --arp-paper: #1a1a1a;
  --arp-ink:   #f0ece4;
  --arp-dim:   rgba(240,236,228,.5);
  --arp-line:  rgba(240,236,228,.18);
}

@media (prefers-color-scheme: dark) {
  body:not(.site-light) .arp {
    --arp-paper: #1a1a1a;
    --arp-ink:   #f0ece4;
    --arp-dim:   rgba(240,236,228,.5);
    --arp-line:  rgba(240,236,228,.18);
  }
}

/* header: it was single-toned in light mode — inverted in dark */
html.site-dark .arp__head,
.site-dark .arp__head,
body.dark .arp__head,
body.dark-mode .arp__head,
body[data-theme="dark"] .arp__head {
  background: var(--arp-ink);
  color: var(--arp-paper);
}

@media (prefers-color-scheme: dark) {
  body:not(.site-light) .arp__head {
    background: var(--arp-ink);
    color: var(--arp-paper);
  }
}

/* artwork and history item borders */
html.site-dark .arp__art,
.site-dark .arp__art,
html.site-dark .arp__histart,
.site-dark .arp__histart,
body.dark .arp__art,
body.dark .arp__histart,
body.dark-mode .arp__art,
body.dark-mode .arp__histart,
body[data-theme="dark"] .arp__art,
body[data-theme="dark"] .arp__histart {
  border-color: var(--arp-line);
}

@media (prefers-color-scheme: dark) {
  body:not(.site-light) .arp__art,
  body:not(.site-light) .arp__histart {
    border-color: var(--arp-line);
  }
}

/* the play button shadow is lighter in dark mode */
html.site-dark .arp__play,
.site-dark .arp__play,
body.dark .arp__play,
body.dark-mode .arp__play,
body[data-theme="dark"] .arp__play {
  box-shadow: 4px 4px 0 rgba(240,236,228,.25);
  border-color: var(--arp-ink);
  color: #1a1a1a;
}

@media (prefers-color-scheme: dark) {
  body:not(.site-light) .arp__play {
    box-shadow: 4px 4px 0 rgba(240,236,228,.25);
    border-color: var(--arp-ink);
    color: #1a1a1a;
  }
}

/* play button hover / active */
html.site-dark .arp__play:hover,
.site-dark .arp__play:hover,
body.dark .arp__play:hover,
body.dark-mode .arp__play:hover,
body[data-theme="dark"] .arp__play:hover {
  box-shadow: 2px 2px 0 rgba(240,236,228,.25);
}

html.site-dark .arp__play:active,
.site-dark .arp__play:active,
body.dark .arp__play:active,
body.dark-mode .arp__play:active,
body[data-theme="dark"] .arp__play:active {
  box-shadow: 0 0 0 rgba(240,236,228,.25);
}

@media (prefers-color-scheme: dark) {
  body:not(.site-light) .arp__play:hover { box-shadow: 2px 2px 0 rgba(240,236,228,.25); }
  body:not(.site-light) .arp__play:active { box-shadow: 0 0 0 rgba(240,236,228,.25); }
}

/* the on=1 (playing) button */
html.site-dark .arp__play[data-on="1"],
.site-dark .arp__play[data-on="1"],
body.dark .arp__play[data-on="1"],
body.dark-mode .arp__play[data-on="1"],
body[data-theme="dark"] .arp__play[data-on="1"] {
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  body:not(.site-light) .arp__play[data-on="1"] { color: #fff; }
}

/* shadow of the tilted variant */
html.site-dark .arp--tilt,
.site-dark .arp--tilt,
body.dark .arp--tilt,
body.dark-mode .arp--tilt,
body[data-theme="dark"] .arp--tilt {
  box-shadow: 12px 12px 0 rgba(43,52,255,.5);
}

@media (prefers-color-scheme: dark) {
  body:not(.site-light) .arp--tilt { box-shadow: 12px 12px 0 rgba(43,52,255,.5); }
}

/* volume slider */
html.site-dark .arp__vol input[type=range],
.site-dark .arp__vol input[type=range],
body.dark .arp__vol input[type=range],
body.dark-mode .arp__vol input[type=range],
body[data-theme="dark"] .arp__vol input[type=range] {
  background: var(--arp-ink);
}

@media (prefers-color-scheme: dark) {
  body:not(.site-light) .arp__vol input[type=range] { background: var(--arp-ink); }
}

/* VU bars take a light colour in dark mode */
html.site-dark .arp__vu i,
.site-dark .arp__vu i,
body.dark .arp__vu i,
body.dark-mode .arp__vu i,
body[data-theme="dark"] .arp__vu i {
  background: var(--arp-ink);
}

@media (prefers-color-scheme: dark) {
  body:not(.site-light) .arp__vu i { background: var(--arp-ink); }
}

/* search link buttons, dark hover */
html.site-dark .arp__link:hover,
.site-dark .arp__link:hover,
body.dark .arp__link:hover,
body.dark-mode .arp__link:hover,
body[data-theme="dark"] .arp__link:hover {
  color: var(--arp-paper);
  background: var(--arp-ink);
  border-color: var(--arp-ink);
}

@media (prefers-color-scheme: dark) {
  body:not(.site-light) .arp__link:hover {
    color: var(--arp-paper);
    background: var(--arp-ink);
    border-color: var(--arp-ink);
  }
}

/* sticky bar, dark */
html.site-dark .arp.arp-is-sticky,
.site-dark .arp.arp-is-sticky,
body.dark .arp.arp-is-sticky,
body.dark-mode .arp.arp-is-sticky,
body[data-theme="dark"] .arp.arp-is-sticky {
  box-shadow: 0 -6px 24px rgba(0,0,0,.55);
}

@media (prefers-color-scheme: dark) {
  body:not(.site-light) .arp.arp-is-sticky { box-shadow: 0 -6px 24px rgba(0,0,0,.55); }
}

/* popup page, dark */
html.site-dark body.arp-popup-page,
.site-dark body.arp-popup-page,
body.dark.arp-popup-page,
body.dark-mode.arp-popup-page,
body[data-theme="dark"].arp-popup-page {
  background: #1a1a1a;
}

@media (prefers-color-scheme: dark) {
  body.arp-popup-page:not(.site-light) { background: #1a1a1a; }
}

/* ---------- sleep timer ---------- */
.arp__sleep{position:relative;display:inline-flex}
.arp__sleepbtn{
  display:inline-flex;align-items:center;gap:7px;
  background:none;border:0;padding:2px 0;margin:0;
  font-family:inherit;font-size:10.5px;font-weight:600;
  letter-spacing:.16em;text-transform:uppercase;
  color:var(--arp-dim);cursor:pointer;
  border-bottom:1.5px solid transparent;
  transition:color .15s ease,border-color .15s ease;
  touch-action:manipulation;-webkit-tap-highlight-color:transparent;
}
.arp__sleepbtn:hover{color:var(--arp-ink);border-bottom-color:var(--arp-ink)}
.arp__sleepbtn:focus-visible{outline:3px solid var(--arp-accent2);outline-offset:3px}
.arp__sleepbtn svg{width:14px;height:14px;fill:currentColor;flex:none}
.arp__sleepbtn[data-on="1"]{color:var(--arp-accent);border-bottom-color:var(--arp-accent)}
.arp__sleepbtn[data-on="1"] svg{animation:arp-sleep-pulse 2.4s ease-in-out infinite}
@keyframes arp-sleep-pulse{0%,100%{opacity:1}50%{opacity:.45}}

.arp__sleepmenu{
  position:absolute;bottom:calc(100% + 10px);left:0;z-index:40;
  display:flex;flex-direction:column;min-width:132px;
  background:var(--arp-paper);border:2px solid var(--arp-ink);
  box-shadow:5px 5px 0 var(--arp-accent2);
}
.arp__sleepmenu[hidden]{display:none !important}
.arp__sleepmenu button{
  display:block;width:100%;text-align:left;
  background:none;border:0;border-bottom:1px solid var(--arp-line);
  padding:9px 12px;margin:0;
  font-family:inherit;font-size:11px;font-weight:600;
  letter-spacing:.14em;text-transform:uppercase;
  color:var(--arp-ink);cursor:pointer;
}
.arp__sleepmenu button:last-child{border-bottom:0}
.arp__sleepmenu button:hover{background:var(--arp-ink);color:var(--arp-paper)}
.arp__sleepmenu button:focus-visible{outline:3px solid var(--arp-accent2);outline-offset:-3px}
.arp__sleepoff{color:var(--arp-accent) !important}
.arp__sleepoff:hover{background:var(--arp-accent) !important;color:var(--arp-paper) !important}

/* muted state indicator */
.arp__vol[data-muted="1"] .arp__volicon{opacity:.35}
.arp__vol[data-muted="1"] input[type=range]{opacity:.35}

@media (max-width:600px){
  .arp__sleepmenu{left:auto;right:0}
}

/* ---------- Poppins fine-tuning ---------- */
/* Poppins is a proportional face, so any figure that ticks would change the
   width of its box on every update. Tabular figures keep those boxes still. */
.arp__listeners,
.arp__histcount,
.arp__histago,
.arp__sleepbtn,
.arp__sleepmenu button,
.arp__playtext{
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum" 1;
}

/* The popup page body sits outside .arp, so it needs the family explicitly. */
body.arp-popup-page{
  font-family:var(--arp-font,'Poppins',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif);
}

/* Poppins has a small x-height; the uppercase micro-labels read better with a
   touch more weight than the monospace face they replaced. */
.arp__head,
.arp__label,
.arp__foot{font-weight:500}
