
#reels { --accent: var(--h3); }

/* ── 06 REHARM REELS (rr-) ─────────────────────────────── */
/* ── 06 REHARM REELS ──────────────────────────────────────── */
/* Every selector sits under #reels. The reel markup keeps the spec's short
   class names (.reel, .reel-win, .ghost …), so the scope keeps them local. */
#reels .exp-stage { container: rr / inline-size; }
/* The five spice levels keep their names and still fit one row of the desktop column */
@media (min-width: 961px) { #reels #rrSpice button { padding: 9px 8px; letter-spacing: 0.06em; } }
#reels .rr-lane { display: block; width: calc(100% - 44px); height: 110px; margin: 22px 22px 0; overflow: visible; }
#reels .rr-lane .rr-band { fill: var(--accent); fill-opacity: 0; transition: fill-opacity 0.2s; }
#reels .rr-lane .rr-band.now { fill-opacity: 0.06; }
#reels .rr-lane .rr-sep { stroke: rgba(244,239,230,0.1); stroke-width: 1; vector-effect: non-scaling-stroke; }
#reels .rr-lane .rr-note { fill: rgba(244,239,230,0.45); transition: fill 0.15s; }
#reels .rr-lane .rr-note.now { fill: var(--accent); }

/* Reels: 8 in a row, so each sits under its bar of the tune. A laptop stage (600-700 px)
   keeps the row with the phone's tighter gutters, about 66-72 px a reel; only a narrower
   stage goes 4 × 2. The lane and thread share the gutter so the slots stay lined up. */
#reels .rr-reels {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px; padding: 22px 22px 0;
}
/* Spin · Play · Before sit right under the reels, so a phone can spin and watch at once */
#reels .rr-actions { padding: 18px 22px 0; }
#reels .stage > .inline-msg { margin: 16px 22px 0; }
@container rr (max-width: 700px) {
  #reels .rr-lane { width: calc(100% - 28px); margin: 22px 14px 0; }
  #reels .rr-reels { gap: 6px; padding: 22px 14px 0; }
  #reels .rr-actions { padding: 18px 14px 0; }
  #reels .stage > .inline-msg { margin: 16px 14px 0; }
  #reels .rr-thread-wrap { padding: 18px 14px 0; }
  #reels .rr-legend { padding: 14px 14px 0; }
  #reels .rr-history { padding: 16px 14px 18px; }
}
@container rr (max-width: 600px) {
  #reels .rr-reels { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; }
}
#reels .reel {
  --fam: rgba(244,239,230,0.5);
  position: relative; min-width: 0;
  display: flex; flex-direction: column; gap: 6px;
  transition: transform 0.3s var(--ease);
}
#reels .reel.now { transform: translateY(-4px); }
#reels .reel-win {
  position: relative; display: block; width: 100%; height: 96px;
  overflow: hidden; border-radius: 12px;
  border: 1px solid var(--fam);
  background: rgba(244,239,230,0.03);
  touch-action: manipulation;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
#reels .reel-win::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--fam); z-index: 1; transition: background 0.25s;
}
@media (hover: hover) { #reels .reel-win:hover { background: rgba(244,239,230,0.06); } }
#reels .reel-win:focus-visible { border-radius: 12px; }
#reels .reel.now .reel-win { box-shadow: 0 0 0 2px var(--ink-soft), 0 0 0 4px var(--accent); }
/* Locked: the border stays in the family colour (Borrowed is this section's cyan too);
   a filled padlock sits in the window's corner and the face lifts a shade */
#reels .reel.locked .reel-win { background: rgba(244,239,230,0.07); }
#reels .rr-lockmark {
  position: absolute; top: 8px; left: 7px; z-index: 2;
  width: 12px; height: 12px; color: var(--paper);
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
#reels .rr-lockmark svg { display: block; width: 12px; height: 12px; }
#reels .rr-lockmark svg .body { fill: currentColor; }
#reels .reel.locked .rr-lockmark { opacity: 1; }
#reels .reel.locked .reel-strip > .ghost:first-child { padding-left: 20px; }   /* a long name clears the padlock */
#reels .reel.rr-flash .reel-win { border-color: var(--paper); }
#reels .reel.rr-flash .reel-win::before { background: var(--paper); }

#reels .reel-strip {
  position: absolute; left: 0; right: 0; top: 3px;
  display: flex; flex-direction: column; align-items: stretch;
  pointer-events: none;
}
#reels .reel-strip.rr-spinning { transition: transform 420ms cubic-bezier(0.2, 0.9, 0.2, 1); }
#reels .reel-strip.rr-tick { transition: transform 160ms var(--ease); }
#reels .reel-strip .ghost {
  flex: 0 0 auto; height: 20px; line-height: 20px; padding: 0 6px;
  font-family: var(--sans); font-size: 12px; text-align: center; color: var(--paper);
  opacity: 0.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#reels .reel-strip .cur {
  flex: 0 0 auto; height: 52px; padding: 0 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--paper);
}
#reels .reel-strip .root { font-family: var(--display); font-size: 28px; line-height: 1; letter-spacing: -0.02em; white-space: nowrap; }
#reels .reel-strip .q {
  margin-top: 4px; max-width: 100%; min-height: 12px;
  font-family: var(--mono); font-size: 10px; line-height: 12px; letter-spacing: 0.02em;
  color: var(--paper-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#reels .reel.before .ghost { visibility: hidden; }
#reels .rr-tag {
  position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%);
  padding: 1px 6px; border-radius: 100px;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink); background: var(--accent);
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
#reels .reel.before .rr-tag { opacity: 1; }
#reels .rr-dot {
  position: absolute; top: 9px; right: 7px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
  opacity: 0; transition: opacity 0.2s; pointer-events: none; z-index: 2;
}
#reels .reel.pending .rr-dot { opacity: 1; }
#reels .reel-win.land { animation: rrLand 120ms ease-out; }
@keyframes rrLand { from { transform: scale(1.04); } to { transform: none; } }

#reels .reel-lock {
  height: 36px; width: 100%;
  display: grid; place-items: center;
  border-radius: 10px; border: 1px solid rgba(244,239,230,0.14);
  color: var(--paper-dim);
  touch-action: manipulation;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
#reels .reel-lock:hover { color: var(--paper); border-color: var(--paper-dim); }
#reels .reel-lock svg { width: 14px; height: 14px; }
#reels .reel-lock svg .body { fill: none; transition: fill 0.2s; }
#reels .reel-lock[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: rgba(77,215,255,0.08); }
#reels .reel-lock[aria-pressed="true"] svg .body { fill: currentColor; }

/* Thread: the three upper voices, slot by slot */
#reels .rr-thread-wrap { padding: 18px 22px 0; }
#reels .rr-thread-wrap .readout-label { display: block; margin-bottom: 4px; }
#rrThread { display: block; width: 100%; height: 60px; overflow: visible; }
#rrThread .rr-v { fill: none; stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#rrThread .rr-d { fill: none; stroke-width: 4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
#rrThread .rr-v1 { stroke: rgba(244,239,230,0.25); }
#rrThread .rr-v2 { stroke: rgba(244,239,230,0.40); }
#rrThread .rr-v3 { stroke: rgba(244,239,230,0.55); }

#reels .rr-legend {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  padding: 14px 22px 0;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--paper-dim);
}
#reels .rr-legend span { display: inline-flex; align-items: center; gap: 7px; }
#reels .rr-legend i { width: 12px; height: 10px; border-radius: 3px; border: 1px solid var(--fam); box-shadow: inset 0 2px 0 var(--fam); }

#reels .rr-history {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 16px 22px 18px;
}
#reels .rr-history .readout-label { flex-basis: 100%; }
#reels .rr-bar {
  display: inline-flex; align-items: center; gap: 2px;
  height: 30px; padding: 0 8px;
  border-radius: 8px; border: 1px solid rgba(244,239,230,0.14);
  touch-action: manipulation;
  transition: border-color 0.2s, background 0.2s, transform 0.25s var(--ease);
}
@media (hover: hover) { #reels button.rr-bar:hover { border-color: var(--paper-dim); background: rgba(244,239,230,0.05); transform: translateY(-1px); } }
#reels .rr-bar i { width: 3px; height: 14px; border-radius: 1px; background: var(--fam); }
#reels .rr-bar.empty { border-style: dashed; border-color: rgba(244,239,230,0.08); width: 58px; }

#reels .rr-foot-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
#reels .rr-pips-row { display: flex; align-items: center; gap: 10px; }
#reels .rr-pips { display: inline-flex; gap: 5px; }
#reels .rr-pips i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--paper-dim); transition: background 0.3s, border-color 0.3s; }
#reels .rr-pips i.on { background: var(--accent); border-color: var(--accent); }

@media (max-width: 560px) {
  #reels .rr-lane { height: 84px; width: calc(100% - 28px); margin: 18px 14px 0; }
  #reels .rr-reels { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 18px 14px 0; gap: 6px; row-gap: 12px; }  /* also without container queries */
  #reels .reel-lock { height: 44px; }
  /* three equal buttons under the reels instead of 2 + an orphan */
  #reels .rr-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 16px 14px 0; }
  #reels .rr-actions .btn { justify-content: center; padding: 14px 8px; }
  #reels .stage > .inline-msg { margin: 14px 14px 0; }
  #reels .reel-strip .ghost { font-size: 11px; padding: 0 4px; }
  #reels .rr-thread-wrap { padding: 16px 14px 0; }
  #rrThread { height: 40px; }
  #reels .rr-legend { padding: 12px 14px 0; gap: 6px 12px; }
  #reels .rr-history { padding: 14px 14px 16px; gap: 6px; }
  #reels .rr-bar.empty { width: 54px; }
  #reels .rr-foot-r { align-items: flex-start; text-align: left; }
}
