/* ── RINGS: central play surface ──────────────────────────────────────────── */

#rings .rings-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: manipulation;
}
#rings .rings-canvas:focus-visible {
  outline-offset: -3px;
  border-radius: 50%;
}

/* Note dots: position comes from --x/--y, colour + outline are inline so drag ghosts keep them. */
#rings .rings-notes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#rings .rings-note {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: clamp(9px, 1.05cqw, 17px);
  aspect-ratio: 1;
  translate: -50% -50%;
  pointer-events: auto;
  box-shadow: 1px 1px 0 var(--ink);
  transition: scale 0.12s;
}
#rings .rings-note:hover {
  scale: 1.3;
}
#rings.is-grounded .rings-note {
  box-shadow: none;
  opacity: 0.7;
}

/* Paper tabs around the rim: RINGS, EARTH and CLEAR */
#rings .rings-count,
#rings .rings-earth,
#rings .rings-clear {
  position: absolute;
  z-index: 2;
}

/* Ring tags: FULL LENGTH, ½, ¼ … with arrows (drawn on the canvas) into their rings */
#rings .rings-tags {
  position: absolute;
  top: 0.3cqw;
  left: 0;
  right: 8%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0.35cqw;
  pointer-events: none;
}
#rings .rings-tag {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.95;
  min-width: 2.6cqw;
  padding: 0.2cqw 0.4cqw 0.15cqw;
  color: var(--ink);
  background: var(--paper);
  border: max(2px, 0.16cqw) solid var(--line);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  box-shadow: 2px 2px 0 var(--ring-c, var(--ink));
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}
#rings .rings-tag[hidden] {
  display: none;
}
#rings .rings-tag:nth-child(odd) {
  rotate: -3deg;
}
#rings .rings-tag:nth-child(even) {
  rotate: 2.5deg;
}
#rings .rings-tag:hover {
  transform: translateY(-2px);
}
#rings .rings-tag[aria-pressed='true'] {
  background: var(--ring-c, var(--creator));
  color: var(--paper);
}
#rings .rings-tag-frac {
  font-family: var(--font-marker);
  font-size: clamp(10px, 1.05cqw, 17px);
}
#rings .rings-tag-timbre {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(10px, 0.95cqw, 16px);
}

/* RINGS − + tab, top-left of the circle */
#rings .rings-count {
  left: 2%;
  top: 5%;
  rotate: -9deg;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15cqw;
  padding: 0.15cqw 0.35cqw 0.3cqw;
  background: var(--paper);
  border: max(2px, 0.16cqw) solid var(--line);
  border-radius: 12px 4px 10px 5px;
}
#rings .rings-count .hand-label {
  font-size: clamp(9px, 0.85cqw, 14px);
}
#rings .rings-count-btns {
  display: flex;
  gap: 0.25cqw;
}
#rings .rings-count-btn {
  min-width: 1.7cqw;
  padding: 0 0.35cqw;
  font-size: clamp(11px, 1.1cqw, 18px);
  line-height: 1.15;
}
#rings .rings-count-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* EARTH: tilted tab hanging off the left of the circle */
#rings .rings-earth {
  left: 0.5%;
  top: 25%;
  rotate: -58deg;
  transform-origin: center;
}
#rings .rings-earth[aria-pressed='true'] {
  background: var(--recorder);
  color: var(--paper);
}

/* CLEAR: top-right */
#rings .rings-clear {
  right: 2%;
  top: 3%;
  rotate: -24deg;
}
#rings .rings-clear:active {
  background: var(--danger);
  color: var(--paper);
}

/* Centre circle = RECORD-INTO-RING arm */
#rings .rings-hub {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50% 46% 52% 48%;
  box-shadow: 1px 1px 0 var(--ink);
}
#rings .rings-hub-dot {
  width: 38%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--danger);
}
#rings .rings-hub[aria-pressed='true'] {
  background: var(--paper);
  color: var(--ink);
}
#rings .rings-hub[aria-pressed='true'] .rings-hub-dot {
  background: var(--danger);
  animation: rings-rec 1.1s ease-in-out infinite;
}
@keyframes rings-rec {
  50% {
    scale: 0.7;
    opacity: 0.6;
  }
}

/* OUTPUT: scope + level meter, arrow pointing off the sheet */
#rings .rings-out {
  position: absolute;
  right: 0.5%;
  top: 17%;
  width: 12.5%;
  height: 22%;
  rotate: 4deg;
  background: var(--paper);
  border: max(2px, 0.16cqw) solid var(--line);
  border-radius: 6px 14px 5px 12px / 12px 5px 14px 6px;
  box-shadow: 2px 2px 0 var(--processor);
  pointer-events: none;
}
#rings .rings-out .hand-label {
  position: absolute;
  left: 0.3cqw;
  top: 0.1cqw;
  font-size: clamp(8px, 0.8cqw, 13px);
}
#rings .rings-scope {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#rings .rings-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
