:root {
  --bg: #000000;
  --accent: #3d7bff; /* the colour of the rings, the lit sign and the connected pill */
  --accent-deep: #2452d6;
  --surface: #16181d;
  --surface-hi: #1e2128;
  --ink: #f3f5f8;
  --muted: #8b919d;
  --edge: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* ---- the pill ---- */
.pair {
  position: relative;
  width: min(272px, calc(100vw - 32px));
  height: 60px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 0 9px;
  border: 0;
  border-radius: 99px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.6),
    0 10px 24px -10px rgba(0, 0, 0, 0.9),
    0 0 0 0 rgba(61, 123, 255, 0);
  transition: box-shadow 0.6s ease;
}
.pair.is-on {
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.6),
    0 14px 34px -12px rgba(61, 123, 255, 0.7),
    0 0 44px -10px rgba(61, 123, 255, 0.45);
}
.pair:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.pair__body {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface-hi), var(--surface));
  z-index: -2;
}
/* the blue that floods the pill from the sign once the headphones answer */
.pair__flood {
  position: absolute;
  left: 30px;
  top: 50%;
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #5a92ff 0%, var(--accent) 38%, var(--accent-deep) 100%);
  transform: scale(0);
}
.pair__rings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.pair__rings circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  opacity: 0;
}
/* a soft light that follows the pointer */
.pair__light {
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 70px at var(--px, 50%) var(--py, 0%), rgba(255, 255, 255, 0.1), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.pair.is-hot .pair__light { opacity: 1; }
/* the 1px edge that catches the light from above */
.pair__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.05) 45%, rgba(255, 255, 255, 0.09));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

/* ---- the Bluetooth sign in its round seat ---- */
.sign {
  position: relative;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  transition: background-color 0.5s ease;
}
.pair.is-on .sign { background: rgba(255, 255, 255, 0.18); }
.sign svg { width: 22px; height: 22px; overflow: visible; }
.sign path { fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sign__base { stroke: #c9ced8; transition: stroke 0.4s ease; }
.pair.is-busy .sign__base { stroke: #5b616d; }
.pair.is-on .sign__base { stroke: #ffffff; }
.sign__lit { stroke: var(--accent); visibility: hidden; }

/* ---- the words ---- */
.label {
  flex: 1;
  min-width: 0;
  height: 22px;
  overflow: hidden;
  font-size: 15.5px;
  line-height: 22px;
  font-weight: 580;
  font-stretch: 104%;
  letter-spacing: -0.005em;
}
.label__word { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- the headphones chip: it only exists once they are found ---- */
.device {
  flex: none;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px 0 9px;
  margin-left: -4px;
  border-radius: 99px;
  background: rgba(8, 14, 34, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  opacity: 0;
  visibility: hidden;
  width: 0;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
}
.device__phones { flex: none; width: 19px; height: 19px; margin-left: 9px; }
.device__phones path { fill: none; stroke: #ffffff; stroke-width: 1.8; stroke-linecap: round; }
.device__phones rect { fill: #ffffff; }
.battery { flex: none; display: flex; align-items: center; gap: 1px; }
.battery__cell {
  display: block;
  width: 20px;
  height: 11px;
  padding: 1.5px;
  border-radius: 3.5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}
.battery__level {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  background: #ffffff;
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.battery__tip { width: 1.5px; height: 4px; border-radius: 0 1px 1px 0; background: rgba(255, 255, 255, 0.75); }
.device__pct {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 30px;
  margin-right: 11px;
  text-align: right;
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #000000;
  stroke-width: 1.3;
  stroke-linejoin: round;
  opacity: 0;
  visibility: hidden;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
  z-index: 10;
}
