/* ============================================================
   css/answers.css — страница «Ответы для учителя»
   ============================================================ */

/* ---------- Task 27: вернуть прокрутку страницы ----------
   base.css ставит body{overflow:hidden} для архитектуры #app
   основной игры. Здесь контент в обычном потоке — без этой
   правки всё ниже первого экрана недостижимо («кнопки
   пропадают», «нет слайдеров»). */
html, body { height: auto; }
body { overflow-x: hidden; overflow-y: auto; }

/* ---------- PIN-замок ---------- */
.ans-gate {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 18px;
  background:
    radial-gradient(900px 500px at 75% -10%, rgba(46, 74, 158, 0.35), transparent 60%),
    radial-gradient(700px 420px at 15% 110%, rgba(226, 54, 54, 0.22), transparent 60%),
    var(--sp-dark);
}
.ans-gate[hidden] { display: none; }
.ans-gate-card {
  width: min(440px, 100%);
  text-align: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 26px 24px;
  backdrop-filter: blur(10px);
  animation: gateIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes gateIn { from { opacity: 0; transform: translateY(18px) scale(0.95); } to { opacity: 1; transform: none; } }
.ans-gate-icon {
  width: 72px; height: 72px; margin: 0 auto 12px;
  display: grid; place-items: center;
  font-size: 2.1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(226, 54, 54, 0.5), rgba(226, 54, 54, 0.14));
  border: 2px solid rgba(226, 54, 54, 0.55);
  box-shadow: 0 0 26px rgba(226, 54, 54, 0.35);
}
.ans-gate-card h1 { font-size: 1.5rem; letter-spacing: 0.02em; }
.ans-gate-sub { color: rgba(255, 255, 255, 0.62); font-size: 0.86rem; margin: 8px 0 18px; line-height: 1.45; }
.ans-gate-form { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.ans-gate-form .field-label { text-align: left; color: rgba(255, 255, 255, 0.7); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; }
.ans-gate-err { min-height: 18px; font-size: 0.82rem; color: #ff8f8f; font-weight: 600; }
.pin-input { text-align: center; letter-spacing: 0.55em; font-size: 1.3rem; font-weight: 800; }
.ans-gate-card .btn-back { margin-top: 4px; justify-content: center; display: inline-flex; }

/* ---------- Каркас ---------- */
.ans-main { max-width: 980px; margin: 0 auto; padding: 18px 16px 40px; }
.ans-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ans-top-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ans-logo {
  width: 52px; height: 52px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 1.5rem;
  border-radius: 16px;
  background: radial-gradient(circle at 32% 28%, rgba(226, 54, 54, 0.45), rgba(226, 54, 54, 0.12));
  border: 1px solid rgba(226, 54, 54, 0.5);
}
.ans-title { font-size: 1.25rem; }
.ans-sub { color: rgba(255, 255, 255, 0.6); font-size: 0.82rem; }
.ans-top-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ans-small { padding: 8px 12px; font-size: 0.82rem; }

/* ---------- Вкладки классов ---------- */
.ans-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ans-tab {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--sp-white);
  border-radius: 12px;
  padding: 9px 14px;
  font: inherit; font-weight: 800; font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.ans-tab:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.1); }
.ans-tab:focus-visible { outline: 2px solid var(--sp-yellow); outline-offset: 2px; }
.ans-tab.on {
  background: linear-gradient(150deg, var(--sp-red), var(--sp-red-dark));
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 6px 18px rgba(226, 54, 54, 0.35);
}
.ans-tab .cnt { opacity: 0.75; font-weight: 600; font-size: 0.8em; margin-left: 4px; }

/* ---------- Исключённые: интро ---------- */
.ans-extra-intro {
  background: linear-gradient(150deg, rgba(255, 197, 49, 0.12), rgba(255, 197, 49, 0.04));
  border: 1px solid rgba(255, 197, 49, 0.35);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  animation: fadeIn 0.4s ease;
}
.ans-extra-intro h2 { font-size: 1.05rem; margin-bottom: 6px; }
.ans-extra-intro p { color: rgba(255, 255, 255, 0.72); font-size: 0.88rem; line-height: 1.5; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Фильтры ---------- */
.ans-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.ans-search {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 10px 14px;
}
.ans-search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  color: var(--sp-white); font: inherit; font-size: 0.95rem;
}
.ans-search input::placeholder { color: rgba(255, 255, 255, 0.4); }
.ans-search:focus-within { border-color: rgba(226, 54, 54, 0.6); box-shadow: 0 0 0 3px rgba(226, 54, 54, 0.15); }
.ans-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ans-chip {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit; font-size: 0.78rem; font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.ans-chip:hover { background: rgba(255, 255, 255, 0.12); }
.ans-chip:focus-visible { outline: 2px solid var(--sp-yellow); outline-offset: 2px; }
.ans-chip.on {
  background: rgba(226, 54, 54, 0.28);
  border-color: rgba(226, 54, 54, 0.55);
  color: #fff;
}
.ans-count { color: rgba(255, 255, 255, 0.55); font-size: 0.82rem; min-height: 18px; }

/* ---------- Карточки задач ---------- */
.ans-list { display: flex; flex-direction: column; gap: 10px; }
.ans-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fadeIn 0.35s ease;
}
.ans-card.champ { border-color: rgba(255, 197, 49, 0.55); box-shadow: 0 0 20px rgba(255, 197, 49, 0.1); }
.ans-card > summary {
  list-style: none;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.ans-card > summary::-webkit-details-marker { display: none; }
.ans-card > summary:hover { background: rgba(255, 255, 255, 0.05); }
.ans-card > summary:focus-visible { outline: 2px solid var(--sp-yellow); outline-offset: -3px; }
.ans-num {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800; font-size: 0.85rem;
}
.ans-card.champ .ans-num { background: rgba(255, 197, 49, 0.2); color: var(--sp-yellow); }
.ans-summain { flex: 1; min-width: 0; }
.ans-qshort {
  font-size: 0.92rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ans-meta { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.ans-tag {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.75);
}
.ans-tag.t-lvl { background: rgba(46, 74, 158, 0.4); color: #cfe0ff; }
.ans-tag.t-type { background: rgba(255, 255, 255, 0.07); }
.ans-tag.t-champ { background: rgba(255, 197, 49, 0.2); color: var(--sp-yellow); }
.ans-tag.t-src { background: transparent; color: rgba(255, 255, 255, 0.45); font-weight: 600; }
.ans-caret { flex: 0 0 auto; color: rgba(255, 255, 255, 0.45); transition: transform 0.2s ease; }
.ans-card[open] .ans-caret { transform: rotate(180deg); }

.ans-body { padding: 0 16px 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.ans-qfull { padding: 12px 0 4px; font-size: 0.95rem; line-height: 1.55; color: rgba(255, 255, 255, 0.92); }

.ans-answer {
  margin-top: 10px;
  display: flex; gap: 10px; align-items: flex-start;
  background: linear-gradient(150deg, rgba(47, 168, 79, 0.16), rgba(47, 168, 79, 0.05));
  border: 1px solid rgba(47, 168, 79, 0.4);
  border-radius: 12px;
  padding: 10px 14px;
}
.ans-answer .aa-ico { font-size: 1.1rem; flex: 0 0 auto; }
.ans-answer .aa-label {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em;
  color: rgba(178, 240, 195, 0.75);
  margin-bottom: 2px;
}
.ans-answer .aa-text { font-size: 0.98rem; font-weight: 700; color: #c9f5d4; line-height: 1.45; overflow-wrap: anywhere; }

.ans-hints { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ans-hint {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(255, 197, 49, 0.07);
  border: 1px dashed rgba(255, 197, 49, 0.35);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.86rem; line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
}
.ans-hint .ah-ico { flex: 0 0 auto; }
.ans-analysis { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ans-analysis li { margin-left: 18px; font-size: 0.9rem; line-height: 1.5; color: rgba(255, 255, 255, 0.88); }
.ans-status {
  margin-top: 10px;
  display: inline-block;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.05em;
  padding: 4px 12px; border-radius: 999px;
}
.ans-status.s-img { background: rgba(46, 74, 158, 0.35); color: #cfe0ff; }
.ans-status.s-amb { background: rgba(255, 197, 49, 0.18); color: #ffe9b3; }
.ans-status.s-bad { background: rgba(214, 69, 69, 0.2); color: #ffc4c4; }
.ans-status.s-proof { background: rgba(47, 168, 79, 0.18); color: #c9f5d4; }

.ans-magic {
  margin-top: 10px;
  display: inline-grid;
  grid-template-columns: repeat(3, 46px);
  gap: 5px;
  padding: 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
}
.ans-magic span {
  aspect-ratio: 1; display: grid; place-items: center;
  border-radius: 8px;
  background: rgba(47, 168, 79, 0.14);
  border: 1px solid rgba(47, 168, 79, 0.3);
  font-weight: 800; font-size: 0.95rem; color: #c9f5d4;
}
.ans-magic span.given { background: rgba(226, 54, 54, 0.2); border-color: rgba(226, 54, 54, 0.4); color: #ffd0d0; }

.ans-empty {
  text-align: center; padding: 40px 16px;
  color: rgba(255, 255, 255, 0.5); font-size: 0.95rem;
}

.ans-footer { margin-top: 26px; text-align: center; }
.ans-footer p { color: rgba(255, 255, 255, 0.4); font-size: 0.78rem; line-height: 1.5; }

/* ---------- Мобилка ---------- */
@media (max-width: 640px) {
  .ans-main { padding: 12px 10px 32px; }
  .ans-top { margin-bottom: 10px; }
  .ans-title { font-size: 1.05rem; }
  .ans-qshort { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .ans-tab { padding: 8px 11px; font-size: 0.84rem; }
  .ans-answer .aa-text { font-size: 0.92rem; }
}

/* ---------- Печать ---------- */
@media print {
  body { background: #fff; color: #111; }
  .web-decor, .ans-gate, .ans-top-r, .ans-filters, .ans-footer, .ans-caret { display: none !important; }
  .ans-main { max-width: 100%; padding: 0; }
  .ans-card { break-inside: avoid; border: 1px solid #bbb; background: #fff; box-shadow: none; }
  .ans-card.champ { border-color: #d8a600; box-shadow: none; }
  .ans-qshort { color: #111; }
  .ans-answer { background: #f0f9f2; border-color: #7bc893; }
  .ans-answer .aa-text { color: #14682e; }
  .ans-tag { background: #eee; color: #333; }
  .ans-hint { background: #fffbea; border-color: #e0c860; color: #333; }
  .ans-qfull, .ans-analysis li { color: #222; }
  .ans-sub, .ans-count { color: #555; }
}
