/* The small controls that float above everything: sound and skip. */
.chrome {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding:
    0
    max(16px, env(safe-area-inset-right) + 8px)
    max(18px, env(safe-area-inset-bottom) + 10px)
    max(16px, env(safe-area-inset-left) + 8px);
  pointer-events: none;
}

.pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(248, 239, 228, 0.24);
  background: rgba(40, 2, 0, 0.36);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  color: var(--paper);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: background 0.3s, color 0.6s, border-color 0.6s, opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

body.chrome-ready .pill {
  opacity: 1;
  transform: none;
}

.pill:hover { background: rgba(40, 2, 0, 0.5); }

body[data-phase='hello'] .pill {
  color: var(--ink);
  border-color: rgba(64, 3, 0, 0.16);
  background: rgba(248, 239, 228, 0.7);
}

body[data-phase='hello'] .pill:hover { background: rgba(241, 225, 207, 0.9); }

.skip { margin-left: auto; }

body:not([data-phase='intro']) .skip,
body.chrome-ready .sound.is-hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

/* Equaliser: still when off, dancing when on. */
.sound__bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.sound__bars i {
  width: 2px;
  height: 3px;
  border-radius: 1px;
  background: currentColor;
  transition: height 0.3s var(--ease-out);
}

.sound.is-on .sound__bars i { animation: eq 1s ease-in-out infinite alternate; }
.sound.is-on .sound__bars i:nth-child(2) { animation-duration: 0.7s; animation-delay: -0.3s; }
.sound.is-on .sound__bars i:nth-child(3) { animation-duration: 0.9s; animation-delay: -0.6s; }
.sound.is-on .sound__bars i:nth-child(4) { animation-duration: 0.6s; animation-delay: -0.1s; }

@keyframes eq {
  from { height: 3px; }
  to { height: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .pill { transform: none; }
  .sound.is-on .sound__bars i { animation: none; height: 9px; }
}
