/* ColorUp — inline canvas, click swatches per part, drag to rotate */
.colorup-root--inline {
  --cu-bg: transparent;
  --cu-panel: rgba(15, 15, 24, 0.55);
  --cu-border: rgba(255, 255, 255, 0.1);
  --cu-text: #f4f2ed;
  --cu-muted: rgba(244, 242, 237, 0.55);
  --cu-gold: #c9a84c;
  --cu-gold-soft: rgba(201, 168, 76, 0.2);
}

.colorup-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}

.colorup-canvas-wrap {
  position: relative;
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 14px;
  background: transparent;
  transition: box-shadow 0.2s, outline 0.2s;
}

/* Swipe / drag affordance (dismissed in JS after first pointerdown or timeout) */
.colorup-rotate-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 12%, 72px);
  z-index: 3;
  transform: translateX(-50%);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem 0.35rem;
  border-radius: 999px;
  background: rgba(8, 10, 18, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.4);
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease,
    transform 0.4s ease;
  max-width: min(240px, calc(100% - 1.5rem));
}

.colorup-canvas-wrap--solo .colorup-rotate-hint {
  bottom: clamp(56px, 18%, 100px);
}

.colorup-rotate-hint--dismissed {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(6px);
}

.colorup-rotate-hint__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.colorup-rotate-hint__chev {
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1;
  color: rgba(255, 255, 255, 0.42);
  user-select: none;
}

.colorup-rotate-hint__touch-wrap {
  width: 48px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.colorup-rotate-hint__touch {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 2px rgba(34, 211, 238, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.35);
  animation: colorup-rotate-hint-swipe 1.7s ease-in-out infinite;
}

@keyframes colorup-rotate-hint-swipe {
  0%,
  100% {
    transform: translateX(-13px);
  }
  50% {
    transform: translateX(13px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .colorup-rotate-hint__touch {
    animation: none;
    transform: translateX(0);
  }
}

.colorup-rotate-hint__label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 242, 237, 0.78);
  white-space: nowrap;
}

.colorup-canvas-wrap canvas {
  display: block;
  background: transparent !important;
  border-radius: 10px;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.colorup-side {
  flex: 0 1 220px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 200px;
}

.colorup-swatch-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: var(--cu-panel);
  border: 1px solid var(--cu-border);
  border-radius: 12px;
  max-height: min(42vh, 280px);
  overflow-y: auto;
  align-content: flex-start;
}

.colorup-drag-swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.colorup-drag-swatch:hover {
  transform: scale(1.06);
  border-color: var(--cu-gold);
}

.colorup-drag-swatch:active {
  transform: scale(1.02);
}

.colorup-drag-swatch.is-selected {
  border-color: rgba(34, 211, 238, 0.9);
  box-shadow:
    0 0 0 2px rgba(34, 211, 238, 0.35),
    0 2px 10px rgba(0, 0, 0, 0.45);
}

.colorup-drag-swatch:focus-visible {
  outline: 2px solid var(--cu-gold);
  outline-offset: 2px;
}

.colorup-swatch-hint {
  font-size: 0.75rem;
  color: var(--cu-muted);
}

.colorup-techpack-hud {
  padding: 10px 12px;
  background: var(--cu-panel);
  border: 1px solid var(--cu-border);
  border-radius: 12px;
  font-size: 0.78rem;
}

.colorup-techpack-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cu-muted);
  margin-bottom: 0.5rem;
}

.colorup-techpack-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.colorup-techpack-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.colorup-techpack-row:last-child {
  border-bottom: none;
}

.colorup-techpack-swatch {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
  margin-top: 2px;
}

.colorup-techpack-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.colorup-techpack-part {
  font-weight: 600;
  color: var(--cu-text);
  font-size: 0.8rem;
}

.colorup-techpack-hex {
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  color: rgba(165, 243, 252, 0.85);
}

.colorup-techpack-mat {
  font-size: 0.72rem;
  color: var(--cu-muted);
}

.colorup-load-err {
  margin: 0;
  font-size: 0.75rem;
  color: #fecdd3;
}

/* Solo canvas (live studio — HUD / carousel mounted elsewhere) */
.colorup-canvas-wrap--solo {
  position: relative;
  width: 100%;
  min-height: min(64vh, 640px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.colorup-canvas-wrap--solo .colorup-studio-frame {
  position: absolute;
  inset: 6px;
  border-radius: 14px;
  pointer-events: none;
  z-index: 0;
  border: 1px solid rgba(34, 211, 238, 0.2);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.45),
    inset 0 0 48px rgba(34, 211, 238, 0.04);
  background: radial-gradient(ellipse 70% 65% at 50% 42%, rgba(34, 211, 238, 0.07), transparent 72%);
}

.colorup-canvas-wrap--solo.is-ready .colorup-studio-frame {
  border-color: rgba(34, 211, 238, 0.32);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 0 64px rgba(34, 211, 238, 0.06);
}

.colorup-canvas-wrap--solo #colorup-cv {
  position: relative;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.55s ease 0.12s;
}

.colorup-canvas-wrap--solo.is-ready #colorup-cv {
  opacity: 1;
}

/* Load-out overlay (CUCO assets) */
.colorup-loadout {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, rgba(12, 18, 28, 0.92), rgba(6, 8, 14, 0.97));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    opacity 0.45s ease,
    visibility 0.45s ease;
}

.colorup-loadout-card {
  max-width: 22rem;
  text-align: center;
  color: var(--cu-text);
}

.colorup-loadout-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cu-muted);
}

.colorup-loadout-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.colorup-loadout-cuco {
  font-weight: 600;
  color: rgba(34, 211, 238, 0.95);
}

.colorup-loadout-path {
  margin: 0 0 1.1rem;
  font-size: 0.68rem;
  color: var(--cu-muted);
  line-height: 1.5;
}

.colorup-loadout-path code {
  font-size: 0.62rem;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.colorup-loadout-steps {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.colorup-loadout-step {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(244, 242, 237, 0.88);
  transition:
    border-color 0.25s ease,
    background 0.25s ease;
}

.colorup-loadout-step[data-status="active"] {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.08);
}

.colorup-loadout-step[data-status="done"] {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.06);
}

.colorup-loadout-step-glyph {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  position: relative;
}

.colorup-loadout-step[data-status="pending"] .colorup-loadout-step-glyph {
  opacity: 0.55;
}

.colorup-loadout-step[data-status="active"] .colorup-loadout-step-glyph {
  border-color: rgba(34, 211, 238, 0.85);
  animation: colorup-loadout-pulse 0.9s ease-in-out infinite;
}

.colorup-loadout-step[data-status="done"] .colorup-loadout-step-glyph {
  border-color: rgba(52, 211, 153, 0.85);
  background: rgba(52, 211, 153, 0.25);
}

.colorup-loadout-step[data-status="done"] .colorup-loadout-step-glyph::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid rgba(255, 255, 255, 0.95);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.colorup-loadout-step[data-status="error"] .colorup-loadout-step-glyph {
  border-color: rgba(251, 113, 133, 0.8);
  background: rgba(251, 113, 133, 0.15);
}

@keyframes colorup-loadout-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(34, 211, 238, 0);
  }
}

.colorup-loadout-bar {
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.colorup-loadout-bar-fill {
  display: block;
  height: 100%;
  width: 38%;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.5), var(--cu-gold), rgba(34, 211, 238, 0.6));
  animation: colorup-loadout-bar-move 1.1s ease-in-out infinite;
}

.colorup-loadout--exit .colorup-loadout-bar-fill {
  animation: none;
  width: 100%;
  transition: width 0.35s ease;
}

@keyframes colorup-loadout-bar-move {
  0% {
    transform: translateX(-30%);
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(220%);
    opacity: 0.85;
  }
}

.colorup-loadout-hint {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--cu-muted);
}

.colorup-loadout-err {
  margin: 0.85rem 0 0;
  font-size: 0.74rem;
  line-height: 1.45;
  color: #fecdd3;
}

.colorup-loadout--error .colorup-loadout-hint {
  display: none;
}

.colorup-loadout--exit {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.colorup-loadout--error {
  background: radial-gradient(ellipse 80% 70% at 50% 45%, rgba(28, 12, 16, 0.95), rgba(8, 6, 10, 0.98));
}

.colorup-seed-fab,
.colorup-reset-fab {
  position: absolute;
  left: 10px;
  z-index: 6;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease 0.15s, background 0.2s, border-color 0.2s;
}

.colorup-seed-fab {
  bottom: 48px;
  border: 1px solid rgba(201, 168, 76, 0.5);
  background: rgba(201, 168, 76, 0.18);
  color: #f0e6c8;
}

.colorup-reset-fab {
  bottom: 10px;
  border: 1px solid rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.15);
  color: #fecdd3;
}

.colorup-canvas-wrap--solo.is-ready .colorup-seed-fab,
.colorup-canvas-wrap--solo.is-ready .colorup-reset-fab {
  opacity: 1;
  pointer-events: auto;
}

.colorup-seed-fab:hover {
  background: rgba(201, 168, 76, 0.28);
}

.colorup-reset-fab:hover {
  background: rgba(251, 113, 133, 0.25);
}

/* Carousel track (also used outside #live-studio for embeds) */
.live-carousel-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.live-carousel-scroller {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  scrollbar-width: thin;
}

.live-carousel-scroller .colorup-drag-swatch {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* TECH PACK — materials grouped by part (materials_by_part.json) */
.colorup-materials-by-part {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: 100%;
}

.colorup-materials-heading {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cu-muted);
  margin: 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.colorup-part-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Part name above swatches; stack left-aligned */
.colorup-part-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  text-align: left;
}

.colorup-part-label {
  display: block;
  width: 100%;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  color: rgba(244, 242, 237, 0.7);
  line-height: 1.2;
}

.colorup-part-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

.colorup-part-swatches .colorup-drag-swatch {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.colorup-swatch-strip.colorup-swatch-strip--by-part {
  max-height: min(70vh, 520px);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.colorup-materials-by-part--inline {
  width: 100%;
}

.colorup-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.colorup-actions .colorup-btn {
  align-self: stretch;
  width: 100%;
}

.colorup-btn {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--cu-border);
  border-radius: 8px;
  background: rgba(6, 6, 14, 0.6);
  color: var(--cu-text);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  align-self: flex-start;
}
.colorup-btn:hover {
  border-color: rgba(201, 168, 76, 0.45);
  background: var(--cu-gold-soft);
}

.colorup-btn-seed {
  border-color: rgba(201, 168, 76, 0.42);
  background: rgba(201, 168, 76, 0.12);
  color: #e8dcb8;
}
.colorup-btn-seed:hover {
  background: rgba(201, 168, 76, 0.22);
}

.colorup-btn-reset {
  border-color: rgba(251, 113, 133, 0.4);
  background: rgba(251, 113, 133, 0.08);
  color: #fecdd3;
}
.colorup-btn-reset:hover {
  background: rgba(251, 113, 133, 0.15);
}
