/* Color Wizard — smart popup widget, v2: more icons, rounder, transparent, urban */

.cwz-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: rgba(10, 14, 21, 0.5);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  color: #f1f1f1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s, background 0.2s;
  position: relative;
}

.cwz-trigger::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 999px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 176, 46, 0.6), rgba(255, 61, 189, 0.6), rgba(0, 229, 255, 0.6));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.cwz-trigger:hover { background: rgba(255, 255, 255, 0.05); }
.cwz-trigger:hover::before { opacity: 1; }
.cwz-trigger:active { transform: scale(0.97); }

.cwz-trigger .ico {
  width: 1.1rem;
  height: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffb02e;
}

.cwz-trigger .ico svg { width: 100%; height: 100%; }

.cwz-trigger .swatch-row {
  display: inline-flex;
  gap: 2px;
  margin-left: 0.25rem;
}

.cwz-trigger .swatch-row span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
}

/* ---------- Modal ---------- */
.cwz-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cwz-modal.is-open { display: flex; }

.cwz-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 10, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.cwz-modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: rgba(10, 14, 21, 0.65);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
}

.cwz-modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 176, 46, 0.3), rgba(255, 61, 189, 0.3), rgba(0, 229, 255, 0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}

.cwz-modal-aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.cwz-modal-aurora .b {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}

.cwz-modal-aurora .b1 {
  width: 220px; height: 220px;
  top: -60px; right: -40px;
  background: var(--cwz-p-c1, rgba(255,176,46,0.6));
  transition: background 0.4s;
}
.cwz-modal-aurora .b2 {
  width: 200px; height: 200px;
  bottom: -80px; left: -50px;
  background: var(--cwz-p-c2, rgba(255,61,189,0.5));
  transition: background 0.4s;
}
.cwz-modal-aurora .b3 {
  width: 180px; height: 180px;
  top: 40%; left: 50%;
  background: var(--cwz-p-c3, rgba(0,229,255,0.4));
  transition: background 0.4s;
  transform: translateX(-50%);
}

.cwz-modal-card > * { position: relative; z-index: 2; }

.cwz-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.2rem 0.6rem;
}

.cwz-modal-head h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.cwz-modal-head h2 .ico {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb02e 0%, #ff3dbd 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #02060a;
}

.cwz-modal-head h2 .ico svg { width: 0.85rem; height: 0.85rem; }

.cwz-modal-close {
  background: transparent;
  border: none;
  color: #7a8fa1;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.15s, color 0.15s;
}

.cwz-modal-close:hover { background: rgba(255,255,255,0.08); color: #fff; }

.cwz-modal-body {
  padding: 0.5rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

/* ---------- Controls row (seed, modes) ---------- */
.cwz-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cwz-seed {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.3rem 0.55rem 0.3rem 0.8rem;
  font-size: 0.78rem;
  color: #c1d4e2;
  flex: 1;
  min-width: 0;
}

.cwz-seed-label {
  color: #5a6c7c;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.65rem;
  font-weight: 700;
}

.cwz-seed-swatch {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  position: relative;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}

.cwz-seed-swatch input {
  opacity: 0;
  position: absolute;
  inset: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  border: 0;
}

.cwz-seed-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #c1d4e2;
  margin-left: auto;
}

.cwz-modes {
  display: flex;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.25rem;
}

.cwz-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  color: #8aa5b8;
  border-radius: 999px;
  padding: 0.4rem 0.65rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cwz-mode:hover { color: #fff; }

.cwz-mode.is-on {
  background: linear-gradient(135deg, rgba(255, 176, 46, 0.18) 0%, rgba(255, 61, 189, 0.18) 100%);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.cwz-mode .ico {
  width: 0.85rem;
  height: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cwz-mode .ico svg { width: 100%; height: 100%; }

/* ---------- Vibe slider ---------- */
.cwz-vibe {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cwz-vibe-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cwz-vibe-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #5a6c7c;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.cwz-vibe-label .ico {
  width: 0.85rem;
  height: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cwz-vibe-label .ico svg { width: 100%; height: 100%; }

.cwz-vibe-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #c1d4e2;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.cwz-vibe-name::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--cwz-vibe-color, #ffb02e);
  box-shadow: 0 0 6px var(--cwz-vibe-color, #ffb02e);
}

.cwz-vibe-track {
  position: relative;
  height: 8px;
  background: linear-gradient(90deg, rgba(120, 200, 255, 0.4) 0%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 61, 189, 0.4) 100%);
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cwz-vibe-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 999px;
}

.cwz-vibe-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 0 3px rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.cwz-vibe-ticks {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: #5a6c7c;
  margin-top: 0.25rem;
}

/* ---------- Result ---------- */
.cwz-result {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cwz-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.cwz-name-text {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #fff 0%, #c1d4e2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cwz-name-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: #5a6c7c;
}

.cwz-swatches-big {
  display: flex;
  gap: 0.4rem;
  height: 88px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.cwz-swatch-big {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.6rem 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: flex 0.2s;
  position: relative;
  min-width: 0;
}

.cwz-swatch-big:hover { flex: 1.2; }
.cwz-swatch-big .hex { font-size: 0.78rem; font-weight: 600; }
.cwz-swatch-big .role { opacity: 0.7; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.1rem; }
.cwz-swatch-big::after {
  content: "Kopieren";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.15s;
}
.cwz-swatch-big:hover::after { opacity: 1; }
.cwz-swatch-big.copied::after {
  content: "Kopiert ✓";
  opacity: 1;
  background: rgba(193, 255, 0, 0.85);
  color: #02060a;
}

/* ---------- Actions ---------- */
.cwz-actions {
  display: flex;
  gap: 0.45rem;
}

.cwz-action {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f1f1;
  border-radius: 999px;
  padding: 0.6rem 0.8rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.cwz-action:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }
.cwz-action:active { transform: scale(0.98); }

.cwz-action--primary {
  background: linear-gradient(135deg, #ffb02e 0%, #ff3dbd 100%);
  color: #02060a;
  border-color: transparent;
}

.cwz-action--primary:hover { background: linear-gradient(135deg, #ffc55e 0%, #ff5dcd 100%); }

.cwz-action .ico { width: 0.9rem; height: 0.9rem; display: inline-flex; }
.cwz-action .ico svg { width: 100%; height: 100%; }

.cwz-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #c1ff00;
  color: #02060a;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 200;
  font-family: 'Space Grotesk', sans-serif;
  box-shadow: 0 4px 20px rgba(193, 255, 0, 0.3);
}

.cwz-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 540px) {
  .cwz-modal-card { max-width: 100%; border-radius: 20px; }
  .cwz-row { flex-direction: column; align-items: stretch; }
  .cwz-seed { width: 100%; }
  .cwz-modes { width: 100%; }
  .cwz-mode { flex: 1; justify-content: center; }
}
