/* ============ chrome — fixed UI (music, bottom nav, progress) ============ */
#wchrome { visibility: hidden; }
#wchrome.is-on { visibility: visible; }

/* top progress bar */
#wchrome .chr-progress {
  position: fixed; z-index: 55;
  top: env(safe-area-inset-top, 0px); left: 0; right: 0;
  max-width: var(--page-max); margin: 0 auto;
  height: 2px; pointer-events: none;
  background: rgba(217,182,110,.18);
  opacity: 0; transition: opacity .6s;
}
#wchrome.is-on .chr-progress { opacity: 1; }
#wchrome .chr-progress span {
  display: block; height: 100%;
  background: var(--gold-gradient);
  transform: scaleX(0); transform-origin: 0 50%;
  box-shadow: 0 0 6px rgba(217,182,110,.7);
}

/* dock: nav (flex) + music (fixed size), both inside the 480px column */
#wchrome .chr-dock {
  position: fixed; z-index: 50;
  left: 0; right: 0; bottom: 0;
  max-width: var(--page-max); margin: 0 auto;
  display: flex; align-items: flex-end; gap: 8px;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  pointer-events: none;
}
#wchrome .chr-dock > * { pointer-events: auto; }
#wchrome .chr-spacer { flex: 1; pointer-events: none; }

/* glass nav pill */
#wchrome .chr-nav {
  flex: 1 1 auto; min-width: 0; max-width: 340px; margin: 0 auto;
  display: flex; align-items: stretch;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255,253,248,.78);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(184,137,59,.5);
  box-shadow: inset 0 0 0 3px rgba(255,253,248,.6), inset 0 0 0 4px rgba(217,182,110,.28), 0 12px 28px -14px rgba(59,51,43,.45);
  opacity: 0; transform: translateY(140%);
  transition: transform .55s var(--ease-out), opacity .4s;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #wchrome .chr-nav { background: rgba(255,253,248,.96); }
}
#wchrome.is-on .chr-nav { opacity: 1; transform: none; transition-delay: .35s; }
#wchrome.is-on.is-tucked .chr-nav { opacity: 0; transform: translateY(140%); transition-delay: 0s; pointer-events: none; }
#wchrome.no-music .chr-nav { max-width: 360px; }

#wchrome .chr-item {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 48px; padding: 5px 2px 4px;
  border-radius: 999px;
  color: var(--ink-soft); text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .35s, color .35s;
}
#wchrome .chr-item svg { width: 20px; height: 20px; flex: none; transition: transform .35s var(--ease-out), color .35s; }
#wchrome .chr-item span {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-sans); font-size: 9.5px; line-height: 1.2; letter-spacing: 0;
}
@media (max-width: 380px) { #wchrome .chr-item span { font-size: 8.8px; letter-spacing: -.01em; } #wchrome .chr-nav { padding: 3px; } #wchrome .chr-item { padding: 5px 0 4px; } }
#wchrome .chr-item.is-active { background: rgba(217,195,154,.42); color: var(--ink); }
#wchrome .chr-item.is-active svg { color: var(--gold-deep); transform: translateY(-1px); }
#wchrome .chr-item:focus-visible { outline: 2px solid var(--rose); outline-offset: -2px; }

/* music button (ref 1: round gold, bottom-right) */
#wchrome .chr-music {
  position: relative; flex: none;
  width: 48px; height: 48px; margin-bottom: 4px;
  border: 0; border-radius: 50%; padding: 0;
  display: grid; place-items: center;
  color: #fff;
  background:
    repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,0) 0 2px, rgba(255,255,255,.08) 2px 3px),
    var(--gold-gradient);
  box-shadow: 0 8px 18px -6px rgba(138,98,36,.65), inset 0 1px 0 rgba(255,255,255,.45), inset 0 -2px 4px rgba(138,98,36,.35);
  opacity: 0; transform: scale(.6);
  transition: opacity .4s, transform .5s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
#wchrome.is-on .chr-music { opacity: 1; transform: none; transition-delay: .2s; }
#wchrome .chr-music:active { transform: scale(.92); }
#wchrome .chr-music:focus-visible { outline: 2px solid var(--rose); outline-offset: 4px; }
#wchrome .chr-music svg { grid-area: 1 / 1; width: 20px; height: 20px; filter: drop-shadow(0 1px 1px rgba(138,98,36,.5)); transition: opacity .25s, transform .3s var(--ease-out); }
#wchrome .chr-ic-pause { opacity: 0; transform: scale(.6); }
#wchrome .chr-music.is-playing .chr-ic-play { opacity: 0; transform: scale(.6); }
#wchrome .chr-music.is-playing .chr-ic-pause { opacity: 1; transform: none; }

/* spinning vinyl ring */
#wchrome .chr-vinyl {
  position: absolute; inset: -5px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 8%, var(--gold-light) 8% 22%, transparent 22% 50%, var(--gold) 50% 62%, transparent 62% 80%, rgba(162,123,62,.7) 80% 86%, transparent 86%);
  -webkit-mask: radial-gradient(circle, transparent 26px, #000 26.5px, #000 28px, transparent 28.5px);
          mask: radial-gradient(circle, transparent 26px, #000 26.5px, #000 28px, transparent 28.5px);
  opacity: 0; transition: opacity .4s;
  pointer-events: none;
}
#wchrome .chr-music.is-playing .chr-vinyl { opacity: 1; animation: chrSpin 3.2s linear infinite; }
@keyframes chrSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  #wchrome .chr-music.is-playing .chr-vinyl { animation: none; }
}
@media (max-width: 340px) {
  #wchrome .chr-item span { font-size: 8.5px; }
  #wchrome .chr-dock { gap: 6px; }
}
