/* ============================================================================
 *  ФормулаЦТ — презентации: список колод и полноэкранный просмотр
 * ==========================================================================*/
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.deck-card {
  position: relative; text-align: left; border: 1px solid var(--line);
  background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px 16px;
  box-shadow: var(--sh-1); transition: transform var(--t-fast), box-shadow var(--t-fast);
  overflow: hidden; color: var(--fg); font: inherit; cursor: pointer;
}
.deck-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.deck-card::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 4px;
  background: var(--deck, var(--brand)); opacity: .9;
}
.deck-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.deck-card__ico { font-size: 26px; line-height: 1; }
.deck-card__count { font-size: 11px; font-weight: 800; color: var(--fg-3); text-transform: uppercase; letter-spacing: .4px; }
.deck-card__title { font-size: 17px; font-weight: 900; line-height: 1.25; margin-bottom: 4px; }
.deck-card__sub { font-size: 12.5px; color: var(--fg-3); margin-bottom: 12px; }
.deck-card__bar { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.deck-card__bar i { display: block; height: 100%; border-radius: 99px; background: var(--deck, var(--brand)); }

/* ------------------------------- ПРОСМОТР -------------------------------- */
.deck {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: calc(10px + var(--safe-top)) 14px calc(16px + var(--safe-bot));
  background:
    radial-gradient(900px 500px at 12% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 60%),
    radial-gradient(700px 420px at 100% 0%, color-mix(in srgb, var(--math) 14%, transparent), transparent 60%),
    var(--bg);
  touch-action: pan-y;
}
.deck__head { display: flex; align-items: center; gap: 10px; max-width: 860px; width: 100%; margin: 0 auto 10px; }
.deck__close {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg-2); display: grid; place-items: center;
  box-shadow: var(--sh-1); flex: 0 0 auto;
}
.deck__close svg { width: 18px; height: 18px; }
.deck__brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.deck__brand-ico {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 20px; flex: 0 0 auto;
}
.deck__brand-t { font-size: 13.5px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck__brand-s { font-size: 11px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck__counter { font-size: 12px; font-weight: 800; color: var(--fg-3); font-variant-numeric: tabular-nums; }

.deck__progress { width: 100%; max-width: 860px; margin: 0 auto 14px; height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.deck__progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--math))); border-radius: 99px; transition: width .3s cubic-bezier(.34,1.56,.64,1); }

.deck__stage { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; display: flex; align-items: stretch; }
.slide {
  width: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--sh-3); padding: clamp(22px, 5vw, 48px);
  display: flex; flex-direction: column; justify-content: center; overflow-y: auto;
  position: relative;
}
.deck__stage.is-anim .slide { animation: deckIn .34s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes deckIn {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.slide__kicker {
  font-size: 11.5px; font-weight: 900; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--brand-600); margin-bottom: 10px;
}
.slide__h1 { font-size: clamp(30px, 6.4vw, 54px); line-height: 1.02; font-weight: 900; letter-spacing: -.02em; margin: 0 0 12px; }
.slide__h2 { font-size: clamp(22px, 3.8vw, 34px); line-height: 1.12; font-weight: 900; letter-spacing: -.015em; margin: 0 0 14px; }
.slide__lead { font-size: clamp(15px, 2.2vw, 18px); color: var(--fg-2); line-height: 1.55; }
.slide__hint { margin-top: 22px; font-size: 12px; color: var(--fg-3); }
.slide__hero { font-size: clamp(48px, 12vw, 84px); line-height: 1; margin-bottom: 14px; }
.slide--title { background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 10%, var(--surface)) 0%, var(--surface) 70%); }
.slide--formula { background: linear-gradient(160deg, color-mix(in srgb, var(--math) 9%, var(--surface)) 0%, var(--surface) 72%); }
.slide--quiz { background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 10%, var(--surface)) 0%, var(--surface) 72%); }
.slide--summary { background: linear-gradient(160deg, color-mix(in srgb, var(--ok) 9%, var(--surface)) 0%, var(--surface) 72%); }

.slide__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.slide__list li {
  position: relative; padding-left: 34px; font-size: clamp(15px, 2.1vw, 18px); line-height: 1.5; color: var(--fg-2);
  opacity: .18; transform: translateY(6px); transition: opacity .3s, transform .3s;
}
.slide__list li.is-in { opacity: 1; transform: none; }
.slide__list li::before {
  content: ''; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234cad02' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/12px no-repeat;
}

.slide__formula {
  font-size: clamp(22px, 4.4vw, 40px); font-weight: 800; line-height: 1.3;
  padding: 20px 22px; border-radius: var(--r-lg); background: var(--surface-2);
  border: 1px dashed var(--line-2); color: var(--fg); overflow-x: auto;
}
.slide__note { margin-top: 16px; font-size: 15px; color: var(--fg-2); line-height: 1.55; }
.slide__note-box {
  margin-top: 6px; padding: 18px 20px 18px 52px; border-radius: var(--r-lg); position: relative;
  background: var(--ok-soft); color: var(--fg); font-size: clamp(15px, 2.2vw, 18px); line-height: 1.5;
}
.slide__note-box::before {
  content: '💡'; position: absolute; left: 16px; top: 16px; font-size: 20px;
}
.slide__note-box.is-warn { background: #fff4cc; }
html[data-theme="dark"] .slide__note-box { background: #22350f; }
html[data-theme="dark"] .slide__note-box.is-warn { background: #3d330d; }

.slide__steps { display: grid; gap: 12px; margin-top: 4px; }
.slide__step {
  display: flex; gap: 14px; align-items: flex-start; font-size: clamp(15px, 2.1vw, 18px); line-height: 1.5;
  color: var(--fg-2); opacity: .18; transform: translateY(6px); transition: opacity .3s, transform .3s;
}
.slide__step.is-in { opacity: 1; transform: none; }
.slide__step-n {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 900;
}

.slide__opts { display: grid; gap: 10px; }
.slide__opt {
  display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; cursor: pointer;
  border: 2px solid var(--line); border-radius: var(--r); background: var(--surface);
  padding: 13px 15px; color: var(--fg); font-size: 15.5px; font-weight: 700;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.slide__opt:hover:not(:disabled) { border-color: var(--brand-300); transform: translateY(-1px); }
.slide__opt-n {
  width: 24px; height: 24px; border-radius: 8px; background: var(--surface-2); color: var(--fg-3);
  display: grid; place-items: center; font-size: 12px; font-weight: 900; flex: 0 0 auto;
}
.slide__opt.is-ok { border-color: var(--ok); background: var(--ok-soft); }
.slide__opt.is-ok .slide__opt-n { background: var(--ok); color: #fff; }
.slide__opt.is-bad { border-color: var(--err); background: var(--err-soft); }
.slide__opt.is-bad .slide__opt-n { background: var(--err); color: #fff; }
.slide__fb {
  margin-top: 14px; padding: 13px 15px; border-radius: var(--r); background: var(--surface-2);
  font-size: 14px; line-height: 1.5; color: var(--fg-2); display: none;
}
.slide__fb.is-open { display: block; animation: deckIn .25s ease both; }

.deck__foot { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 860px; margin: 14px auto 0; }
.deck__rail { flex: 1; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.deck__dot {
  width: 8px; height: 8px; border-radius: 99px; border: 0; padding: 0; background: var(--line-2);
  transition: width var(--t), background var(--t); cursor: pointer;
}
.deck__dot.is-on { width: 24px; background: var(--brand); }
.deck__nav {
  flex: 0 0 auto; height: 46px; min-width: 46px; padding: 0 18px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg-2);
  display: grid; place-items: center; font: inherit; font-weight: 800; font-size: 14px;
  box-shadow: var(--sh-1); cursor: pointer;
}
.deck__nav svg { width: 18px; height: 18px; }
.deck__nav:disabled { opacity: .35; cursor: default; }
.deck__nav--next { background: var(--brand); border-color: var(--brand-700); color: #fff; box-shadow: var(--sh-brand); }

@media (max-width: 560px) {
  .deck { padding-left: 10px; padding-right: 10px; }
  .slide { border-radius: 22px; }
  .deck__brand-s { display: none; }
  .deck__nav { min-width: 44px; height: 44px; padding: 0 14px; }
  .deck__foot { gap: 8px; }
}
.slide__emblem {
  position: absolute; top: 16px; right: 18px; font-size: 28px; line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(15,23,42,.12)); opacity: .9;
  animation: deckEmblem 4.6s ease-in-out infinite;
}
@keyframes deckEmblem { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-3px) rotate(4deg); } }
@media (max-width: 560px) { .slide__emblem { font-size: 22px; top: 12px; right: 14px; } }
