/* Гайд новичка (pages/guide.html): лишь то, чего нет в site.css.
   Только для этой страницы; общие .guide/.guide-step/.keys живут в site.css. */

/* Шапка с артом: путник у ворот. Отражаем, чтобы фигура не пряталась под текстом. */
.gd-head-bg img { transform: scaleX(-1); object-position: 50% 40%; }
[dir="rtl"] .gd-head-bg img { transform: none; }
.gd-head .page-head-inner { padding-top: clamp(64px, 9vw, 128px); padding-bottom: clamp(40px, 5vw, 64px); }
.gd-head h1 { max-width: 15ch; }

/* «Пять минут до первого боя» */
.gd-quick-wrap { max-width: var(--wrap); margin: 0 auto; padding: 28px var(--gutter) 36px; }
.gd-quick-title { margin: 0 0 16px; font-family: var(--f-mono); font-weight: 500; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-text); }
.gd-quick { list-style: none; margin: 0; padding: 0; counter-reset: q; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.gd-quick li {
  counter-increment: q; position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 44px 16px 18px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(217, 164, 65, .07), var(--surface) 60%);
}
.gd-quick li::before {
  content: counter(q); position: absolute; top: 14px; left: 16px; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 50%; background: var(--gold); color: var(--on-gold); font-family: var(--f-mono); font-size: 12px; font-weight: 600;
}
.gd-quick b { color: var(--text-strong); font-weight: 600; font-size: 16px; }
.gd-quick span { color: var(--soft); font-size: 14px; line-height: 1.45; }

/* Иллюстрации и карточки внутри шагов */
.gd-fig { margin: 4px 0 18px; border: 1px solid var(--line); background: var(--bg-2); overflow: hidden; }
.gd-fig img { display: block; width: 100%; height: auto; aspect-ratio: 1280 / 724; object-fit: cover; }
.guide-step h3 { margin-top: 22px; }
.guide-step > h2 + .gd-fig { margin-top: 10px; }
.gd-cards { display: grid; gap: 12px; margin: 14px 0 6px; }
.gd-cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gd-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gd-cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gd-card { padding: 16px 18px; border: 1px solid var(--line); background: var(--surface-2); scroll-margin-top: calc(var(--header-h) + 16px); }
.gd-card-wide { grid-column: 1 / -1; }
.guide-step .gd-card h3 { margin: 0 0 6px; font-family: var(--f-body); font-size: 16px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-strong); }
.guide-step .gd-card p { font-size: 15px; margin-bottom: 6px; }
.guide-step h3[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

/* Таблицы */
.gd-table-wrap { margin: 8px 0 14px; overflow-x: auto; border: 1px solid var(--line); }
.gd-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.gd-table th, .gd-table td { padding: 10px 14px; text-align: start; vertical-align: top; border-top: 1px solid var(--line); color: var(--soft); }
.gd-table thead th { border-top: 0; font-family: var(--f-mono); font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: rgba(255, 240, 215, .03); }
.gd-table tbody tr:first-child > * { border-top: 0; }
.gd-table thead + tbody tr:first-child > * { border-top: 1px solid var(--line); }
.gd-table tbody th { color: var(--text-strong); font-weight: 600; }
.gd-table td:first-child:not([data-i]) { font-family: var(--f-mono); color: var(--gold-text); white-space: nowrap; }

/* Подсказки */
.gd-tip { margin: 12px 0; padding: 12px 16px; border: 1px solid rgba(217, 164, 65, .35); border-inline-start: 3px solid var(--gold); background: rgba(217, 164, 65, .06); }
.guide-step .gd-tip p { margin: 0; color: var(--text); font-size: 15px; max-width: none; }
.gd-tip b { color: var(--gold-text); font-weight: 600; margin-inline-end: 4px; }
.gd-tip-warn { border-color: rgba(240, 149, 126, .35); border-inline-start-color: var(--danger); background: rgba(240, 149, 126, .06); }
.gd-tip-warn b { color: var(--danger); }

/* Ссылки «подробнее» */
.gd-more { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--gold-text); font-weight: 600; text-decoration: none; }
.gd-more::after { content: "→"; transition: transform .2s var(--ease); }
[dir="rtl"] .gd-more::after { content: "←"; }
.gd-more:hover { color: var(--gold-hover); }
.gd-more:hover::after { transform: translateX(3px); }
.gd-links { display: flex; flex-wrap: wrap; column-gap: 22px; }

/* Комбинация «как открыть» */
.gd-path-line kbd { margin: 0 2px; }

/* Маршрут 1–100 */
.gd-route { list-style: none; margin: 6px 0 14px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); }
.gd-route li { display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 16px; border-inline-start: 1px solid var(--line); color: var(--soft); font-size: 14px; line-height: 1.4; }
.gd-route li:first-child { border-inline-start: 0; }
.gd-route b { font-family: var(--f-mono); font-size: 15px; font-weight: 600; color: var(--gold-text); }

/* Безопасность */
.gd-safe { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-width: 74ch; }
.gd-safe li { position: relative; padding: 12px 16px 12px 44px; border: 1px solid var(--line); background: var(--surface-2); color: var(--soft); }
.gd-safe li::before {
  content: ""; position: absolute; left: 19px; top: 16px; width: 7px; height: 13px;
  border: solid var(--online); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
[dir="rtl"] .gd-safe li { padding: 12px 44px 12px 16px; }
[dir="rtl"] .gd-safe li::before { left: auto; right: 19px; }
.gd-safe b { color: var(--text-strong); font-weight: 600; }

/* Частые вопросы */
.gd-faq { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin-bottom: 10px; }
.gd-faq details { border-bottom: 1px solid var(--line); }
.gd-faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; align-items: center;
  min-height: 48px; padding: 12px 0; color: var(--text-strong); font-weight: 600;
}
.gd-faq summary::-webkit-details-marker { display: none; }
.gd-faq summary::after { content: "+"; flex: none; font-family: var(--f-mono); font-size: 20px; color: var(--gold-text); transition: transform .2s var(--ease); }
.gd-faq details[open] summary::after { transform: rotate(45deg); }
.gd-faq summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.guide-step .gd-faq p { margin: 0 0 14px; }

@media (max-width: 1080px) {
  .gd-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gd-quick li:last-child { grid-column: 1 / -1; }
  .gd-route { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gd-route li { border-inline-start: 0; border-top: 1px solid var(--line); }
  .gd-route li:nth-child(-n+2) { border-top: 0; }
  .gd-route li:nth-child(even) { border-inline-start: 1px solid var(--line); }
  .gd-route li:last-child { grid-column: 1 / -1; border-inline-start: 0; }
}
@media (max-width: 720px) {
  .gd-cards-2, .gd-cards-3, .gd-cards-4 { grid-template-columns: minmax(0, 1fr); }
  .gd-quick { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .gd-quick li { padding: 14px 14px 14px 50px; }
  .gd-quick li::before { top: 15px; left: 14px; }
  [dir="rtl"] .gd-quick li { padding: 14px 50px 14px 14px; }
  [dir="rtl"] .gd-quick li::before { left: auto; right: 14px; }
  .gd-fig { margin-left: -18px; margin-right: -18px; border-left: 0; border-right: 0; }
  .gd-table { font-size: 14px; }
  .gd-table th, .gd-table td { padding: 9px 10px; }
  .gd-head h1 { max-width: none; }
  /* El texto ocupa todo el ancho: velo uniforme para que el arte no le reste contraste (LTR y RTL). */
  .gd-head .gd-head-bg::after { background: linear-gradient(180deg, rgba(14, 11, 9, .62), rgba(14, 11, 9, .78) 55%, var(--bg)); }
  /* Tabla de características: en el teléfono, cada fila es una tarjeta. */
  .gd-table-stack thead { display: none; }
  .gd-table-stack tr { display: block; padding: 10px 12px; border-top: 1px solid var(--line); }
  .gd-table-stack tbody tr:first-child { border-top: 0; }
  .gd-table-stack th, .gd-table-stack td { display: block; padding: 2px 0; border: 0 !important; }
  .gd-table-stack td:last-child { color: var(--muted); font-size: 13px; }
}
