/* The iPod picked up off the desk: an original CSS rendition of a white
   click-wheel player. Sizes are fixed CSS px; ipod.js scales the whole device
   with a transform, so everything inside keeps its proportions. */

.ipod-host {
  position: fixed; inset: 0; z-index: 6;
  pointer-events: none;            /* the room stays clickable until the iPod is up */
  --ipod-lcd: #f7f8f9;
  --ipod-ink: #121518;
  --ipod-blue: #2f72cf;
  --ipod-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.ipod-host.ipod-open { pointer-events: auto; }
.ipod-host *, .ipod-host *::before, .ipod-host *::after { box-sizing: border-box; } /* every size below is outer size */

.ipod-backdrop {
  position: absolute; inset: 0; cursor: zoom-out;
  background: radial-gradient(ellipse 60% 85% at 72% 50%, rgba(10, 12, 10, 0.3), rgba(10, 12, 10, 0.64));
  opacity: 0; transition: opacity 0.3s ease;
}
.ipod-open .ipod-backdrop { opacity: 1; }

/* ------------------------------------------------ body */
.ipod-device {
  position: absolute; left: 0; top: 0;
  width: 280px; height: 460px; margin: -230px 0 0 -140px; /* centred on the translate() point */
  border-radius: 30px;
  border: 3px solid transparent;
  /* white polycarbonate front over a chrome back that shows as a thin rim */
  background:
    linear-gradient(165deg, #ffffff 0%, #f7f7f8 36%, #e8e9ec 100%) padding-box,
    linear-gradient(135deg, #f5f6f8, #9aa0a7 24%, #f2f3f5 46%, #80868e 72%, #dde0e4) border-box;
  box-shadow:
    0 44px 70px -30px rgba(0, 0, 0, 0.65),
    0 14px 26px -10px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 #fff,
    inset 0 -3px 6px rgba(0, 0, 0, 0.05);
  font: 700 12px/1 var(--ipod-font);
  color: var(--ipod-ink);
  outline: none;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
.ipod-device[hidden] { display: none; }
.ipod-device::before {             /* specular sheen across the plastic */
  content: ""; position: absolute; inset: 0; border-radius: 27px; pointer-events: none;
  background:
    linear-gradient(116deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 34%),
    radial-gradient(ellipse 70% 40% at 18% 0%, rgba(255, 255, 255, 0.8), transparent 70%),
    linear-gradient(180deg, transparent 70%, rgba(0, 0, 0, 0.035));
}
.ipod-face {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 22px;
}

/* ------------------------------------------------ screen */
.ipod-bezel {
  position: relative; width: 236px; height: 180px; padding: 6px;
  border-radius: 7px; background: #26292d;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.75), 0 1px 0 #fff, 0 -1px 0 rgba(0, 0, 0, 0.08);
}
.ipod-bezel::after {               /* the clear front layer catching the light */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.06) 36%, transparent 38%);
}
.ipod-screen {
  position: relative; width: 224px; height: 168px; overflow: hidden;
  border-radius: 2px; background: var(--ipod-lcd);
  transition: filter 0.35s ease;
}
.ipod-screen.ipod-unlit { filter: brightness(0.74) saturate(0.45) contrast(0.92); }

.ipod-bar {
  position: relative; height: 21px;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid #8f98a1;
  background: linear-gradient(#fefefe, #e7eaed 55%, #d2d7dc);
  font: 700 12px/1 var(--ipod-font);
}
.ipod-title { max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.ipod-state { position: absolute; left: 7px; top: 50%; width: 8px; height: 9px; margin-top: -4.5px; }
.ipod-state[data-s="playing"],
.ipod-state[data-s="loading"] {
  background: linear-gradient(#6aa6ee, var(--ipod-blue));
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.ipod-state[data-s="loading"] { animation: ipod-blink 1.1s ease-in-out infinite; }
.ipod-state[data-s="paused"] {
  width: 7px;
  background: linear-gradient(90deg, var(--ipod-blue) 0 2.5px, transparent 2.5px 4.5px, var(--ipod-blue) 4.5px);
}
@keyframes ipod-blink { 50% { opacity: 0.25; } }

.ipod-batt {
  position: absolute; right: 8px; top: 50%; width: 19px; height: 9px; margin-top: -4.5px;
  border: 1px solid #555b61; border-radius: 2px; background: #fff;
}
.ipod-batt::before {
  content: ""; position: absolute; left: 1px; top: 1px; bottom: 1px; width: 76%;
  border-radius: 1px; background: linear-gradient(#a8e27c, #4dab2a);
}
.ipod-batt::after {
  content: ""; position: absolute; right: -3px; top: 2px; width: 2px; height: 3px;
  border-radius: 0 1px 1px 0; background: #555b61;
}

.ipod-stage { position: absolute; left: 0; right: 0; top: 21px; bottom: 0; overflow: hidden; }
.ipod-view { position: absolute; inset: 0; background: var(--ipod-lcd); }

/* ------------------------------------------------ lists */
.ipod-rows { position: absolute; left: 0; right: 0; top: 0; }
.ipod-scroll .ipod-rows { right: 10px; }
.ipod-row {
  display: flex; align-items: center; height: 21px; padding: 0 7px 0 6px;
  font: 700 12.5px/21px var(--ipod-font); letter-spacing: -0.01em;
  cursor: pointer;
}
.ipod-label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ipod-val { flex: none; margin-left: 8px; font-weight: 500; color: #545a60; }
.ipod-go::after {
  content: "›"; flex: none; margin-left: 6px;
  font: 700 17px/1 var(--ipod-font); color: #737a82; transform: translateY(-1px);
}
.ipod-now::after {                 /* a little speaker beside the song that's on */
  content: ""; flex: none; width: 10px; height: 9px; margin-left: 6px;
  background: var(--ipod-blue);
  clip-path: polygon(0 30%, 35% 30%, 80% 0, 80% 100%, 35% 70%, 0 70%);
}
.ipod-dim { color: #a3a9af; }
.ipod-sel {
  color: #fff;
  background: linear-gradient(#80b5f3, #4a8ee3 48%, #2f72cf 52%, #3d84df);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.ipod-sel.ipod-dim { color: rgba(255, 255, 255, 0.62); }
.ipod-sel .ipod-val, .ipod-sel.ipod-go::after { color: #fff; }
.ipod-sel.ipod-now::after { background: #fff; }

.ipod-sb {
  display: none; position: absolute; right: 2px; top: 2px; bottom: 2px; width: 7px;
  border: 1px solid #8a9199; border-radius: 1px; background: #eceff2;
}
.ipod-scroll .ipod-sb { display: block; }
.ipod-sb i {
  position: absolute; left: 0; right: 0; top: 0; min-height: 6px;
  background: linear-gradient(90deg, #86b4ec, var(--ipod-blue));
}

/* ------------------------------------------------ now playing */
.ipod-np { display: flex; flex-direction: column; padding: 5px 8px 0; }
.ipod-np-count { height: 13px; font: 600 10.5px/13px var(--ipod-font); color: #3c4248; }
.ipod-np-main { display: flex; gap: 8px; margin-top: 4px; }
.ipod-art {
  position: relative; flex: none; width: 62px; height: 62px; overflow: hidden;
  display: grid; place-items: center; border-radius: 2px; background: #9aa3ad;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.ipod-art b {
  font: 700 24px/1 Georgia, "Times New Roman", serif; letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.9); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.ipod-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 46%);
}
.ipod-np-meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-top: 1px; }
.ipod-np-title {
  font: 700 12.5px/15px var(--ipod-font);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.ipod-np-artist, .ipod-np-game {
  font: 500 11px/13px var(--ipod-font); color: #353b41;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ipod-np-foot { position: relative; height: 32px; margin: auto 0 8px; }
.ipod-np-time, .ipod-np-vol { position: absolute; left: 0; right: 0; top: 0; }

.ipod-meter {
  position: relative; height: 10px;
  border: 1px solid #5f6a75; background: linear-gradient(#fff, #e0e4e8);
}
.ipod-meter i {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(#9cc8f7, #4a8ee3 48%, var(--ipod-blue) 52%, #3f86e2);
}
.ipod-meter b {                    /* the scrub diamond */
  display: none; position: absolute; top: 50%; left: 0;
  width: 8px; height: 8px; margin: -4px 0 0 -4px;
  background: #fff; border: 1px solid var(--ipod-blue); transform: rotate(45deg);
}
.ipod-np-scrub .ipod-meter b { display: block; }
.ipod-times {
  display: flex; justify-content: space-between; margin-top: 4px;
  font: 600 10.5px/1 var(--ipod-font); font-variant-numeric: tabular-nums;
}
.ipod-np-msg { display: none; margin-top: 4px; font: 600 10.5px/1.2 var(--ipod-font); color: #a1261b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ipod-np-err .ipod-times { display: none; }
.ipod-np-err .ipod-np-msg { display: block; }

.ipod-np-vol { display: none; align-items: center; gap: 6px; top: 3px; }
.ipod-np-vol .ipod-meter { flex: 1; }
.ipod-np-vol-on .ipod-np-time { visibility: hidden; }
.ipod-np-vol-on .ipod-np-vol { display: flex; }
.ipod-np-muted .ipod-np-vol .ipod-meter i { background: linear-gradient(#d3d7db, #9aa1a8); }
.ipod-spk {
  flex: none; width: 8px; height: 9px; background: #3c4248;
  clip-path: polygon(0 30%, 35% 30%, 80% 0, 80% 100%, 35% 70%, 0 70%);
}
.ipod-spk-up { width: 12px; height: 12px; }

/* ------------------------------------------------ click wheel */
.ipod-wheel {
  position: relative; width: 180px; height: 180px; margin-top: 44px;
  border-radius: 50%; overflow: hidden;   /* also clips hit-testing to the circle */
  background: radial-gradient(circle at 50% 36%, #e4e5e7, #d0d2d5 58%, #c4c6ca);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.2),
    inset 0 -1px 1px rgba(255, 255, 255, 0.75),
    0 1px 0 rgba(255, 255, 255, 0.9);
  touch-action: none;
}
/* each label owns a quarter of the ring, so a press anywhere in its wedge counts */
.ipod-zone {
  position: absolute; inset: 0; padding: 0; margin: 0;
  display: flex; color: #7f848a;
  transition: background-color 0.12s;
}
.ipod-z-menu { clip-path: polygon(50% 50%, 0 0, 100% 0); align-items: flex-start; justify-content: center; padding-top: 15px; }
.ipod-z-next { clip-path: polygon(50% 50%, 100% 0, 100% 100%); align-items: center; justify-content: flex-end; padding-right: 16px; }
.ipod-z-play { clip-path: polygon(50% 50%, 100% 100%, 0 100%); align-items: flex-end; justify-content: center; padding-bottom: 17px; }
.ipod-z-prev { clip-path: polygon(50% 50%, 0 100%, 0 0); align-items: center; justify-content: flex-start; padding-left: 16px; }
.ipod-zone:hover { color: #62676d; }
.ipod-zone:active { background-color: rgba(0, 0, 0, 0.05); }
.ipod-zone:focus-visible { outline: none; }
.ipod-zone:focus-visible > span { outline: 2px solid var(--ipod-blue); outline-offset: 4px; border-radius: 2px; }
.ipod-zone > span { display: block; }
.ipod-z-menu > span { font: 700 11px/1 var(--ipod-font); letter-spacing: 0.08em; }

.ipod-ico-skip { position: relative; width: 14px; height: 9px; }
.ipod-ico-skip::before {           /* two triangles nose to tail */
  content: ""; position: absolute; left: 0; top: 0; width: 11px; height: 9px; background: currentColor;
  clip-path: polygon(0 0, 50% 50%, 50% 0, 100% 50%, 50% 100%, 50% 50%, 0 100%);
}
.ipod-ico-skip::after { content: ""; position: absolute; right: 0; top: 0; width: 2px; height: 9px; background: currentColor; }
.ipod-ico-back { transform: scaleX(-1); }
.ipod-ico-pp { position: relative; width: 17px; height: 9px; }
.ipod-ico-pp::before {
  content: ""; position: absolute; left: 0; top: 0; width: 7px; height: 9px; background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.ipod-ico-pp::after {
  content: ""; position: absolute; right: 0; top: 0; width: 7px; height: 9px;
  background: linear-gradient(90deg, currentColor 0 2.5px, transparent 2.5px 4.5px, currentColor 4.5px);
}

.ipod-center {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  width: 70px; height: 70px; margin: -35px 0 0 -35px; padding: 0;
  border-radius: 50%;
  background: linear-gradient(#fefefe, #eceef1);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.16), inset 0 1px 0 #fff;
}
.ipod-center:active {
  background: linear-gradient(#eef0f2, #f8f9fa);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), inset 0 1px 3px rgba(0, 0, 0, 0.14);
}
.ipod-center:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(47, 114, 207, 0.6), inset 0 1px 0 #fff;
}

/* ------------------------------------------------ captions */
.ipod-hint {
  position: absolute; left: 50%; top: calc(100% + 18px); margin: 0;
  transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font: 500 11px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(246, 241, 231, 0.72);
}
.ipod-hint-touch { display: none; }
@media (hover: none) {
  .ipod-hint-key { display: none; }
  .ipod-hint-touch { display: inline; }
}
.ipod-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

@media (max-width: 759px) {
  .ipod-backdrop { background: rgba(10, 12, 10, 0.6); }
  .ipod-hint { white-space: normal; width: 260px; text-align: center; line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  .ipod-state[data-s="loading"] { animation: none; }
  .ipod-screen, .ipod-zone { transition: none; }
}
