/* ==========================================================================
   quiz.html — «Хорошо ли вы знаете русскую литературу?»
   Поверх общих styles.css (палитра закладок, кнопки, арки, плашки .plate).
   Заголовки — Prata, набор — Helvetica Neue. --tone — главный цвет
   выбранного автора, его задаёт quiz.js. Без разрядки, без анимаций
   и «плавающих» точек-индикаторов (просьба владельца).
   ========================================================================== */

.quiz-body { --tone: var(--ink); }
.quiz-body [hidden] { display: none !important; }   /* .btn задаёт display */

.quiz-top__link {
  font-size: 15px;
  color: var(--ink-soft);
  padding-block: 6px;
}
.quiz-top__link:hover { color: var(--warm); }
body[data-screen="intro"] .quiz-top__link,
body[data-screen="authors"] .quiz-top__link { visibility: hidden; }

/* ряд «← Все авторы» над экраном: вернуться к выбору можно одним нажатием */
.backbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(22px, 4vh, 40px);
}
.backbar__link { padding-block: 6px; font-size: 15px; color: var(--ink-soft); }
.backbar__link:hover { color: var(--warm); }

/* ссылка внутри текста — тонкое подчёркивание, как адрес на лендинге */
.textlink {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--warm-line);
  text-underline-offset: .3em;
}
.textlink:hover { color: var(--warm); }

/* плашки в викторине — один кегль */
.quiz-body .plate { font-size: clamp(15px, 1.5vw, 18px); }
.quiz-body .plates { gap: 8px; }

/* заголовки — Prata, как .display на лендинге; пояснения — как .lede */
.start__title,
.pick__title,
.list__title,
.gift__title {
  margin-top: 18px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(27px, 4.2vw, 52px);
  line-height: var(--lh-head);
  letter-spacing: -.005em;
}
.list__title { font-size: clamp(24px, 3.3vw, 40px); }
.start__lede,
.pick__note,
.gift__lede {
  margin-top: clamp(14px, 2.4vh, 22px);
  max-width: 44ch;
  font-size: clamp(16px, 1.25vw, 18.5px);
  line-height: var(--lh-text);
  color: var(--ink-soft);
}

/* --- старт -------------------------------------------------------------- */

.start {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-block: clamp(28px, 5vh, 64px) clamp(48px, 8vh, 96px);
}
.start__photo { width: min(280px, 62vw); aspect-ratio: 700 / 892; background: var(--bg); }
.start__plate { margin-top: clamp(26px, 4vh, 40px); }
.start__lede { max-width: 36ch; }
.start__meta { margin-top: 12px; font-size: 14px; line-height: 1.55; color: var(--warm); max-width: 40ch; }
.start__cta { margin-top: clamp(24px, 4vh, 38px); }
.start__cta .btn { min-width: 240px; }

/* --- выбор автора ------------------------------------------------------- */

.pick {
  max-width: 760px;
  padding-block: clamp(32px, 5vh, 64px) clamp(48px, 8vh, 96px);
}

/* строки авторов — как строки списка на закладке: между ними линии */
.authors {
  display: grid;
  margin-top: clamp(26px, 4vh, 40px);
  border-top: 1px solid var(--warm-line);
}
.author {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 2.4vw, 22px);
  padding: 14px clamp(12px, 2vw, 20px) 14px 6px;
  border-bottom: 1px solid var(--warm-line);
  color: var(--ink);
  transition: background .3s var(--ease);
}
.author:hover { color: var(--ink); background: rgba(148, 135, 121, .1); }

/* миниатюра: арка с пятью корешками цвета автора */
.author__mark {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 46px;
  height: 58px;
  padding: 14px 7px 0;
  border: 1px solid var(--warm-line);
  border-bottom: 0;
  border-radius: 1000px 1000px 0 0;
  overflow: hidden;
  box-shadow: inset 0 -1px 0 var(--ink);
}
.author__mark i { flex: 1 1 0; }
.author__text { display: grid; gap: 4px; }
.author__name { font-family: var(--serif); font-size: clamp(19px, 2.2vw, 23px); line-height: 1.2; text-transform: uppercase; }
.author__note { font-size: 14px; color: var(--warm); }
.author__go { font-size: 15px; color: var(--ink); white-space: nowrap; }
.author__go::after { content: "  →"; white-space: pre; }
.author.is-done .author__go { color: var(--warm); }
.author.is-done .author__go::after { content: "  ✓"; }

.passbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: clamp(28px, 4vh, 44px);
}
.passbar__text { flex: 1 1 260px; }
.passbar__note { margin-top: 4px; font-size: 15px; line-height: 1.55; color: var(--ink-soft); max-width: 44ch; }
.passbar__actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 560px) {
  .passbar__actions { width: 100%; }
  .passbar__actions .btn { flex: 1 1 100%; }
}

/* --- отметки: список «К прочтению», как на закладке -------------------- */

.list {
  max-width: 900px;
  padding-block: clamp(18px, 3vh, 34px) 40px;
}
.tabs {
  display: flex;
  gap: clamp(16px, 3vw, 32px);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--warm-line);
  margin-inline: calc(-1 * var(--pad));
  padding-inline: var(--pad);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs__item {
  flex: 0 0 auto;
  padding: 10px 0 11px;
  font-size: 15px;
  color: var(--warm);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs__item:hover { color: var(--ink); }
.tabs__item.is-active { color: var(--ink); border-bottom-color: var(--ink); }

.list__head { margin-top: clamp(24px, 4vh, 38px); }
.list__note { margin-top: 10px; font-size: 15px; color: var(--warm); }

/* строки как на закладке: квадрат, название, год Prata; между строками
   волосяная линия. На широком экране — две колонки. */
.books {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(28px, 5vw, 64px);
  margin-top: clamp(20px, 3vh, 30px);
  border-top: 1px solid var(--warm-line);
}
.bk {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--hair);
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink);
  text-align: left;
}
.bk:hover { background: rgba(148, 135, 121, .08); }
.bk__box {
  position: relative;
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--warm-line);
}
.bk.is-read .bk__box { background: var(--tone); border-color: var(--tone); }
.bk.is-read .bk__box::after {
  content: "";
  position: absolute;
  left: 4.5px; top: 1px;
  width: 4px; height: 8px;
  border: solid var(--bg);
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
}
.bk__year { font-family: var(--serif); font-size: 15px; color: var(--ink-soft); white-space: nowrap; }
@media (max-width: 640px) {
  .books { grid-template-columns: minmax(0, 1fr); }
}

/* низ экрана: счётчик, звание и кнопка — всегда под рукой */
.listfoot {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-top: auto;
  background: rgba(253, 240, 223, .96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--warm-line);
  padding-bottom: env(safe-area-inset-bottom);
}
.listfoot__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 24px;
  max-width: 900px;
  padding-block: 14px 16px;
}
.listfoot__count { font-size: 15px; color: var(--ink-soft); }
.listfoot__count b { font-family: var(--serif); font-weight: 400; font-size: 24px; color: var(--ink); }
.listfoot__count small { font-size: 14px; color: var(--warm); }
.listfoot__rank { margin-left: 12px; color: var(--ink); }
.listfoot__bar { grid-column: 1; height: 2px; background: var(--stone); }
.listfoot__bar i { display: block; height: 100%; width: 0; background: var(--tone); transition: width .3s var(--ease); }
.listfoot .btn { grid-row: 1 / span 2; grid-column: 2; }
@media (max-width: 560px) {
  .listfoot__inner { grid-template-columns: 1fr; padding-block: 12px 14px; }
  .listfoot__count { display: flex; justify-content: space-between; align-items: baseline; }
  .listfoot .btn { grid-row: auto; grid-column: 1; width: 100%; }
}

/* --- результат: карточка, «поделиться», подарок, звание ----------------
   На телефоне сверху вниз: заголовок → карточка → кнопки → звание.
   Карточка по высоте подогнана под экран, чтобы «Поделиться» и подарок
   были видны без прокрутки. На широком экране карточка слева. */

.res {
  max-width: 1000px;
  padding-block: clamp(20px, 4vh, 56px) clamp(48px, 8vh, 96px);
}
.res__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "card" "actions" "status";
  gap: 16px;
}
.res__head { grid-area: head; text-align: center; }
/* на телефоне подпись «Моя полка …: 32%» не нужна — всё это есть на
   карточке, а место над ней дорого */
@media (max-width: 560px) { .res__head .label { display: none; } .res__title { margin-top: 0; } }
.res__title {
  margin-top: 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 3.2vw, 38px);
  line-height: 1.15;
  letter-spacing: -.005em;
}
.share__canvas-hold.res__card {
  grid-area: card;
  width: min(100%, 400px, calc((100svh - 350px) * 9 / 16 + 22px));
  max-width: none;
  min-width: min(100%, 200px);
  justify-self: center;
}
.res__card canvas { display: block; width: 100%; height: auto; }
.res__actions {
  grid-area: actions;
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 440px;
  justify-self: center;
}
.res__actions .btn { width: 100%; }
.res__actions .share__social { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.res__actions .share__social .btn { min-height: 46px; padding: 10px 8px; font-size: 15px; }
.res__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 26px; margin-top: 4px; }
.res__links .textlink,
.res__edit .textlink { padding: 6px 0; font-size: 15px; background: none; border: 0; cursor: pointer; }
.res__actions .share__status:empty { display: none; }

/* подарок — отдельная, заметная кнопка-«талон»: двойная рамка, как
   у плашек, и цвет автора слева */
.giftbtn {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 13px 44px 13px 18px;
  border: 1.5px solid var(--ink);
  border-left: 6px solid var(--tone);
  background: var(--ivory);
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 0 0 3px var(--ivory), inset 0 0 0 4px var(--hair);
}
.giftbtn__main { font-family: var(--serif); font-size: clamp(18px, 5vw, 21px); line-height: 1.2; }
.giftbtn__sub { font-size: 14px; line-height: 1.35; color: var(--warm); }
.giftbtn__go {
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
}
.giftbtn:hover { background: var(--paper); color: var(--ink); }

.res__status { grid-area: status; width: 100%; max-width: 560px; justify-self: center; margin-top: 18px; }
.res__block { padding-block: 22px; border-top: 1px solid var(--hair); }
.res__block:first-child { padding-top: 22px; }
.res__rank {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.15;
}
/* фраза в духе автора */
.res__say { margin-top: 10px; font-family: var(--serif); font-size: clamp(18px, 2vw, 21px); line-height: 1.35; }
.res__book { margin-top: 8px; font-family: var(--serif); font-size: clamp(20px, 2.6vw, 25px); line-height: 1.25; }
.res__small { margin-top: 8px; font-size: 15px; line-height: 1.55; color: var(--warm); max-width: 46ch; }
.res__small--ink { color: var(--ink-soft); font-size: 16px; }
.res__small--ink:empty { display: none; }
.res__edit { padding-top: 4px; }

/* лесенка званий: пройденные — цветом автора, текущее — рамкой */
.ladder { display: grid; gap: 6px; margin-top: 16px; }
.ladder__step {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--hair);
  border-left: 3px solid var(--hair);
  color: var(--warm);
}
.ladder__name { font-family: var(--serif); font-size: 18px; line-height: 1.2; }
.ladder__note { flex: 0 0 auto; font-size: 14px; }
.ladder__step.is-done { border-left-color: var(--tone); color: var(--ink-soft); }
.ladder__step.is-current {
  border: 1.5px solid var(--ink);
  border-left: 6px solid var(--tone);
  background: var(--ivory);
  color: var(--ink);
}
.ladder__step.is-current .ladder__note { font-weight: 500; }

@media (min-width: 880px) {
  .res__layout {
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "card head" "card actions" "card status";
    column-gap: clamp(40px, 6vw, 80px);
    row-gap: 22px;
    align-items: start;
  }
  .share__canvas-hold.res__card { width: 100%; max-width: none; min-width: 0; position: sticky; top: calc(var(--header-h, 78px) + 20px); }
  .res__head { text-align: left; }
  .res__actions, .res__status { justify-self: stretch; max-width: 460px; }
  .res__links { justify-content: flex-start; }
  .res__status { margin-top: 8px; }
}

/* карточка и кнопки «поделиться» — общие для результата и паспорта */
.share__canvas-hold {
  max-width: 380px;
  width: 100%;
  margin-inline: auto;
  border: 1px solid var(--hair);
  background: var(--ivory);
}
.share__social { grid-template-columns: repeat(3, 1fr); }
.share__social.share__social--two { grid-template-columns: 1fr 1fr; }
.share--center { max-width: 400px; margin-inline: auto; width: 100%; }

.more {
  margin-top: clamp(40px, 7vh, 72px);
  padding-top: 26px;
  border-top: 1px solid var(--warm-line);
}
.more__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 10px;
  margin-top: 14px;
}
.more__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 12px 16px;
  border-block: 1px solid var(--warm-line);
  border-left: 3px solid var(--tone);
  font-family: var(--serif);
  font-size: 18px;
}
.more__item small { font-family: var(--sans); font-size: 14px; color: var(--ink-soft); }
.more__item.is-done small { color: var(--warm); }
.more__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* --- подарок на кассе --------------------------------------------------- */

.gift {
  max-width: 580px;
  text-align: center;
  padding-block: clamp(28px, 5vh, 64px) clamp(48px, 8vh, 96px);
}
.gift .backbar { justify-content: flex-start; }
.gift__lede { margin-inline: auto; }
.gift__arches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: end;
  margin: clamp(26px, 4vh, 40px) auto 0;
  max-width: 440px;
}
.gift__arches .arch-photo { aspect-ratio: 3 / 3.6; background: var(--bg); }
.gift__arches .arch-photo:last-child { aspect-ratio: 3 / 4.2; }
.gift__ticket {
  margin: 0 auto clamp(26px, 4vh, 40px);
  max-width: 460px;
  padding: 20px 0;
  border-block: 1px solid var(--warm-line);
}
.gift__list { display: grid; gap: 10px; }
.gift__list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  text-align: left;
}
.gift__rank { font-family: var(--serif); font-size: clamp(19px, 3.4vw, 24px); line-height: 1.25; }
.gift__count { flex: 0 0 auto; font-family: var(--serif); font-size: 20px; color: var(--ink-soft); }
.gift__time { margin-top: 14px; font-size: 14px; color: var(--warm); }
.gift__more { font-size: 15px; line-height: 1.55; color: var(--ink-soft); max-width: 40ch; margin-inline: auto; }
.gift__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 16px; }

/* --- паспорт читателя --------------------------------------------------- */

.passport {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  gap: clamp(30px, 5vw, 76px);
  align-items: start;
  max-width: 1040px;
  padding-block: clamp(28px, 5vh, 64px) clamp(48px, 8vh, 96px);
}
.passport__head { margin-top: 22px; font-size: 17px; line-height: 1.5; color: var(--ink-soft); max-width: 40ch; }
/* «82 книги, ≈ 15 500 страниц и 387 часов с русской классикой» — крупно */
.passport__big {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: clamp(30px, 4.4vw, 50px);
  line-height: 1.15;
  max-width: 18ch;
}
.passport__label { margin-top: 26px; }
.passport__call { margin-top: 20px; font-size: 16px; line-height: 1.55; color: var(--ink-soft); max-width: 42ch; }
@media (max-width: 880px) {
  .passport { grid-template-columns: minmax(0, 1fr); }
}

/* четыре имени во вкладках помещаются в строку и на узком телефоне */
@media (max-width: 420px) {
  .tabs { gap: 14px; }
  .tabs__item { font-size: 14px; }
}

/* другие авторы на телефоне — в столбик */
@media (max-width: 560px) {
  .more__list { grid-template-columns: minmax(0, 1fr); }
}
