:root{
  --ink:#0f172a;
  --muted:#64748b;
  --bg1:#f6fbff;
  --bg2:#fff7ff;
  --shadow: 0 18px 45px rgba(15,23,42,.12);
  --shadow2: 0 10px 24px rgba(15,23,42,.10);
  --r:24px;
  --green: rgba(34,197,94,.20);
  --blue: rgba(59,130,246,.18);
  --orange: rgba(251,146,60,.18);
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(59,130,246,.14), transparent 45%),
    radial-gradient(circle at 88% 18%, rgba(168,85,247,.12), transparent 45%),
    radial-gradient(circle at 30% 92%, rgba(34,197,94,.14), transparent 45%),
    radial-gradient(circle at 78% 92%, rgba(251,146,60,.12), transparent 45%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  min-height:100vh;
}

/* Topbar */
.topbar{
  max-width:1100px;
  margin:0 auto;
  padding:18px 16px 10px;
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.back{
  text-decoration:none;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(15,23,42,.06);
  color:var(--ink);
  font-weight:900;
  border:1px solid rgba(15,23,42,.08);
}
.pill{
  display:inline-flex;
  padding:7px 10px;
  border-radius:999px;
  font-weight:1000;
  font-size:12px;
  color:#334155;
  background: rgba(15,23,42,.06);
  border:1px solid rgba(15,23,42,.08);
}
.title h1{
  margin:8px 0 0;
  font-size: clamp(24px, 3.6vw, 38px);
  letter-spacing:-.02em;
}
.subtitle{
  margin:6px 0 0;
  color:var(--muted);
  font-size: 14px;
  font-weight:700;
}

/* Layout */
.page{max-width:1100px;margin:0 auto;padding:0 16px 26px;}
.panel{
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(8px);
  margin-top: 10px;
}
.panelTop{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:12px;
  flex-wrap:wrap;
}
.panelTop h2{margin:0}
.muted{margin:0;color:var(--muted);font-size:13px;font-weight:800}

.labGrid{
  margin-top: 14px;
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media(min-width:980px){
  .labGrid{grid-template-columns: 1fr 1.15fr 1fr;}
}

.card{
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: var(--r);
  box-shadow: var(--shadow2);
  padding: 16px;
}
.cardTitle{margin:0 0 10px;font-size:16px}

.tray{
  display:flex;
  gap:12px;
  justify-content:center;
  margin-top: 8px;
}
.chipBtn{
  width:72px;height:72px;
  border-radius: 22px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(59,130,246,.10);
  font-weight:1000;
  font-size: 26px;
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  box-shadow: 0 10px 20px rgba(15,23,42,.08);
}
.chipBtn:hover{transform: translateY(-2px)}
.chipBtn:active{transform: translateY(-1px) scale(.99)}
.chipBtn.on{
  background: var(--green);
  filter: saturate(1.1);
  box-shadow: 0 16px 30px rgba(34,197,94,.18);
}

.note{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(59,130,246,.10);
  border: 1px dashed rgba(59,130,246,.22);
  color:#1e3a8a;
  font-weight:900;
  font-size: 12px;
  text-align:center;
}

.mixerCard{position:relative}
.mixer{
  display:grid;
  gap: 12px;
  place-items:center;
}

.dropZone{
  position:relative;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  border: 2px dashed rgba(15,23,42,.18);
  background: rgba(255,255,255,.85);
  display:grid;
  place-items:center;
  text-align:center;
  overflow:hidden;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.dropZone.dragOver{
  border-color: rgba(34,197,94,.55);
  box-shadow: 0 18px 45px rgba(34,197,94,.18);
}
.dropText{
  color: var(--muted);
  font-weight: 1000;
  line-height: 1.1;
}
.dropText small{font-weight:800; opacity:.85;}

.inside{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  transform: translateY(22px);
}
.slot{
  width:64px;height:64px;
  border-radius: 20px;
  display:grid;
  place-items:center;
  font-weight:1000;
  font-size: 24px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(15,23,42,.05);
  opacity:.45;
  transition: opacity .2s ease, transform .2s ease;
}
.slot.on{
  opacity: 1;
  transform: scale(1.05);
  background: var(--green);
}
.plus{
  font-size: 22px;
  font-weight: 1000;
  opacity:.75;
}

.controls{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:center;
}
.btn{
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(15,23,42,.06);
  border-radius: 18px;
  padding: 10px 14px;
  font-weight: 1000;
  cursor:pointer;
}
.btn.primary{
  background: rgba(34,197,94,.18);
  border-color: rgba(34,197,94,.22);
  color:#14532d;
}
.btn:active{transform: scale(.99);}

.status{
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 1000;
  font-size: 12px;
  background: rgba(15,23,42,.06);
  border: 1px solid rgba(15,23,42,.10);
}

.productBox{
  height: 220px;
  border-radius: 24px;
  border: 1px solid rgba(15,23,42,.08);
  background: linear-gradient(180deg, rgba(34,197,94,.10), rgba(59,130,246,.06));
  display:grid;
  place-items:center;
  position:relative;
  overflow:hidden;
}
.product{
  width:96px;height:96px;
  border-radius: 28px;
  display:grid;
  place-items:center;
  font-weight: 1000;
  font-size: 30px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.92);
  box-shadow: 0 18px 35px rgba(15,23,42,.12);
  opacity: 0;
  transform: translateY(14px) scale(.9);
  transition: opacity .25s ease, transform .25s ease;
}
.product.show{
  opacity: 1;
  transform: translateY(0) scale(1);
}
.productHint{
  position:absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  text-align:center;
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}

.miniExplain{
  margin-top: 12px;
  padding: 12px 12px;
  border-radius: 18px;
  background: rgba(251,146,60,.12);
  border: 1px dashed rgba(251,146,60,.25);
  color:#7c2d12;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
}

/* Sparks */
.sparkArea{position:absolute; inset:0; pointer-events:none;}
.spark{
  position:absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(251,191,36,.95);
  box-shadow: 0 0 14px rgba(251,191,36,.65);
  animation: sparkUp .85s ease-out forwards;
}
@keyframes sparkUp{
  0%{ transform: translate(0,0) scale(1); opacity:1;}
  100%{ transform: translate(var(--dx), var(--dy)) scale(.2); opacity:0;}
}
