/* Развилка ролей и иллюстрации сайта 5–8.
   Дополняет styles.css и views.css, переменные берутся оттуда. */

/* ---------- окно выбора роли ---------- */
.rolegate[hidden] { display: none; }
.rolegate {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: 24px 16px;
  background: rgba(5, 8, 16, 0.88);
  backdrop-filter: blur(10px);
  overflow-y: auto;
}
body.gate-open { overflow: hidden; }

.rolegate-box { width: min(1060px, 100%); text-align: center; }
.rolegate-box .eyebrow { justify-content: center; }
.rolegate h2 {
  font-size: clamp(1.6rem, 4vw, 2.6rem); line-height: 1.12;
  margin: 10px 0 8px; color: var(--white);
}
/* text-wrap: balance не даёт последней строке оставаться с одним словом,
   52ch держит удобную длину строки — на телефоне перенос после первого предложения */
.rolegate-sub { color: var(--muted); margin: 0 auto 28px; max-width: 52ch; text-wrap: balance; }
.rolegate h2 { text-wrap: balance; }
@media (max-width: 560px) { .rolegate-sub br { display: none; } }

.rolecards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.rolecard {
  position: relative; display: block; width: 100%;
  border: 1px solid var(--line); border-radius: 24px;
  background: var(--panel-strong); color: var(--white);
  padding: 0 0 22px; overflow: hidden; cursor: pointer; text-align: left;
  font: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.rolecard:hover, .rolecard:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(255, 77, 157, 0.6);
  box-shadow: 0 22px 50px rgba(4, 8, 16, 0.6);
}
.rolecard img { width: 100%; height: 230px; object-fit: cover; object-position: center 18%; display: block; }
.rolecard-text { padding: 18px 22px 0; }
.rolecard h3 { margin: 0 0 6px; font-size: 1.3rem; }
.rolecard p { margin: 0; font-size: 0.94rem; line-height: 1.5; color: var(--muted); }
.rolecard-go {
  display: inline-block; margin: 14px 22px 0;
  color: var(--secondary); font-weight: 800; font-size: 0.95rem;
}
.rolegate-skip {
  margin-top: 22px; border: 0; background: none; color: var(--muted);
  font: inherit; font-size: 0.92rem; cursor: pointer; text-decoration: underline;
}
.rolegate-skip:hover { color: var(--white); }
@media (max-width: 860px) {
  .rolecards { grid-template-columns: 1fr; gap: 14px; }
  .rolecard img { height: 150px; object-position: center 20%; }
}

/* кнопка смены роли в шапке */
.role-switch {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05);
  color: var(--muted); border-radius: 999px; padding: 0.5rem 0.95rem;
  font: inherit; font-size: 0.86rem; font-weight: 700; cursor: pointer;
}
.role-switch:hover { color: var(--white); border-color: rgba(255, 255, 255, 0.3); }

/* ---------- иллюстрации ---------- */
.il { margin: 0 0 28px; }
.il img {
  width: 100%; height: auto; display: block; border-radius: 22px;
  box-shadow: 0 18px 46px rgba(4, 8, 16, 0.5);
}
.il figcaption { margin-top: 12px; font-size: 0.94rem; color: var(--muted); line-height: 1.5; }
.il-wide img { max-height: 420px; object-fit: cover; }

.il-row { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: center; margin-bottom: 34px; }
.il-row .il { margin: 0; }
.il-row-text h3 { margin: 0 0 12px; font-size: 1.45rem; line-height: 1.22; }
.il-row-text p { margin: 0 0 12px; }
.il-row-text p:last-child { margin: 0; }
@media (max-width: 860px) { .il-row { grid-template-columns: 1fr; gap: 20px; } }

/* ---------- карточки помощников с картинкой ---------- */
.helpers { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.helper {
  border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  background: var(--panel-strong); display: flex; flex-direction: column;
}
.helper img { width: 100%; height: 170px; object-fit: cover; display: block; }
.helper-body { padding: 20px 22px 22px; }
.helper-num {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--secondary); color: #1a1400; font-weight: 800; font-size: 0.95rem; margin-bottom: 10px;
}
.helper h3 { margin: 0 0 8px; font-size: 1.12rem; }
.helper p { margin: 0; font-size: 0.92rem; line-height: 1.5; }

/* ---------- светофор честности ---------- */
.lights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.light { border-radius: 20px; padding: 22px 24px; border: 1px solid var(--line); background: var(--panel-strong); }
.light-dot { width: 26px; height: 26px; border-radius: 50%; margin-bottom: 12px; }
.light-green .light-dot { background: #2ecc71; box-shadow: 0 0 20px rgba(46, 204, 113, .55); }
.light-amber .light-dot { background: #f5b942; box-shadow: 0 0 20px rgba(245, 185, 66, .55); }
.light-red .light-dot { background: #ff5b5b; box-shadow: 0 0 20px rgba(255, 91, 91, .55); }
.light h3 { margin: 0 0 8px; font-size: 1.1rem; }
.light p { margin: 0; font-size: 0.93rem; line-height: 1.5; }
@media (max-width: 760px) { .lights { grid-template-columns: 1fr; } }

/* ---------- герои ---------- */
.heroes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.heroc { display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: center;
  border: 1px solid var(--line); border-radius: 22px; background: var(--panel-strong); padding: 20px 22px; }
.heroc img { width: 120px; height: 120px; object-fit: contain; border-radius: 16px; background: rgba(255,255,255,.05); }
.heroc h3 { margin: 0 0 6px; font-size: 1.15rem; }
.heroc p { margin: 0; font-size: 0.92rem; line-height: 1.5; }
@media (max-width: 860px) { .heroes { grid-template-columns: 1fr; } }

/* ---------- две книги ---------- */
.twobooks { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tbook { border: 1px solid var(--line); border-radius: 22px; background: var(--panel-strong); padding: 24px 26px; }
.tbook-tag {
  display: inline-block; font-size: 0.74rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--secondary); margin-bottom: 10px;
}
.tbook h3 { margin: 0 0 10px; font-size: 1.25rem; }
.tbook ul { margin: 0; padding-left: 18px; font-size: 0.93rem; line-height: 1.55; }
.tbook li { margin-bottom: 6px; }
@media (max-width: 760px) { .twobooks { grid-template-columns: 1fr; } }
