/* =========================================================
   Step 2 — Conditioner — "My Passions"
   Everything scoped under .lvl-2. The stage is the size
   container "stage"; .l2-left / .l2-right are containers too.
   ========================================================= */

.lvl-2 { --l2-tag-h: 50px; --l2-pad: 12px; }
.lvl-2 .l2-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.lvl-2 .l2-scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

/* fallback backdrop (under the kit scene) */
.lvl-2::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(60% 50% at 25% 40%, rgba(255, 255, 255, .7), transparent 70%),
    radial-gradient(50% 45% at 80% 30%, rgba(220, 205, 255, .55), transparent 70%),
    linear-gradient(180deg, #fff5fa 0%, #fbe9f6 55%, #f1e6ff 100%);
}

/* ---------------- layout ---------------- */
.lvl-2 .l2-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 44fr) minmax(0, 56fr);
  gap: 4px;
  padding: 8px var(--l2-pad) 10px;
  transition: grid-template-rows .8s var(--ease-in-out), grid-template-columns .8s var(--ease-in-out);
}
.lvl-2.l2-is-wide .l2-wrap {
  grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  padding: 10px 16px 12px;
}
.lvl-2 .l2-wrap[data-phase="done"] { grid-template-rows: minmax(0, 100fr) minmax(0, 0fr); }
.lvl-2.l2-is-wide .l2-wrap[data-phase="done"] { grid-template-columns: minmax(0, 100fr) minmax(0, 0fr); grid-template-rows: minmax(0, 1fr); }

.lvl-2 .l2-left {
  position: relative;
  min-width: 0;
  min-height: 0;
  container-type: size;
  display: grid;
  place-items: center;
}
.lvl-2 .l2-right {
  position: relative;
  min-width: 0;
  min-height: 0;
  container-type: size;
  transition: opacity .5s var(--ease-out);
}
.lvl-2 .l2-wrap[data-phase="done"] .l2-right { opacity: 0; pointer-events: none; }

/* ---------------- the client (kit seat: 520 × 640) ---------------- */
.lvl-2 .l2-clientbox {
  position: relative;
  width: min(100cqw, 81.25cqh);
  height: min(100cqh, 123.08cqw);
}
.lvl-2 .l2-seat { position: absolute; inset: 0; width: 100%; height: 100%; }
.lvl-2 .l2-seat .salon-chair { pointer-events: none; }
/* my overlays cover the whole seat and sit above the chair;
   the tangles are placed from the hair zone's box in JS */
.lvl-2 .l2-over {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
/* soft floor glow under the chair */
.lvl-2 .l2-clientbox::before {
  content: '';
  position: absolute;
  left: 8%; right: 8%; bottom: -2%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(180, 110, 200, .22), transparent);
  pointer-events: none;
}
/* shine sweep when the hair turns smooth */
.lvl-2 .l2-clientbox::after {
  content: '';
  position: absolute;
  inset: 0 0 20%;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .75) 45%, transparent 60%);
  mix-blend-mode: soft-light;
  opacity: 0;
  transform: translateX(-60%);
}
.lvl-2 .l2-wrap.is-smooth .l2-clientbox::after { animation: l2-shine 1.4s var(--ease-in-out) .15s both; }
@keyframes l2-shine { 0% { opacity: 0; transform: translateX(-60%); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateX(60%); } }

/* tangles */
.lvl-2 .l2-knots { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.lvl-2 .l2-knot {
  --p: 0;
  position: absolute;
  width: 10%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(.85);
  opacity: .95;
  transition: opacity .35s, transform .45s var(--ease-pop);
}
.lvl-2 .l2-knot__in { position: absolute; inset: 0; display: block; transform: rotate(calc(var(--p) * 420deg)) scale(calc(1 - var(--p) * .55)); opacity: calc(1 - var(--p) * .6); transition: transform .12s linear; }
.lvl-2 .l2-knot__in svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 5px rgba(255, 190, 225, .9)); }
.lvl-2 .l2-knot__ring {
  position: absolute;
  inset: -34%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .85), rgba(255, 120, 190, .55) 50%, rgba(255, 95, 168, 0) 100%);
  opacity: 0;
  transition: opacity .3s;
}
.lvl-2 .l2-knot__ring::after {
  content: '';
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 3px dashed #fff;
  box-shadow: 0 0 0 2px rgba(255, 95, 168, .75), 0 0 16px rgba(255, 95, 168, .8), inset 0 0 12px rgba(255, 95, 168, .45);
  animation: spa-spin 6s linear infinite;
}
.lvl-2 .l2-wrap.is-tangled .l2-knot { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.lvl-2 .l2-knot.is-active { z-index: 2; transform: translate(-50%, -50%) scale(1.15); }
.lvl-2 .l2-knot.is-active .l2-knot__ring { opacity: 1; animation: l2-ring 1.4s ease-in-out infinite; }
.lvl-2 .l2-wrap .l2-knot.is-done { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(90deg); }
.lvl-2 .l2-knot.is-nudge .l2-knot__ring { animation: l2-ring .45s ease-in-out 3; }
@keyframes l2-ring { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }

/* the comb */
.lvl-2 .l2-comb {
  position: absolute;
  z-index: 5;
  width: 22%;
  left: 50%; top: 60%;
  transform: translate(-50%, -38%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s, left .18s var(--ease-out), top .18s var(--ease-out);
  filter: drop-shadow(0 8px 10px rgba(150, 40, 110, .28));
}
.lvl-2 .l2-comb.is-in { opacity: 1; }
.lvl-2 .l2-comb.is-parked { transition: opacity .35s, left .5s var(--ease-out), top .5s var(--ease-out); }
.lvl-2 .l2-comb.is-parked .l2-comb__in { transform: rotate(-72deg) scale(.82); transition: transform .5s var(--ease-pop); }
.lvl-2 .l2-comb__in { display: block; transform-origin: 50% 20%; }
.lvl-2 .l2-comb__in svg { width: 100%; height: auto; overflow: visible; }
.lvl-2 .l2-comb.is-ready .l2-comb__in { animation: l2-comb-hint 1.6s var(--ease-in-out) infinite; }
.lvl-2 .l2-comb.is-scrub .l2-comb__in { animation: l2-comb-scrub .22s ease-out; }
.lvl-2 .l2-comb.is-stroke .l2-comb__in,
.lvl-2 .l2-comb.is-demo .l2-comb__in { animation: l2-comb-stroke .6s var(--ease-in-out); }
.lvl-2 .l2-wrap[data-phase="key"] .l2-comb,
.lvl-2 .l2-wrap[data-phase="done"] .l2-comb { opacity: 0; }
@keyframes l2-comb-hint { 0%, 100% { transform: translateY(-14%) rotate(-4deg); } 50% { transform: translateY(26%) rotate(3deg); } }
@keyframes l2-comb-scrub { 0% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(6%); } 100% { transform: rotate(0) translateY(0); } }
@keyframes l2-comb-stroke { 0% { transform: translateY(-40%); } 60% { transform: translateY(60%) rotate(2deg); } 100% { transform: translateY(0); } }

/* floating bits over the client */
.lvl-2 .l2-float { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.lvl-2 .l2-q {
  position: absolute;
  width: 14.5%;
  transform: translate(-50%, -110%);
  filter: drop-shadow(0 6px 10px rgba(150, 40, 110, .25));
}
.lvl-2 .l2-q svg { width: 100%; height: auto; overflow: visible; }
.lvl-2 .l2-q.is-up { animation: l2-q-up .7s var(--ease-pop) both; }
.lvl-2 .l2-q .l2-q__heart { opacity: 0; transform: scale(.3); transform-origin: 11px -20px; transition: opacity .3s, transform .45s var(--ease-pop); }
.lvl-2 .l2-q .l2-q__ask { transition: opacity .25s, transform .3s; transform-origin: 11px -20px; }
.lvl-2 .l2-q.is-friend .l2-q__ask { opacity: 0; transform: scale(.6); }
.lvl-2 .l2-q.is-friend .l2-q__heart { opacity: 1; transform: scale(1); }
.lvl-2 .l2-q.is-gone { opacity: 0; transition: opacity .4s, transform .5s; transform: translate(-50%, -260%) scale(.6); }
@keyframes l2-q-up { from { opacity: 0; transform: translate(-50%, -30%) scale(.3); } to { opacity: 1; transform: translate(-50%, -110%) scale(1); } }

/* ---------------- the pedestal (step A) ---------------- */
.lvl-2 .l2-ped {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  transition: opacity .45s var(--ease-out), transform .5s var(--ease-out), visibility 0s .5s;
}
.lvl-2 .l2-ped.is-gone { opacity: 0; transform: translateY(12%) scale(.85); visibility: hidden; pointer-events: none; }
.lvl-2 .l2-ped__halo {
  position: absolute;
  width: min(80cqw, 78cqh);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, #fff 0%, rgba(239, 230, 255, .9) 40%, rgba(255, 210, 235, .45) 70%, transparent 100%);
  animation: l2-breathe 4.5s ease-in-out infinite;
}
.lvl-2 .l2-ped__stand {
  position: absolute;
  left: 50%;
  top: calc(50% + min(30cqh, 150px));
  width: min(52cqw, 44cqh, 240px);
  height: min(8cqh, 34px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #fff 0%, #f4ecff 45%, #d9c8ff 80%, rgba(217, 200, 255, 0) 100%);
  box-shadow: 0 6px 16px rgba(120, 60, 160, .18);
}
.lvl-2 .l2-bottle {
  position: relative;
  z-index: 2;
  height: min(60cqh, 300px);
  aspect-ratio: 110 / 236;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
  border-radius: 24px;
  transform: translateY(-4%);
}
.lvl-2 .l2-bottle:active { cursor: grabbing; }
.lvl-2 .l2-bottle__in { display: block; width: 100%; height: 100%; animation: spa-float 3.2s ease-in-out infinite; }
.lvl-2 .l2-bottle__art { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 16px 16px rgba(110, 60, 150, .28)); transition: transform .2s var(--ease-pop); }
.lvl-2 .l2-bottle:hover .l2-bottle__art { transform: scale(1.04) rotate(-2deg); }
/* glint sweep across the pack */
.lvl-2 .l2-bottle::after {
  content: '';
  position: absolute;
  inset: 4% 10% 8%;
  border-radius: 40% 40% 12px 12px;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .7) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: l2-glint 2.8s ease-in-out infinite;
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.lvl-2 .l2-bottle.is-nudge .l2-bottle__in { animation: l2-hop .7s var(--ease-pop) 2; }
.lvl-2 .l2-bottle.is-squeeze .l2-bottle__art { animation: l2-squeeze .55s var(--ease-pop); }
.lvl-2 .l2-ped__tag {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: calc(50% - min(33cqh, 165px));
  transform: translate(-110%, -50%) rotate(-8deg);
  padding: .45em .9em;
  border-radius: 12px;
  background: linear-gradient(180deg, #ff9ccb, var(--pink));
  border: 2px solid #fff;
  box-shadow: 0 3px 0 var(--pink-deep), 0 8px 16px rgba(160, 30, 100, .25);
  color: #fff;
  font: 400 .66rem var(--font-pixel);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  animation: l2-tag-bob 1.8s ease-in-out infinite;
}
.lvl-2 .l2-ped__tag::after { content: ''; position: absolute; right: 14px; bottom: -8px; width: 12px; height: 12px; background: var(--pink); border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); }
.lvl-2 .l2-ped__tag:empty { display: none; }
@keyframes l2-tag-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
.lvl-2 .l2-ped__sparkles { position: absolute; inset: 0; pointer-events: none; }
.lvl-2 .l2-ped__sparkles i { position: absolute; font-style: normal; color: #fff; text-shadow: 0 0 10px rgba(255, 95, 168, .8); font-size: clamp(14px, 5cqmin, 26px); animation: l2-twinkle 2.4s ease-in-out infinite; }
.lvl-2 .l2-ped__sparkles i:nth-child(1) { left: 26%; top: 24%; }
.lvl-2 .l2-ped__sparkles i:nth-child(2) { right: 24%; top: 36%; animation-delay: -.8s; color: #fff8d0; }
.lvl-2 .l2-ped__sparkles i:nth-child(3) { left: 30%; bottom: 26%; animation-delay: -1.6s; }
@keyframes l2-glint { 0%, 55% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
@keyframes l2-squeeze { 0% { transform: none; } 35% { transform: scale(1.06, .9) rotate(-8deg); } 70% { transform: scale(.97, 1.04) rotate(3deg); } 100% { transform: none; } }
@keyframes l2-breathe { 0%, 100% { transform: scale(1); opacity: .95; } 50% { transform: scale(1.05); opacity: 1; } }
@keyframes l2-twinkle { 0%, 100% { opacity: .2; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes l2-hop { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-9%) scaleY(1.03); } 60% { transform: translateY(0) scaleY(.96); } 80% { transform: translateY(-2%); } }

/* easy mode: a copy of the bottle arcs onto the hair */
.lvl-2 .l2-ghost { position: absolute; z-index: 40; pointer-events: none; transform-origin: 50% 60%; filter: drop-shadow(0 14px 16px rgba(110, 60, 150, .3)); }
.lvl-2 .l2-ghost > svg { width: 100%; height: 100%; overflow: visible; }
.lvl-2 .l2-bottle.is-away { opacity: 0; transition: opacity .12s; }

/* ---------------- the connect board ---------------- */
.lvl-2 .l2-board {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "people data" "mid mid" "stories sales";
  gap: 6px 10px;
  padding: 4px 2px;
  opacity: 0;
  transition: opacity .5s var(--ease-out);
}
.lvl-2 .l2-wrap:not([data-phase="apply"]) .l2-board { opacity: 1; }

/* the frosted card behind the board */
.lvl-2 .l2-board::before {
  content: '';
  position: absolute;
  inset: calc(var(--l2-tag-h) / 2) 4% calc(var(--l2-tag-h) / 2);
  border-radius: 28px;
  background:
    radial-gradient(circle, rgba(183, 156, 255, .38) 1.3px, transparent 1.8px) 0 0 / 20px 20px,
    linear-gradient(160deg, rgba(255, 255, 255, .72), rgba(255, 240, 250, .5));
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 10px 30px rgba(150, 60, 130, .1), inset 0 1px 0 #fff;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.lvl-2 .l2-threads { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; overflow: visible; pointer-events: none; }
.lvl-2 .l2-guide { fill: none; stroke: rgba(183, 156, 255, .55); stroke-width: 2; stroke-dasharray: 2 9; stroke-linecap: round; opacity: 0; transition: opacity .6s; }
.lvl-2 .l2-board.is-guided .l2-guide { opacity: 1; }
.lvl-2 .l2-board.is-crossed .l2-guide { opacity: 0; }
.lvl-2 .l2-thread path { fill: none; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .95s var(--ease-in-out); }
.lvl-2 .l2-thread__base { stroke-width: 9; filter: drop-shadow(0 3px 5px rgba(150, 40, 110, .25)); }
.lvl-2 .l2-thread__hi { stroke: #fff; stroke-width: 2.4; opacity: .75; transform: translateY(-2px); }
.lvl-2 .l2-board.is-a .l2-thread--a path,
.lvl-2 .l2-board.is-b .l2-thread--b path { stroke-dashoffset: 0; }

/* tags */
.lvl-2 .l2-tag {
  --t1: #ffc2df; --t2: #ff6fae; --t3: #e33b8a; --ts: #b8246b;
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 196px);
  min-height: var(--l2-tag-h);
  padding: 5px 14px 5px 5px;
  border: 2px solid rgba(255, 255, 255, .95);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--t1) 0%, var(--t2) 58%, var(--t3) 100%);
  box-shadow: 0 4px 0 var(--ts), 0 10px 20px rgba(150, 40, 110, .22), inset 0 -4px 8px rgba(0, 0, 0, .06);
  color: #fff;
  font: 400 clamp(.68rem, 3.4cqmin, .86rem) var(--font-pixel);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(90, 10, 60, .35);
  cursor: pointer;
  touch-action: manipulation;
  isolation: isolate;
  transition: transform .3s var(--ease-pop), opacity .35s, filter .2s;
}
.lvl-2 .l2-tag::before {
  content: '';
  position: absolute;
  left: 14%; right: 10%; top: 3px;
  height: 42%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .06));
  z-index: -1;
  pointer-events: none;
}
.lvl-2 .l2-tag--people { grid-area: people; justify-self: start; align-self: start; }
.lvl-2 .l2-tag--data { grid-area: data; justify-self: end; align-self: start; --t1: #e8deff; --t2: #a98bff; --t3: #8565f0; --ts: #5e40c4; text-shadow: 0 1px 0 rgba(50, 20, 120, .35); }
.lvl-2 .l2-tag--stories { grid-area: stories; justify-self: start; align-self: end; --t1: #ffd0e2; --t2: #ff86b4; --t3: #ec5a92; --ts: #bf3b70; }
.lvl-2 .l2-tag--sales { grid-area: sales; justify-self: end; align-self: end; --t1: #d7f2ff; --t2: #6cc4ff; --t3: #3fa3ec; --ts: #2277bf; text-shadow: 0 1px 0 rgba(10, 60, 120, .35); }
.lvl-2 .l2-tag__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: calc(var(--l2-tag-h) - 14px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 40%, #fff3f9 100%);
  color: var(--t3);
  box-shadow: inset 0 -2px 4px rgba(120, 40, 110, .15), 0 1px 0 rgba(255, 255, 255, .8);
}
.lvl-2 .l2-tag__icon svg { width: 62%; height: 62%; stroke-dasharray: none; fill: none; }
.lvl-2 .l2-tag__label { flex: 1; text-align: left; white-space: nowrap; }
.lvl-2 .l2-tag__count { display: inline-flex; gap: 1px; font: 400 .8rem var(--font-body); color: #fff; }
.lvl-2 .l2-tag__count i { font-style: normal; animation: spa-pop-in .4s var(--ease-pop) both; }
.lvl-2 .l2-tag:hover { transform: translateY(-2px) scale(1.03); }
.lvl-2 .l2-tag.is-filled .l2-tag__icon { background: radial-gradient(circle at 35% 30%, #fff 0 30%, var(--t1) 100%); }
.lvl-2 .l2-tag.is-pop { animation: l2-tag-pop .5s var(--ease-pop); }
.lvl-2 .l2-tag.is-hint { animation: l2-tag-hint .5s ease-in-out 4; }
.lvl-2 .l2-tag.is-bars .l2-tag__icon svg rect { animation: l2-bars .6s var(--ease-pop) both; transform-origin: 50% 90%; transform-box: fill-box; }
.lvl-2 .l2-tag.is-bars .l2-tag__icon svg rect:nth-of-type(2) { animation-delay: .1s; }
.lvl-2 .l2-tag.is-bars .l2-tag__icon svg rect:nth-of-type(3) { animation-delay: .2s; }
.lvl-2 .l2-board:not(.is-open) .l2-tag { opacity: 0; transform: translateY(-18px) scale(.7); pointer-events: none; }
/* tags only take taps while a clue is being sorted; otherwise taps fall through to "tap anywhere" */
.lvl-2 .l2-board:not(.is-sorting) .l2-tag { pointer-events: none; cursor: default; }
.lvl-2 .l2-board.is-open .l2-tag { transition-delay: calc(var(--i) * 120ms); }
.lvl-2 .l2-board.is-open .l2-tag:hover { transition-delay: 0s; }
/* kit drag states: tags light up as drop zones */
.lvl-2 .l2-tag.is-drop-ready { box-shadow: 0 4px 0 var(--ts), 0 0 0 3px #fff, 0 0 0 6px rgba(183, 156, 255, .85), 0 0 22px rgba(183, 156, 255, .6); animation: l2-ready 1.3s ease-in-out infinite; }
.lvl-2 .l2-tag.is-drop-hover { box-shadow: 0 4px 0 var(--ts), 0 0 0 3px #fff, 0 0 0 7px var(--pink), 0 0 30px rgba(255, 95, 168, .7); transform: scale(1.08); animation: none; }
@keyframes l2-ready { 50% { transform: scale(1.04); } }
.lvl-2 .l2-clue.salon-draggable.is-held { outline: none; }
.lvl-2 .l2-clue.is-held .l2-clue__orb { box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--lilac), 0 0 24px rgba(183, 156, 255, .8), 0 14px 26px rgba(150, 40, 110, .28); transform: scale(1.06); }
.lvl-2 .l2-clue.is-held .l2-clue__orb { animation: none; }
.lvl-2 .l2-bottle.salon-draggable.is-held { outline: none; }
@keyframes l2-tag-pop { 0% { transform: scale(1); } 35% { transform: scale(1.14) rotate(-2deg); } 100% { transform: scale(1); } }
@keyframes l2-tag-hint { 0%, 100% { filter: none; transform: scale(1); } 50% { filter: brightness(1.12) drop-shadow(0 0 10px rgba(255, 255, 255, .9)); transform: scale(1.08); } }
@keyframes l2-bars { from { transform: scaleY(.1); } to { transform: none; } }

/* centre: the clue shelf (clues land here while combing) */
.lvl-2 .l2-mid { grid-area: mid; position: relative; z-index: 2; display: grid; place-items: center; min-height: 0; }
.lvl-2 .l2-shelf { display: flex; flex-direction: column; align-items: center; gap: clamp(4px, 1.6cqh, 12px); width: 100%; transition: opacity .4s; }
.lvl-2 .l2-mid.is-parade .l2-shelf,
.lvl-2 .l2-wrap[data-phase="key"] .l2-shelf,
.lvl-2 .l2-wrap[data-phase="done"] .l2-shelf { opacity: 0; }
.lvl-2 .l2-shelf__cap {
  padding: .35em .9em;
  border-radius: 99px;
  background: rgba(255, 255, 255, .85);
  box-shadow: 0 2px 8px rgba(150, 60, 130, .12);
  font: 400 .6rem var(--font-pixel);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #8a5bd6;
}
.lvl-2 .l2-shelf__cap::before, .lvl-2 .l2-shelf__cap::after { content: ' ✦ '; color: var(--pink-2); }
.lvl-2 .l2-shelf__cap:empty { display: none; }
.lvl-2 .l2-shelf__row { display: flex; justify-content: center; gap: clamp(8px, 3cqw, 20px); }
.lvl-2 .l2-slot {
  position: relative;
  width: clamp(58px, min(20cqw, 24cqh), 118px);
  aspect-ratio: 1;
}
.lvl-2 .l2-slot__ring {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 2.5px dashed rgba(255, 255, 255, .95);
  background: radial-gradient(closest-side, rgba(255, 255, 255, .75), rgba(255, 255, 255, .25));
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .25), 0 6px 16px rgba(150, 60, 130, .12);
  transition: opacity .3s, transform .4s var(--ease-pop);
}
.lvl-2 .l2-slot__ring::after {
  content: '?';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: italic 800 clamp(1.1rem, 5cqmin, 1.8rem) var(--font-display);
  color: rgba(255, 140, 196, .6);
}
.lvl-2 .l2-slot.is-full .l2-slot__ring { opacity: 0; transform: scale(.7); }
.lvl-2 .l2-slot.is-used .l2-slot__ring { opacity: .7; }
.lvl-2 .l2-slot.is-used .l2-slot__ring::after { content: '♥'; font-style: normal; color: var(--pink); }
.lvl-2 .l2-slot .l2-clue { position: absolute; inset: 0; }

/* a clue */
.lvl-2 .l2-clue {
  position: relative;
  z-index: 3;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: grab;
  touch-action: none;
}
.lvl-2 .l2-clue:active { cursor: grabbing; }
.lvl-2 .l2-clue__bob { position: absolute; inset: 0; display: block; transition: transform .45s var(--ease-pop), filter .3s; }
.lvl-2 .l2-clue.is-waiting { cursor: default; pointer-events: none; }
.lvl-2 .l2-clue.is-waiting .l2-clue__bob { transform: scale(.82); filter: saturate(.85); }
.lvl-2 .l2-clue.is-waiting .l2-clue__label { opacity: 0; }
.lvl-2 .l2-clue.is-ready { z-index: 4; }
.lvl-2 .l2-clue.is-ready .l2-clue__bob { transform: scale(1.06); }
.lvl-2 .l2-clue.is-ready .l2-clue__orb { animation: l2-bob 2.2s ease-in-out infinite; }
.lvl-2 .l2-clue.is-nudge .l2-clue__orb { animation: l2-wiggle .5s ease-in-out 2; }
.lvl-2 .l2-clue__orb {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(255, 140, 196, .55), 0 12px 26px rgba(150, 40, 110, .28), inset 0 -8px 14px rgba(120, 40, 110, .08);
  background: #fff;
}
.lvl-2 .l2-clue__orb::after { /* soap-bubble gloss */
  content: '';
  position: absolute;
  left: 14%; top: 7%;
  width: 44%; height: 26%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0));
  transform: rotate(-24deg);
  pointer-events: none;
}
.lvl-2 .l2-clue__art { width: 100%; height: 100%; display: block; }
.lvl-2 .l2-clue__label {
  position: absolute;
  left: 50%;
  bottom: -8%;
  transform: translateX(-50%);
  padding: .25em .75em;
  border-radius: 99px;
  background: #fff;
  box-shadow: 0 0 0 2px var(--pink-2), 0 4px 10px rgba(150, 40, 110, .2);
  font: 700 clamp(.72rem, 3.2cqmin, .86rem) var(--font-body);
  color: var(--ink);
  white-space: nowrap;
  transition: opacity .3s;
}
/* a halo pulse on the clue to connect next */
.lvl-2 .l2-clue.is-ready::before {
  content: '';
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .0) 60%, rgba(255, 170, 215, .55) 80%, transparent 100%);
  animation: l2-ring 1.6s ease-in-out infinite;
  pointer-events: none;
}

/* everyday people pop out round the dock */
.lvl-2 .l2-parade {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 8px 8px;
  padding: 4px 6px;
  pointer-events: none;
}
.lvl-2 .l2-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(255, 140, 196, .35), 0 8px 16px rgba(150, 40, 110, .18);
  font: 700 clamp(.74rem, 3.3cqmin, .9rem) var(--font-body);
  color: var(--ink);
  white-space: nowrap;
  opacity: 0;
}
.lvl-2 .l2-parade.is-in .l2-chip { animation: spa-pop-in .45s var(--ease-pop) both; animation-delay: calc(var(--j) * 140ms + 100ms); }
.lvl-2 .l2-chip__face {
  flex: none;
  width: clamp(28px, 9cqmin, 38px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #fff, var(--blush-2));
  box-shadow: inset 0 0 0 2px #fff;
}
.lvl-2 .l2-face { width: 100%; height: 100%; display: block; }

/* the heart where the threads cross */
.lvl-2 .l2-heart {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  left: 50%; top: 50%;
  width: clamp(40px, 15cqmin, 76px);
  transform: translate(-50%, -50%) scale(0);
  filter: drop-shadow(0 6px 10px rgba(200, 40, 120, .35));
  transition: transform .5s var(--ease-pop);
}
.lvl-2 .l2-heart svg { width: 100%; height: auto; overflow: visible; }
.lvl-2 .l2-board.is-crossed .l2-heart { transform: translate(-50%, -50%) scale(1); animation: l2-beat 1.3s ease-in-out .6s infinite; }
@keyframes l2-beat { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 15% { transform: translate(-50%, -50%) scale(1.16); } 30% { transform: translate(-50%, -50%) scale(1); } }

/* the key line, two beats */
.lvl-2 .l2-key {
  position: absolute;
  z-index: 4;
  left: 50%;
  width: max-content;
  max-width: 94%;
  padding: .32em .8em .38em;
  border-radius: 18px;
  background: rgba(255, 255, 255, .9);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(255, 140, 196, .45), 0 10px 26px rgba(150, 40, 110, .2);
  font: italic 800 clamp(1rem, 5.6cqmin, 1.85rem)/1.15 var(--font-display);
  color: var(--ink);
  text-align: center;
  text-wrap: balance;
  opacity: 0;
  transform: translate(-50%, 10px) scale(.94);
  transition: opacity .45s var(--ease-out), transform .55s var(--ease-pop);
  pointer-events: none;
}
.lvl-2 .l2-key--1 { top: calc(var(--l2-tag-h) + 16px); }
.lvl-2 .l2-key--2 { bottom: calc(var(--l2-tag-h) + 16px); }
.lvl-2 .l2-key.is-in { opacity: 1; transform: translate(-50%, 0) scale(1); }
.lvl-2 .l2-w { display: inline-block; }
.lvl-2 .l2-key.is-in .l2-w { animation: spa-fade-up .45s var(--ease-out) both; animation-delay: calc(var(--w) * 45ms); }
.lvl-2 .l2-w.is-story { color: var(--pink-deep); background: linear-gradient(180deg, transparent 62%, rgba(255, 214, 234, .95) 62%); }
.lvl-2 .l2-w.is-number { color: #6a45d8; background: linear-gradient(180deg, transparent 62%, rgba(221, 210, 255, .95) 62%); }

/* ---------------- the finish ---------------- */
.lvl-2 .l2-stamp {
  position: absolute;
  z-index: 6;
  left: 74%; top: 84%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: .5em 1.3em .6em;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 238, 248, .96));
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--pink-2), 0 14px 30px rgba(150, 40, 110, .25);
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-5deg) scale(1.8);
  pointer-events: none;
}
.lvl-2 .l2-stamp.is-in { animation: l2-stamp .6s var(--ease-pop) both; }
.lvl-2 .l2-stamp__big { font: 400 clamp(1.8rem, 8cqmin, 3rem)/1 var(--font-script); color: var(--pink-deep); }
.lvl-2 .l2-stamp__small { white-space: nowrap; font: 400 .62rem var(--font-pixel); letter-spacing: .12em; text-transform: uppercase; color: #6a45d8; }
.lvl-2 .l2-stamp__small:empty { display: none; }
@keyframes l2-stamp { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-5deg) scale(1.8); } 60% { opacity: 1; transform: translate(-50%, -50%) rotate(-5deg) scale(.94); } 100% { opacity: 1; transform: translate(-50%, -50%) rotate(-5deg) scale(1); } }

@keyframes l2-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes l2-wiggle { 0%, 100% { transform: rotate(0) scale(1); } 25% { transform: rotate(-8deg) scale(1.06); } 75% { transform: rotate(8deg) scale(1.06); } }

/* ---------------- dialog placement ---------------- */
/* wide: Shruti talks from under her own portrait, the board stays clear */
.lvl-2.l2-is-wide .dlg.l2-dlg {
  left: 14px;
  width: calc(45cqw - 24px);
  max-width: 560px;
  transform: none;
}
.lvl-2 .dlg.l2-dlg.dlg--top { top: 8px; }

/* ---------------- sizes ---------------- */
@container stage (max-width: 520px) {
  .lvl-2 { --l2-tag-h: 46px; }
  .lvl-2 .l2-tag { gap: 6px; padding-right: 10px; }
}
@container stage (max-height: 460px) {
  .lvl-2 { --l2-tag-h: 40px; }
  .lvl-2 .l2-wrap, .lvl-2.l2-is-wide .l2-wrap { padding: 4px 10px 6px; gap: 6px; }
  .lvl-2 .l2-tag { padding: 3px 10px 3px 3px; gap: 6px; border-width: 1.5px; box-shadow: 0 3px 0 var(--ts), 0 6px 14px rgba(150, 40, 110, .2); }
  .lvl-2 .l2-board { gap: 4px 8px; }
  .lvl-2 .l2-key { font-size: clamp(.86rem, 5.2cqmin, 1.2rem); padding: .2em .7em .26em; }
  .lvl-2 .l2-key--1 { top: calc(var(--l2-tag-h) + 8px); }
  .lvl-2 .l2-key--2 { bottom: calc(var(--l2-tag-h) + 8px); }
  .lvl-2 .l2-chip { padding: 2px 9px 2px 2px; }
  .lvl-2 .l2-parade { gap: 5px; }
  .lvl-2.l2-is-wide .dlg.l2-dlg { width: calc(45cqw - 20px); left: 10px; bottom: 8px; padding: 8px 10px 8px 8px; gap: 8px; border-width: 2px; }
  .lvl-2.l2-is-wide .dlg.l2-dlg .dlg__face { width: 40px; height: 40px; }
  .lvl-2.l2-is-wide .dlg.l2-dlg .dlg__text { font-size: .9rem; line-height: 1.3; }
}
