:root {
  --bg1: #062b1e;
  --bg2: #0b4531;
  --mint: #6ff0b8;
  --lime: #d4ff7a;
  --ink: #eafff4;
  --muted: #9fe9c8;
  --card: rgba(9, 54, 38, 0.66);
  --line: rgba(126, 240, 184, 0.28);
  --bad: #ff8b8b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 15% -10%, #14724f 0%, transparent 60%),
    radial-gradient(900px 700px at 100% 20%, #0d5a3e 0%, transparent 55%),
    linear-gradient(160deg, var(--bg2) 0%, var(--bg1) 55%, #041d14 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

h1, h2, h3 { font-weight: 800; letter-spacing: 0.5px; }

/* ================= АНИМИРОВАННЫЙ ФОН С ПРИБОРАМИ ================= */
.lab-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.lab-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(140, 255, 200, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* --- колбочка (общая) --- */
.flask {
  position: absolute; width: 70px; height: 90px;
  animation: floatX 55s ease-in-out infinite alternate;
}
.flask::before { /* стекло */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.28), rgba(255,255,255,.06));
  clip-path: polygon(38% 0, 62% 0, 62% 30%, 96% 92%, 84% 100%, 16% 100%, 4% 92%, 38% 30%);
  border: 2px solid rgba(190,255,225,.5);
}
.flask::after { /* жидкость */
  content: ""; position: absolute; left: 8%; right: 8%; bottom: 4%; height: 46%;
  background: linear-gradient(180deg, #7dffcd, #17a06b);
  clip-path: polygon(6% 100%, 94% 100%, 88% 34%, 12% 34%);
  animation: slosh 5.5s ease-in-out infinite;
}
.flask.pink::after { background: linear-gradient(180deg, #ff9ad5, #e0409b); }
.flask.violet::after { background: linear-gradient(180deg, #c39bff, #7b3ff2); }
.flask.amber::after { background: linear-gradient(180deg, #ffd479, #ff9d2e); }

.bubbles i {
  position: absolute; bottom: 18%; width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,.75); opacity: 0;
  animation: bubbleUp 5s ease-in infinite;
}
.bubbles i:nth-child(1) { left: 32%; animation-delay: 0s; }
.bubbles i:nth-child(2) { left: 50%; animation-delay: 1.6s; }
.bubbles i:nth-child(3) { left: 64%; animation-delay: 3.1s; }

@keyframes bubbleUp {
  0% { transform: translateY(0) scale(.5); opacity: 0; }
  20% { opacity: .9; }
  100% { transform: translateY(-46px) scale(1.1); opacity: 0; }
}
@keyframes slosh { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(.86); } }

.f1 { top: 14%; left: -120px; animation-duration: 70s; transform: scale(1.1); }
.f2 { top: 62%; left: -120px; animation-duration: 60s; animation-delay: -8s; transform: scale(.9); }
.f3 { top: 36%; left: -120px; animation-duration: 85s; animation-delay: -18s; transform: scale(1.25); }

/* --- пробирки --- */
.tube {
  position: absolute; width: 26px; height: 96px; border: 2px solid rgba(190,255,225,.5);
  border-radius: 0 0 14px 14px; background: rgba(255,255,255,.07);
  animation: floatX 65s ease-in-out infinite alternate;
}
.tube span {
  position: absolute; left: 3px; right: 3px; bottom: 3px; height: 55%;
  border-radius: 0 0 11px 11px; background: linear-gradient(180deg, #ffd479, #ff8f3c);
  animation: slosh 5s ease-in-out infinite;
}
.t1 { top: 76%; left: -60px; animation-duration: 55s; animation-delay: -4s; transform: rotate(12deg); }
.t2 { top: 8%; left: -60px; animation-duration: 80s; animation-delay: -14s; transform: rotate(-16deg) scale(.85); }
.t2 span { background: linear-gradient(180deg, #7de3ff, #2f8fe0); }

/* --- микроскоп --- */
.microscope {
  position: absolute; width: 64px; height: 84px;
  animation: floatX 95s ease-in-out infinite alternate;
}
.microscope::before { /* корпус */
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(#bfe9ff, #7fb8d8) padding-box;
  clip-path: polygon(20% 100%, 80% 100%, 76% 88%, 66% 88%, 66% 40%, 76% 30%, 62% 18%, 62% 6%, 40% 6%, 40% 18%, 52% 28%, 56% 40%, 56% 88%, 28% 88%);
  opacity: .85;
}
.microscope::after { /* окуляр блик */
  content: ""; position: absolute; top: 4%; left: 42%; width: 16%; height: 12%;
  background: #eaffff; border-radius: 4px; animation: glint 4.5s ease-in-out infinite;
}
@keyframes glint { 0%,100% { opacity: .2; } 50% { opacity: .95; } }

.m1 { top: 24%; left: -100px; animation-duration: 46s; animation-delay: -10s; transform: scale(1.1); }
.m2 { top: 70%; left: -100px; animation-duration: 36s; animation-delay: -22s; transform: scale(.85) scaleX(-1); }

/* --- лупа --- */
.magnifier {
  position: absolute; width: 76px; height: 76px; border-radius: 50%;
  border: 6px solid #cfe8dc; background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.5), rgba(160,255,215,.12));
  animation: floatX 32s ease-in-out infinite alternate;
}
.magnifier::after { /* ручка */
  content: ""; position: absolute; right: -6px; bottom: -4px; width: 12px; height: 40px;
  background: linear-gradient(#8fb8a8, #5d8a79); border-radius: 6px; transform: rotate(-45deg);
  transform-origin: top center;
}
.g1 { top: 50%; left: -100px; animation-duration: 27s; animation-delay: -6s; transform: scale(.9); }
.g2 { top: 18%; left: -100px; animation-duration: 44s; animation-delay: -25s; transform: scale(1.15) rotate(20deg); }

/* --- молекулы и атомы --- */
.molecule {
  position: absolute; width: 54px; height: 54px;
  animation: floatX 38s ease-in-out infinite alternate, spinSlow 18s linear infinite;
}
.molecule::before, .molecule::after {
  content: ""; position: absolute; border-radius: 50%;
}
.molecule::before { width: 24px; height: 24px; left: 0; top: 16px; background: radial-gradient(circle at 30% 30%, #d4ff7a, #58c94a); }
.molecule::after { width: 24px; height: 24px; right: 0; top: 4px; background: radial-gradient(circle at 30% 30%, #9be8ff, #2f8fe0); }
.mol1 { top: 42%; left: -80px; animation-duration: 30s, 20s; }
.mol2 { top: 86%; left: -80px; animation-duration: 48s, 26s; animation-delay: -12s, -6s; transform: scale(.8); }
.mol3 { top: 6%; left: -80px; animation-duration: 36s, 15s; animation-delay: -20s, -3s; transform: scale(1.1); }

.atom {
  position: absolute; width: 46px; height: 46px; border: 2px solid rgba(212,255,122,.7);
  border-radius: 50%; animation: floatX 34s ease-in-out infinite alternate, spinSlow 9s linear infinite;
}
.atom::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 12px; height: 12px;
  margin: -6px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff, #ffd479);
}
.a1 { top: 58%; left: -70px; animation-duration: 25s, 11s; }
.a2 { top: 30%; left: -70px; animation-duration: 43s, 7s; animation-delay: -17s, -2s; transform: scale(.7); }

@keyframes floatX {
  from { translate: 0 -18px; }
  to   { translate: calc(100vw + 240px) 26px; }
}
@keyframes spinSlow { to { rotate: 360deg; } }

@media (prefers-reduced-motion: reduce) {
  .lab-bg, .lab-bg * { animation: none !important; display: none; }
}

/* ускорение фоновых приборов, когда открыт раздел (bg-hurry на body) */
.bg-hurry .lab-bg > * { animation-duration: 9s !important; }
.bg-hurry .lab-bg .microscope, .bg-hurry .lab-bg .molecule, .bg-hurry .lab-bg .atom { animation-duration: 14s !important; }
@media (prefers-reduced-motion: reduce) {
  .bg-hurry .lab-bg > * { animation-duration: initial !important; }
}

/* ================= ШАПКА ================= */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px clamp(14px, 3vw, 36px);
  background: rgba(4, 30, 21, .78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.logo { font-weight: 800; font-size: 20px; color: var(--lime); white-space: nowrap; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.nav-btn {
  font: inherit; font-weight: 700; color: #d8fff0;
  background: linear-gradient(135deg, rgba(47,213,143,.3), rgba(23,160,107,.25));
  border: 1px solid rgba(125,255,205,.4); border-radius: 999px; padding: 9px 18px;
  cursor: pointer; transition: .2s; backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0,0,0,.22);
}
.nav-btn:hover { background: linear-gradient(135deg, rgba(47,213,143,.55), rgba(23,160,107,.45)); border-color: var(--lime); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(47,213,143,.35); }
.nav-btn.active {
  background: linear-gradient(120deg, #2fd58f, #17a06b); color: #02271b;
  border: none; border-color: #7dffcd;
  box-shadow: 0 8px 22px rgba(47,213,143,.5), inset 0 2px 0 rgba(255,255,255,.4);
}

.progress-wrap { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.xp b { color: var(--lime); font-size: 16px; }
.progress-bar { width: 130px; height: 10px; border-radius: 999px; background: rgba(0,0,0,.35); border: 1px solid var(--line); overflow: hidden; }
#progressFill { height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, #2fd58f, var(--lime)); transition: width .6s cubic-bezier(.2,.8,.3,1); }

/* ================= СТРАНИЦЫ ================= */
.page { display: none; padding: 24px clamp(14px, 3vw, 40px) 60px; max-width: 1100px; margin: 0 auto; position: relative; z-index: 2; }
.page.active { display: block; animation: pageIn .45s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.page-title { font-size: clamp(26px, 4.5vw, 40px); color: var(--lime); margin-bottom: 6px; }
.page-sub { color: var(--muted); margin-bottom: 22px; font-size: 16px; }

/* --- герой --- */
.hero { text-align: center; padding-top: clamp(20px, 5vh, 60px); }
.hero-title {
  font-size: clamp(40px, 8.5vw, 92px); line-height: 1.05;
  background: linear-gradient(100deg, #b8ffd9 0%, var(--lime) 45%, #57e6a5 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 24px rgba(60, 230, 160, .35));
  animation: glow 4s ease-in-out infinite;
  text-transform: uppercase;
}
@keyframes glow {
  0%,100% { filter: drop-shadow(0 6px 18px rgba(60,230,160,.25)); }
  50% { filter: drop-shadow(0 10px 34px rgba(160,255,120,.5)); }
}
.hero-sub { max-width: 640px; margin: 18px auto 0; font-size: clamp(15px, 2vw, 19px); color: #bdf3d8; }
.hero-actions { margin-top: 28px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  font: inherit; font-weight: 700; color: #052e20;
  background: linear-gradient(120deg, #3ce89b, #2fd58f);
  border: none; border-radius: 999px; padding: 12px 26px;
  cursor: pointer; transition: .2s; backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(47,213,143,.3), inset 0 2px 0 rgba(255,255,255,.35);
}
.btn:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 14px 30px rgba(47,213,143,.45), inset 0 2px 0 rgba(255,255,255,.4); filter: saturate(1.15); }
.btn:active { transform: translateY(-1px) scale(.98); }
.btn.big { padding: 15px 32px; font-size: 17px; background: linear-gradient(120deg, #3ce89b, #a9f45e); box-shadow: 0 10px 30px rgba(60,232,155,.35), inset 0 2px 0 rgba(255,255,255,.4); }
.btn.big.alt { background: linear-gradient(120deg, #7de3ff, #4fa8ff); box-shadow: 0 10px 30px rgba(80,170,255,.35), inset 0 2px 0 rgba(255,255,255,.45); color: #03243d; }
.btn.small { padding: 8px 16px; font-size: 14px; }
.btn.ghost { background: linear-gradient(120deg, #7de3ff, #59b7ff); color: #03243d; box-shadow: 0 8px 18px rgba(80,170,255,.3), inset 0 2px 0 rgba(255,255,255,.4); }
.btn.ghost:hover { box-shadow: 0 14px 28px rgba(80,170,255,.45), inset 0 2px 0 rgba(255,255,255,.5); filter: saturate(1.2); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; filter: grayscale(.5); }

.hidden { display: none !important; }
.note-line { border-left: 3px solid #7fe3a1; padding-left: 10px; margin-top: 8px; }
.muted { color: var(--muted); }

.hero-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 48px; }
.info-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 24px; cursor: pointer; transition: .25s; backdrop-filter: blur(10px); text-align: center;
}
.info-card:hover { transform: translateY(-6px); border-color: var(--mint); box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.info-card .ic { font-size: 44px; display: inline-block; animation: bob 3.5s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(5deg); } }
.info-card h3 { font-size: 20px; margin: 10px 0 8px; color: #d6ffe9; }
.info-card p { font-size: 14.5px; color: var(--muted); line-height: 1.55; }

/* ================= ТЕОРИЯ ================= */
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.lesson-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 24px; cursor: pointer; transition: .25s; backdrop-filter: blur(10px); position: relative;
}
.lesson-card:hover { transform: translateY(-5px); border-color: var(--mint); }
.lesson-card .emoji { font-size: 40px; }
.lesson-card h3 { color: var(--lime); font-size: 20px; margin: 8px 0; }
.lesson-card p { color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.lesson-card .btn { align-self: flex-start; margin-top: auto; }
.lesson-card.done { border-color: var(--lime); }
.lesson-card.done::after { content: "✅"; position: absolute; bottom: 14px; right: 16px; }

.card {
  background: rgba(5, 40, 28, .82); border: 1px solid var(--line); border-radius: 24px;
  padding: clamp(20px, 4vw, 36px); backdrop-filter: blur(12px); margin-top: 24px;
}
#lessonView h2 { color: var(--lime); font-size: clamp(22px, 4vw, 32px); margin-bottom: 10px; }
#lessonView h4 { margin: 22px 0 8px; color: var(--mint); font-size: 17px; }
#lessonView p, #lessonView li { color: #cdf6e2; line-height: 1.75; font-size: 15.5px; }
#lessonView ul { padding-left: 22px; margin-top: 6px; }
.formula {
  display: inline-block; background: rgba(60,232,155,.12); border: 1px dashed var(--mint);
  border-radius: 12px; padding: 8px 16px; margin: 6px 6px 6px 0; font-weight: 700; color: var(--lime);
}

/* мини-квиз урока */
.lesson-quiz { margin-top: 24px; border-top: 1px dashed var(--line); padding-top: 18px; }
.lesson-quiz .q { font-weight: 700; margin-bottom: 12px; color: #d6ffe9; }
.answers { display: grid; gap: 10px; }
.answer {
  font: inherit; font-weight: 700; text-align: left; color: #eafff4;
  background: linear-gradient(135deg, rgba(47,213,143,.22), rgba(23,160,107,.18));
  border: 2px solid rgba(125,255,205,.35); border-radius: 22px; padding: 15px 20px;
  cursor: pointer; transition: .2s; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.answer .key {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; font-weight: 900;
  background: linear-gradient(135deg, var(--lime), #17a06b); color: #02271b;
}
.answer:hover:not(:disabled) { transform: translateY(-3px) scale(1.02); border-color: var(--lime); box-shadow: 0 10px 24px rgba(47,213,143,.35); }
.answer:nth-child(2) .key { background: linear-gradient(135deg, #7de3ff, #2b9fd6); }
.answer:nth-child(3) .key { background: linear-gradient(135deg, #ffd166, #e89b1c); }
.answer:nth-child(4) .key { background: linear-gradient(135deg, #c792ea, #8e5bd8); }
.answer:disabled { cursor: default; opacity: .92; }
.answer.correct { background: linear-gradient(135deg, rgba(60,232,155,.5), rgba(23,160,107,.4)); border-color: var(--lime); animation: pop .35s ease; }
.answer.wrong { background: linear-gradient(135deg, rgba(255,110,110,.42), rgba(180,50,50,.32)); border-color: var(--bad); }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }
.feedback { margin-top: 14px; padding: 14px 18px; border-radius: 18px; font-weight: 700; line-height: 1.55; }
.feedback.good { background: rgba(60,232,155,.18); border: 1px solid var(--lime); color: var(--lime); }
.feedback.bad { background: rgba(255,110,110,.15); border: 1px solid var(--bad); color: var(--bad); }
.feedback .right-ans { display: block; margin-top: 6px; color: #ffe9a8; font-weight: 800; }
.feedback .why { display: block; margin-top: 6px; color: #cdf6e2; font-weight: 500; font-size: 14.5px; }
.big-quiz .option {
  font: inherit; font-weight: 700; color: #eafff4; text-align: left;
  background: linear-gradient(135deg, rgba(47,213,143,.22), rgba(23,160,107,.18));
  border: 2px solid rgba(125,255,205,.35); border-radius: 22px; padding: 15px 20px;
  cursor: pointer; transition: .2s; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.big-quiz .option .key {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; font-weight: 900;
  background: linear-gradient(135deg, var(--lime), #17a06b); color: #02271b;
}
.big-quiz .option:nth-child(2) .key { background: linear-gradient(135deg, #7de3ff, #2b9fd6); }
.big-quiz .option:nth-child(3) .key { background: linear-gradient(135deg, #ffd166, #e89b1c); }
.big-quiz .option:nth-child(4) .key { background: linear-gradient(135deg, #c792ea, #8e5bd8); }
.big-quiz .option:hover:not(:disabled) { transform: translateY(-3px) scale(1.02); border-color: var(--lime); box-shadow: 0 10px 24px rgba(47,213,143,.35); }
.big-quiz .option:disabled { cursor: default; opacity: .92; }
.big-quiz .option.correct { background: linear-gradient(135deg, rgba(60,232,155,.5), rgba(23,160,107,.4)); border-color: var(--lime); animation: pop .35s ease; }
.big-quiz .option.wrong { background: linear-gradient(135deg, rgba(255,110,110,.42), rgba(180,50,50,.32)); border-color: var(--bad); }

/* ================= ПРАКТИКА ================= */
.practice-tabs { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  font: inherit; font-weight: 700; color: #d8fff0;
  background: linear-gradient(135deg, rgba(125,227,255,.28), rgba(47,213,143,.22));
  border: 1px solid rgba(125,255,205,.4); border-radius: 999px; padding: 10px 22px;
  cursor: pointer; transition: .2s; backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0,0,0,.22);
}
.tab:hover { background: linear-gradient(135deg, rgba(125,227,255,.5), rgba(47,213,143,.45)); border-color: var(--lime); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(47,213,143,.35); }
.tab.active {
  background: linear-gradient(120deg, #3ce89b, #7de3ff); color: #04281c; border: none;
  box-shadow: 0 8px 22px rgba(47,213,143,.45), inset 0 2px 0 rgba(255,255,255,.45);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: pageIn .35s ease; }

.reaction-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.reaction-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px;
  cursor: pointer; transition: .25s; backdrop-filter: blur(10px);
}
.reaction-card:hover { transform: translateY(-5px); border-color: var(--mint); box-shadow: 0 16px 36px rgba(0,0,0,.35); }
.reaction-card .emoji { font-size: 36px; }
.reaction-card h3 { font-size: 17px; margin: 8px 0 6px; color: #d6ffe9; }
.reaction-card p { font-size: 13.5px; color: var(--muted); line-height: 1.5; }

.reactor-card { margin-top: 20px; }
.stage { background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 18px; margin: 14px 0; overflow: hidden; }
#reactionCanvas { display: block; width: 100%; height: auto; }
.equation { font-size: clamp(16px, 2.6vw, 22px); font-weight: 800; color: var(--lime); text-align: center; margin: 10px 0; letter-spacing: 1px; }
.flask-controls { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.flask-controls label { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
input[type=range] { accent-color: var(--lime); width: 160px; }

/* миксер */
.mixer { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  font: inherit; font-weight: 700; font-size: 14px; color: #eafff6;
  background: linear-gradient(135deg, rgba(47,213,143,.3), rgba(23,160,107,.22));
  border: 1px solid rgba(125,255,205,.45); border-radius: 999px; padding: 8px 14px;
  cursor: pointer; transition: .18s; box-shadow: 0 4px 10px rgba(0,0,0,.2);
}
.chip:hover { transform: translateY(-2px); border-color: var(--lime); background: linear-gradient(135deg, rgba(47,213,143,.5), rgba(23,160,107,.4)); box-shadow: 0 8px 18px rgba(47,213,143,.35); }
.chip.selected {
  background: linear-gradient(120deg, #3ce89b, #a9f45e); color: #04281c; border: none;
  box-shadow: 0 8px 20px rgba(60,232,155,.5), inset 0 2px 0 rgba(255,255,255,.45);
}
.beaker-wrap { background: rgba(0,0,0,.28); border: 1px solid var(--line); border-radius: 18px; padding: 8px; margin-bottom: 14px; }
#mixCanvas { display: block; width: 100%; height: auto; }
.mix-right h3 { color: var(--lime); margin-bottom: 12px; }
.log { background: rgba(0,0,0,.3); border: 1px dashed var(--line); border-radius: 14px; padding: 14px; min-height: 150px; max-height: 260px; overflow-y: auto; font-size: 14.5px; }
.log p { margin-bottom: 8px; line-height: 1.5; color: #cdf6e2; }
.log p strong { color: var(--lime); }
.result-box { margin-top: 14px; padding: 14px 16px; border-radius: 14px; font-weight: 700; }
.result-box.good { background: rgba(60,232,155,.18); border: 1px solid var(--lime); color: var(--lime); }
.result-box.bad { background: rgba(255,140,140,.14); border: 1px solid var(--bad); color: var(--bad); }
.result-box.info { background: rgba(125,227,255,.12); border: 1px solid #7de3ff; color: #7de3ff; }

/* ================= КВИЗ ================= */
.quiz-card { max-width: 720px; margin: 0 auto; }
.quiz-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.quiz-progress { height: 8px; background: rgba(0,0,0,.35); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 18px; }
#quizProgressFill { height: 100%; width: 0%; background: linear-gradient(90deg, #2fd58f, var(--lime)); transition: width .4s ease; }
#quizQuestion { font-size: clamp(18px, 3vw, 24px); color: #d6ffe9; margin-bottom: 16px; line-height: 1.4; }
.quiz-final { text-align: center; }
.quiz-final .trophy { font-size: 70px; animation: bob 3s ease-in-out infinite; display: inline-block; }
.quiz-final h3 { font-size: 26px; color: var(--lime); margin: 12px 0; }
.quiz-final p { color: var(--muted); margin-bottom: 18px; font-size: 16px; line-height: 1.6; }

/* ================= ПОДВАЛ ================= */
.site-footer {
  position: relative; z-index: 2; text-align: center; padding: 22px;
  color: var(--muted); font-size: 14px; border-top: 1px solid var(--line);
  background: rgba(4, 30, 21, .6); backdrop-filter: blur(8px);
}

/* ================= ВСПЛЫВАЮЩИЕ НАГРАДЫ ================= */
.xp-float {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 60;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 800;
  color: #04231a;
  background: linear-gradient(135deg, var(--lime), #7de3ff);
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 6px 22px rgba(60,232,155,.5);
  pointer-events: none;
  animation: xpRise 1.4s ease-out forwards;
}
@keyframes xpRise {
  0%   { transform: translate(-50%, 0) scale(.6); opacity: 0; }
  18%  { transform: translate(-50%, -8px) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -70px) scale(1); opacity: 0; }
}

/* ================= АДАПТИВ ================= */
@media (max-width: 760px) {
  .lab-bg .molecule, .lab-bg .hazmat { display: none; }
  .mixer { grid-template-columns: 1fr; }
  .site-header { gap: 10px; }
  .nav-btn { padding: 8px 13px; font-size: 14px; }
  .progress-wrap { width: 100%; justify-content: flex-end; }
}
