:root {
  --bg1: #17112b;
  --bg2: #2a1c4d;
  --card: rgba(255, 255, 255, 0.07);
  --card-border: rgba(255, 255, 255, 0.14);
  --text: #f4f0ff;
  --muted: #b8aee0;
  --accent: #ff7ac6;
  --accent2: #7cf0c8;
  --radius: 18px;
}

* { box-sizing: border-box; }

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 15% -10%, #43267a 0%, transparent 60%),
    radial-gradient(900px 700px at 110% 20%, #7a2660 0%, transparent 55%),
    linear-gradient(160deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
}

/* ---------- шапка ---------- */
.topbar {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 26px 6px;
}
.logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.logo span {
  background: linear-gradient(90deg, var(--accent), #ffd36e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { color: var(--muted); font-size: 14px; }

/* ---------- раскладка ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(320px, 460px);
  gap: 20px;
  padding: 10px 26px 26px;
  align-items: start;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

/* ---------- сцена ---------- */
.stage { position: sticky; top: 10px; }
.stage-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border: 1px solid var(--card-border);
  border-radius: 26px;
  padding: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}
#catCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  background:
    radial-gradient(500px 340px at 50% 30%, #fff6e6 0%, #ffe9d2 55%, #ffd9c2 100%);
}
.stage-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.07); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn-primary {
  background: linear-gradient(90deg, var(--accent), #ff9e5e);
  color: #2a0d22;
  box-shadow: 0 8px 22px rgba(255, 122, 198, 0.35);
}
.btn-fun {
  background: linear-gradient(90deg, var(--accent2), #6ec8ff);
  color: #062b25;
  box-shadow: 0 8px 22px rgba(124, 240, 200, 0.28);
}
.btn-ghost {
  background: rgba(255,255,255,0.10);
  color: var(--text);
  border: 1px solid var(--card-border);
}
.name-row { margin-top: 12px; }
.name-input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  padding: 12px 16px;
  font-size: 16px;
  text-align: center;
  outline: none;
}
.name-input:focus { border-color: var(--accent); }

/* ---------- панель ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.panel-scroll { max-height: calc(100vh - 150px); overflow-y: auto; padding: 6px 18px 18px; }
.panel-scroll::-webkit-scrollbar { width: 10px; }
.panel-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 8px; }

.group {
  border: none;
  margin: 0;
  padding: 16px 0 6px;
  border-bottom: 1px dashed rgba(255,255,255,0.13);
}
.group:last-child { border-bottom: none; }
.group legend {
  font-size: 16px;
  font-weight: 800;
  padding: 0 0 8px;
}
.sub-label {
  margin: 12px 0 8px;
  font-size: 13px;
  color: var(--muted);
}

/* кольори-кружки */
.swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.swatch:hover { transform: scale(1.12); }
.swatch.active {
  box-shadow: 0 0 0 3px #17112b, 0 0 0 6px var(--accent2);
  transform: scale(1.1);
}
.swatch.active::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* чипы */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.07);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
  user-select: none;
}
.chip:hover { transform: translateY(-2px); background: rgba(255,255,255,0.13); }
.chip.active {
  background: linear-gradient(90deg, rgba(255,122,198,0.30), rgba(255,211,110,0.28));
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(255,122,198,0.25);
}
.chips-toggle .chip.active {
  background: linear-gradient(90deg, rgba(124,240,200,0.28), rgba(110,200,255,0.25));
  border-color: var(--accent2);
  box-shadow: 0 4px 14px rgba(124,240,200,0.22);
}

/* ползунок */
.range-row { display: flex; align-items: center; gap: 12px; }
#fluff {
  flex: 1;
  appearance: none;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6b5fa8, var(--accent));
  outline: none;
}
#fluff::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}
#fluff::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  cursor: pointer;
}
.range-value {
  min-width: 44px;
  text-align: center;
  font-weight: 800;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  padding: 6px 8px;
}
.range-hints {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 0 20px 26px;
}
