
:root {
  --plum: #2b1430;
  --plum2: #3b1d43;
  --wine: #55213f;
  --copper: #c47a42;
  --copper2: #e4a35d;
  --cream: #fff2d1;
  --paper: #f4dfb8;
  --green: #173f35;
  --green2: #235a48;
  --mint: #9af2c9;
  --gold: #f2cf77;
  --rose: #e9859c;
  --blue: #9bd5ff;
  --text: #fff1d2;
  --darktext: #2b1430;
  --muted: #d8bfaa;
  --acid: #bcff3b;
  --acid2: #68ff8f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(228,163,93,.24), transparent 22%),
    radial-gradient(circle at 86% 14%, rgba(154,242,201,.12), transparent 20%),
    radial-gradient(circle at 18% 84%, rgba(233,133,156,.16), transparent 24%),
    radial-gradient(circle at 82% 80%, rgba(242,207,119,.12), transparent 22%),
    linear-gradient(135deg, #2b1430 0%, #3b1d43 42%, #1a2d29 100%);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.020) 1px, transparent 1px);
  background-size: 70px 70px;
  opacity: .32;
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 80%);
}
.lab-glow { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.lab-glow span { position: absolute; border-radius: 999px; filter: blur(28px); opacity: .34; animation: drift 11s ease-in-out infinite; }
.g1 { width: 280px; height: 280px; left: -80px; top: 12%; background: #e4a35d; }
.g2 { width: 320px; height: 320px; right: -110px; bottom: 8%; background: #9af2c9; animation-delay: 2s; }
.g3 { width: 230px; height: 230px; left: 42%; bottom: -80px; background: #e9859c; animation-delay: 4s; }

.main-lab {
  position: relative;
  z-index: 2;
  width: min(1390px, calc(100% - 26px));
  margin: 0 auto;
  min-height: calc(100vh - 84px);
  display: grid;
  align-items: start;
  padding: 18px 0 10px;
}
.lab-card {
  width: 100%;
  border-radius: 40px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.105), rgba(255,255,255,.055));
  border: 1px solid rgba(242,207,119,.22);
  box-shadow: 0 42px 130px rgba(0,0,0,.34), 0 0 80px rgba(228,163,93,.07), inset 0 0 0 1px rgba(255,255,255,.045);
  backdrop-filter: blur(14px);
}
.lab-layout { display: grid; }
.lab-top {
  display: grid;
  grid-template-columns: 280px minmax(420px, 1fr) 300px;
  gap: 16px;
  align-items: stretch;
}
.ingredient-wing, .info-panel, .table-tray, .intro-card, .center-actions {
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255,255,255,.095), rgba(255,255,255,.05));
  border: 1px solid rgba(242,207,119,.18);
}
.ingredient-wing { padding: 14px; box-shadow: inset 0 -14px 0 rgba(0,0,0,.10); }
.wing-title, .tray-title {
  text-align: center;
  color: var(--gold);
  font-weight: 950;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.15px;
  margin-bottom: 12px;
}
.ingredients { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ingredient {
  min-height: 112px;
  border-radius: 20px;
  padding: 10px 8px;
  cursor: pointer;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 4px;
  background: radial-gradient(circle at 50% 0%, rgba(242,207,119,.16), transparent 42%), rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.10);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
  text-align: center;
}
.ingredient:hover {
  transform: translateY(-4px);
  border-color: rgba(242,207,119,.50);
  background: radial-gradient(circle at 50% 0%, rgba(242,207,119,.24), transparent 44%), rgba(255,255,255,.105);
}
.ingredient.disabled { opacity: .42; pointer-events: none; }
.ing-icon { font-size: clamp(34px, 3.6vw, 48px); line-height: 1; filter: drop-shadow(0 10px 12px rgba(0,0,0,.25)); }
.ingredient strong { color: var(--text); font-size: 12px; line-height: 1.12; }
.ingredient span { color: var(--muted); font-size: 10px; line-height: 1.18; }

.center-stage { display: grid; grid-template-rows: auto 1fr auto auto; gap: 12px; min-height: 0; }
.intro-card {
  padding: 14px 16px;
  text-align: center;
}
.intro-card h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1;
  color: var(--gold);
}
.intro-card p {
  margin: 0;
  color: var(--cream);
  font-size: 14px;
  line-height: 1.45;
}
.intro-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
}
.cauldron-zone {
  position: relative;
  min-height: 315px;
  border-radius: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 25%, rgba(154,242,201,.10), transparent 28%), radial-gradient(circle at 50% 92%, rgba(228,163,93,.13), transparent 26%), linear-gradient(180deg, rgba(0,0,0,.22), rgba(0,0,0,.15));
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: inset 0 0 60px rgba(0,0,0,.22);
}
.cauldron-zone::before { content: ""; position: absolute; left: 10%; right: 10%; bottom: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.24); filter: blur(5px); }
.cauldron-zone::after { content: ''; position: absolute; inset: 14px; border-radius: 26px; border: 1px dashed rgba(242,207,119,.12); }
.cauldron { position: relative; width: min(390px, 84%); height: 265px; display: grid; place-items: center; }
.steam { position: absolute; top: -52px; left: 50%; width: 170px; height: 96px; transform: translateX(-50%); pointer-events: none; }
.steam span { position: absolute; bottom: 0; width: 34px; height: 66px; border-radius: 999px; background: rgba(255,255,255,.14); filter: blur(8px); animation: steamRise 2.8s ease-in-out infinite; }
.steam span:nth-child(1) { left: 18px; }
.steam span:nth-child(2) { left: 66px; animation-delay: .5s; }
.steam span:nth-child(3) { left: 116px; animation-delay: 1s; }
.cauldron-bowl { position: absolute; bottom: 0; width: 100%; height: 170px; border-radius: 42px 42px 88px 88px; background: radial-gradient(circle at 50% 0%, var(--brewColor, #9af2c9), transparent 31%), linear-gradient(180deg, #244039, #0f211d); border: 7px solid rgba(242,207,119,.42); box-shadow: 0 30px 70px rgba(0,0,0,.28), inset 0 -24px 36px rgba(0,0,0,.30), inset 0 18px 28px rgba(255,255,255,.05); }
.cauldron-liquid { position: absolute; top: 60px; left: 12%; right: 12%; height: 70px; border-radius: 50%; background: radial-gradient(circle at 42% 35%, rgba(255,255,255,.75), transparent 15%), radial-gradient(circle at 62% 54%, rgba(255,255,255,.26), transparent 18%), var(--brewColor, #9af2c9); box-shadow: 0 0 38px var(--brewGlow, rgba(154,242,201,.45)), inset 0 0 24px rgba(255,255,255,.32); animation: bubble 1.9s ease-in-out infinite; }
.cauldron-liquid::before, .cauldron-liquid::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.40); top: 22px; animation: popBubble 1.5s ease-in-out infinite; }
.cauldron-liquid::before { left: 28%; }
.cauldron-liquid::after { right: 28%; animation-delay: .65s; }
.cauldron-body { position: absolute; inset: 0; display: grid; place-items: center; font-size: 90px; pointer-events: none; transform: translateY(34px); filter: drop-shadow(0 12px 18px rgba(0,0,0,.35)); }
.cauldron.brewing { animation: shake 0.15s linear infinite; }
.secret-spark { position: absolute; width: 64px; height: 64px; border-radius: 50%; display: none; place-items: center; border: none; cursor: pointer; font-size: 34px; background: radial-gradient(circle, #fff8bf, #f2cf77 48%, rgba(242,207,119,.10) 72%); box-shadow: 0 0 36px rgba(242,207,119,.55); z-index: 5; right: 13%; top: 14%; animation: sparkPulse .9s ease-in-out infinite; }
.secret-spark.show { display: grid; }

.table-tray {
  min-height: 92px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
}
.selected-ing {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 30px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 12px 28px rgba(0,0,0,.20); animation: popIn .22s ease;
}
.center-actions {
  padding: 10px 14px 14px;
  display: grid;
  gap: 9px;
}
.info-panel {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.counter-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.counter { padding: 12px 10px; border-radius: 18px; background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.10); text-align: center; color: var(--muted); font-weight: 900; font-size: 12px; }
.counter strong { display: block; margin-top: 5px; color: var(--text); font-size: 22px; }
.message { min-height: 138px; display: grid; align-content: center; text-align: center; line-height: 1.42; font-size: 17px; }
.message strong { color: var(--gold); }
.message .small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.potion-result { display: grid; place-items: center; gap: 8px; }
.bottle { width: 90px; height: 126px; position: relative; border-radius: 22px 22px 30px 30px; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.70), transparent 16%), linear-gradient(180deg, rgba(255,255,255,.22), var(--resultColor, #9af2c9)); border: 3px solid rgba(255,255,255,.45); box-shadow: 0 0 34px var(--resultGlow, rgba(154,242,201,.40)), 0 16px 38px rgba(0,0,0,.24), inset 0 0 18px rgba(255,255,255,.20); }
.bottle::before { content: ""; position: absolute; width: 38px; height: 30px; border-radius: 10px 10px 6px 6px; left: 50%; top: -26px; transform: translateX(-50%); background: rgba(255,255,255,.20); border: 3px solid rgba(255,255,255,.40); }
.actions { display: grid; gap: 10px; }
.btn, button { border: none; cursor: pointer; border-radius: 999px; padding: 14px 22px; font-size: 16px; font-weight: 950; color: var(--darktext); background: linear-gradient(135deg, var(--gold), var(--copper2)); text-decoration: none; text-align: center; box-shadow: 0 16px 36px rgba(228,163,93,.18); transition: transform .16s ease, opacity .16s ease; }
.btn:hover, button:hover { transform: translateY(-2px); }
.btn.secondary, button.secondary { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid rgba(255,255,255,.12); box-shadow: none; }
button:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.reveal-potion { padding: 18px 28px; font-size: 22px; letter-spacing: .4px; text-transform: uppercase; background: linear-gradient(135deg, #fff0aa, var(--gold), var(--copper2)); box-shadow: 0 24px 58px rgba(242,207,119,.22), inset 0 0 0 1px rgba(255,255,255,.24); }
.acid-brew { background: linear-gradient(135deg, var(--acid), var(--acid2)); box-shadow: 0 0 24px rgba(188,255,59,.35), 0 18px 36px rgba(104,255,143,.18); color: #173110; text-transform: uppercase; letter-spacing: .4px; }
.fly-item { position: fixed; z-index: 50; font-size: 44px; pointer-events: none; animation: flyToCauldron .75s ease forwards; }
.bottom-brand { position: relative; z-index: 2; width: min(1220px, calc(100% - 32px)); margin: 6px auto 0; text-align: center; color: var(--gold); font-size: clamp(26px, 3.4vw, 38px); font-weight: 950; letter-spacing: .4px; text-shadow: 0 14px 38px rgba(0,0,0,.30); }
.footer { position: relative; z-index: 2; width: min(1220px, calc(100% - 32px)); margin: 0 auto; padding: 10px 0 20px; display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.footer a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 900; }
.footer a:hover { color: var(--gold); }
.content-wrap { position: relative; z-index: 2; width: min(900px, calc(100% - 32px)); margin: 34px auto 60px; }
.content-card { padding: 34px; border-radius: 32px; background: linear-gradient(180deg, rgba(255,255,255,.105), rgba(255,255,255,.055)); border: 1px solid rgba(242,207,119,.22); box-shadow: 0 24px 80px rgba(0,0,0,.28); color: var(--muted); line-height: 1.72; backdrop-filter: blur(12px); }
.content-card h1, .content-card h2 { color: var(--text); }
.content-card h1 { margin-top: 0; font-size: clamp(32px, 4vw, 48px); }
.content-card a { color: var(--gold); font-weight: 900; }
@keyframes popIn { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes drift { 0%,100% { transform: translate(0,0); } 50% { transform: translate(40px,-18px); } }
@keyframes steamRise { 0% { opacity: .05; transform: translateY(20px) scale(.7); } 50% { opacity: .5; } 100% { opacity: 0; transform: translateY(-70px) scale(1.2); } }
@keyframes bubble { 0%,100% { transform: scaleX(1) translateY(0); } 50% { transform: scaleX(1.06) translateY(-2px); } }
@keyframes popBubble { 0% { transform: translateY(8px) scale(.3); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateY(-22px) scale(1); opacity: 0; } }
@keyframes shake { 0% { transform: translateX(-1px) rotate(-.3deg); } 50% { transform: translateX(1px) rotate(.3deg); } 100% { transform: translateX(-1px) rotate(-.3deg); } }
@keyframes sparkPulse { 0%,100% { transform: scale(.95); } 50% { transform: scale(1.08); } }
@keyframes flyToCauldron { 0% { transform: translate(0,0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(.35) rotate(22deg); opacity: 0; } }
@media (max-width: 1220px) {
  .lab-top { grid-template-columns: 1fr; }
  .center-stage { order: -1; }
  .cauldron-zone { min-height: 310px; }
}
@media (max-width: 820px) {
  .ingredients { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 620px) {
  .ingredients { grid-template-columns: repeat(2, 1fr); }
  .counter-grid { grid-template-columns: repeat(2, 1fr); }
  .ingredient { min-height: 110px; }
  .cauldron-zone { min-height: 280px; }
  .cauldron { width: min(340px, 94%); height: 240px; }
  .cauldron-bowl { height: 160px; }
  .cauldron-liquid { top: 56px; height: 62px; }
  .cauldron-body { font-size: 80px; transform: translateY(30px); }
}
