/* ============================================================================
 *  ГеккоЦТ — «Настоящие ТТ»: стили раздела тренировочных тестов
 * ==========================================================================*/

/* ------------------------------- герой ---------------------------------- */
.tt-hero {
  position: relative;
  overflow: hidden;
  padding: 22px 20px 18px;
  border-radius: var(--r-xl);
  background: linear-gradient(150deg, #1d2a5c 0%, #2f3f8f 45%, #4f37a8 100%);
  color: #fff;
  box-shadow: var(--sh-3);
}
.tt-hero__glow {
  position: absolute;
  inset: -40% -20% auto auto;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 102, .55), transparent 65%);
  filter: blur(6px);
  pointer-events: none;
}
.tt-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .16);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tt-hero__title {
  margin-top: 12px;
  font-family: var(--font-num, inherit);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .25);
}
.tt-hero__sub {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, .82);
  max-width: 34em;
}
.tt-hero__stats {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.tt-hero__stat {
  flex: 1;
  padding: 9px 10px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(4px);
  text-align: center;
}
.tt-hero__stat b {
  display: block;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.1;
}
.tt-hero__stat span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, .74);
}

/* ------------------------------ табы ------------------------------------ */
.tt-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0 14px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--bg-2, rgba(0, 0, 0, .04));
}
.tt-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--fg-2);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s, color .18s, box-shadow .18s;
}
.tt-tab__ico { font-size: 15px; opacity: .85; }
.tt-tab.is-active {
  background: var(--surface, #fff);
  color: var(--brand-700, var(--brand));
  box-shadow: var(--sh-1, 0 2px 8px rgba(0, 0, 0, .08));
}

/* ------------------------------ карточка -------------------------------- */
.tt-card {
  position: relative;
  margin-bottom: 14px;
  padding: 18px;
  border-radius: var(--r-xl);
  background: var(--surface, #fff);
  box-shadow: var(--sh-2, 0 6px 20px rgba(0, 0, 0, .07));
  border: 1px solid var(--line);
}
.tt-card::before {
  content: "";
  position: absolute;
  left: 0; top: 18px; bottom: 18px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--brand);
}
.tt-card--math::before { background: var(--math, #6366f1); }
.tt-card--phys::before { background: var(--phys, #0ea5e9); }

.tt-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tt-badge {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  background: var(--brand-100, #eef0ff);
  color: var(--brand-700, var(--brand));
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.tt-badge--gold {
  background: linear-gradient(180deg, #ffe9a8, #ffd166);
  color: #7a5200;
}
.tt-card__time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fg-3);
}
.tt-card__time-ico { font-size: 13px; }

.tt-card__title {
  margin-top: 10px;
  font-size: 19px;
  font-weight: 800;
  color: var(--fg);
}
.tt-card__sub {
  margin-top: 3px;
  font-size: 13px;
  color: var(--fg-2);
}
.tt-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.tt-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-2, #f3f5fa);
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.tt-pill--soft {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--fg-3);
  font-weight: 600;
}
.tt-card__note {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--fg-3);
}
.tt-card__best {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 209, 102, .18), rgba(255, 209, 102, .08));
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fg);
}
.tt-card__best-ico { color: #e0a800; }
.tt-card__best-tries { margin-left: auto; font-weight: 600; color: var(--fg-3); }

/* ------------------------------ правила --------------------------------- */
.tt-rules {
  margin: 6px 0 18px;
  padding: 16px 16px 6px;
  border-radius: var(--r-xl);
  background: var(--surface, #fff);
  border: 1px dashed var(--line-2, #dfe3ee);
}
.tt-rules__title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 10px;
}
.tt-rules__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg-2);
  border-top: 1px solid var(--line);
}
.tt-rules__row:first-of-type { border-top: 0; }
.tt-rules__n {
  flex: 0 0 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--brand-100, #eef0ff);
  color: var(--brand-700, var(--brand));
  font-size: 12px;
  font-weight: 800;
}

/* --------------------- задание с картинкой в плеере --------------------- */
.tt-media {
  margin: 4px 0 14px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(20, 26, 51, .07), inset 0 0 0 1px rgba(20, 26, 51, .06);
}
.tt-media__img {
  display: block;
  width: 100%;
  height: auto;
}
/* номер задания в шапке плеера */
.tt-step-no {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--brand-100, #eef0ff);
  color: var(--brand-700, var(--brand));
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

@media (max-width: 380px) {
  .tt-hero__title { font-size: 23px; }
  .tt-card { padding: 16px; }
}


/* вариант ответа без текста (в ТТ варианты нарисованы в условии) */
.answer__key--solo {
  background: linear-gradient(180deg, #eef1ff, #e3e8ff);
  color: var(--brand-700, var(--brand));
  font-size: 16px;
  font-weight: 800;
}
.answer.is-sel .answer__key--solo {
  background: rgba(255, 255, 255, .28);
  color: #fff;
}
.tt-timer {
  padding: 6px 10px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 800;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------------ просмотр условия на весь экран ----------------- */
.tt-media { cursor: zoom-in; }
.tt-zoom {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: rgba(12, 16, 34, .92);
  backdrop-filter: blur(3px);
  animation: ttzoom .16s ease-out;
}
@keyframes ttzoom { from { opacity: 0; } to { opacity: 1; } }
.tt-zoom__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + var(--safe-top)) 14px 10px;
  color: rgba(255, 255, 255, .78);
  font-size: 12.5px;
}
.tt-zoom__hint { flex: 1; }
.tt-zoom__x {
  width: 34px; height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
.tt-zoom__scroll {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 12px calc(18px + var(--safe-bot));
}
.tt-zoom__img {
  display: block;
  width: 155%;
  max-width: none;
  height: auto;
  border-radius: 10px;
  background: #fff;
}

/* запасной вариант, если картинка не пришла (бывает в WebView Telegram) */
.tt-media.is-broken { background: var(--surface-2, #f4f5fa); }
.tt-media__fallback { padding: 26px 18px; text-align: center; }
.tt-media__fallback-t { font-size: 14px; font-weight: 700; color: var(--fg-2); }
.tt-media__fallback-a { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 800;
  color: var(--brand-700, var(--brand)); text-decoration: underline; }
