html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background: transparent;
  font-family: system-ui, sans-serif;

  --text-color: #ffffff;
  --progress-color: #ffffff;
  --bg-r: 0;
  --bg-g: 0;
  --bg-b: 0;
  --bg-alpha: 0.3;
}

#media-root {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
}

#media-root .mp-empty {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  background: rgba(18, 18, 18, 0.42);
  box-sizing: border-box;
  pointer-events: none;
}

body.ding-edit-mode #media-root .mp-empty {
  border: 2px dashed rgba(255, 255, 255, 0.7);
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.18);
  font-size: 0.95rem;
}

#media-root.has-player .mp-empty {
  display: none;
}

#media-root .mp-main {
  display: none;
}

#media-root.has-player .mp-main {
  display: flex;
}

.mp-main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  height: 100%;
  padding: 10px 12px 8px;
  box-sizing: border-box;
  border-radius: 14px;
  background: rgba(var(--bg-r), var(--bg-g), var(--bg-b), calc(var(--bg-alpha) + 0.04));
  border: 1px solid rgba(255, 255, 255, 0.10);
  overflow: hidden;
  isolation: isolate;
}

.mp-controls-overlay {
  position: absolute;
  left: 50%;
  bottom: 4px;
  z-index: 3;
  transform: translateX(-50%) translateY(6px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
  opacity: 0;
  visibility: hidden;
  padding: 0;
  box-sizing: border-box;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

body.ding-host-chrome-visible .mp-controls-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.mp-volume-strip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.mp-control-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 5px 8px 6px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.mp-volume-btn {
  width: 20px;
  min-width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 1);
  font: 700 12px/1 system-ui, sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

.mp-volume-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.mp-volume-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.72);
}

.mp-volume-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.mp-volume-slider {
  --volume-fill: 0%;
  width: 100%;
  height: 6px;
  margin: 0;
  min-width: 0;
  align-self: center;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 1) 0,
    rgba(255, 255, 255, 1) var(--volume-fill),
    rgba(255, 255, 255, 0.45) var(--volume-fill),
    rgba(255, 255, 255, 0.45) 100%
  );
  cursor: pointer;
}

.mp-volume-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 9999px;
  background: transparent;
}

.mp-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  margin-top: -2px;
  border-radius: 9999px;
  border: 0;
  background: #fff;
}

.mp-volume-slider::-moz-range-track {
  height: 6px;
  border-radius: 9999px;
  background: transparent;
}

.mp-volume-slider::-moz-range-progress {
  height: 6px;
  border-radius: 9999px;
  background: transparent;
}

.mp-volume-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 9999px;
  background: #fff;
}

.mp-volume-slider:disabled,
.mp-volume-slider:disabled::-webkit-slider-thumb,
.mp-volume-slider:disabled::-moz-range-thumb {
  cursor: default;
}

.mp-control-btn {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.12s ease, opacity 0.12s ease, transform 0.12s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.mp-control-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.8);
}

.mp-control-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.mp-control-btn:disabled {
  cursor: default;
  opacity: 0.45;
}

.mp-control-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
}

.mp-control-btn-primary svg {
  width: 15px;
  height: 15px;
}

.mp-control-icon-pause {
  display: none;
}

.mp-control-btn.is-playing .mp-control-icon-play {
  display: none;
}

.mp-control-btn.is-playing .mp-control-icon-pause {
  display: block;
}

.mp-cover {
  width: min(156px, 100%);
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 8px;
}

.mp-cover-img[hidden],
.mp-nocover[hidden] {
  display: none;
}

.mp-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mp-nocover {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-info {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.mp-title {
  width: 100%;
  min-width: 0;
  align-self: stretch;
  color: var(--text-color);
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1.12;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-artist {
  width: 100%;
  min-width: 0;
  align-self: stretch;
  color: var(--text-color);
  opacity: 0.85;
  font-size: 0.92rem;
  line-height: 1.12;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.mp-progress {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.20);
  margin-top: 8px;
}

.mp-bar {
  height: 100%;
  background: var(--progress-color);
  width: 100%;
  transform-origin: left center;
  transform: scaleX(var(--progress-scale, 0));
  transition: transform 0.2s ease;
  will-change: transform;
}

.mp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-color);
  font-variant-numeric: tabular-nums;
  min-width: 0;
  margin-top: 4px;
}

.mp-time-wrap {
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
}

.mp-time-current,
.mp-time-total {
  text-align: left;
}

.mp-status {
  white-space: nowrap;
  opacity: 0.85;
  margin-left: 0;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.mp-time-current,
.mp-time-total,
.mp-status {
  color: var(--text-color);
}

body.ding-host-chrome-visible .mp-progress,
body.ding-host-chrome-visible .mp-meta {
  opacity: 0.14;
  transition: opacity 0.12s ease;
}

body.ding-host-chrome-visible .mp-title,
body.ding-host-chrome-visible .mp-artist {
  opacity: 0.5;
  transition: opacity 0.12s ease;
}
