.rbt { position: relative; background: #000; border-radius: var(--radius-sm); overflow: hidden; margin: 24px 0; }
.rbt canvas { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; cursor: pointer; }

/* control panel: every control is the same 36 px pill on one surface, labels on one line above */
.rbt-ctl { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; padding: 18px 20px 14px;
  background: #121214; border-top: 1px solid #1f2023; color: #e8e9ec; font-size: 14px; }
.rbt-sec { display: flex; flex-direction: column; gap: 8px; }
.rbt-lbl { height: 14px; line-height: 14px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #7c7d82; }
.rbt-pill { display: flex; align-items: center; height: 36px; padding: 0 4px; gap: 2px; background: #1c1d21; border-radius: 10px; }
.rbt-out { width: 100%; padding-top: 12px; border-top: 1px solid #1f2023; color: #6e6f74; font-size: 12px; font-variant-numeric: tabular-nums; }

/* speed: slider and its value inside one pill */
.rbt-sec-speed { flex: 1 1 200px; max-width: 280px; }
.rbt-spdbox { padding: 0 12px 0 14px; gap: 12px; }
.rbt-x { min-width: 28px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.rbt-speed { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 20px; margin: 0; background: transparent; cursor: pointer; }
.rbt-speed:focus { outline: none; }
.rbt-spdbox:focus-within { box-shadow: 0 0 0 1px #3a3b40; }
.rbt-speed::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, #fff var(--p, 0%), #3a3b40 var(--p, 0%)); }
.rbt-speed::-moz-range-track { height: 4px; border-radius: 2px; background: #3a3b40; }
.rbt-speed::-moz-range-progress { height: 4px; border-radius: 2px; background: #fff; }
.rbt-speed::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; border: 0; }
.rbt-speed::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }

/* colour swatches */
.rbt-cols { padding: 0 10px; gap: 10px; }
.rbt .rbt-col { width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 0; background: var(--c); cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255,255,255,.15); transition: box-shadow .15s, transform .15s; }
.rbt .rbt-col:hover { transform: scale(1.12); }
.rbt .rbt-col[aria-pressed=true] { box-shadow: 0 0 0 2px #1c1d21, 0 0 0 3.5px #fff; }

/* segmented buttons: directions, pause / fullscreen */
.rbt-seg button { width: 34px; height: 28px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 7px;
  background: transparent; color: #a9aaaf; font: inherit; font-size: 15px; cursor: pointer; transition: background .15s, color .15s; }
.rbt-seg button:hover { color: #fff; background: #2a2b30; }
.rbt-seg button[aria-pressed=true] { background: #fff; color: #000; }
.rbt-ico svg { width: 17px; height: 17px; fill: currentColor; stroke: currentColor; }
.rbt-ico svg[fill=none] { fill: none; }

/* fullscreen: the panel floats over the pattern and hides when the mouse is idle */
.rbt:fullscreen { border-radius: 0; margin: 0; }
.rbt:fullscreen canvas { width: 100%; height: 100%; aspect-ratio: auto; }
.rbt:fullscreen .rbt-ctl { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  border: 1px solid #2a2b30; border-radius: 16px; background: rgba(18,18,20,.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0,0,0,.6); transition: opacity .3s; }
.rbt.rbt-idle, .rbt.rbt-idle canvas { cursor: none; }
.rbt.rbt-idle .rbt-ctl { opacity: 0; pointer-events: none; }

@media (max-width: 700px) {
  .rbt-ctl { justify-content: flex-start; }
  .rbt-sec-speed { max-width: none; flex-basis: 100%; }
  .rbt-act .rbt-lbl { display: none; }
}
