/* Media player: thedevons.net. Colours are tokens so another site can restyle by overriding :root. */
:root {
  --bg: #ffffff;
  --ink: #141414;
  --muted: #6b6b6b;
  --line: #e7e7e7;
  --card: #f6f6f5;
  --hover: #efefee;
  --accent: #e40408;          /* the red of the EARS lettering */
  --accent-ink: #ffffff;
  --love: #e40408;
  --focus: #e40408;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --ink: #f2f2f2; --muted: #a3a3a3; --line: #2a2a2a;
    --card: #1c1c1c; --hover: #242424; --accent: #ff3b3f; --love: #ff4d50; --focus: #ff6a6d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121212; --ink: #f2f2f2; --muted: #a3a3a3; --line: #2a2a2a;
  --card: #1c1c1c; --hover: #242424; --accent: #ff3b3f; --love: #ff4d50; --focus: #ff6a6d;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.page {
  max-width: 720px; margin: 0 auto;
  padding: 24px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
}
.page-title {
  margin: 0 0 16px; text-align: center;
  font-size: 1.15rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.cover {
  display: block; width: 100%; height: auto; border-radius: var(--radius);
  background: #fff;
}
@media (prefers-color-scheme: dark) { .cover { box-shadow: 0 0 0 1px var(--line); } }
.home { margin: 32px 0 0; text-align: center; }
.home a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.home a:hover { color: var(--ink); text-decoration: underline; }

button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- player ---------- */
.mp { margin-top: 20px; }
.mp-msg { color: var(--muted); text-align: center; padding: 24px 0; }

.mp-deck {
  background: var(--card); border-radius: var(--radius); padding: 18px 18px 14px;
}
.mp-now { text-align: center; min-height: 3.2em; }
.mp-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}
.mp-title {
  margin-top: 2px; font-size: 1.3rem; font-weight: 700; line-height: 1.25;
  overflow-wrap: anywhere;
}
.mp-title.is-idle { font-size: 1rem; font-weight: 500; color: var(--muted); }

.mp-controls {
  display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center;
  column-gap: 22px; margin: 14px 0 10px;
}
.mp-controls .mp-deck-vote { grid-area: auto; height: 40px; padding: 0 12px; border-radius: 20px; font-size: .95rem; min-width: 0; }
.mp-controls .mp-deck-vote svg { width: 21px; height: 21px; }
.mp-controls .mp-deck-vote.mp-like { justify-self: start; }
.mp-controls .mp-deck-vote.mp-love { justify-self: end; }
.mp-controls .mp-deck-vote:disabled { opacity: .4; cursor: default; background: none; }
.mp-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.mp-btn:hover { background: var(--hover); }
.mp-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.mp-btn svg { width: 24px; height: 24px; fill: currentColor; }
.mp-play { width: 60px; height: 60px; background: var(--accent); color: var(--accent-ink); }
.mp-play:hover { background: var(--accent); filter: brightness(1.08); }
.mp-play svg { width: 28px; height: 28px; }
.mp-play.is-loading svg { opacity: .55; }

.mp-seek { display: grid; grid-template-columns: 3.2em 1fr 3.2em; align-items: center; gap: 10px; }
.mp-time { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-time:first-child { text-align: right; }
.mp-range {
  --p: 0%;
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0;
  background: transparent; cursor: pointer; touch-action: none;
}
.mp-range:disabled { cursor: default; }
.mp-range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--p), var(--line) var(--p));
}
.mp-range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
.mp-range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.mp-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -5px;
  border: 0; border-radius: 50%; background: var(--accent);
}
.mp-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--accent); }
.mp-range:disabled::-webkit-slider-thumb { background: transparent; }
.mp-range:disabled::-moz-range-thumb { background: transparent; }

/* ---------- lyrics ---------- */
.mp-lyrics {
  position: relative; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px;
}
.mp-lyrics[hidden] { display: none; }
.mp-lyrics-head { display: flex; justify-content: space-between; align-items: baseline; }
.mp-lyrics-body {
  height: 13.5rem; overflow-y: auto; overscroll-behavior: contain; padding: 4.5rem 4px;
  text-align: center; white-space: pre-line; line-height: 1.75; color: var(--muted);
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
          mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
  scrollbar-width: none;
}
.mp-lyrics-body::-webkit-scrollbar { display: none; }
.mp-lyrics-body p { margin: 0; }
.mp-lyrics-body.is-plain { color: var(--ink); }
.mp-lyrics-body .is-now { color: var(--ink); font-weight: 700; }
.mp-lyrics-toggle {
  border: 0; background: none; padding: 4px 0; color: var(--muted); font-size: .8rem; cursor: pointer;
}
.mp-lyrics-toggle:hover { color: var(--ink); }

/* ---------- track list ---------- */
.mp-list { list-style: none; margin: 16px 0 0; padding: 0; }
.mp-row {
  position: relative; display: grid; align-items: center; column-gap: 6px;
  grid-template-columns: 26px minmax(0, 1fr) auto auto auto auto;
  grid-template-areas: "ind title dur plays like love";
  padding: 6px 6px 6px 8px; border-radius: 10px;
}
.mp-row + .mp-row::before {
  content: ""; position: absolute; left: 10px; right: 10px; top: 0; border-top: 1px solid var(--line);
}
.mp-row:hover { background: var(--hover); }
.mp-row.is-current { background: var(--card); }
.mp-row:hover::before, .mp-row:hover + .mp-row::before,
.mp-row.is-current::before, .mp-row.is-current + .mp-row::before { border-color: transparent; }

.mp-pick {
  grid-area: title; min-width: 0; padding: 8px 0; border: 0; background: none; text-align: left; cursor: pointer;
  font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-pick::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }  /* whole row picks the song */
.mp-pick:focus-visible { outline: none; }
.mp-pick:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -2px; }
.mp-row.is-current .mp-pick { color: var(--accent); }

.mp-ind { grid-area: ind; display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.mp-ind svg { width: 14px; height: 14px; fill: currentColor; }
.mp-bars { display: none; gap: 2px; align-items: end; height: 12px; }
.mp-bars i { display: block; width: 3px; background: var(--accent); border-radius: 1px; height: 40%; }
.mp-row.is-playing .mp-bars { display: flex; }
.mp-row.is-playing .mp-ind-n { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .mp-row.is-playing .mp-bars i { animation: mp-bar .9s ease-in-out infinite alternate; }
  .mp-row.is-playing .mp-bars i:nth-child(2) { animation-delay: -.3s; }
  .mp-row.is-playing .mp-bars i:nth-child(3) { animation-delay: -.6s; }
}
.mp-row.is-playing .mp-bars i:nth-child(2) { height: 90%; }
.mp-row.is-playing .mp-bars i:nth-child(3) { height: 60%; }
@keyframes mp-bar { from { height: 25%; } to { height: 100%; } }

.mp-dur { grid-area: dur; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; padding: 0 6px; }
.mp-stat {
  position: relative; z-index: 1;   /* above the row-wide pick target */
  display: inline-flex; align-items: center; justify-content: flex-start; gap: 4px;
  min-width: 3.6em; height: 36px; padding: 0 8px; border: 0; border-radius: 18px; background: none;
  color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.mp-stat svg { width: 16px; height: 16px; flex: none; }
.mp-plays { grid-area: plays; pointer-events: none; }
.mp-plays svg { fill: currentColor; }
.mp-like { grid-area: like; } .mp-love { grid-area: love; }
button.mp-stat { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.mp-stat:hover { background: var(--line); }
.mp-like:hover, .mp-like.is-on { color: var(--ink); }
.mp-love:hover, .mp-love.is-on { color: var(--love); }
.mp-like svg, .mp-love svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.mp-like.is-on svg { fill: currentColor; }
.mp-love.is-on svg { fill: currentColor; stroke: currentColor; }
@media (prefers-reduced-motion: no-preference) {
  .mp-stat.pop svg { animation: mp-pop .32s ease-out; }
}
@keyframes mp-pop { 50% { transform: scale(1.35); } }

/* Love only (data-votes="love"): no thumbs-up column. */
.mp-no-like .mp-row { grid-template-columns: 26px minmax(0, 1fr) auto auto auto; grid-template-areas: "ind title dur plays love"; }

/* Phones: title on its own line, counts underneath. */
@media (max-width: 520px) {
  .mp-deck { padding: 16px 12px 12px; }
  .mp-controls { column-gap: 8px; }
  .mp-controls .mp-deck-vote { padding: 0 8px; }
  .mp-row {
    grid-template-columns: 26px minmax(0, 1fr) auto auto auto;
    grid-template-areas:
      "ind title title title dur"
      ".   plays like  love  .";
    row-gap: 0; padding: 4px 4px 6px 6px;
  }
  .mp-no-like .mp-row {
    grid-template-columns: 26px auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "ind title title title dur"
      ".   plays love  .     .";
  }
  .mp-pick { padding: 6px 0 2px; }
  .mp-stat { height: 32px; padding: 0 8px 0 0; min-width: 0; }
  .mp-plays { justify-self: start; }
  .mp-like, .mp-love { padding: 0 8px; }
  .mp-dur { align-self: center; }
}
