:root {
  --bg: #000;
  --ink: rgba(230, 240, 255, 0.92);
  --muted: rgba(220, 230, 255, 0.52);
  --faint: rgba(220, 230, 255, 0.32);
  --glass: rgba(14, 16, 20, 0.62);
  --line: rgba(230, 240, 255, 0.10);
  --hover: rgba(230, 240, 255, 0.07);
  --on: rgba(230, 240, 255, 0.14);
  --gutter: max(16px, env(safe-area-inset-left));
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#wall {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(20px, env(safe-area-inset-top)) var(--gutter) max(20px, env(safe-area-inset-bottom));
  transition: opacity 0.6s ease;
}
#ui > * { pointer-events: auto; }

body.idle #ui { opacity: 0; }
body.idle { cursor: none; }
body.hide-ui #ui, body.bare #ui { opacity: 0; pointer-events: none; }
body.hide-ui #ui > *, body.bare #ui > * { pointer-events: none; }

/* ---- header ----------------------------------------------------------------- */
.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.brand h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.brand p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 34ch;
  line-height: 1.4;
}
.gh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}
.gh:hover { background: var(--on); }

/* ---- bottom bar ------------------------------------------------------------- */
.bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 100%;
}
.caption {
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  min-height: 2.8em;
}
.caption strong {
  display: block;
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
#picker {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
#picker::-webkit-scrollbar { display: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
button:focus-visible, .gh:focus-visible {
  outline: 1px solid rgba(230, 240, 255, 0.55);
  outline-offset: 1px;
}
.chip {
  flex: none;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.chip:hover { background: var(--hover); color: var(--ink); }
.chip[aria-checked="true"] { background: var(--on); color: var(--ink); }

.icon {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
}
.icon:hover { background: var(--hover); color: var(--ink); }
.icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon svg .fill { fill: currentColor; stroke: none; }
#play[aria-pressed="true"] .i-play,
#play[aria-pressed="false"] .i-pause { display: none; }
#fullscreen[aria-pressed="true"] { color: var(--ink); }

.sep {
  flex: none;
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: var(--line);
}

.keys, #note {
  margin: 0;
  font-size: 12px;
  color: var(--faint);
  text-align: center;
}
#note { color: var(--muted); }

body.nogl #ui { opacity: 1; }
body.nogl .bar, body.nogl .keys, body.nogl .caption { display: none; }

/* Phones: the design row scrolls inside the bar, the arrows stay put. */
@media (max-width: 720px) {
  .keys { display: none; }
  .brand p { font-size: 12px; }
  .gh span { display: none; }
  .gh { padding: 8px; }
  .chip { padding: 7px 10px; }
}

@media (hover: none) {
  body.idle #ui { opacity: 1; }
}
