/* ---- default navioverlay M3E theme (MICL magenta dark) ---- */
:root {
  --md-sys-color-primary: rgb(255 178 186);
  --md-sys-color-surface-tint: rgb(255 178 186);
  --md-sys-color-on-primary: rgb(86 29 38);
  --md-sys-color-primary-container: rgb(114 51 60);
  --md-sys-color-on-primary-container: rgb(255 217 220);
  --md-sys-color-secondary: rgb(229 189 191);
  --md-sys-color-on-secondary: rgb(67 41 44);
  --md-sys-color-secondary-container: rgb(92 63 66);
  --md-sys-color-on-secondary-container: rgb(255 217 220);
  --md-sys-color-tertiary: rgb(232 192 142);
  --md-sys-color-on-tertiary: rgb(68 43 6);
  --md-sys-color-tertiary-container: rgb(93 65 27);
  --md-sys-color-on-tertiary-container: rgb(255 221 182);
  --md-sys-color-error: rgb(255 180 171);
  --md-sys-color-on-error: rgb(105 0 5);
  --md-sys-color-error-container: rgb(147 0 10);
  --md-sys-color-on-error-container: rgb(255 218 214);
  --md-sys-color-background: rgb(26 17 18);
  --md-sys-color-on-background: rgb(240 222 223);
  --md-sys-color-surface: rgb(26 17 18);
  --md-sys-color-on-surface: rgb(240 222 223);
  --md-sys-color-surface-variant: rgb(82 67 68);
  --md-sys-color-on-surface-variant: rgb(215 193 194);
  --md-sys-color-outline: rgb(159 140 141);
  --md-sys-color-outline-variant: rgb(82 67 68);
  --md-sys-color-shadow: rgb(0 0 0);
  --md-sys-color-scrim: rgb(0 0 0);
  --md-sys-color-inverse-surface: rgb(240 222 223);
  --md-sys-color-inverse-on-surface: rgb(56 46 47);
  --md-sys-color-inverse-primary: rgb(143 73 82);
  --md-sys-color-primary-fixed: rgb(255 217 220);
  --md-sys-color-on-primary-fixed: rgb(59 7 18);
  --md-sys-color-primary-fixed-dim: rgb(255 178 186);
  --md-sys-color-on-primary-fixed-variant: rgb(114 51 60);
  --md-sys-color-secondary-fixed: rgb(255 217 220);
  --md-sys-color-on-secondary-fixed: rgb(44 21 24);
  --md-sys-color-secondary-fixed-dim: rgb(229 189 191);
  --md-sys-color-on-secondary-fixed-variant: rgb(92 63 66);
  --md-sys-color-tertiary-fixed: rgb(255 221 182);
  --md-sys-color-on-tertiary-fixed: rgb(42 24 0);
  --md-sys-color-tertiary-fixed-dim: rgb(232 192 142);
  --md-sys-color-on-tertiary-fixed-variant: rgb(93 65 27);
  --md-sys-color-surface-dim: rgb(26 17 18);
  --md-sys-color-surface-bright: rgb(65 55 55);
  --md-sys-color-surface-container-lowest: rgb(20 12 13);
  --md-sys-color-surface-container-low: rgb(34 25 26);
  --md-sys-color-surface-container: rgb(39 29 30);
  --md-sys-color-surface-container-high: rgb(49 40 40);
  --md-sys-color-surface-container-highest: rgb(61 50 51);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: transparent !important;
  font-family: var(--md-ref-typeface-brand, 'Google Sans', system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
  color: var(--md-sys-color-on-surface);
}

/* ---- Card (OBS Browser Source) ---- */
#card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 900px;
  height: 200px;
  overflow: hidden;
  border-radius: var(--md-sys-shape-corner-extra-large, 26px);
  background-color: rgb(from var(--md-sys-color-surface-container-highest) r g b / 0.92);

  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease, background-color 0.5s ease, border-color 0.5s ease;
}

#card.show {
  opacity: 1;
  transform: translateY(0);
}

#card:not(.show) {
  pointer-events: none;
}

/* ---- Artwork ---- */
#art-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  flex-shrink: 0;
  overflow: hidden;
  background-color: var(--md-sys-color-surface-container-low);
  border-radius: var(--_card-shape);
}

#art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#art-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 72px;
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.38;
}

#pause-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(from var(--md-sys-color-surface-dim) r g b / 0.7);
  font-size: 72px;
  color: var(--md-sys-color-on-surface);
  z-index: 2;
}

/* ---- Metadata & Marquee ---- */
#meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 24px 28px;
}

#headline {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.marquee-slot {
  position: relative;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  contain: paint;
}

#headline .marquee-slot {
  flex: 1 1 0%;
  min-width: 0;
}

#meta > .marquee-slot {
  width: 100%;
}

.marquee-content {
  display: inline-block;
  white-space: nowrap;
}

.marquee-slot.scrolling {
  mask-image: linear-gradient(to right, black calc(100% - 32px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 32px), transparent 100%);
}

.marquee-slot.scrolling .marquee-content {
  will-change: transform;
  animation: marquee-scroll var(--marquee-duration, 8s) ease-in-out infinite;
}

@keyframes marquee-scroll {
  0%, 20% { transform: translateX(0); }
  80%, 100% { transform: translateX(calc(-1 * var(--marquee-distance, 0px))); }
}

#title {
  color: var(--md-sys-color-on-surface);
}

#artist {
  color: var(--md-sys-color-on-surface-variant);
}

#album {
  color: var(--md-sys-color-outline);
}

/* ---- Wavy Progress Bar (micl) ---- */
#progress-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
}

#progress {
  flex: 1;
  --md-comp-linear-progress-track-thickness: 6px;
  --md-comp-linear-progress-active-thickness: 6px;
  --md-comp-linear-progress-active-wave-amplitude: 4px;
  --md-comp-linear-progress-active-wave-wavelength: 36px;
  --md-comp-linear-progress-active-indicator-color: var(--md-sys-color-primary);
  --md-comp-linear-progress-track-color: var(--md-sys-color-surface-container-high);
  --md-comp-linear-progress-stop-color: var(--md-sys-color-surface-container-high);
  transition: --micl-progress-amplitude 500ms cubic-bezier(0.2, 0, 0, 1);
}

#progress .micl-linear-progress__wave {
  transition: none !important;
}

@keyframes wave-crawl {
  to {
    mask-position: calc(-1 * var(--md-comp-linear-progress-active-wave-wavelength, 36px)) center;
    -webkit-mask-position: calc(-1 * var(--md-comp-linear-progress-active-wave-wavelength, 36px)) center;
  }
}

#card:not(.paused) #progress .micl-linear-progress__wave {
  animation: wave-crawl 1.4s linear infinite;
}

#card.paused #progress {
  --micl-progress-amplitude: 0;
}

.time {
  font-variant-numeric: tabular-nums;
  color: var(--md-sys-color-on-surface-variant);
  min-width: 26px;
}

.time#time-now {
  text-align: left;
}

.time#time-total {
  text-align: right;
}

/* ---- Debug Alert ---- */
#debug {
  position: fixed;
  inset: auto 16px 16px 16px;
  z-index: 99;
  max-width: calc(100vw - 32px);
}

/* ---- Setup Form ---- */
#setup {
  width: min(460px, calc(100vw - 32px));
  margin: 6vh auto 0;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-corner-extra-large, 28px);
}

.setup-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setup-hint {
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.45;
}

#setup form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

#result-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

#result-row .micl-textfield-outlined {
  flex: 1;
  min-width: 0;
}

.hidden {
  display: none !important;
}
