:root{
  --bg:#f7fbff;
  --card:#ffffff;
  --ink:#0f172a;
  --muted:#64748b;
  --shadow: 0 14px 35px rgba(15,23,42,.10);
  --radius: 18px;

  --red: rgba(239,68,68,.22);
  --orange: rgba(251,146,60,.22);
  --blue: rgba(59,130,246,.18);
  --green: rgba(34,197,94,.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 10% 15%, rgba(239,68,68,.14), transparent 40%),
    radial-gradient(circle at 90% 20%, rgba(59,130,246,.12), transparent 45%),
    radial-gradient(circle at 35% 95%, rgba(34,197,94,.10), transparent 45%),
    var(--bg);
  min-height:100vh;
}

.topbar{
  max-width:1200px;
  margin:0 auto;
  padding:18px 16px 10px;
  display:flex;
  align-items:center;
  gap:12px;
}
.back{
  text-decoration:none;
  padding:10px 12px;
  border-radius:14px;
  background: rgba(15,23,42,.06);
  color:var(--ink);
  font-weight:800;
}
.title h1{margin:0; font-size: clamp(22px,3vw,34px);}
.title p{margin:4px 0 0; color:var(--muted); font-size:14px;}

.wrap{max-width:1200px;margin:0 auto;padding:0 16px 28px;}
.card{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
  border: 1px solid rgba(15,23,42,.06);
  margin-top:14px;
}
.muted{color:var(--muted)}

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

.items h2, .stage h2{margin:0 0 10px}
.itemList{display:grid; gap:10px;}

.draggable{
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.88);
  cursor:grab;
  transition: transform .12s ease, box-shadow .12s ease;
}
.draggable:hover{transform: translateY(-1px);}
.draggable:active{cursor:grabbing; transform: scale(.99);}
.emoji{
  width:46px;height:46px;border-radius:16px;
  display:grid;place-items:center;
  font-size:24px;
  background: rgba(15,23,42,.06);
}
.meta strong{display:block;}
.meta span{display:block;color:var(--muted);font-size:12px;margin-top:2px;}

.tip{
  margin-top:10px;
  font-size:12px;
  color:var(--muted);
  background: rgba(15,23,42,.04);
  padding:10px 12px;
  border-radius:14px;
  border: 1px dashed rgba(15,23,42,.10);
}

.stageTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.status{
  padding:8px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
  background: rgba(15,23,42,.06);
  border: 1px solid rgba(15,23,42,.10);
}

.arena{
  position:relative;
  margin-top: 12px;
  height: 360px;
  border-radius: 18px;
  border:1px solid rgba(15,23,42,.08);
  background: linear-gradient(180deg, rgba(239,68,68,.06), rgba(59,130,246,.05));
  overflow:hidden;
}

.slot{
  position:absolute;
  width: 140px;
  height: 80px;
  border-radius: 18px;
  display:grid;
  grid-template-columns: 1fr;
  place-items:center;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.85);
  box-shadow: 0 12px 28px rgba(15,23,42,.08);
}
.slotLabel{
  font-size:12px;
  font-weight:900;
  color:var(--muted);
  margin-top:10px;
}
.slotIcon{
  font-size:28px;
  margin-bottom:12px;
  opacity:.35;
  transition: opacity .2s ease, transform .2s ease;
}

.slot-fuel{left:18px; bottom:18px;}
.slot-heat{right:18px; bottom:18px;}
.slot-oxygen{left:50%; top:16px; transform: translateX(-50%);}

.dropZone{
  position:absolute;
  left:50%;
  top:50%;
  transform: translate(-50%,-50%);
  width: 220px;
  height: 220px;
  border-radius: 999px;
  border: 2px dashed rgba(15,23,42,.18);
  background: rgba(255,255,255,.72);
  display:grid;
  place-items:center;
  text-align:center;
}
.dropZone.dragOver{
  border-color: rgba(239,68,68,.55);
  box-shadow: 0 16px 40px rgba(239,68,68,.14);
}
.dropText{
  color: var(--muted);
  font-weight: 900;
  line-height: 1.1;
}
.dropText small{font-weight:700; opacity:.85;}

.fireWrap{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  opacity:0;
  transform: scale(.92);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events:none;
}
.fireWrap.on{
  opacity:1;
  transform: scale(1);
}

.fire{
  position:relative;
  width: 120px;
  height: 140px;
  display:grid;
  place-items:center;
}
.flame{
  position:absolute;
  bottom: 8px;
  width: 56px;
  height: 86px;
  border-radius: 999px 999px 999px 999px;
  filter: blur(.2px);
  transform-origin: 50% 90%;
  animation: flicker 0.9s ease-in-out infinite;
}
.f1{
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.65), transparent 35%),
              rgba(239,68,68,.72);
  animation-duration: .95s;
}
.f2{
  width: 44px;
  height: 72px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.55), transparent 40%),
              rgba(251,146,60,.75);
  animation-duration: .82s;
  transform: translateX(-14px);
}
.f3{
  width: 38px;
  height: 62px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.45), transparent 45%),
              rgba(251,191,36,.78);
  animation-duration: .74s;
  transform: translateX(14px);
}

.glow{
  position:absolute;
  bottom: 0;
  width: 140px;
  height: 50px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(239,68,68,.35), transparent 70%);
  filter: blur(1px);
  animation: pulse 1.3s ease-in-out infinite;
}

@keyframes flicker{
  0%{ transform: translateY(0) scale(1) rotate(-2deg); }
  50%{ transform: translateY(-6px) scale(1.05) rotate(2deg); }
  100%{ transform: translateY(0) scale(1) rotate(-2deg); }
}
@keyframes pulse{
  0%{ transform: scale(.95); opacity:.55;}
  50%{ transform: scale(1.05); opacity:.85;}
  100%{ transform: scale(.95); opacity:.55;}
}

/* Smoke */
.smoke{
  position:absolute;
  top: 26px;
  width: 130px;
  height: 130px;
  opacity:.0;
  transition: opacity .25s ease;
}
.fireWrap.on .smoke{opacity:.22;}
.smoke::before, .smoke::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 30% 70%, rgba(255,255,255,.9), transparent 40%),
    radial-gradient(circle at 60% 40%, rgba(255,255,255,.8), transparent 45%),
    radial-gradient(circle at 70% 80%, rgba(255,255,255,.85), transparent 40%);
  filter: blur(1px);
  animation: floaty 1.6s ease-in-out infinite;
}
.smoke::after{opacity:.8; animation-delay:.35s;}

@keyframes floaty{
  0%{ transform: translateY(12px) scale(.95); opacity:.18;}
  50%{ transform: translateY(-8px) scale(1.03); opacity:.55;}
  100%{ transform: translateY(12px) scale(.95); opacity:.18;}
}

/* Sparks */
.sparks{
  position:absolute;
  inset:0;
  pointer-events:none;
}
.spark{
  position:absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(251,191,36,.95);
  box-shadow: 0 0 12px rgba(251,191,36,.65);
  animation: sparkUp .9s 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;}
}

.readout{
  margin-top: 12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.chip{
  padding:8px 10px;
  border-radius:999px;
  background: rgba(15,23,42,.06);
  border:1px solid rgba(15,23,42,.10);
  font-size:12px;
  font-weight:900;
}
.chip.on{
  background: rgba(34,197,94,.14);
  border-color: rgba(34,197,94,.25);
}
.chip.warn{
  background: rgba(239,68,68,.14);
  border-color: rgba(239,68,68,.22);
}

.btnRow{margin-top:12px;}
.btn{
  border:0;
  cursor:pointer;
  font-weight: 900;
  border-radius: 16px;
  padding: 10px 14px;
  background: rgba(15,23,42,.06);
  border: 1px solid rgba(15,23,42,.10);
}
.btn:active{transform: scale(.99);}
