/* ==========================================================================
   Unicorn Makeover
   ========================================================================== */

.studio {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
    gap: clamp(16px, 2.6vw, 26px);
    padding: clamp(14px, 3vw, 26px) 0 clamp(30px, 5vw, 48px);
    align-items: start;
}

/* ── Canvas stage ────────────────────────────────────────────────────── */
.stage {
    position: relative;
    padding: clamp(14px, 2.4vw, 22px);
    border-radius: var(--r-lg);
    background: linear-gradient(160deg, #FFF3FB 0%, #F6F0FF 55%, #EFF5FF 100%);
    box-shadow: var(--shadow-m);
    overflow: hidden;
}
.stage::before,
.stage::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
    pointer-events: none;
}
.stage::before { width: 200px; height: 200px; top: -70px; right: -60px; }
.stage::after  { width: 150px; height: 150px; bottom: -60px; left: -40px; }

.stage__canvas {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: var(--r-md);
    touch-action: manipulation;
}

.stage__progress {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding: 12px 18px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .9);
    box-shadow: var(--shadow-s);
}
.stage__label { font-family: 'Fredoka', sans-serif; font-size: .98rem; }
.stage__label b { color: var(--bubble-deep); }
.stage__stars { letter-spacing: 3px; font-size: 1.05rem; min-height: 1.2em; }
.stage__stars span { display: inline-block; animation: popIn .4s var(--ease-bounce) backwards; }

/* ── Control panel ───────────────────────────────────────────────────── */
.kit {
    display: grid;
    gap: clamp(14px, 2vw, 18px);
    padding: clamp(18px, 2.6vw, 24px);
    border-radius: var(--r-lg);
    background: #fff;
    box-shadow: var(--shadow-m);
    position: sticky;
    top: 84px;
}

.kit__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.02rem;
    margin-bottom: 12px;
}
.kit__title small {
    margin-left: auto;
    font-family: 'Nunito', sans-serif;
    font-size: .78rem;
    font-weight: 800;
    color: var(--ink-faint);
}

/* Part chooser */
.parts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
    gap: 8px;
}

.part {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 12px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    border: 2px solid transparent;
    font-family: 'Fredoka', sans-serif;
    font-size: .93rem;
    color: var(--ink-soft);
    text-align: left;
    transition: transform .2s var(--ease-bounce), border-color .2s, background .2s, color .2s;
    -webkit-tap-highlight-color: transparent;
}
.part:hover { transform: translateY(-2px); background: #fff; }
.part[aria-selected="true"] {
    background: var(--bubble-soft);
    border-color: var(--bubblegum);
    color: var(--bubble-deep);
}
.part__emoji { font-size: 1.15rem; }
.part__tick { margin-left: auto; color: var(--mint-deep); opacity: 0; transition: opacity .2s; }
.part.is-done .part__tick { opacity: 1; }

/* Colour palette */
.swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
    gap: 10px;
}

.swatch {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--r-sm);
    border: 3px solid #fff;
    box-shadow: var(--shadow-s);
    transition: transform .22s var(--ease-bounce), box-shadow .22s;
    -webkit-tap-highlight-color: transparent;
}
.swatch:hover { transform: translateY(-4px) scale(1.06); box-shadow: var(--shadow-m); }
.swatch:active { transform: scale(.94); }
.swatch[aria-selected="true"] {
    box-shadow: 0 0 0 3px var(--grape), var(--shadow-m);
}
.swatch[aria-selected="true"]::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    font-size: 1.2rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, .45);
}

.swatch-name {
    margin-top: 10px;
    text-align: center;
    font-size: .85rem;
    font-weight: 800;
    color: var(--ink-faint);
    min-height: 1.2em;
}

/* Actions */
.kit__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kit__actions .btn { width: 100%; padding-inline: 14px; }
.kit__actions .btn--wide { grid-column: 1 / -1; }

.kit__hint {
    font-size: .84rem;
    color: var(--ink-faint);
    text-align: center;
    line-height: 1.5;
}
.kit__hint kbd {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 7px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-family: inherit;
    font-size: .8rem;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .studio { grid-template-columns: 1fr; }
    .kit { position: static; }
    .stage__canvas { max-width: 460px; margin-inline: auto; }
}

@media (max-width: 420px) {
    .parts { grid-template-columns: 1fr 1fr; }
    .kit__actions { grid-template-columns: 1fr; }
}
