/* A miniature cassette deck: physical controls, tinted metal and an inset tape. */
#live2d-widget .vn-bgm {
  --deck-metal: color-mix(in srgb, var(--vn-panel) 65%, #737574);
  margin: 3px 0 0;
  padding: 8px 8px 4px;
  border: 1px solid #080a0d;
  border-radius: 3px;
  background: linear-gradient(#ffffff0b, transparent 32%, #0003), var(--deck-metal);
  box-shadow: inset 1px 1px 0 #ffffff30, inset -1px -1px 0 #0009, 0 2px 2px #0005;
  font: 11px/1.5 var(--vn-font);
  min-width: 0;
}
#live2d-widget .vn-bgm-deck {
  position: relative;
  padding: 5px 7px;
  border: 1px solid #080b11;
  border-radius: 3px;
  background: linear-gradient(135deg, #ffffff0a, #0005), var(--vn-panel);
  box-shadow: inset 0 2px 4px #0008, 0 1px 0 #ffffff25;
}
#live2d-widget .vn-bgm-deck::before,
#live2d-widget .vn-bgm-deck::after {
  content: "";
  position: absolute;
  bottom: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a6a29a 40%, #23252b 45% 60%, #a6a29a 65%);
  box-shadow: 0 1px 1px #000;
}
#live2d-widget .vn-bgm-deck::before { left: 5px; }
#live2d-widget .vn-bgm-deck::after { right: 5px; }
#live2d-widget .vn-bgm-track {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 1px 4px;
  color: #302b27;
  background: color-mix(in srgb, var(--vn-light) 20%, #dfd5bd);
  border-bottom: 2px solid color-mix(in srgb, var(--vn-light) 45%, #575455);
  white-space: nowrap;
  line-height: 1.5;
}
#live2d-widget .vn-bgm-label { flex: 0 0 auto; }
#live2d-widget [data-bgm-title] { overflow: hidden; text-overflow: ellipsis; }
#live2d-widget .vn-bgm-type { margin-left: auto; padding-left: 5px; font: 7px/1 monospace; letter-spacing: .4px; }
#live2d-widget .vn-bgm-tape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  width: 68%;
  max-width: 190px;
  height: 30px;
  padding: 0 8px;
  margin: 5px auto 0;
  border: 1px solid #090b0e;
  border-radius: 14px;
  background: linear-gradient(165deg, #ffffff14, transparent 50%), #101216;
  box-shadow: inset 0 2px 3px #000a, 0 1px 0 #ffffff20;
}
#live2d-widget .vn-bgm-reel {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 4px solid #50443c;
  border-radius: 50%;
  background: repeating-conic-gradient(#aaa89c 0deg 30deg, #353942 30deg 60deg);
  box-shadow: 0 0 0 1px #05070a, inset 0 0 0 1px #ded6bb70;
  animation: bgm-reel 2.5s linear infinite paused;
}
#live2d-widget .vn-bgm-reel::after { content: ""; position: absolute; inset: 4px; background: #101216; border-radius: 50%; }
#live2d-widget .vn-bgm-tape-line { position: absolute; inset: 6px 20px; border-top: 1px solid #736354; border-bottom: 1px solid #736354; }
#live2d-widget [data-bgm-state="playing"] .vn-bgm-reel { animation-play-state: running; }
#live2d-widget .vn-bgm-main {
  display: grid;
  grid-template-columns: 30px 30px minmax(34px, 1fr) 66px;
  align-items: center;
  gap: 4px;
}
#live2d-widget .vn-bgm-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 26px;
  padding: 0;
  border: 1px solid #12151b;
  border-radius: 2px;
  color: #ede5d4;
  background: linear-gradient(#77766e, #404349 48%, #35383e 49%);
  box-shadow: inset 1px 1px 0 #ffffff60, inset -1px -2px 0 #0008, 0 1px 1px #0008;
  transition: filter .12s, box-shadow .12s;
}
#live2d-widget .vn-bgm-button:hover { color: #fff7df; filter: brightness(1.18); }
#live2d-widget .vn-bgm-button:active,
#live2d-widget [data-bgm-state="playing"] [data-bgm-play],
#live2d-widget .vn-bgm-button[aria-pressed="true"] {
  background: linear-gradient(#303339, #53534f);
  color: var(--vn-light);
  box-shadow: inset 0 2px 3px #000a, 0 1px 0 #ffffff20;
}
#live2d-widget .vn-bgm-button svg { display: block; width: 13px; height: 13px; }
#live2d-widget .vn-bgm-transport { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 6px; align-items: center; margin: 1px 0; }
#live2d-widget [data-bgm-time] { font-variant-numeric: tabular-nums; color: #ded4bc; font-size: 10px; }
#live2d-widget .vn-bgm-volume > span { flex-shrink: 0; white-space: nowrap; }
#live2d-widget .vn-bgm-volume { display: flex; align-items: center; gap: 5px; font: 8px monospace; margin: 0; color: #ded4bc; }
#live2d-widget .vn-bgm input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  height: 20px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  cursor: pointer;
  accent-color: var(--vn-light);
}
#live2d-widget .vn-bgm input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: #13161b; box-shadow: 0 1px 0 #ffffff25, inset 0 1px 2px #000; }
#live2d-widget .vn-bgm input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: #13161b; box-shadow: 0 1px 0 #ffffff25, inset 0 1px 2px #000; }
#live2d-widget .vn-bgm input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: 9px; height: 13px; margin-top: -4px;
  border: 1px solid #16191e; border-radius: 1px;
  background: linear-gradient(90deg, #aaa89c, #585b60 40%, #dbcfaf 45% 55%, #585b60 60%);
  box-shadow: 0 1px 2px #0008;
}
#live2d-widget .vn-bgm input[type="range"]::-moz-range-thumb {
  width: 7px; height: 11px; border: 1px solid #16191e; border-radius: 1px;
  background: linear-gradient(90deg, #aaa89c, #585b60 40%, #dbcfaf 45% 55%, #585b60 60%);
  box-shadow: 0 1px 2px #0008;
}
#live2d-widget .vn-bgm input:disabled { opacity: .4; cursor: default; }
#live2d-widget .vn-bgm :focus-visible { outline: 1px dashed var(--vn-light); outline-offset: 2px; }
#live2d-widget .vn-bgm-meta { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; color: #c7c4ba; font-size: 9px; }
#live2d-widget .vn-bgm-meta > span { font: 7px/1.8 monospace; letter-spacing: .5px; }
#live2d-widget .vn-bgm-meta a { color: #ddd6c7; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#live2d-widget .vn-bgm-meta a:hover { color: #fff; text-decoration: underline; }
#live2d-widget [data-bgm-status] { display: flex; gap: 4px; align-items: center; justify-content: center; white-space: nowrap; font-size: 10px; color: #ddd6c7; }
#live2d-widget [data-bgm-status]::before { content: ""; width: 4px; height: 4px; flex-shrink: 0; border-radius: 50%; background: #202520; border: 1px solid #111; box-shadow: 0 1px 0 #ffffff25; }
#live2d-widget [data-bgm-state="playing"] [data-bgm-status]::before { background: #c8df9b; box-shadow: 0 0 4px #c8df9b70; }
#live2d-widget [data-bgm-state="loading"] [data-bgm-status]::before { animation: bgm-loading .8s steps(2, end) infinite; }
#live2d-widget [data-bgm-state="error"] [data-bgm-status] { color: #ffd1b5; }
@keyframes bgm-reel { to { transform: rotate(360deg); } }
@keyframes bgm-loading { 50% { background: #c8df9b; } }
@media (prefers-reduced-motion: reduce) {
  #live2d-widget .vn-bgm-reel, #live2d-widget [data-bgm-state="loading"] [data-bgm-status]::before { animation: none; }
  #live2d-widget .vn-bgm-button { transition: none; }
}
