/* test/test.css — страница вступительного теста (выбор предмета) */
.test-page { background: #f3f7f4 !important; }
.tp-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 16px 64px; }

.tp-hero {
  position: relative; overflow: hidden; text-align: center;
  background: linear-gradient(135deg, #0f2518 0%, #17432a 100%); color: #fff;
  border-radius: 24px; padding: 40px 24px 32px; margin-bottom: 28px;
  box-shadow: 0 18px 40px rgba(15,37,24,.18);
}
.tp-hero::before, .tp-hero::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(93,214,124,.30), transparent 70%);
}
.tp-hero::before { width: 320px; height: 320px; right: -110px; top: -140px; }
.tp-hero::after  { width: 260px; height: 260px; left: -120px; bottom: -150px; }
.tp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; position: relative; z-index: 1;
  padding: 6px 14px; border-radius: 999px; font-size: .8rem; font-weight: 700; letter-spacing: .02em;
  background: rgba(93,214,124,.15); color: #8ee6a6; border: 1px solid rgba(93,214,124,.25);
}
.tp-hero h1 { position: relative; z-index: 1; font-size: clamp(1.6rem, 4.5vw, 2.5rem); line-height: 1.15; font-weight: 800; margin: 14px 0 10px; letter-spacing: -.02em; }
.tp-hero p  { position: relative; z-index: 1; max-width: 620px; margin: 0 auto; color: #b9d3c1; font-size: 1.02rem; line-height: 1.6; }
.tp-steps { position: relative; z-index: 1; list-style: none; padding: 0; margin: 22px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.tp-steps li { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; color: #dcebe1; }
.tp-steps li span { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800; background: #2fbf57; color: #fff; }

.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tp-card {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px 16px; padding: 20px; text-decoration: none; color: inherit;
  background: #fff; border: 1.5px solid #e1e9e3; border-radius: 18px;
  box-shadow: 0 2px 6px rgba(16,40,24,.04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  animation: tpIn .45s cubic-bezier(.22,1,.36,1) both;
}
.tp-card:hover { transform: translateY(-3px); border-color: #2fbf57; box-shadow: 0 14px 30px rgba(31,154,69,.14); }
.tp-card:active { transform: translateY(-1px); }
@keyframes tpIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.tp-ico { width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #1f9a45; border: 1px solid rgba(0,0,0,.04); }
.tp-ico .fi { width: 32px !important; height: 24px !important; border-radius: 5px; background-size: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.12); }
.tp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tp-name { font-size: 1.08rem; font-weight: 800; color: #15241b; line-height: 1.25; }
.tp-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: #6f8176; }
.tp-meta span { white-space: nowrap; }
.tp-meta i { margin-right: 5px; color: #1f9a45; }
.tp-go {
  grid-column: 1 / -1; justify-content: center; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 12px; font-size: .88rem; font-weight: 700;
  background: #e6f5ea; color: #17692e; transition: background .18s, color .18s;
}
.tp-card:hover .tp-go { background: #1f9a45; color: #fff; }
.tp-go i { transition: transform .18s; }
.tp-card:hover .tp-go i { transform: translateX(3px); }
.tp-empty { text-align: center; color: #6f8176; padding: 40px 0; }

@media (max-width: 520px) {
  .tp-wrap { padding: 16px 12px 48px; }
  .tp-hero { padding: 30px 18px 24px; border-radius: 20px; }
  .tp-grid { grid-template-columns: 1fr; gap: 10px; }
  .tp-card { grid-template-columns: auto 1fr auto; padding: 14px; gap: 12px; }
  .tp-ico { width: 48px; height: 48px; border-radius: 14px; }
  .tp-go { grid-column: auto; padding: 0; width: 38px; height: 38px; border-radius: 50%; }
  .tp-go-txt { display: none; }
  /* результат: три плашки не вылезают за экран */
  .tp-stats { gap: 8px !important; }
  .tp-stats > div { padding: 14px 6px !important; }
  .tp-stats > div p:first-child { font-size: 1.9rem !important; }
  .tp-stats > div p:last-child { font-size: .68rem !important; letter-spacing: 0 !important; overflow-wrap: anywhere; }
}

/* ── Выбор сложности (модальное окно) ─────────────────────────────── */
.tp-legend-hint { text-align: center; color: #8a6d1f; font-size: .9rem; font-weight: 600; margin: 22px auto 0; max-width: 560px; }
.tp-legend-hint i { color: #d4a017; margin-right: 6px; }
.tp-modal { position: fixed; inset: 0; z-index: 80; background: rgba(8,20,12,.55); display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity .2s; }
.tp-modal.open { opacity: 1; }
.tp-modal[hidden] { display: none; }
.tp-sheet { position: relative; width: 100%; max-width: 480px; background: #fff; border-radius: 24px; padding: 26px 22px 22px; box-shadow: 0 30px 60px rgba(0,0,0,.25); transform: translateY(14px) scale(.98); transition: transform .25s cubic-bezier(.22,1,.36,1); }
.tp-modal.open .tp-sheet { transform: none; }
.tp-sheet h2 { font-size: 1.35rem; font-weight: 800; color: #15241b; margin: 2px 0 16px; }
.tp-sheet-sub { font-size: .85rem; font-weight: 700; color: #1f9a45; text-transform: uppercase; letter-spacing: .06em; }
.tp-x { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #f1f5f2; color: #334539; cursor: pointer; font-size: 1rem; }
.tp-tiers { display: flex; flex-direction: column; gap: 10px; }
.tp-tier { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; border: 1.5px solid #e1e9e3; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s, box-shadow .15s; }
.tp-tier:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(16,40,24,.08); }
.tp-tier-ico { width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.tp-tier-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tp-tier-name { font-weight: 800; font-size: 1.02rem; color: #15241b; }
.tp-tier-name small { font-weight: 700; font-size: .75rem; color: #6f8176; margin-left: 4px; }
.tp-tier-desc { font-size: .84rem; color: #6f8176; }
.tp-tier-n { font-size: .78rem; font-weight: 700; color: #6f8176; white-space: nowrap; }
.tp-tier-beginner .tp-tier-ico { background: #e6f5ea; color: #1f9a45; }
.tp-tier-beginner:hover { border-color: #2fbf57; }
.tp-tier-intermediate .tp-tier-ico { background: #fff1e0; color: #e07b00; }
.tp-tier-intermediate:hover { border-color: #f5a524; }
.tp-tier-expert .tp-tier-ico { background: linear-gradient(135deg, #fff4cc, #ffe08a); color: #a86b00; }
.tp-tier-expert:hover { border-color: #e0b100; box-shadow: 0 10px 26px rgba(224,177,0,.25); }
.tp-tier.is-off { opacity: .45; pointer-events: auto; cursor: not-allowed; }
.tp-tier.is-off:hover { transform: none; box-shadow: none; border-color: #e1e9e3; }
@media (max-width: 520px) {
  .tp-modal { align-items: flex-end; padding: 0; }
  .tp-sheet { border-radius: 24px 24px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateY(40px); }
}

/* чип сложности */
.tp-tier-chip { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; vertical-align: middle; }
.tp-tier-chip.tp-tier-beginner { background: #e6f5ea; color: #17692e; }
.tp-tier-chip.tp-tier-intermediate { background: #fff1e0; color: #b35f00; }
.tp-tier-chip.tp-tier-expert { background: linear-gradient(135deg, #fff4cc, #ffe08a); color: #8a5a00; }

/* ── Страница результата ─────────────────────────────────────────── */
.rs-card { position: relative; background: #fff; border: 1px solid #e1e9e3; border-radius: 26px; padding: 30px 22px 24px; text-align: center; box-shadow: 0 16px 40px rgba(16,40,24,.08); overflow: hidden; }
.rs-card.is-legend { border: 2px solid #e0b100; box-shadow: 0 0 0 4px rgba(255,214,90,.25), 0 20px 50px rgba(224,177,0,.25); }
.rs-card.is-legend::before { content: ''; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent 0 70%, rgba(255,215,90,.35) 80%, transparent 90%); animation: rsSpin 6s linear infinite; pointer-events: none; }
@keyframes rsSpin { to { transform: rotate(360deg); } }
.rs-card > * { position: relative; }
.rs-legend { display: inline-flex; gap: 8px; align-items: center; background: linear-gradient(135deg, #fff4cc, #ffe08a); color: #7a4f00; font-weight: 800; padding: 8px 14px; border-radius: 14px; margin-bottom: 14px; font-size: .92rem; }
.rs-sub { font-size: 1.05rem; color: #4d5f53; margin: 0 0 18px; }
.rs-sub b { color: #1f9a45; }
.rs-ring { --p: 0; width: 200px; height: 200px; margin: 0 auto 20px; border-radius: 50%; background: conic-gradient(#2fbf57 calc(var(--p) * 1%), #fde2e2 0); display: flex; align-items: center; justify-content: center; }
.rs-card.is-legend .rs-ring { background: conic-gradient(#e0b100 calc(var(--p) * 1%), #fff4cc 0); }
.rs-ring-in { width: 164px; height: 164px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rs-level { font-size: 3.2rem; font-weight: 900; color: #1f9a45; line-height: 1; }
.rs-card.is-legend .rs-level { color: #b7791f; }
.rs-pct { font-size: 1rem; color: #6f8176; margin-top: 6px; font-weight: 700; }
.rs-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 460px; margin: 0 auto 16px; }
.rs-stats div { border-radius: 16px; padding: 12px 6px; }
.rs-stats b { display: block; font-size: 1.8rem; font-weight: 900; line-height: 1.1; }
.rs-stats span { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #6f8176; }
.rs-stats .ok { background: #e9f8ee; } .rs-stats .ok b { color: #1f9a45; }
.rs-stats .bad { background: #fdecec; } .rs-stats .bad b { color: #d0342c; }
.rs-stats .all { background: #eef3fd; } .rs-stats .all b { color: #2f64c8; }
.rs-name { color: #4d5f53; margin: 0 0 18px; }
.rs-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.rs-btn { flex: 1 1 180px; max-width: 260px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 18px; border-radius: 16px; border: 0; font: 800 1rem inherit; font-family: inherit; cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.rs-btn:hover { transform: translateY(-2px); }
.rs-share { background: linear-gradient(135deg, #2fbf57, #1f9a45); color: #fff; box-shadow: 0 10px 24px rgba(31,154,69,.3); }
.rs-pdf { background: #15241b; color: #fff; }
.rs-more { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; font-size: .85rem; color: #6f8176; }
.rs-more.pulse { animation: jdPick 1.6s ease-out; border-radius: 16px; }
.rs-app { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #fff; border: 0; cursor: pointer; text-decoration: none; transition: transform .15s; }
.rs-app:hover { transform: scale(1.08); }
.rs-app.wa { background: #25d366; } .rs-app.tg { background: #27a7e7; } .rs-app.sms { background: #6f8176; }
.rs-app.ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.rs-app.cp { background: #e6f5ea; color: #17692e; }
.rs-text { white-space: pre-wrap; text-align: left; font: .88rem/1.55 inherit; font-family: inherit; color: #3e5246; background: #f5f8f6; border: 1px dashed #cfe0d4; border-radius: 14px; padding: 12px 14px; margin: 16px 0 0; }
.rs-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #15241b; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: .92rem; z-index: 90; max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.rs-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.rs-link { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 14px; background: #fff; border: 1px solid #e1e9e3; color: #334539; font-weight: 700; text-decoration: none; font-size: .92rem; }
.rs-link.primary { background: #fff4cc; border-color: #f0d36b; color: #7a4f00; }
@media (max-width: 520px) {
  .rs-more > span { flex-basis: 100%; text-align: center; }
  .rs-card { padding: 22px 14px 18px; border-radius: 22px; }
  .rs-ring { width: 170px; height: 170px; } .rs-ring-in { width: 138px; height: 138px; } .rs-level { font-size: 2.6rem; }
  .rs-stats b { font-size: 1.4rem; } .rs-stats span { font-size: .62rem; }
  .rs-btn { max-width: none; }
}
@keyframes jdPick { 0%, 40% { box-shadow: 0 0 0 6px rgba(47,191,87,.35); } 100% { box-shadow: 0 0 0 0 rgba(47,191,87,0); } }

/* Приглашение от друга (?r=...) */
.tp-invite { display: flex; align-items: center; gap: 14px; background: #fff; border: 1.5px solid #cfe9d7; border-radius: 18px; padding: 14px 16px; margin: -8px 0 22px; box-shadow: 0 8px 22px rgba(16,40,24,.06); }
.tp-invite.is-legend { border-color: #e8c547; background: linear-gradient(100deg, #fffbea, #fff); }
.tp-inv-badge { flex-shrink: 0; min-width: 56px; height: 56px; padding: 0 8px; border-radius: 16px; background: linear-gradient(135deg, #2fbf57, #1f9a45); color: #fff; font-weight: 900; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; }
.tp-invite.is-legend .tp-inv-badge { background: linear-gradient(135deg, #ffd65a, #d49a00); }
.tp-inv-txt { color: #3e5246; font-size: .98rem; line-height: 1.45; }
.tp-inv-txt b { color: #15241b; }
