/* B: piccolo stereo. A single audio element serves both sizes. */
#player {
  --stereo-cream: #f7edd3;
  --stereo-ink: #473d2e;
  --stereo-coral: #df7967;
  position: fixed;
  left: auto;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  width: 380px;
  max-width: calc(100vw - 24px);
  height: auto;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 12px 14px;
  padding: 18px 18px 14px 25px;
  border: 2px solid var(--stereo-ink);
  border-radius: 18px;
  background: linear-gradient(120deg, #fff5dd, var(--stereo-cream));
  color: var(--stereo-ink);
  box-shadow: 2px 5px 0 #74634c, 0 12px 26px #291a2540;
  font-family: 'Lucida Console', 'Courier New', monospace;
  z-index: 2000;
}
#player::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid var(--stereo-ink);
  border-radius: 12px;
  pointer-events: none;
}
#player::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 7px;
  bottom: 7px;
  width: 7px;
  border-radius: 7px 0 0 7px;
  background: var(--stereo-coral);
  border-right: 1px solid var(--stereo-ink);
  pointer-events: none;
}
#player button {
  color: var(--stereo-ink);
  border: 1px solid var(--stereo-ink);
  border-radius: 3px;
  background: linear-gradient(#fff7e4, #f0e2c3);
  box-shadow: inset 1px 1px #fffaf0, inset -1px -1px #c4b697, 0 2px 0 #9c8c6a;
  display: grid;
  place-items: center;
  padding: 0;
}
#player button:hover:not(:disabled) { background: #ffe3b7; }
#player button:active:not(:disabled) {
  box-shadow: inset 1px 1px 2px #85725055;
  transform: translateY(1px);
}
#player button:disabled { opacity: .4; }
#player button:focus-visible,
#player input:focus-visible { outline: 3px solid #b84b3d; outline-offset: 3px; }
#player .stereo-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 24px;
  z-index: 1;
}
#player .stereo-toggle::after { content: ''; position: absolute; inset: -5px; }
#player .stereo-toggle svg { width: 18px; height: 18px; stroke-width: 2; }
.stereo-art { width: 104px; height: 104px; }
.stereo-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid var(--stereo-ink);
  border-radius: 3px;
  box-shadow: 1px 2px 2px #473d2e26;
}
.stereo-info { min-width: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.stereo-copy { display: flex; flex-direction: column; gap: 5px; padding-right: 23px; padding-top: 4px; }
.stereo-copy strong { font-size: 16px; line-height: 1.15; font-weight: 700; overflow-wrap: anywhere; }
.stereo-copy > span { font-size: 14px; line-height: 1.2; }
.stereo-timeline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 8px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.stereo-timeline #duration { text-align: right; }
#player #seek {
  --progress: 0%;
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  height: 24px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  accent-color: var(--stereo-coral);
}
#player #seek::-webkit-slider-runnable-track {
  height: 7px;
  border: 1px solid var(--stereo-ink);
  border-radius: 5px;
  background: linear-gradient(to right, var(--stereo-coral) var(--progress), #f9f0d8 var(--progress));
  box-shadow: inset 0 1px 2px #473d2e33;
}
#player #seek::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 17px;
  margin-top: -6px;
  border: 1px solid var(--stereo-ink);
  border-radius: 2px;
  background: #fff3d6;
  box-shadow: 1px 1px 0 #aa9977;
}
#player #seek::-moz-range-track { height: 5px; border: 1px solid var(--stereo-ink); border-radius: 5px; background: #f9f0d8; }
#player #seek::-moz-range-progress { height: 5px; background: var(--stereo-coral); }
#player #seek::-moz-range-thumb { width: 10px; height: 15px; border: 1px solid var(--stereo-ink); border-radius: 2px; background: #fff3d6; }
.stereo-controls { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr repeat(3, 44px) 1fr; align-items: center; gap: 8px; }
#player .stereo-key { width: 44px; height: 32px; }
#player .stereo-key svg { width: 21px; height: 21px; stroke: none; fill: currentColor; }
.speaker { width: 44px; height: 26px; justify-self: center; background: radial-gradient(circle, #5a4c35 1px, transparent 1.4px) 0 0 / 5px 5px; }

#player.is-compact {
  width: 300px;
  grid-template-columns: 44px minmax(0, 1fr) 38px 30px;
  gap: 8px;
  padding: 10px 12px 10px 20px;
  border-radius: 13px;
}
#player.is-compact::before { border-radius: 8px; }
#player.is-compact .stereo-art { width: 44px; height: 44px; }
#player.is-compact .stereo-info { align-self: center; }
#player.is-compact .stereo-copy { padding: 0; gap: 3px; }
#player.is-compact .stereo-copy strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#player.is-compact .stereo-copy > span { font-size: 14px; }
#player.is-compact .stereo-timeline,
#player.is-compact #previous,
#player.is-compact #next,
#player.is-compact .speaker { display: none; }
#player.is-compact .stereo-controls { grid-column: 3; grid-row: 1; display: block; }
#player.is-compact #play { width: 38px; height: 34px; }
#player.is-compact .stereo-toggle { position: relative; top: auto; right: auto; grid-column: 4; grid-row: 1; width: 30px; height: 28px; }

@media (max-width: 650px) {
  #player { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  #player:not(.is-compact) { width: 360px; grid-template-columns: 96px minmax(0, 1fr); gap: 10px 12px; padding: 18px 16px 14px 23px; }
  #player:not(.is-compact) .stereo-art { width: 96px; height: 96px; }
  #player:not(.is-compact) .stereo-key { height: 40px; }
}
@media (max-width: 350px) {
  #player:not(.is-compact) { grid-template-columns: 80px minmax(0, 1fr); }
  #player:not(.is-compact) .stereo-art { width: 80px; height: 80px; }
  .speaker { width: 24px; }
}
