@property --glow-a {
  syntax: '<color>';
  inherits: true;
  initial-value: #18c9aa;
}
@property --glow-b {
  syntax: '<color>';
  inherits: true;
  initial-value: #6a45ff;
}

:root {
  --bg: #050507;
  --fg: #f3f2f7;
  --dim: rgba(243, 242, 247, 0.55);
  --faint: rgba(243, 242, 247, 0.32);
  --glass: rgba(20, 20, 27, 0.5);
  --glass-strong: rgba(18, 18, 24, 0.78);
  --card-solid: rgba(16, 16, 22, 0.96);
  --glass-hi: rgba(255, 255, 255, 0.075);
  --stroke: rgba(255, 255, 255, 0.085);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', Inter,
    Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
  transition: --glow-a 1.8s ease, --glow-b 1.8s ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--fg);
  transition: background-color 0.6s ease, color 0.6s ease;
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* --- backdrop: a dark studio lit by the cube's own content ------------------------ */
.backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(42% 36% at 50% 47%, color-mix(in oklab, var(--glow-a) 22%, transparent), transparent 72%),
    radial-gradient(60% 28% at 50% 88%, color-mix(in oklab, var(--glow-b) 18%, transparent), transparent 75%),
    radial-gradient(120% 90% at 50% 10%, #0e0e15 0%, #08080b 45%, var(--bg) 100%);
}
.backdrop::after {
  /* gentle vignette + grain so gradients never band */
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(140% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.bg-transparent,
body.bg-transparent #app {
  background: transparent;
}
body.bg-transparent .backdrop,
body.bg-custom .backdrop {
  display: none;
}
body.bg-custom #app {
  background: inherit;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  outline: none;
}
#stage.grabbing {
  cursor: grabbing;
}

/* --- chrome ------------------------------------------------------------------------- */
.chrome {
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
body.no-ui .chrome {
  display: none;
}
body.ui-idle .dock,
body.ui-idle .brand {
  opacity: 0;
  pointer-events: none;
}
body.ui-idle .dock {
  transform: translate(-50%, 10px);
}
body.ui-idle .status {
  opacity: 0.55;
}
body.ui-idle .corner-btn {
  opacity: 0;
  pointer-events: none;
}

/* the design credit, small in the bottom right corner (under the dock's level, so it never meets it) */
.credit {
  position: absolute;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(5px, calc(env(safe-area-inset-bottom) - 17px));
  z-index: 2;
  font: 600 9.5px/14px var(--font);
  letter-spacing: 0.14em;
  color: var(--dim);
  text-decoration: none;
  opacity: 0.75;
}
.credit:hover,
.credit:focus-visible {
  color: var(--fg);
  opacity: 1;
}
body.ui-idle .credit {
  opacity: 0.35;
}

/* full screen, in the top right corner */
.corner-btn {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  z-index: 4;
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  color: var(--fg);
  cursor: pointer;
}
.corner-btn[hidden] {
  display: none;
}
.corner-btn:hover {
  background: var(--glass-strong);
}
.corner-btn:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--glow-a) 70%, white);
  outline-offset: 2px;
}
.corner-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.corner-btn .i-exit,
.corner-btn[aria-pressed='true'] .i-enter {
  display: none;
}
.corner-btn[aria-pressed='true'] .i-exit {
  display: block;
}

.brand {
  position: absolute;
  top: max(22px, env(safe-area-inset-top));
  left: max(24px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  user-select: none;
}
.brand .mark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background:
    linear-gradient(90deg, transparent 31%, rgba(5, 5, 7, 0.85) 31% 36%, transparent 36% 64%, rgba(5, 5, 7, 0.85) 64% 69%, transparent 69%),
    linear-gradient(0deg, transparent 31%, rgba(5, 5, 7, 0.85) 31% 36%, transparent 36% 64%, rgba(5, 5, 7, 0.85) 64% 69%, transparent 69%),
    linear-gradient(135deg, var(--glow-a), var(--glow-b));
  box-shadow: 0 0 18px color-mix(in oklab, var(--glow-a) 45%, transparent);
}

.status {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 15px 0 13px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  font-size: 13px;
  font-weight: 520;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  user-select: none;
  /* never under the full screen button in the corner */
  max-width: calc(100% - 2 * (max(20px, env(safe-area-inset-right)) + 48px));
}
.status .label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status::after {
  /* progress hairline */
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: calc(var(--p, 0) * 100%);
  background: linear-gradient(90deg, var(--glow-a), var(--glow-b));
  opacity: 0;
  transition: width 0.25s ease, opacity 0.4s;
}
.status[data-phase='scrambling']::after,
.status[data-phase='solving']::after {
  opacity: 0.9;
}
.status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ff0a8;
  box-shadow: 0 0 12px #4ff0a8;
  transition: background 0.3s, box-shadow 0.3s;
}
.status[data-phase='scrambling'] .dot,
.status[data-phase='scrambled'] .dot {
  background: #ffc857;
  box-shadow: 0 0 12px #ffc857;
}
.status[data-phase='solving'] .dot,
.status[data-phase='thinking'] .dot {
  background: #7aa2ff;
  box-shadow: 0 0 12px #7aa2ff;
  animation: blink 1s ease-in-out infinite;
}
.status[data-phase='manual'] .dot {
  background: #f3f2f7;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}
@keyframes blink {
  50% {
    opacity: 0.35;
  }
}
.status .move {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  min-width: 30px;
  padding: 3px 7px;
  border-radius: 7px;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
}

.hint {
  position: absolute;
  left: 50%;
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + var(--dock-h, 54px) + 20px);
  transform: translateX(-50%);
  margin: 0;
  font-size: 12.5px;
  color: var(--faint);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.hint span {
  margin: 0 6px;
}
.hint.gone {
  opacity: 0;
  transform: translate(-50%, 6px);
}

/* --- dock ----------------------------------------------------------------------------- */
.dock {
  position: absolute;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.dock .break {
  display: none;
}
.dock .group {
  display: flex;
  align-items: center;
  gap: 2px;
}
.sep {
  width: 1px;
  height: 22px;
  background: var(--stroke);
  margin: 0 2px;
}

.btn {
  appearance: none;
  height: 40px;
  padding: 0 14px 0 11px;
  border: 0;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  background: transparent;
  font: 520 13.5px/1 var(--font);
  letter-spacing: 0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, transform 0.12s;
}
.btn:hover {
  background: var(--glass-hi);
}
.btn:active {
  transform: scale(0.95);
}
.btn:focus-visible,
.seg button:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--glow-a) 70%, white);
  outline-offset: 1px;
}
.btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.btn.icon {
  width: 40px;
  padding: 0;
  justify-content: center;
}
.btn.auto .i-play,
.btn.auto[aria-pressed='false'] .i-pause {
  display: none;
}
.btn.auto[aria-pressed='false'] .i-play {
  display: block;
  fill: currentColor;
}
.btn.auto[aria-pressed='true'] {
  background: rgba(255, 255, 255, 0.1);
}
.btn.sound .i-off,
.btn.sound[aria-pressed='false'] .i-on {
  display: none;
}
.btn.sound[aria-pressed='false'] .i-off {
  display: block;
}
.btn.sound[aria-pressed='false'] {
  color: var(--dim);
}

.content-name {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg);
  height: 40px;
  min-width: 92px;
  padding: 0 8px 0 12px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: 600 13.5px/1 var(--font);
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s;
}
.content-name:hover,
body.sheet-open .content-name {
  background: var(--glass-hi);
}
.content-name svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
  transition: transform 0.25s;
}
body.sheet-open .content-name svg {
  transform: rotate(180deg);
}
.btn .pip {
  fill: currentColor;
  stroke: none;
}
.btn .fillhalf {
  fill: currentColor;
  stroke: none;
}
#btn-reroll[hidden] {
  display: none;
}

.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
}
.seg button {
  appearance: none;
  width: 30px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--dim);
  font: 600 12.5px/1 var(--font);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.seg button:hover {
  color: var(--fg);
}
.seg button[aria-checked='true'] {
  background: rgba(255, 255, 255, 0.13);
  color: var(--fg);
}

.nogl {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  text-align: center;
  color: var(--dim);
  padding: 24px;
}
body.no-webgl .nogl {
  display: grid;
}

/* --- gallery sheet ---------------------------------------------------------------------- */
.sheet {
  position: absolute;
  left: 50%;
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + var(--dock-h, 54px) + 12px);
  transform: translateX(-50%);
  width: min(740px, calc(100vw - 24px));
  max-height: min(56vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: sheet-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 3;
}
.sheet[hidden] {
  display: none;
}
@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translate(-50%, 14px) scale(0.985);
  }
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 4px 12px;
}
.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
}
.tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  height: 32px;
  padding: 0 14px;
  border-radius: 10px;
  font: 600 13px/1 var(--font);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.tabs button[aria-selected='true'] {
  background: rgba(255, 255, 255, 0.12);
  color: var(--fg);
}
.sheet-body {
  overflow-y: auto;
  padding: 4px 18px 18px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.sheet h3 {
  margin: 14px 2px 10px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.sheet h3 span {
  margin-left: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--faint);
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}
.card {
  appearance: none;
  border: 0;
  padding: 0 0 9px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--stroke);
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.card:hover {
  background: rgba(255, 255, 255, 0.07);
}
.card:active {
  transform: scale(0.97);
}
.card.active {
  box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--glow-a) 70%, white);
  background: color-mix(in oklab, var(--glow-a) 10%, transparent);
}
.card canvas {
  width: 100%;
  max-width: 112px;
  aspect-ratio: 1;
  display: block;
}
.card .name {
  font-size: 12.5px;
  font-weight: 560;
  max-width: 100%;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card.add {
  justify-content: center;
  min-height: 132px;
  gap: 10px;
  color: var(--dim);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--stroke);
  border: 1px dashed transparent;
}
.card.add:hover {
  color: var(--fg);
}
.add-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
}
.add-ico svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.maprow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--dim);
}
.maprow[hidden] {
  display: none;
}
.maprow .seg button {
  width: auto;
  padding: 0 12px;
}
.seg button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.fine {
  margin: 12px 2px 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--faint);
}

.looks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  padding-top: 10px;
}
.look {
  appearance: none;
  border: 0;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px var(--stroke);
  color: var(--fg);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.look:hover {
  background: rgba(255, 255, 255, 0.07);
}
.look.active {
  box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--glow-a) 70%, white);
}
.look-text b {
  display: block;
  font-size: 13.5px;
  font-weight: 620;
}
.look-text small {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--dim);
}
.look-art {
  height: 92px;
  border-radius: 11px;
  display: grid;
  grid-template-columns: repeat(3, 22px);
  grid-template-rows: repeat(3, 22px);
  gap: 3px;
  place-content: center;
}
.look-art i {
  border-radius: 5px;
}
.look-studio {
  background: radial-gradient(circle at 50% 45%, #2a1f4a, #08080c 70%);
}
.look-studio i {
  background: linear-gradient(135deg, #ff4f8b, #6a3cff);
  box-shadow: 0 0 10px rgba(140, 90, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.look-studio i:nth-child(3n + 1) {
  background: linear-gradient(135deg, #ffb24f, #ff4f8b);
}
.look-gallery {
  background: linear-gradient(160deg, #f6f2ec, #e3ddd3);
}
.look-gallery i {
  background: #eae5dd;
  box-shadow: 0 2px 5px rgba(80, 60, 30, 0.18);
}
.look-gallery i:nth-child(odd) {
  background: linear-gradient(135deg, #f0b8a0, #c8b7e8);
}
.look-glass {
  background: radial-gradient(circle at 50% 45%, #10203a, #07080c 70%);
}
.look-glass i {
  background: radial-gradient(circle, rgba(80, 220, 255, 0.85) 0 22%, rgba(255, 255, 255, 0.08) 30%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}
.look-classic {
  background: #0a0a0b;
}
.look-classic i {
  background: #10c46b;
  box-shadow: 0 0 0 2px #050506;
}
.look-classic i:nth-child(2),
.look-classic i:nth-child(7) {
  background: #ff3b30;
}
.look-classic i:nth-child(4),
.look-classic i:nth-child(9) {
  background: #ffd60a;
}
.look-classic i:nth-child(5) {
  background: #f4f4ef;
}
.look-classic i:nth-child(3),
.look-classic i:nth-child(8) {
  background: #1f6bff;
}

/* --- drop zone + toast --------------------------------------------------------------------- */
.dropzone {
  position: absolute;
  inset: 14px;
  z-index: 10;
  display: grid;
  place-items: center;
  border-radius: 28px;
  border: 2px dashed color-mix(in oklab, var(--glow-a) 70%, white);
  background: color-mix(in oklab, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 18px;
  font-weight: 600;
  pointer-events: none;
}
.dropzone[hidden] {
  display: none;
}
.toast {
  position: absolute;
  left: 50%;
  top: calc(max(18px, env(safe-area-inset-top)) + 48px);
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  font-size: 13px;
  text-align: center;
  z-index: 4;
}
.toast[hidden] {
  display: none;
}

/* --- light theme (Gallery look) ------------------------------------------------------------- */
body[data-theme='light'] {
  --bg: #ece8e1;
  --fg: #19181d;
  --dim: rgba(25, 24, 29, 0.6);
  --faint: rgba(25, 24, 29, 0.4);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(250, 248, 244, 0.82);
  --glass-hi: rgba(0, 0, 0, 0.055);
  --card-solid: rgba(250, 248, 244, 0.97);
  --stroke: rgba(0, 0, 0, 0.08);
  color-scheme: light;
}
body[data-theme='light'] .backdrop {
  background:
    radial-gradient(46% 40% at 50% 46%, color-mix(in oklab, var(--glow-a) 10%, #fbf9f5), transparent 75%),
    radial-gradient(120% 90% at 50% 0%, #f7f4ef 0%, #ece7df 55%, #e2dcd2 100%);
}
body[data-theme='light'] .backdrop::after {
  background:
    radial-gradient(140% 100% at 50% 50%, transparent 60%, rgba(90, 70, 40, 0.12) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body[data-theme='light'] .dock,
body[data-theme='light'] .status {
  box-shadow: 0 12px 36px rgba(60, 40, 20, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
body[data-theme='light'] .sheet {
  box-shadow: 0 24px 70px rgba(60, 40, 20, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
body[data-theme='light'] .btn.auto[aria-pressed='true'],
body[data-theme='light'] .seg button[aria-checked='true'],
body[data-theme='light'] .tabs button[aria-selected='true'] {
  background: rgba(0, 0, 0, 0.08);
}
body[data-theme='light'] .seg,
body[data-theme='light'] .tabs,
body[data-theme='light'] .card,
body[data-theme='light'] .look {
  background: rgba(0, 0, 0, 0.035);
}
body[data-theme='light'] .add-ico {
  background: rgba(0, 0, 0, 0.05);
}
body[data-theme='light'] .status .move {
  background: rgba(0, 0, 0, 0.07);
}
body[data-theme='light'] .status[data-phase='manual'] .dot {
  background: #19181d;
  box-shadow: none;
}

/* --- puzzle mode swaps the first dock group ------------------------------------------- */
.mode-puzzle {
  display: none !important;
}
body.puzzle-mode .mode-puzzle {
  display: inline-flex !important;
}
body.puzzle-mode .mode-play {
  display: none !important;
}
.btn:disabled {
  opacity: 0.32;
  cursor: default;
  background: transparent;
  transform: none;
}
.btn[aria-pressed='true']:not(.auto) {
  background: rgba(255, 255, 255, 0.12);
}
body[data-theme='light'] .btn[aria-pressed='true']:not(.auto) {
  background: rgba(0, 0, 0, 0.08);
}
#btn-hint .label,
#btn-hint svg {
  color: #ffd166;
}
body[data-theme='light'] #btn-hint svg,
body[data-theme='light'] #btn-hint .label {
  color: #b7791f;
}
.status[data-phase='ready'] .dot {
  background: #ffc857;
  box-shadow: 0 0 12px #ffc857;
  animation: blink 1.2s ease-in-out infinite;
}
.status[data-phase='running'] .dot {
  background: #ff5d73;
  box-shadow: 0 0 12px #ff5d73;
}
.status[data-phase='running'] .label,
.status[data-phase='solved'] .label {
  font-variant-numeric: tabular-nums;
}

/* --- more popover ---------------------------------------------------------------------- */
.popover {
  position: absolute;
  /* dock panels open at the right edge, so the cube keeps the rest of the screen */
  right: max(20px, env(safe-area-inset-right));
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + var(--dock-h, 54px) + 12px);
  width: 300px;
  padding: 14px;
  border-radius: 20px;
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 3;
  animation: pop-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.popover[hidden] {
  display: none;
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}
.popover .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.row-label {
  font-size: 13px;
  font-weight: 560;
  color: var(--dim);
}
.popover .seg button {
  width: 38px;
}
.switch {
  appearance: none;
  border: 0;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: background 0.2s;
}
.switch i {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.22s cubic-bezier(0.3, 0.7, 0.3, 1);
}
.switch[aria-checked='true'] {
  background: color-mix(in oklab, var(--glow-a) 75%, #22c58b);
}
.switch[aria-checked='true'] i {
  transform: translateX(18px);
}
body[data-theme='light'] .switch {
  background: rgba(0, 0, 0, 0.14);
}
.wide {
  appearance: none;
  border: 0;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  font: 600 13px/1 var(--font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.18s;
}
.wide:hover {
  background: rgba(255, 255, 255, 0.13);
}
.wide svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body[data-theme='light'] .wide {
  background: rgba(0, 0, 0, 0.06);
}
.keys {
  margin: 2px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: 11.5px;
  color: var(--faint);
}
.keys dt {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
}
.keys dd {
  margin: 0;
}
/* touch-only devices have no keyboard to use the shortcuts with */
@media (hover: none) and (pointer: coarse) {
  .keys {
    display: none;
  }
}

/* --- world and light cards --------------------------------------------------------------- */
.world-art,
.lights-art {
  position: relative;
  overflow: hidden;
  grid-template-columns: repeat(3, 12px) !important;
  grid-template-rows: repeat(3, 12px) !important;
  gap: 2px !important;
}
.world-art i,
.lights-art i {
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
  position: relative;
  top: -6px;
}
.world-studio { background: radial-gradient(circle at 50% 45%, #2a1f4a, #08080c 70%); }
.world-studio i { background: linear-gradient(135deg, #ff4f8b, #6a3cff); }
.world-cyclorama { background: linear-gradient(#d6d4d0, #f1efeb 62%, #ebe9e5); }
.world-cyclorama i { background: linear-gradient(135deg, #18c9aa, #6a45ff); }
.world-obsidian { background: linear-gradient(#030307, #0d0e18 56%, #5a3cff 57%, #020203 58%, #0b0b12); }
.world-tide { background: linear-gradient(#0a1430, #e2876c 57%, #1d4560 58%, #0b2235); }
.world-dune { background: radial-gradient(circle at 30% 58%, #ffe0b0 0 9px, transparent 10px), linear-gradient(#2b1d52, #ff9f6e 58%, #e3a374 59%, #8a5440); }
.world-cloud { background: linear-gradient(#8db6ff, #ffd9ea 60%, #fff8fb 61%, #d9cdf0); }
.world-orbit { background: radial-gradient(circle at 50% 170%, #4a74c4 0 46%, #6ea0ff 47%, transparent 52%), radial-gradient(circle at 20% 20%, #fff 0 1px, transparent 2px), radial-gradient(circle at 75% 35%, #fff 0 1px, transparent 2px), radial-gradient(circle at 60% 12%, #fff 0 1px, transparent 2px), #01020a; }
.world-grid { background: repeating-linear-gradient(90deg, transparent 0 15px, rgba(255, 60, 200, 0.6) 15px 16px) 0 58% / 100% 42% no-repeat, linear-gradient(#07001a, #ff2f8f 57%, #05010c 58%); }
.world-atrium { background: linear-gradient(90deg, transparent 46%, rgba(255, 250, 235, 0.35) 46% 54%, transparent 54%), linear-gradient(#cfcdc8, #b4b1ab 60%, #9d9a94 61%, #8a8781); }
.world-mist { background: linear-gradient(#323c4b, #86909e 55%, #4d5561 70%, #272c34); }
.world-snow { background: radial-gradient(circle at 20% 30%, #fff 0 1.5px, transparent 2px), radial-gradient(circle at 70% 18%, #fff 0 1.5px, transparent 2px), radial-gradient(circle at 85% 45%, #fff 0 1.5px, transparent 2px), linear-gradient(#9bb0c9, #e3eaf3 58%, #f7f9fc 59%, #dfe6f0); }
.world-aurora { background: radial-gradient(ellipse 60% 30% at 30% 38%, rgba(60, 255, 150, 0.55), transparent 70%), radial-gradient(ellipse 50% 22% at 72% 30%, rgba(170, 80, 255, 0.45), transparent 70%), linear-gradient(#020814, #0a2633 58%, #9fb4c8 59%, #03070d 62%, #0b1a26); }
.world-blossom { background: radial-gradient(circle at 22% 30%, #ffc4d8 0 2px, transparent 3px), radial-gradient(circle at 68% 22%, #ffd6e4 0 2px, transparent 3px), radial-gradient(circle at 84% 48%, #ffb9cf 0 2px, transparent 3px), radial-gradient(ellipse 40% 12% at 30% 56%, #f7b6cb, transparent 70%), linear-gradient(#b7c4f0, #ffd3de 57%, #c9b4c8 58%, #e8d2dc); }
.world-abyss { background: repeating-linear-gradient(100deg, transparent 0 9px, rgba(170, 245, 255, 0.12) 9px 13px), linear-gradient(#0d6f8c, #04324a 55%, #3d6f78 72%, #123a48); }
.world-magma { background: radial-gradient(circle at 62% 50%, #ff7a2a 0 3px, transparent 8px), linear-gradient(118deg, transparent 52%, #1b0d0b 52.5%), linear-gradient(242deg, transparent 52%, #1b0d0b 52.5%) , linear-gradient(#07020a, #4a1208 56%, #151012 58%), #151012; background-size: 100% 100%, 50% 58%, 50% 58%, 100% 100%; background-position: 0 0, 15% 0, 85% 0, 0 0; background-repeat: no-repeat; }
.world-city { background: linear-gradient(90deg, #0b0a14 0 12%, transparent 12% 18%, #0b0a14 18% 30%, transparent 30% 40%, #0b0a14 40% 48%, transparent 48% 62%, #0b0a14 62% 74%, transparent 74% 82%, #0b0a14 82%) 0 22% / 100% 36% no-repeat, linear-gradient(#05030f, #5a1f6a 57%, #0b0b10 58%, #2a1036 70%, #0b0b10); }
.world-eclipse { background: radial-gradient(circle at 54% 32%, #000 0 6px, #fff6e6 7px, rgba(255, 240, 220, 0.35) 9px, transparent 16px), linear-gradient(#02030a, #1a1530 52%, #ff7a3a 57%, #0d0c14 58%, #3a2f44); }
.world-aurora i,
.world-abyss i,
.world-magma i,
.world-city i,
.world-eclipse i { background: linear-gradient(135deg, #ff9a3c, #ff2e7e); }
.world-blossom i { background: linear-gradient(135deg, #25b4ff, #7b5bff); }
.world-obsidian i,
.world-tide i,
.world-dune i,
.world-orbit i,
.world-grid i,
.world-mist i { background: linear-gradient(135deg, #ff9a3c, #ff2e7e); }
.world-atrium i,
.world-cloud i,
.world-snow i { background: linear-gradient(135deg, #25b4ff, #7b5bff); }

.lights-art { background: #0b0b12; }
.lights-art i { background: linear-gradient(135deg, #8a7dff, #3b2f8f); top: 0; }
.lights-default { background: radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.35), transparent 55%), #0b0b12; }
.lights-soft { background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.55), transparent 75%), #1a1a22; }
.lights-sunset { background: radial-gradient(circle at 0% 60%, rgba(255, 140, 70, 0.75), transparent 60%), radial-gradient(circle at 100% 50%, rgba(255, 80, 140, 0.4), transparent 60%), #120a18; }
.lights-neon { background: radial-gradient(circle at 15% 50%, rgba(255, 43, 214, 0.7), transparent 45%), radial-gradient(circle at 85% 50%, rgba(31, 227, 255, 0.7), transparent 45%), #05050a; }
.lights-scan { background: linear-gradient(160deg, transparent 30%, rgba(255, 240, 220, 0.35) 40%, transparent 50%), linear-gradient(200deg, transparent 30%, rgba(220, 230, 255, 0.35) 40%, transparent 50%), #06060a; }
.lights-laser { background: repeating-conic-gradient(from -50deg at 50% 110%, rgba(40, 255, 138, 0.8) 0 0.6deg, transparent 0.6deg 11deg) 0 0 / 100% 100%, #04040a; }
.lights-disco { background: radial-gradient(circle at 15% 25%, #ff5fd2 0 3px, transparent 4px), radial-gradient(circle at 80% 30%, #5fd2ff 0 3px, transparent 4px), radial-gradient(circle at 30% 80%, #ffe15f 0 3px, transparent 4px), radial-gradient(circle at 70% 75%, #8aff5f 0 3px, transparent 4px), radial-gradient(circle at 90% 85%, #ff7a5f 0 3px, transparent 4px), #0a0812; }
.lights-blackout { background: #000; }
.lights-blackout i { background: linear-gradient(135deg, #ff4f8b, #6a3cff); box-shadow: 0 0 10px rgba(140, 90, 255, 0.6); }
.lights-heartbeat { background: radial-gradient(circle at 50% 50%, rgba(255, 60, 90, 0.55), transparent 65%), #120508; }
.lights-strobe { background: linear-gradient(90deg, #f4f4f8 50%, #0b0b12 50%); }

/* --- effect tiles: a little cube in the dark, with the effect around it ------------------------ */
.fx-art {
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #1b1630, #07070b 70%);
  grid-template-columns: repeat(3, 10px) !important;
  grid-template-rows: repeat(3, 10px) !important;
  gap: 2px !important;
}
.fx-art i {
  border-radius: 2px;
  background: linear-gradient(135deg, #ff4f8b, #6a3cff);
  position: relative;
  z-index: 1;
}
.fx-art::before,
.fx-art::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.fx-halo::before { inset: 34% -10%; border-radius: 50%; border: 2px dotted rgba(140, 220, 255, 0.85); transform: rotate(-12deg); }
.fx-pools::before { left: 8%; right: 8%; bottom: -6%; height: 34%; border-radius: 50%; background: radial-gradient(ellipse at 30% 50%, rgba(255, 80, 160, 0.7), transparent 60%), radial-gradient(ellipse at 70% 50%, rgba(80, 200, 255, 0.7), transparent 60%); }
.fx-shafts::before { inset: -20%; background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 230, 255, 0.28) 0 6deg, transparent 6deg 24deg); }
.fx-flares::before { left: -10%; right: -10%; top: 47%; height: 3px; background: linear-gradient(90deg, transparent, rgba(150, 200, 255, 0.95), transparent); box-shadow: 0 0 6px rgba(150, 200, 255, 0.9); }
.fx-field::before { inset: 6%; border-radius: 50%; border: 1px solid rgba(150, 230, 255, 0.7); background: radial-gradient(circle, transparent 55%, rgba(120, 200, 255, 0.35)); }
.fx-lightning::before { left: 58%; top: 50%; width: 3px; height: 60%; background: #e8f4ff; box-shadow: 0 0 6px #9fd0ff; transform: skewX(-25deg); }
.fx-lightning::after { left: 30%; top: 50%; width: 2px; height: 55%; background: #e8f4ff; box-shadow: 0 0 6px #ff9fe0; transform: skewX(28deg); }
.fx-echoes::before { inset: 22% 30% 22% 6%; border: 2px solid rgba(255, 120, 200, 0.45); border-radius: 3px; }
.fx-echoes::after { inset: 22% 46% 22% -10%; border: 2px solid rgba(255, 120, 200, 0.22); border-radius: 3px; }
.fx-shock::before { inset: 10%; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.55); box-shadow: 0 0 8px rgba(255, 255, 255, 0.5), inset 0 0 8px rgba(255, 255, 255, 0.4); }
.fx-tiles .tile[aria-pressed='true'] {
  border-color: var(--accent, #8a7dff);
  box-shadow: 0 0 0 1px var(--accent, #8a7dff);
}
.fx-tiles .tile.unavailable {
  opacity: 0.45;
}
#fx-halo button {
  width: auto;
  padding: 0 12px;
}
#fx-halo-row.dim {
  opacity: 0.5;
}

/* --- music show popover, YouTube panel, VJ mode -------------------------------------------- */
.popover.show {
  width: 340px;
}
.popover.panel-pop {
  max-height: calc(100% - var(--dock-h, 54px) - max(22px, env(safe-area-inset-bottom)) - 80px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.popover.panel-pop > * {
  flex-shrink: 0; /* scroll instead of squashing */
}
.popover .row.stack {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.chips.wrap {
  flex-wrap: wrap;
}
#style-seg {
  display: flex;
}
#style-seg button {
  flex: 1;
  width: auto;
  padding: 0 4px;
}
#timing-seg button {
  width: auto;
  padding: 0 9px;
}
.chip[aria-checked='true'] {
  background: rgba(255, 255, 255, 0.2);
  color: var(--fg);
}
body[data-theme='light'] .chip[aria-checked='true'] {
  background: rgba(0, 0, 0, 0.14);
}
.show-actions {
  display: flex;
  gap: 8px;
}
.show-actions .wide {
  flex: 1;
}
.yt {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + var(--dock-h, 54px) + 12px);
  width: min(380px, calc(100% - 32px));
  border-radius: 16px;
  overflow: hidden;
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  z-index: 2;
}
.yt[hidden] {
  display: none;
}
.yt-frame {
  aspect-ratio: 16 / 9;
  background: #000;
}
.yt-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.yt-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--dim);
}
.yt-bar span {
  flex: 1;
}
@media (max-width: 639px) {
  .yt {
    top: calc(max(18px, env(safe-area-inset-top)) + 48px);
    bottom: auto;
    left: 12px;
    width: calc(100% - 24px);
  }
}
/* VJ mode: nothing but the show */
body.vj .chrome {
  display: none !important;
}
body.vj #stage {
  cursor: none;
}
body.vj .toast {
  top: auto;
  bottom: 24px;
}

/* --- recording --------------------------------------------------------------------------- */
.popover .row[hidden] {
  display: none;
}
.rec-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff3b4e;
  box-shadow: 0 0 8px rgba(255, 59, 78, 0.7);
}
.wide.rec {
  gap: 9px;
}
#rec-format {
  display: flex;
}
#rec-format button {
  flex: 1;
  width: auto;
}
.rec-bar {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 14px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  font: 600 13px/1 var(--font);
  font-variant-numeric: tabular-nums;
  z-index: 6;
}
.rec-bar[hidden] {
  display: none;
}
.rec-bar .rec-dot {
  animation: rec-blink 1.2s ease-in-out infinite;
}
@keyframes rec-blink {
  50% {
    opacity: 0.25;
  }
}
.rec-label {
  color: var(--dim);
  font-weight: 520;
}
body.recording .chrome {
  display: none !important;
}

/* --- formations popover ------------------------------------------------------------------ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}
.form {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  border-radius: 12px;
  padding: 8px 0 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font: 560 10.5px/1 var(--font);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.form svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.form:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--fg);
}
.form[aria-pressed='true'] {
  background: rgba(255, 255, 255, 0.13);
  color: var(--fg);
}
body[data-theme='light'] .form:hover {
  background: rgba(0, 0, 0, 0.05);
}
body[data-theme='light'] .form[aria-pressed='true'] {
  background: rgba(0, 0, 0, 0.09);
}
.form-text {
  display: flex;
  gap: 8px;
  margin: 0;
}
.form-text input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font: 520 14px/1 var(--font);
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-text input::placeholder {
  text-transform: none;
  letter-spacing: 0;
  color: var(--faint);
}
.form-text input:focus {
  border-color: color-mix(in oklab, var(--glow-a) 60%, transparent);
}
body[data-theme='light'] .form-text input {
  background: rgba(0, 0, 0, 0.04);
}
.formations .music-note {
  margin-top: -2px;
}

/* --- surprise reveal ------------------------------------------------------------------------ */
.reveal {
  position: absolute;
  left: 50%;
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + var(--dock-h, 54px) + 14px);
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 32px));
  padding: 18px 22px 16px;
  border-radius: 24px;
  text-align: center;
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  z-index: 4;
  animation: reveal-in 0.55s cubic-bezier(0.2, 0.9, 0.25, 1.15);
}
@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translate(-50%, 16px) scale(0.94);
  }
}
/* the card rises from the dock; with the dock hidden (VJ, recording) it keeps a margin */
body.ui-idle .reveal {
  bottom: max(22px, env(safe-area-inset-bottom));
}
.reveal[hidden] {
  display: none;
}
.reveal p {
  margin: 0;
}
.reveal-kicker {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.reveal-code {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 3px 8px;
  background: color-mix(in oklab, var(--glow-a) 22%, transparent);
  color: var(--fg);
  font: 650 12px/1 var(--mono);
  letter-spacing: 0.08em;
  cursor: pointer;
}
.reveal-title {
  margin: 8px 0 6px;
  font-size: 34px;
  font-weight: 680;
  letter-spacing: -0.02em;
  line-height: 1.05;
  animation: reveal-title 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: linear-gradient(100deg, var(--fg) 30%, color-mix(in oklab, var(--glow-a) 75%, var(--fg)) 50%, var(--fg) 70%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: reveal-title 0.9s cubic-bezier(0.2, 0.8, 0.2, 1), reveal-shine 2.4s ease-in-out 0.4s 1 both;
}
@keyframes reveal-title {
  from {
    opacity: 0;
    letter-spacing: 0.25em;
    filter: blur(6px);
  }
}
@keyframes reveal-shine {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}
.reveal-parts {
  font-size: 13px;
  line-height: 1.45;
  color: var(--dim);
}
.reveal .result-actions {
  margin-top: 14px;
}
@media (prefers-reduced-motion: reduce) {
  .reveal-title {
    animation: none;
  }
}

/* --- puzzle result --------------------------------------------------------------------- */
.result {
  position: absolute;
  left: 50%;
  top: calc(max(18px, env(safe-area-inset-top)) + 54px);
  transform: translateX(-50%);
  width: min(380px, calc(100vw - 32px));
  padding: 22px 22px 18px;
  border-radius: 24px;
  text-align: center;
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  z-index: 4;
  animation: result-in 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.15);
}
.result[hidden] {
  display: none;
}
@keyframes result-in {
  from {
    opacity: 0;
    transform: translate(-50%, -12px) scale(0.94);
  }
}
.result p {
  margin: 0;
}
.result-kicker {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.result.win .result-kicker {
  color: color-mix(in oklab, var(--glow-a) 70%, white);
}
.result-time {
  margin-top: 6px !important;
  font-size: 56px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.result-meta {
  margin-top: 10px !important;
  font-size: 13.5px;
  color: var(--dim);
}
.result-best {
  margin-top: 4px !important;
  font-size: 12.5px;
  color: var(--faint);
  min-height: 1em;
}
.result-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.pill {
  appearance: none;
  border: 0;
  height: 38px;
  padding: 0 16px;
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--fg);
  font: 600 13px/1 var(--font);
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
}
.pill:hover {
  background: rgba(255, 255, 255, 0.15);
}
.pill:active {
  transform: scale(0.96);
}
.pill.primary {
  background: var(--fg);
  color: var(--bg);
}
.pill[hidden] {
  display: none;
}
body[data-theme='light'] .pill {
  background: rgba(0, 0, 0, 0.06);
}
body[data-theme='light'] .pill.primary {
  background: var(--fg);
  color: #fff;
}

/* --- small screens ---------------------------------------------------------------------- */
@media (max-width: 960px) {
  .btn .label {
    display: none;
  }
  .btn {
    padding: 0 11px;
  }
}
@media (max-width: 720px) {
  .brand {
    display: none;
  }
  .dock .sep {
    display: none;
  }
  .hint {
    font-size: 12px;
  }
  .sheet {
    max-height: 52vh;
  }
  .cards {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
  }
  .looks {
    grid-template-columns: repeat(2, 1fr);
  }
  .content-name {
    min-width: 84px;
  }
  .popover {
    left: 12px;
    right: 12px;
    width: auto;
  }
}

/* phones: two tidy rows — play controls on top, content and view below */
@media (max-width: 639px) {
  .dock {
    left: 12px;
    right: 12px;
    transform: none;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 4px;
    gap: 3px;
    padding: 6px 4px;
  }
  body.ui-idle .dock {
    transform: translateY(10px);
  }
  .dock .group {
    display: contents;
  }
  .dock .break {
    display: block;
    flex-basis: 100%;
    height: 0;
    order: 5;
  }
  #btn-auto,
  #btn-exit { order: 1; }
  #btn-scramble,
  #btn-new { order: 2; }
  #btn-solve,
  #btn-hint,
  #btn-giveup { order: 3; }
  #btn-puzzle,
  #btn-undo,
  #btn-redo,
  #btn-stage,
  #btn-show { order: 4; }
  #btn-prev { order: 6; }
  #content-open { order: 7; }
  #btn-next { order: 8; }
  #btn-reroll { order: 9; }
  #btn-presets,
  #btn-scene,
  #btn-more { order: 10; }
  /* phones: Surprise lives in the Presets panel, so the dock still fits in two rows */
  .dock .split {
    display: none;
  }
  .btn.icon,
  .btn {
    width: 40px;
    padding: 0;
    justify-content: center;
  }
  .btn.caret {
    width: 20px;
  }
  #btn-prev,
  #btn-next,
  #btn-reroll,
  #btn-more {
    width: 34px;
  }
  .content-name {
    min-width: 76px;
    padding: 0 6px 0 10px;
  }
  .result-time {
    font-size: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chrome,
  :root {
    transition: none;
  }
  .status .dot {
    animation: none !important;
  }
}

/* --- music + typing (milestone 4) ------------------------------------------------------- */
.chips {
  display: flex;
  gap: 6px;
}
.chip {
  appearance: none;
  border: 0;
  height: 32px;
  padding: 0 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  font: 600 12.5px/1 var(--font);
  cursor: pointer;
  transition: background 0.18s;
}
.chip:hover {
  background: rgba(255, 255, 255, 0.14);
}
.chip.on {
  background: color-mix(in oklab, var(--glow-a) 80%, #ff4f8b);
  color: #fff;
}
.chip[hidden] {
  display: none;
}
body[data-theme='light'] .chip {
  background: rgba(0, 0, 0, 0.06);
}
/* shows: cards in the Show panel, a slim strip above the dock, a card to change a part */
:root {
  --k-intro: rgba(255, 255, 255, 0.34);
  --k-main: #5dcaa5;
  --k-build: #afa9ec;
  --k-drop: #f0997b;
  --k-break: #ed93b1;
  --k-outro: rgba(255, 255, 255, 0.34);
}
body[data-theme='light'] {
  --k-intro: rgba(0, 0, 0, 0.22);
  --k-outro: rgba(0, 0, 0, 0.22);
}
.k-intro { background: var(--k-intro); }
.k-main { background: var(--k-main); }
.k-build { background: var(--k-build); }
.k-drop { background: var(--k-drop); }
.k-break { background: var(--k-break); }
.k-outro { background: var(--k-outro); }
.show-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.show-cardbtn {
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px 9px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  font: inherit;
  min-width: 0;
}
.show-cardbtn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.show-cardbtn.active {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--glow-a) 70%, white);
}
body[data-theme='light'] .show-cardbtn {
  background: rgba(0, 0, 0, 0.05);
}
body[data-theme='light'] .show-cardbtn.active {
  background: rgba(0, 0, 0, 0.1);
}
.show-mini {
  display: flex;
  gap: 2px;
  height: 6px;
}
.show-mini span {
  border-radius: 2px;
  min-width: 2px;
}
.show-cardbtn .scb-name {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.show-cardbtn .scb-blurb {
  font-size: 10.5px;
  line-height: 1.3;
  color: var(--dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.show-cardbtn .scb-tag {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--dim);
}
.show-actions-row .chip {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.show-actions-row[hidden],
.show-name[hidden] {
  display: none;
}
.show-name {
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font: 520 12.5px/1 var(--font);
}
.show-bar {
  position: absolute;
  left: 50%;
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + var(--dock-h, 54px) + 10px);
  transform: translateX(-50%);
  width: min(700px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
}
.show-bar.solo {
  justify-content: center;
}
.show-bar[hidden],
.show-strip[hidden],
.mini-player[hidden] {
  display: none;
}
.show-strip {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
/* what's playing, always to hand: play/pause and the name (tap it for the player) */
.mini-player {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 26px;
  padding: 0 8px 0 2px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  max-width: 46%;
}
.mp-toggle {
  appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in oklab, var(--glow-a) 55%, white);
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.mp-toggle svg,
.pl-play svg,
.pl-icon svg,
.pl-volume svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mp-toggle svg {
  width: 12px;
  height: 12px;
}
.mp-toggle .i-play,
.pl-play .i-play {
  fill: currentColor;
  stroke-width: 1.4;
}
.mp-toggle[aria-pressed='true'] .i-play,
.mp-toggle:not([aria-pressed='true']) .i-pause,
.pl-play[aria-pressed='true'] .i-play,
.pl-play:not([aria-pressed='true']) .i-pause {
  display: none;
}
.mp-name {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: 600 11.5px/26px var(--font);
  padding: 0 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  cursor: pointer;
}
.mp-name::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: 1px;
  background: var(--dim);
}
.mini-player.live .mp-name::before {
  background: #ff5a5f;
  box-shadow: 0 0 6px #ff5a5f;
}
body.ui-idle .mini-player {
  opacity: 0.55;
}
/* the player in the Show panel */
.player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px var(--stroke);
}
body[data-theme='light'] .player {
  background: rgba(0, 0, 0, 0.05);
}
.pl-play {
  appearance: none;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in oklab, var(--glow-a) 60%, white);
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px color-mix(in oklab, var(--glow-a) 35%, transparent);
}
.pl-play svg {
  width: 20px;
  height: 20px;
}
.pl-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pl-kicker {
  font: 700 9.5px/1.2 var(--font);
  letter-spacing: 0.1em;
  color: var(--dim);
}
.pl-kicker.live {
  color: #ff7a7e;
}
.pl-title {
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-sub {
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-icon {
  appearance: none;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--fg);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.pl-icon:hover {
  background: rgba(255, 255, 255, 0.08);
}
.pl-icon[hidden] {
  display: none;
}
.pl-icon svg {
  width: 18px;
  height: 18px;
}
.pl-volume {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
  color: var(--dim);
}
.pl-volume svg {
  flex: none;
  width: 18px;
  height: 18px;
}
.pl-volume .slider {
  flex: 1;
}
.pl-own {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.pl-own .chip {
  height: 28px;
  padding: 0 11px;
  font-size: 12px;
}
.pl-own .chip.on {
  background: rgba(255, 255, 255, 0.2);
  color: var(--fg);
}
.radio-station.live .rs-name::after {
  content: ' · LIVE';
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: #ff7a7e;
}
.show-filters .chip {
  height: 26px;
  padding: 0 9px;
  font-size: 11.5px;
}
.show-filters .chip[aria-selected='true'] {
  background: rgba(255, 255, 255, 0.2);
  color: var(--fg);
}
body[data-theme='light'] .show-filters .chip[aria-selected='true'] {
  background: rgba(0, 0, 0, 0.14);
}
.ss-bar {
  position: relative;
  flex: 1;
  min-width: 0;
}
.ss-track {
  display: flex;
  gap: 2px;
  height: 22px;
  transition: height 0.4s ease;
}
.ss-seg {
  appearance: none;
  border: 0;
  padding: 0 4px;
  border-radius: 6px;
  min-width: 4px;
  cursor: pointer;
  font: 600 10px/22px var(--font);
  color: rgba(20, 18, 24, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  opacity: 0.55;
  transition: opacity 0.3s ease, filter 0.3s ease;
}
.ss-seg.now {
  opacity: 1;
}
.ss-seg.own {
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.7);
}
.ss-seg.open {
  outline: 2px solid var(--fg);
  outline-offset: 1px;
  opacity: 1;
}
.ss-seg:hover {
  opacity: 0.9;
}
.ss-head {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 0;
  width: 2px;
  border-radius: 1px;
  background: var(--fg);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.ss-add {
  appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: var(--fg);
  font: 500 15px/1 var(--font);
  cursor: pointer;
}
.ss-add[hidden] {
  display: none;
}
/* left alone, the strip thins to a line with the playhead */
body.ui-idle .ss-track {
  height: 4px;
}
body.ui-idle .ss-seg {
  color: transparent;
}
body.ui-idle .ss-add {
  opacity: 0;
  pointer-events: none;
}
body.show-on .hint {
  display: none;
}
.show-card {
  position: absolute;
  /* at the right edge, like the dock's panels, so the cube stays in view */
  right: max(20px, env(safe-area-inset-right));
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + var(--dock-h, 54px) + 44px);
  width: min(320px, calc(100% - 24px));
  padding: 12px;
  border-radius: 18px;
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 4;
  animation: pop-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.show-card[hidden] {
  display: none;
}
.sc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}
.sc-len {
  font-size: 11.5px;
  color: var(--dim);
  margin-right: auto;
}
.sc-x {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.sc-scope button {
  flex: 1;
  width: auto;
  height: 30px;
  padding: 0 6px;
  font-size: 11.5px;
  white-space: nowrap;
}
.sc-scope button[hidden] {
  display: none;
}
@media (max-width: 719px) {
  .show-card {
    left: 12px;
    right: 12px;
    width: auto;
  }
}
.sc-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--dim);
}
.sc-row select {
  height: 30px;
  min-width: 0;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font: 520 12px/1 var(--font);
}
.sc-row select option,
.sc-row select optgroup {
  color: #111;
}
.sc-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.sc-foot .chip {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}
.sc-bars {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
  font-size: 12px;
  color: var(--dim);
}
.sc-bars[hidden] {
  display: none;
}
.sc-bars button {
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  cursor: pointer;
  font: 500 14px/1 var(--font);
}
.sc-bars span {
  min-width: 52px;
  text-align: center;
}
/* palettes: a chip in the gallery header, a card with readymade and generated palettes */
.sheet-pal {
  position: relative;
  margin-left: auto;
}
.pal-chip {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font: 560 12px/1 var(--font);
  cursor: pointer;
  white-space: nowrap;
}
.pal-chip:hover,
.pal-chip[aria-expanded='true'] {
  background: rgba(255, 255, 255, 0.12);
}
.pal-chip svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  opacity: 0.7;
}
.pal-strip {
  display: flex;
  width: 58px;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.pal-strip span {
  flex: 1;
}
.pal-strip.original {
  background: conic-gradient(from 200deg, #16e0bd, #8457ff, #ff5aa5, #ffd23f, #16e0bd);
}
.pal-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pal-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  max-height: min(560px, 70vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  border-radius: 18px;
  /* nearly solid: it sits over the gallery, inside the sheet's own blur */
  background: var(--card-solid);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 6;
  animation: pop-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pal-card[hidden],
.pc-pane[hidden],
.pc-recent-row[hidden],
.pc-tint[hidden] {
  display: none;
}
.pc-top,
.pc-foot {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pc-top .chip {
  margin-left: auto;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.pc-top .seg button,
.pc-foot .seg button {
  width: auto;
  height: 28px;
  padding: 0 10px;
  font-size: 11.5px;
}
.pc-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pc-label {
  font: 600 10.5px/1.2 var(--font);
  letter-spacing: 0.02em;
  color: var(--dim);
}
.pc-chips .chip {
  height: 26px;
  padding: 0 9px;
  font-size: 11.5px;
}
.pc-chips .chip[aria-selected='true'] {
  background: rgba(255, 255, 255, 0.2);
  color: var(--fg);
}
.pal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.pal-tile {
  appearance: none;
  border: 0;
  padding: 6px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  text-align: left;
  font: 560 11.5px/1.2 var(--font);
}
.pal-tile:hover {
  background: rgba(255, 255, 255, 0.1);
}
.pal-tile.active {
  box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--glow-a) 70%, white);
}
.pal-tile .pal-strip {
  width: 100%;
  height: 22px;
  border-radius: 7px;
}
.pal-swatches {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}
.pal-sw {
  appearance: none;
  border: 0;
  aspect-ratio: 3 / 4;
  border-radius: 9px;
  position: relative;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.pal-sw svg {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
  opacity: 0.55;
}
.pal-sw.locked svg {
  opacity: 1;
}
.pc-go {
  background: color-mix(in oklab, var(--glow-a) 55%, white) !important;
  color: #111 !important;
  font-weight: 650;
}
.pal-recent {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pal-recent .pal-strip {
  width: 54px;
  height: 18px;
  cursor: pointer;
}
.radio-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: -2px;
}
.radio-box[hidden] {
  display: none;
}
.radio-chips .chip {
  height: 26px;
  padding: 0 9px;
  font-size: 11.5px;
}
.radio-chips .chip[aria-selected='true'] {
  background: rgba(255, 255, 255, 0.2);
  color: var(--fg);
}
body[data-theme='light'] .radio-chips .chip[aria-selected='true'] {
  background: rgba(0, 0, 0, 0.14);
}
.radio-stations {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.radio-station {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.radio-station:hover {
  background: rgba(255, 255, 255, 0.1);
}
.radio-station[aria-checked='true'] {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--glow-a) 60%, transparent);
}
body[data-theme='light'] .radio-station {
  background: rgba(0, 0, 0, 0.05);
}
body[data-theme='light'] .radio-station[aria-checked='true'] {
  background: rgba(0, 0, 0, 0.1);
}
.rs-name {
  font-size: 12.5px;
  font-weight: 600;
}
.rs-blurb {
  font-size: 11px;
  color: var(--dim);
}
#radio-note a {
  color: inherit;
}
.music-note {
  margin: -4px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--faint);
}
.type-sink {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
  font-size: 16px; /* no zoom-on-focus on phones */
  pointer-events: none;
  resize: none;
}
.status[data-phase='music'] .dot {
  background: #ff4f8b;
  box-shadow: 0 0 14px #ff4f8b;
  transform: scale(calc(1 + var(--beat, 0) * 0.6));
}

/* --- motion slider, quality, shapes (phase 0/1) ---------------------------------------- */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 150px;
  height: 26px;
  background: transparent;
  cursor: pointer;
}
.slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
}
.slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}
.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}
body[data-theme='light'] .slider::-webkit-slider-runnable-track {
  background: rgba(0, 0, 0, 0.12);
}
#quality button {
  width: 44px;
}
.shape-cube,
.shape-monolith,
.shape-ball,
.shape-mirror {
  background: radial-gradient(circle at 50% 45%, #23203b, #0a0a10 70%);
}
.shape-cube i {
  background: linear-gradient(135deg, #18c9aa, #6a45ff);
}
.shape-monolith {
  gap: 0 !important;
}
.shape-monolith i {
  border-radius: 0;
  background: linear-gradient(135deg, #ff9a3c, #ff2e7e);
}
.shape-monolith i:nth-child(1) { border-top-left-radius: 6px; }
.shape-monolith i:nth-child(3) { border-top-right-radius: 6px; }
.shape-monolith i:nth-child(7) { border-bottom-left-radius: 6px; }
.shape-monolith i:nth-child(9) { border-bottom-right-radius: 6px; }
.shape-ball {
  grid-template-columns: repeat(3, 24px) !important;
  grid-template-rows: repeat(3, 24px) !important;
}
.shape-ball i {
  background: linear-gradient(135deg, #25b4ff, #7b5bff);
}
.shape-ball i:nth-child(1) { border-radius: 70% 4px 4px 4px; }
.shape-ball i:nth-child(3) { border-radius: 4px 70% 4px 4px; }
.shape-ball i:nth-child(7) { border-radius: 4px 4px 4px 70%; }
.shape-ball i:nth-child(9) { border-radius: 4px 4px 70% 4px; }
.shape-mirror {
  grid-template-columns: 30px 20px 14px !important;
  grid-template-rows: 16px 22px 30px !important;
}
.shape-mirror i {
  background: linear-gradient(135deg, #e9edf5, #8b95a8);
}
.shape-skewb,
.shape-pyraminx,
.shape-megaminx {
  background-color: #0a0a10;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 64px 64px;
}
.shape-skewb i,
.shape-pyraminx i,
.shape-megaminx i {
  display: none;
}
.shape-skewb {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%2318c9aa'/%3E%3Cstop offset='1' stop-color='%236a45ff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='url(%23g)' stroke='%230a0a10' stroke-width='2.5' stroke-linejoin='round'%3E%3Cpath d='M6 6h52v52H6z'/%3E%3Cpath d='M32 6L58 32 32 58 6 32z'/%3E%3C/g%3E%3C/svg%3E");
}
.shape-pyraminx {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23ff9a3c'/%3E%3Cstop offset='1' stop-color='%23ff2e7e'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='url(%23g)' stroke='%230a0a10' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M32 5L60 55H4z'/%3E%3Cpath d='M22.7 21.7h18.6L32 38.3zM13.3 38.3h18.7L22.7 55zM32 38.3h18.7L41.3 55z' /%3E%3Cpath d='M22.7 21.7L13.3 38.3h18.7zM41.3 21.7L50.7 38.3H32z' fill='none'/%3E%3C/g%3E%3C/svg%3E");
}
.shape-megaminx {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%2325b4ff'/%3E%3Cstop offset='1' stop-color='%237b5bff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='url(%23g)' stroke='%230a0a10' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M32 4L60.5 24.7 49.6 58.3H14.4L3.5 24.7z'/%3E%3Cpath d='M32 4L49.6 58.3 3.5 24.7h57L14.4 58.3z' fill='none'/%3E%3C/g%3E%3C/svg%3E");
}
.card.loading {
  opacity: 0.55;
  pointer-events: none;
}
/* Random photo, Random artwork and the videos: big pictures rather than icons */
.card.add.hero-card {
  position: relative;
  overflow: hidden;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 1px;
  padding: 10px 11px;
  color: #fff;
  background: #0d0b12;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  text-align: left;
}
.hero-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.4s ease;
}
.hero-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, 0.78));
  pointer-events: none;
}
.hero-card:hover .hero-img {
  transform: scale(1.07);
  filter: saturate(1.15);
}
.hero-card .name,
.hero-sub,
.hero-badge,
.hero-play {
  position: relative;
  z-index: 1;
}
.hero-card .name {
  font-weight: 650;
  font-size: 12.5px;
  line-height: 1.15;
  padding: 0;
  white-space: normal;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.hero-sub {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.hero-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(10, 8, 16, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.hero-badge svg,
.hero-play svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero-play {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  transition: transform 0.3s ease, background 0.3s ease;
}
.hero-play svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}
.hero-card:hover .hero-play {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(255, 255, 255, 0.26);
}
.video-yt {
  background:
    radial-gradient(120% 90% at 20% 15%, rgba(255, 80, 80, 0.85), transparent 55%),
    radial-gradient(90% 80% at 85% 90%, rgba(30, 160, 255, 0.8), transparent 60%),
    radial-gradient(70% 60% at 70% 20%, rgba(255, 200, 80, 0.6), transparent 60%),
    linear-gradient(135deg, #2b0f2e, #0b1430);
}
.video-random {
  background:
    radial-gradient(100% 80% at 80% 20%, rgba(255, 150, 60, 0.85), transparent 55%),
    radial-gradient(90% 90% at 15% 85%, rgba(90, 220, 170, 0.75), transparent 60%),
    linear-gradient(160deg, #1c2a12, #2a0f1f);
}
.video-random::before {
  /* a strip of film */
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;
  height: 10px;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0 8px, rgba(255, 255, 255, 0.35) 8px 13px);
  opacity: 0.6;
}
.vlink {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.vlink[hidden],
.vlink-step[hidden] {
  display: none;
}
.vlink-row {
  display: flex;
  gap: 6px;
}
.vlink-row input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font: 500 13px/1 var(--font);
}
.vlink-step {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}
.vlink-go {
  background: color-mix(in oklab, var(--glow-a) 55%, white) !important;
  color: #111 !important;
  font-weight: 650;
}
.card.loading .add-ico {
  animation: blink 0.9s ease-in-out infinite;
}

/* --- dock panels (Scene, Stage, Show, Surprise, More) ----------------------------------------- */
.btn {
  position: relative;
}
.btn.panel-btn .label {
  display: none;
}
@media (min-width: 1280px) {
  .btn.panel-btn .label {
    display: inline;
  }
}
.btn.open,
.btn.caret.open {
  background: var(--glass-hi);
}
.btn.lit::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--glow-a) 75%, white);
}
/* "new" dots: until the thing has been opened once */
[data-new] {
  position: relative;
}
[data-new]::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5d8f;
  box-shadow: 0 0 0 2px var(--glass-strong), 0 0 8px rgba(255, 93, 143, 0.7);
  pointer-events: none;
}
.tabs [data-new]::after {
  top: 4px;
  right: 4px;
}
.split {
  display: inline-flex;
  align-items: center;
}
.split #btn-surprise {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}
.btn.caret {
  width: 22px;
  padding: 0;
  justify-content: center;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  color: var(--dim);
}
.btn.caret svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}
.btn.caret:hover {
  color: var(--fg);
}
.btn.caret[data-new]::after {
  top: 7px;
  right: 2px;
}
.popover .tabs {
  display: flex;
}
.popover .tabs button {
  flex: 1;
  padding: 0 8px;
  position: relative;
}
.tabpanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tabpanel[hidden] {
  display: none;
}
.scene-pop {
  width: 372px;
}
.stage-pop {
  width: 344px;
}
.surprise-pop {
  width: 360px;
}

/* compact pickers: small picture tiles; the chosen one's description underneath */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 9px 6px;
}
.tile {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font: 560 10.5px/1.15 var(--font);
  text-align: center;
  transition: color 0.18s;
}
.tile .look-art {
  zoom: 0.44;
  width: 116px;
  height: 92px;
  border-radius: 22px;
  box-shadow: inset 0 0 0 2px var(--stroke);
  transition: box-shadow 0.2s, transform 0.2s;
}
.tile:hover {
  color: var(--fg);
}
.tile:hover .look-art {
  transform: translateY(-3px);
}
.tile.active {
  color: var(--fg);
}
.tile.active .look-art {
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--glow-a) 75%, white);
}
.tile:focus-visible {
  outline: none;
}
.tile:focus-visible .look-art {
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--glow-a) 70%, white);
}
.tile-name {
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow-wrap: anywhere;
}
.pick-note {
  margin: -2px 0 0;
  min-height: 2.8em;
  font-size: 12px;
  line-height: 1.4;
  color: var(--dim);
}
.pick-note b {
  color: var(--fg);
  font-weight: 620;
}
.popover .row[hidden] {
  display: none;
}
.seg.fill {
  display: flex;
}
.popover .seg.fill button {
  flex: 1;
  width: auto;
}
#camera-seg button {
  height: 38px;
}

/* the surprise panel */
.sp-head {
  display: flex;
  gap: 8px;
}
.sp-head .wide {
  flex: 1;
}
.wide.accent {
  flex: 1.5;
  background: color-mix(in oklab, var(--glow-a) 60%, #6a45ff);
  color: #fff;
}
.wide.accent:hover {
  background: color-mix(in oklab, var(--glow-a) 70%, #7d5cff);
}
.sp-hist {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: -4px;
}
.btn.small {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}
.btn.small svg {
  width: 17px;
  height: 17px;
}
#sp-star[aria-pressed='true'] {
  color: #ffd166;
  background: transparent;
}
#sp-star[aria-pressed='true'] svg {
  fill: currentColor;
}
.sp-code {
  appearance: none;
  border: 0;
  flex: 1;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--fg);
  font: 600 12.5px/1 var(--mono);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.sp-code:disabled {
  color: var(--faint);
  font-family: var(--font);
  letter-spacing: 0;
  cursor: default;
}
.sp-slider {
  display: grid;
  grid-template-columns: 66px auto 1fr auto;
  align-items: center;
  gap: 8px;
}
.sp-slider .slider {
  width: 100%;
}
.sp-end {
  font-size: 11px;
  color: var(--faint);
}
#sp-hint {
  margin-top: -6px;
  min-height: 2.8em;
}
.row-label small {
  margin-left: 6px;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--faint);
}
#sp-auto button,
#sp-reveal button {
  width: auto;
  padding: 0 8px;
}
.chip[role='radio'][aria-checked='true'] {
  background: rgba(255, 255, 255, 0.2);
}
.chip.lock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 11px 0 9px;
  height: 30px;
  color: var(--dim);
}
.chip.lock svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.55;
}
.chip.lock .shackle {
  transform: translate(3.5px, -1.5px) rotate(18deg);
  transform-origin: 15.5px 10.5px;
  transition: transform 0.2s;
}
.chip.lock.locked {
  background: color-mix(in oklab, var(--glow-a) 32%, rgba(255, 255, 255, 0.08));
  color: var(--fg);
}
.chip.lock.locked svg {
  opacity: 1;
}
.chip.lock.locked .shackle {
  transform: none;
}
.code-form input {
  font-family: var(--mono);
}
.form-text input.bad {
  border-color: #ff5d73;
}
kbd {
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font: 600 11px/1 var(--mono);
  color: var(--dim);
}

/* describe a scene in your own words (Surprise settings) */
.words-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke);
}
.words-form .row-label small {
  display: block;
  margin-top: 2px;
}
.words-row {
  display: flex;
  gap: 8px;
}
.words-row input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font: 520 14px/1 var(--font);
  outline: none;
}
.words-row input::placeholder {
  color: var(--faint);
}
.words-row input:focus {
  border-color: color-mix(in oklab, var(--glow-a) 60%, transparent);
}
.words-row input.bad {
  border-color: #ff5d73;
}
body[data-theme='light'] .words-row input {
  background: rgba(0, 0, 0, 0.04);
}
.words-row .chip.accent {
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--glow-a) 85%, #ff4f8b), color-mix(in oklab, var(--glow-b) 85%, #6a3cff));
  color: #fff;
  white-space: nowrap;
}
.words-hint {
  margin: 0;
  font-size: 12px;
  color: var(--dim);
}
.words-hint.bad {
  color: #ff8a9a;
}
.words-ideas {
  gap: 6px;
}
.words-ideas .chip.idea {
  height: 26px;
  padding: 0 10px;
  font-weight: 520;
  font-size: 12px;
  color: var(--dim);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.words-ideas .chip.idea::before {
  content: '“';
}
.words-ideas .chip.idea::after {
  content: '”';
}
.reveal-parts .mood-chip {
  height: 28px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  cursor: default;
  background: color-mix(in oklab, var(--glow-a) 24%, rgba(255, 255, 255, 0.06));
}
.reveal-code[hidden] {
  display: none;
}

/* the title card: tap a part to keep it */
.reveal-parts {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.reveal-parts .chip.lock {
  height: 28px;
  font-size: 12px;
}
.reveal-parts .chip.kept:not(.locked) {
  opacity: 0.6;
}
.reveal-tip {
  margin-top: 8px !important;
  font-size: 11.5px;
  color: var(--faint);
}

/* the content sheet's header */
.sheet-title {
  margin: 0 0 0 6px;
  font-size: 15px;
  font-weight: 650;
}
.sheet-title span {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
}

/* --- command palette ------------------------------------------------------------------------ */
.palette {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: rgba(0, 0, 0, 0.32);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: max(12vh, 60px) 12px 12px;
  animation: palette-fade 0.18s ease;
}
.palette[hidden] {
  display: none;
}
@keyframes palette-fade {
  from {
    opacity: 0;
  }
}
.palette-box {
  width: min(560px, 100%);
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: pop-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.palette-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--stroke);
}
.palette-field svg {
  width: 19px;
  height: 19px;
  flex: none;
  fill: none;
  stroke: var(--dim);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.palette-field input {
  flex: 1;
  min-width: 0;
  height: 54px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--fg);
  font: 500 16px/1 var(--font);
}
.palette-field input::placeholder {
  color: var(--faint);
}
.palette-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 14px;
  cursor: pointer;
}
.palette-item[aria-selected='true'] {
  background: rgba(255, 255, 255, 0.09);
}
.palette-item.active .palette-label::after {
  content: '✓';
  margin-left: 8px;
  color: color-mix(in oklab, var(--glow-a) 70%, white);
}
.palette-group {
  flex: none;
  font-size: 11.5px;
  color: var(--faint);
}
.palette-empty {
  padding: 18px 12px;
  font-size: 13px;
  color: var(--dim);
}
.palette-foot {
  margin: 0;
  padding: 9px 16px;
  display: flex;
  gap: 16px;
  border-top: 1px solid var(--stroke);
  font-size: 11px;
  color: var(--faint);
}
@media (hover: none) and (pointer: coarse) {
  .palette-foot {
    display: none;
  }
}

/* light worlds: the same controls on a pale glass */
body[data-theme='light'] .sp-code,
body[data-theme='light'] kbd {
  background: rgba(0, 0, 0, 0.05);
}
body[data-theme='light'] .chip[role='radio'][aria-checked='true'] {
  background: rgba(0, 0, 0, 0.14);
}
body[data-theme='light'] .chip.lock.locked {
  background: color-mix(in oklab, var(--glow-a) 30%, rgba(0, 0, 0, 0.06));
}
body[data-theme='light'] .palette-item[aria-selected='true'] {
  background: rgba(0, 0, 0, 0.06);
}
body[data-theme='light'] .palette {
  background: rgba(40, 30, 20, 0.16);
}
body[data-theme='light'] .tile.active .look-art {
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--glow-a) 70%, #19181d);
}

/* --- the guided solve ------------------------------------------------------------------------ */
body.guide-mode .mode-play {
  display: none !important;
}
.guide {
  position: absolute;
  left: max(20px, env(safe-area-inset-left));
  top: calc(max(18px, env(safe-area-inset-top)) + 58px);
  width: 344px;
  max-height: calc(100% - var(--dock-h, 54px) - max(22px, env(safe-area-inset-bottom)) - 100px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 14px 16px 14px;
  border-radius: 22px;
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  z-index: 3;
  animation: pop-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.guide[hidden] {
  display: none;
}
.guide p {
  margin: 0;
}
.guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -4px -6px 8px 0;
}
.guide-kicker {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.guide-kicker span {
  letter-spacing: 0.02em;
  text-transform: none;
  font-weight: 560;
  color: var(--faint);
}
.guide-stages {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}
.guide-stages li {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
}
.guide-stages li.done {
  background: color-mix(in oklab, var(--glow-a) 55%, #22c58b);
}
.guide-stages li.now {
  background: color-mix(in oklab, var(--glow-a) 70%, white);
  animation: blink 1.6s ease-in-out infinite;
}
.guide-title {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.01em;
}
.guide-goal {
  font-size: 13px;
  line-height: 1.45;
  color: var(--dim);
}
.guide-why {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--dim);
}
.guide-why summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--fg);
  font-size: 12.5px;
  list-style-position: inside;
}
.guide-why p {
  margin-top: 6px !important;
}
.guide-step {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}
.guide-hold {
  font-size: 11.5px;
  color: var(--faint);
  margin-bottom: 4px !important;
}
.guide-text {
  font-size: 14px;
  line-height: 1.45;
}
.guide-moves {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.gm {
  min-width: 30px;
  padding: 5px 7px;
  border-radius: 8px;
  text-align: center;
  font: 650 13.5px/1 var(--mono);
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
}
.gm.done {
  opacity: 0.35;
}
.gm.next {
  background: color-mix(in oklab, var(--glow-a) 70%, #6a45ff);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--glow-a) 30%, transparent);
}
.guide-help {
  margin-top: 8px !important;
  font-size: 12px;
  line-height: 1.45;
  color: var(--dim);
}
.guide-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.guide-actions .pill {
  flex: 1;
}
.pill:disabled {
  opacity: 0.4;
  cursor: default;
}
.guide-foot {
  margin-top: 10px !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 11.5px;
  color: var(--faint);
}
.linkish {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.linkish:hover {
  color: var(--fg);
}
.guide-notation {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  line-height: 1.5;
  color: var(--dim);
}
.guide-notation[hidden] {
  display: none;
}
.guide-notation p + p {
  margin-top: 6px !important;
}
.guide-loading {
  padding: 18px 2px;
  font-size: 13px;
  color: var(--dim);
}
.guide-loading[hidden],
.guide-done[hidden],
#guide-body[hidden] {
  display: none;
}
body[data-theme='light'] .guide-step,
body[data-theme='light'] .gm,
body[data-theme='light'] .guide-notation {
  background: rgba(0, 0, 0, 0.05);
}
body[data-theme='light'] .guide-stages li {
  background: rgba(0, 0, 0, 0.1);
}
@media (max-width: 719px) {
  .guide {
    top: auto;
    left: 12px;
    right: 12px;
    width: auto;
    bottom: calc(max(22px, env(safe-area-inset-bottom)) + var(--dock-h, 54px) + 12px);
    max-height: 46vh;
    padding: 12px 14px;
  }
  .guide-title {
    font-size: 18px;
  }
}
@media (max-width: 639px) {
  #btn-learn {
    display: none !important;
  }
}
body.guide-mode .hint {
  display: none;
}

/* --- presets -------------------------------------------------------------------------------- */
.presets-pop {
  width: 400px;
}
.pr-save {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pr-save[hidden],
.sp-head[hidden] {
  display: none;
}
.pr-save .form-text input {
  text-transform: none;
  letter-spacing: 0;
}
.pr-filters .chip {
  height: 28px;
  padding: 0 11px;
}
.pr-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 8px;
}
.pcard {
  position: relative;
  border-radius: 14px;
}
.pcard.dragging {
  opacity: 0.4;
}
.pcard.drop .pcard-art {
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--glow-a) 70%, white);
}
.pcard-apply {
  appearance: none;
  border: 0;
  padding: 0;
  width: 100%;
  background: transparent;
  color: var(--dim);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  cursor: pointer;
  font: 560 11px/1.2 var(--font);
  text-align: center;
}
.pcard-art {
  position: relative;
  aspect-ratio: 1 / 0.86;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px var(--stroke);
  transition: transform 0.2s, box-shadow 0.2s;
}
.pcard-art canvas {
  width: 88%;
  height: auto;
  aspect-ratio: 1;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35));
}
.pcard-apply:hover {
  color: var(--fg);
}
.pcard-apply:hover .pcard-art {
  transform: translateY(-2px);
}
.pcard.active .pcard-art {
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--glow-a) 75%, white);
}
.pcard.active .pcard-name {
  color: var(--fg);
}
.pcard-name {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.pcard.media .pcard-art::after {
  content: 'your media';
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 9.5px;
}
.pcard-tools {
  position: absolute;
  top: 3px;
  right: 3px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.pcard:hover .pcard-tools,
.pcard:focus-within .pcard-tools,
.pcard-tools:has([aria-pressed='true']) {
  opacity: 1;
}
@media (hover: hover) {
  .pcard:not(:hover):not(:focus-within) .pcard-tools .pcard-tool:not(.fav):not(.pl[aria-pressed='true']) {
    display: none;
  }
}
.pcard-tool.pl[aria-pressed='true'] {
  background: color-mix(in oklab, var(--glow-a) 60%, #6a45ff);
}
@media (hover: none) {
  .pcard-tools {
    opacity: 1;
  }
}
.pcard-tool {
  appearance: none;
  border: 0;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 14, 0.62);
  color: #fff;
  cursor: pointer;
}
.pcard-tool svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pcard-tool.fav[aria-pressed='true'] {
  color: #ffd166;
}
.pcard-tool.fav[aria-pressed='true'] svg {
  fill: currentColor;
}
.pcard-tool.del.armed {
  background: #e5484d;
}
#pr-note {
  min-height: 2.8em;
}
.pr-foot {
  margin: -2px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--faint);
}
@media (hover: none) {
  .pr-foot span {
    display: none;
  }
}
@media (max-width: 719px) {
  .pr-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* phones and narrow windows: every dock panel spans the width, whatever its desktop size */
@media (max-width: 719px) {
  .popover.panel-pop {
    left: 12px;
    right: 12px;
    width: auto;
  }
}

/* --- the playlist ---------------------------------------------------------------------------- */
.pl {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}
.pl .row[hidden],
.pl p[hidden],
.pl .chip[hidden] {
  display: none;
}
.pl-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pl-items:empty {
  display: none;
}
.pl-item {
  display: inline-flex;
  align-items: center;
  height: 30px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.pl-item.now {
  background: color-mix(in oklab, var(--glow-a) 45%, rgba(255, 255, 255, 0.1));
  box-shadow: 0 0 0 1.5px color-mix(in oklab, var(--glow-a) 70%, white);
}
.pl-item button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg);
  height: 30px;
  cursor: pointer;
}
.pl-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 6px;
  font: 600 12px/1 var(--font);
  max-width: 150px;
}
.pl-n {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  font: 650 10.5px/1 var(--mono);
}
.pl-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-drop,
.pl-rm {
  width: 24px;
  display: grid;
  place-items: center;
  color: var(--faint) !important;
}
.pl-drop:hover,
.pl-rm:hover {
  color: var(--fg) !important;
}
.pl-drop[aria-pressed='true'] {
  color: #ffd166 !important;
}
.pl-drop svg,
.pl-rm svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pl-drop[aria-pressed='true'] svg {
  fill: currentColor;
}
#pl-switch button,
#pl-order button {
  width: auto;
  padding: 0 8px;
}
.pl-play.on {
  background: color-mix(in oklab, var(--glow-a) 80%, #ff4f8b);
  color: #fff;
}
body[data-theme='light'] .pl,
body[data-theme='light'] .pl-item {
  background: rgba(0, 0, 0, 0.05);
}

/* --- embed ------------------------------------------------------------------------------------ */
.embed-pop {
  width: 360px;
}
.em-title {
  margin: 0;
  color: var(--fg);
  font-size: 14px;
}
.em-lead {
  margin-top: -6px !important;
}
#em-bg button {
  width: auto;
  padding: 0 9px;
}
#em-color {
  width: 34px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
#em-color[hidden] {
  display: none;
}
.em-height {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--dim);
}
.em-height input {
  width: 74px;
  height: 30px;
  padding: 0 8px;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font: 520 13px/1 var(--font);
}
.em-code {
  width: 100%;
  resize: none;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.25);
  color: var(--fg);
  font: 500 11px/1.45 var(--mono);
}
body[data-theme='light'] .em-code,
body[data-theme='light'] .em-height input {
  background: rgba(0, 0, 0, 0.04);
}
.music-note code {
  font: 500 11px var(--mono);
}
#pr-transition button {
  width: auto;
  padding: 0 8px;
}

/* a tapped card's picture flies into the cube */
.fly-ghost {
  position: fixed;
  z-index: 9;
  pointer-events: none;
  border-radius: 14px;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.4));
}
/* tabs inside panels crossfade */
.tabpanel.enter {
  animation: tab-in 0.22s ease;
}
@keyframes tab-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
/* the status pill's words slide over when its state changes */
.status .label.morph {
  animation: label-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes label-in {
  from {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(2px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tabpanel.enter,
  .status .label.morph {
    animation: none;
  }
}
.sheet-trans {
  margin-left: auto;
  margin-right: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--dim);
}
.sheet-trans select {
  height: 30px;
  max-width: 190px;
  padding: 0 8px;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font: 560 12.5px/1 var(--font);
}
.sheet-trans select option {
  color: #111;
}
.sheet-trans .chip {
  height: 30px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media (max-width: 639px) {
  .sheet-trans label {
    display: none;
  }
  .sheet-trans select {
    max-width: 130px;
  }
}
@media (max-width: 639px) {
  .sheet-title span {
    display: none;
  }
  /* two rows: the title and close, then the palette chip and the transition */
  .sheet-head {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .sheet-title {
    flex: 1 0 calc(100% - 52px);
  }
  #sheet-close {
    order: 1;
  }
  .sheet-pal {
    order: 2;
    position: static;
    margin-left: 0;
  }
  .sheet-trans {
    order: 3;
    margin-right: 0;
  }
  .pal-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .pal-card {
    left: 10px;
    right: 10px;
    width: auto;
  }
}

/* --- the camera tab -------------------------------------------------------------------------- */
.cam-modes button {
  padding: 0 4px;
  font-size: 12px;
}
.cam-sec {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cam-sec[hidden] {
  display: none;
}
.cam-chips .chip {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.cam-pads {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.cam-pad {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 8px 6px;
  min-height: 52px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  cursor: pointer;
  text-align: left;
  font: 560 11.5px/1.2 var(--font);
}
.cam-pad span {
  font: 650 11px/1 var(--mono);
  color: var(--faint);
}
.cam-pad:hover {
  background: rgba(255, 255, 255, 0.12);
}
.cam-pad:active {
  background: color-mix(in oklab, var(--glow-a) 50%, rgba(255, 255, 255, 0.1));
}
.cam-now {
  min-height: 1.4em;
}
.cam-now:empty {
  display: none;
}
#stage.whip {
  filter: blur(3px);
  transition: filter 0.24s ease-out;
}
/* cinema bars */
.letterbox-bars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  display: none;
}
body.letterbox .letterbox-bars {
  display: block;
}
.letterbox-bars i {
  position: absolute;
  left: 0;
  right: 0;
  height: max(0px, calc((100% - 100vw / 2.39) / 2));
  background: #000;
}
.letterbox-bars i:first-child {
  top: 0;
}
.letterbox-bars i:last-child {
  bottom: 0;
}
body.letterbox.vj .letterbox-bars,
body.letterbox.recording .letterbox-bars {
  display: block !important;
}
/* --- the dance tab ---------------------------------------------------------------------------- */
.dance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px 6px;
}
.dance-tile {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font: 560 10.5px/1.15 var(--font);
  text-align: center;
}
.dance-tile:hover,
.dance-tile.active {
  color: var(--fg);
}
.dance-cube {
  width: 52px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: end center;
  padding-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px var(--stroke);
}
.dance-tile.active .dance-cube {
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--glow-a) 75%, white);
}
.dance-cube i {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--glow-a) 80%, white), color-mix(in oklab, var(--glow-b) 70%, #6a45ff));
}
.dance-tile:hover .dance-cube i,
.dance-tile.active .dance-cube i {
  animation: d-bounce 0.6s ease-in-out infinite;
}
.dance-spin i, .dance-showcase i { animation-name: d-spin !important; animation-duration: 1.4s !important; }
.dance-robot i { animation-name: d-robot !important; animation-duration: 1.6s !important; animation-timing-function: steps(4) !important; }
.dance-ballet i, .dance-float i { animation-name: d-float !important; animation-duration: 2s !important; }
.dance-hiphop i { animation-name: d-nod !important; animation-duration: 0.5s !important; }
.dance-rave i, .dance-march i { animation-duration: 0.36s !important; }
.dance-waltz i { animation-name: d-sway !important; animation-duration: 1.5s !important; }
.dance-freestyle i, .dance-custom i { animation-name: d-free !important; animation-duration: 2.4s !important; }
.dance-none i { animation: none !important; opacity: 0.5; }
@keyframes d-bounce { 50% { transform: translateY(-12px); } }
@keyframes d-spin { to { transform: rotate(360deg); } }
@keyframes d-robot { to { transform: rotate(360deg); } }
@keyframes d-float { 50% { transform: translateY(-10px) rotate(8deg); } }
@keyframes d-nod { 50% { transform: translateY(3px) rotate(-12deg); } }
@keyframes d-sway { 33% { transform: translateX(-6px) rotate(-12deg); } 66% { transform: translateX(6px) rotate(12deg); } }
@keyframes d-free { 25% { transform: translateY(-12px); } 50% { transform: rotate(180deg); } 75% { transform: translateX(6px) rotate(270deg); } }
@media (prefers-reduced-motion: reduce) {
  .dance-cube i { animation: none !important; }
}
.dance-moves .chip {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
#dance-custom,
#dance-layer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
#dance-custom select,
#dance-layer select {
  height: 30px;
  min-width: 0;
  padding: 0 4px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font: 520 11px/1 var(--font);
}
#dance-custom select option,
#dance-layer select option,
#dance-custom select optgroup,
#dance-layer select optgroup {
  color: #111;
}
.dance-groups {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dance-group-label {
  font: 600 10.5px/1.2 var(--font);
  letter-spacing: 0.02em;
  color: var(--dim);
  margin-top: 4px;
}
.dance-chips .chip,
.dance-fams .chip {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.dance-chips .chip.active {
  background: rgba(255, 255, 255, 0.2);
  color: var(--fg);
}
.dance-fams .chip[aria-selected='true'] {
  background: rgba(255, 255, 255, 0.2);
  color: var(--fg);
}
body[data-theme='light'] .dance-chips .chip.active,
body[data-theme='light'] .dance-fams .chip[aria-selected='true'] {
  background: rgba(0, 0, 0, 0.14);
}
.dance-moves {
  min-height: 28px;
}
.dance-track-label {
  font: 560 11px/1.2 var(--font);
  color: var(--dim);
}
.dance-track-label small {
  font-weight: 450;
  opacity: 0.8;
}
.dance-pad-wrap {
  position: relative;
}
.dance-pad {
  display: block;
  width: 100%;
  height: 150px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--stroke);
  touch-action: none;
  cursor: crosshair;
}
.dance-pad-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  font: 500 12px/1 var(--font);
  color: var(--dim);
}
.dance-pad-hint[hidden] {
  display: none;
}
/* tiles for the travelling routines */
.dance-boomerang i { animation-name: d-boomerang !important; animation-duration: 1.6s !important; }
.dance-garden i, .dance-starlight i { animation-name: d-flower !important; animation-duration: 2.4s !important; animation-timing-function: linear !important; }
.dance-infinity i, .dance-skater i, .dance-drawn i { animation-name: d-infinity !important; animation-duration: 2.2s !important; animation-timing-function: linear !important; }
.dance-orbit i, .dance-murmuration i { animation-name: d-orbit !important; animation-duration: 2.4s !important; animation-timing-function: linear !important; }
.dance-coaster i, .dance-gymnast i { animation-name: d-loop !important; animation-duration: 1.4s !important; animation-timing-function: linear !important; }
.dance-jellyfish i, .dance-boxer i { animation-name: d-punch !important; animation-duration: 0.9s !important; }
.dance-bboy i, .dance-swan i { animation-name: d-spin !important; animation-duration: 1s !important; }
.dance-tango i, .dance-vogue i, .dance-salsa i, .dance-linedance i { animation-name: d-sway !important; animation-duration: 1.2s !important; }
.dance-glitch i { animation-name: d-glitch !important; animation-duration: 0.9s !important; animation-timing-function: steps(1) !important; }
@keyframes d-boomerang { 30% { transform: translate(8px, -14px) scale(0.45) rotate(300deg); } 60% { transform: translate(-8px, -12px) scale(0.55) rotate(600deg); } 100% { transform: rotate(1080deg); } }
@keyframes d-flower {
  0%, 100% { transform: translate(0, 0); } 12% { transform: translate(9px, -9px); } 25% { transform: translate(0, -2px); }
  37% { transform: translate(-9px, -9px); } 50% { transform: translate(0, -2px); } 62% { transform: translate(-6px, -18px); }
  75% { transform: translate(0, -2px); } 87% { transform: translate(6px, -18px); }
}
@keyframes d-infinity {
  0%, 100% { transform: translate(0, -8px); } 12% { transform: translate(9px, -14px); } 25% { transform: translate(14px, -8px); }
  37% { transform: translate(9px, -2px); } 50% { transform: translate(0, -8px); } 62% { transform: translate(-9px, -14px); }
  75% { transform: translate(-14px, -8px); } 87% { transform: translate(-9px, -2px); }
}
@keyframes d-orbit { 0%, 100% { transform: translate(0, 0) scale(1); } 25% { transform: translate(12px, -10px) scale(0.75); } 50% { transform: translate(0, -18px) scale(0.6); } 75% { transform: translate(-12px, -10px) scale(0.75); } }
@keyframes d-loop { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(10px, -10px) rotate(90deg); } 50% { transform: translate(0, -20px) rotate(180deg); } 75% { transform: translate(-10px, -10px) rotate(270deg); } }
@keyframes d-punch { 0%, 100% { transform: scale(1); } 20% { transform: scale(0.85); } 35% { transform: scale(1.7); } 55% { transform: scale(1.6); } }
@keyframes d-glitch { 0% { transform: translate(0, 0); } 20% { transform: translate(5px, -6px) skewX(12deg); } 40% { transform: translate(-6px, -2px); } 60% { transform: translate(3px, -12px) scaleX(1.4); } 80% { transform: translate(-3px, -4px); } }
