/* ================= Лаборатория ================= */
.subtabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-bottom: 12px; }
.subtabs button {
  padding: 7px 2px; border-radius: 12px; font-size: 11.5px; font-weight: 900;
  border: 3px solid var(--out); background: linear-gradient(180deg, #3a3396, #282370); box-shadow: 0 3px 0 var(--out);
}
.subtabs button.active { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 50%, var(--gold-lo)); color: var(--out); transform: translateY(2px); box-shadow: 0 1px 0 var(--out); }
.btn-buyall.small { width: auto; margin: 0; padding: 7px 12px; font-size: 13px; white-space: nowrap; }
.btn-buyall.blue { background: linear-gradient(180deg, #a8dcff, #5aa8ff 45%, #2f6ed8); box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 4px 0 #173a80, 0 5px 0 var(--out); }
.lab-note { font-size: 12.5px; color: var(--muted); margin: 0 2px 10px; line-height: 1.4; }
.lab-card { display: flex; gap: 11px; align-items: center; padding: 9px 12px; margin-bottom: 10px; }
.lab-card > img { width: 48px; height: 48px; padding: 3px; flex-shrink: 0; }
.lab-card.done { background: linear-gradient(180deg, #3aa85a, #2a8a48 30%, #237a3e); }
.lab-body { flex: 1; min-width: 0; }
.lab-name { font-size: 14.5px; font-weight: 900; }
.lab-desc { font-size: 12px; color: var(--muted); }
.lab-card.done .lab-desc { color: #e8ffe8; }
.lab-time { font-size: 12px; color: var(--gold); font-weight: 800; }
.lab-ok { font-size: 24px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 var(--out); }
.lab-card .progress { height: 12px; margin: 5px 0 3px; }
.toggle-sw { width: 54px; height: 30px; padding: 0; border-radius: 15px; border: 3px solid var(--out); background: #120e33; position: relative; flex-shrink: 0; }
.toggle-sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); border: 2px solid var(--out); transition: .2s; }
.toggle-sw.on { background: #3cc860; }
.toggle-sw.on::after { left: 26px; background: #fff; }

/* алхимия */
.alch-mixer { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 6px; border-radius: var(--radius); border: 3px solid var(--out);
  background: radial-gradient(ellipse at center, #4a3ab0, #2a2272 70%); box-shadow: inset 0 2px 0 rgba(255,255,255,.14), var(--shadow); }
.alch-slot { width: 84px; height: 92px; display: grid; place-items: center; cursor: pointer; }
.alch-slot.res { cursor: default; }
.alch-op { font-size: 26px; font-weight: 900; color: var(--gold); text-shadow: 0 2px 0 var(--out); }
.slot-empty { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 900; color: var(--muted);
  border: 3px dashed rgba(179,169,230,.5); background: rgba(0,0,0,.2); }
.slot-empty.fail { color: var(--bad); border-color: var(--bad); animation: shake .3s; }
.alch-msg { text-align: center; font-size: 13.5px; font-weight: 800; margin: 9px 0; min-height: 18px; }
.alch-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.alch-btns .btn-buyall { margin-bottom: 8px; font-size: 14px; }
.alch-info { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 10px; }
.alch-info b { color: var(--gold); }
.alch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.el { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; border: 0; background: none; transition: transform .1s; }
.el:hover { transform: translateY(-3px) scale(1.05); }
.el-ico {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 28px;
  background: radial-gradient(circle at 38% 30%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 60%, #000));
  border: 3px solid var(--out); box-shadow: inset 0 3px 0 rgba(255,255,255,.35), 0 3px 0 #0a0720;
}
.el-name { font-size: 11px; font-weight: 900; line-height: 1.1; text-align: center; }
.el-star { position: absolute; top: 0; right: 8px; font-style: normal; font-size: 13px; color: var(--gold); text-shadow: 0 1px 0 var(--out), 1px 0 0 var(--out), -1px 0 0 var(--out); }
.el.sel .el-ico { box-shadow: 0 0 0 4px var(--gold), 0 3px 0 #0a0720; }
.el.hint .el-ico { animation: hintPulse 0.8s ease-in-out infinite; }
@keyframes hintPulse { 50% { box-shadow: 0 0 0 6px #7dfcff, 0 3px 0 #0a0720; transform: scale(1.08); } }
.el.new .el-ico { animation: newEl .6s cubic-bezier(.2,1.6,.4,1); box-shadow: 0 0 0 4px var(--good), 0 0 22px var(--gold); }
@keyframes newEl { from { transform: scale(.2) rotate(-90deg); } }
.el.in-slot:hover { transform: none; }

/* наборы артефактов */
.sets { display: flex; flex-wrap: wrap; gap: 6px; }
.set { padding: 4px 10px; border-radius: 10px; font-size: 12px; background: #1d1858; border: 2px solid var(--out); color: var(--muted); }
.set.on { background: linear-gradient(180deg, #4a3ab0, #3a2d8a); color: var(--text); }
.set.gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: var(--out); }
.sets-total { margin-top: 8px; font-size: 13px; color: var(--good); font-weight: 800; }

/* события, торговля */
.boost.event { background: linear-gradient(180deg, #a8dcff, #5aa8ff 55%, #2f6ed8); color: var(--out); }
.trades { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.trade { padding: 11px 12px; border-radius: 14px; font-size: 14px; font-weight: 800; text-align: left; border: 3px solid var(--out);
  background: linear-gradient(180deg, #3a3396, #282370); box-shadow: 0 4px 0 var(--out); }
.trade:hover:not(:disabled) { filter: brightness(1.2); }
.trade:disabled { opacity: .4; }
.trade b { color: var(--gold); }

/* обучение */
#tut {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 4; width: min(420px, calc(100% - 28px));
  padding: 10px 14px; border-radius: var(--radius); border: 3px solid var(--out); text-align: center;
  background: linear-gradient(180deg, #5aa8ff, #2f6ed8); box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 4px 0 var(--out);
  animation: pop .35s cubic-bezier(.2,1.6,.4,1);
}
.tut-step { font-size: 11px; font-weight: 900; letter-spacing: 1px; color: #e8f4ff; }
.tut-text { font-size: 14.5px; font-weight: 900; margin: 3px 0 6px; }
#tut-skip { border: 0; background: none; font-size: 11.5px; font-weight: 800; color: #d8ecff; text-decoration: underline; }
.tut-glow { animation: tutGlow 1s ease-in-out infinite !important; position: relative; z-index: 3; }
@keyframes tutGlow { 50% { box-shadow: 0 0 0 4px #7dfcff, 0 0 24px #7dfcff; } }

.subtabs button { position: relative; }
.subtabs .badge { top: -9px; right: -6px; }

/* переключатели: кружок ровно внутри рамки */
.toggle-sw::after, #modal .toggle::after { box-sizing: border-box; width: 22px; height: 22px; top: 1px; left: 1px; }
.toggle-sw.on::after, #modal .toggle.on::after { left: calc(100% - 23px); }

/* подсказка алхимии: недоступная кнопка и плашка с подсказанной парой */
#alch-hint.cant { filter: grayscale(.6) brightness(.8); }
.alch-hint-box {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; padding: 9px 12px;
  border-radius: 14px; border: 3px solid var(--out); background: linear-gradient(180deg, #2a5aa8, #1d3f80);
  box-shadow: 0 0 0 2px #7dfcff inset, 0 3px 0 #0a0720; font-weight: 800; animation: pop .3s;
}
.alch-hint-box b { color: #fff3a0; }
.alch-hint-box button {
  margin-left: auto; padding: 4px 12px; border-radius: 10px; border: 3px solid var(--out); font-weight: 900; color: var(--out);
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); box-shadow: 0 2px 0 var(--out);
}

/* категории алхимии: ровная сетка 3×3 с прогрессом */
.alch-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 6px; }
.acat {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 6px; row-gap: 5px;
  padding: 7px 7px 8px; border-radius: 14px; border: 2.5px solid var(--out); color: #fff; text-align: left; min-width: 0; column-gap: 5px;
  background: linear-gradient(180deg, #3a3396, #282370); box-shadow: inset 0 2px 0 rgba(255,255,255,.15), 0 3px 0 var(--out);
}
.acat:hover { filter: brightness(1.12); }
.acat i { font-style: normal; font-size: 14px; line-height: 1; }
.acat span { grid-column: 2 / 4; font-weight: 900; font-size: 11.5px; white-space: nowrap; letter-spacing: -.1px; }
.acat small { grid-row: 2; grid-column: 3; font-weight: 800; font-size: 10.5px; color: var(--muted); line-height: 1; }
.acat-bar { grid-row: 2; grid-column: 1 / 3; display: block; height: 5px; border-radius: 3px; background: rgba(0,0,0,.35); overflow: hidden; }
.acat-bar em { display: block; height: 100%; background: linear-gradient(90deg, #7dfcff, #7ee06a); border-radius: 3px; }
.acat.on { color: var(--out); background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); }
.acat.on small { color: rgba(26,16,51,.7); }
.acat.on .acat-bar { background: rgba(26,16,51,.25); }
.acat.on .acat-bar em { background: var(--out); }
.acat-title { font-family: 'Rubik', sans-serif; font-weight: 800; color: var(--gold); margin: 14px 2px 4px; font-size: 15px; }
