/* sg-map.css — «Карта приключения» on /watch (sprint map-signal, T2). Everything is scoped to .sg-map. */
.sg-map { --map-ink: #202b40; --map-muted: #5b6474; --map-coral: #bd3851; --map-gold: #c98a12; --map-line: #d9cfc3;
  display: block; max-width: 720px; margin: 0 auto 40px; scroll-margin-top: 88px; color: var(--map-ink); }
.sg-map:not([data-sg-map-ready]) { display: none; }
.sg-map *, .sg-map *::before, .sg-map *::after { box-sizing: border-box; }
.sg-map .sg-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sg-map .sg-map-inner { position: relative; background: #fffaf3; border: 1px solid #efe5d8; border-radius: 24px; padding: 22px 18px 18px; }
.sg-map .sg-map-head { margin-bottom: 14px; }
.sg-map .sg-map-heading { margin: 0; font-size: 1.5rem; line-height: 1.2; font-weight: 800; }
.sg-map .sg-map-sub { margin: 4px 0 0; font-size: 1rem; color: var(--map-muted); }

.sg-map .sg-map-bubble { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px;
  padding: 14px 16px; background: #fff; border: 2px solid var(--map-coral); border-radius: 18px; font-size: 1rem; font-weight: 700; }
.sg-map .sg-map-bubble p { margin: 0; flex: 1 1 200px; }
.sg-map .sg-map-bubble-close { min-height: 44px; padding: 8px 18px; border: 0; border-radius: 999px; background: var(--map-coral); color: #fff;
  font: inherit; font-weight: 700; cursor: pointer; }
.sg-map .sg-map-banner { margin: 0 0 14px; padding: 12px 16px; border-radius: 16px; font-size: 1rem; font-weight: 700; background: #eef6ff; }
.sg-map .sg-map-banner.is-all { background: #fff3d6; }
.sg-map .sg-map-banner.is-rest { background: #eaf6ef; }
.sg-map .sg-map-banner.is-storage { background: #f3f1ee; font-weight: 600; color: var(--map-muted); }

.sg-map .sg-map-track { position: relative; }
.sg-map .sg-map-trail { position: absolute; left: 0; top: 0; color: var(--map-line); pointer-events: none; overflow: visible; }
.sg-map .sg-map-list { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.sg-map .sg-map-node { position: relative; width: calc(100% - 44px); }
.sg-map .sg-map-node[data-side="right"] { margin-left: 44px; }
.sg-map .sg-map-node[data-side="center"] { width: 100%; }
@media (min-width: 600px) {
  .sg-map .sg-map-inner { padding: 28px 28px 22px; }
  .sg-map .sg-map-node { width: 78%; }
  .sg-map .sg-map-node[data-side="right"] { margin-left: 22%; }
  .sg-map .sg-map-node[data-side="center"] { width: 100%; }
}
.sg-map .sg-map-node-link { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 6px 12px 6px 6px; border-radius: 20px;
  background: #fff; border: 1px solid #ece4da; color: inherit; text-decoration: none; box-shadow: 0 4px 14px rgb(32 43 64 / 6%); }
.sg-map .sg-map-node-link:hover { border-color: #d8c9b8; }
.sg-map a:focus-visible, .sg-map button:focus-visible { outline: 3px solid #245edb; outline-offset: 3px; }
.sg-map .sg-map-circle { position: relative; flex: 0 0 64px; width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: #e9e3da; border: 3px solid #fff; box-shadow: 0 0 0 2px #e2d6c8; }
.sg-map .sg-map-circle img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sg-map .sg-map-num { font-size: 1.4rem; font-weight: 800; color: var(--map-muted); }
.sg-map .sg-map-check { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; background: #2f8f5b;
  color: #fff; font-size: 14px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }
.sg-map .is-done .sg-map-circle { box-shadow: 0 0 0 2px #2f8f5b; }
.sg-map .is-progress .sg-map-circle { box-shadow: 0 0 0 2px var(--map-gold); }
.sg-map .sg-map-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sg-map .sg-map-title { font-size: 1rem; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.sg-map .sg-map-status { font-size: 0.95rem; color: var(--map-muted); font-weight: 600; }
.sg-map .sg-map-status.is-done { color: #237249; }
.sg-map .sg-map-status.is-progress { color: #8a5d00; }
.sg-map .sg-map-bar { display: block; width: 100%; max-width: 180px; height: 6px; border-radius: 9px; background: #efe7dc; overflow: hidden; }
.sg-map .sg-map-bar > span { display: block; height: 100%; background: var(--map-gold); border-radius: 9px; }
.sg-map .sg-map-chip { align-self: flex-start; display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--map-coral);
  color: #fff; font-size: 0.8rem; font-weight: 800; letter-spacing: .02em; }
.sg-map .sg-map-chip-mission { margin: 6px 0 0 6px; }
.sg-map .is-next > .sg-map-node-link { border: 2px solid var(--map-coral); box-shadow: 0 0 0 5px rgb(189 56 81 / 14%), 0 6px 18px rgb(32 43 64 / 10%); }
.sg-map .is-next .sg-map-circle { box-shadow: 0 0 0 3px var(--map-coral); animation: sg-map-pulse 2.4s ease-in-out infinite; }

.sg-map .sg-map-stars { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 6px 0 0 6px; padding: 0; }
.sg-map .sg-map-star { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 2px 10px 2px 8px; border-radius: 999px;
  background: #f4efe8; font-size: 0.875rem; font-weight: 700; color: var(--map-muted); }
.sg-map .sg-map-star.is-on { background: #fff1cf; color: #6e4a00; }
.sg-map .sg-map-star.is-on .sg-map-star-icon { color: var(--map-gold); }
.sg-map .sg-map-star.is-locked { opacity: .8; }
.sg-map .sg-map-star-icon { font-size: 1rem; line-height: 1; }
.sg-map .sg-map-star-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -6px -10px -6px -8px; padding: 6px 10px 6px 8px;
  color: inherit; text-decoration: none; border-radius: 999px; }

.sg-map .sg-map-signal .sg-map-node-link { background: linear-gradient(120deg, #1f2c4f, #2e4a7a); color: #fff; border-color: #1f2c4f; }
.sg-map .sg-map-signal .sg-map-status { color: #dbe6ff; }
.sg-map .sg-map-beacon { background: #2e4a7a; box-shadow: 0 0 0 2px #ffd86f; }
.sg-map .sg-map-signal.is-todo .sg-map-beacon { animation: sg-map-pulse 2.4s ease-in-out infinite; }
.sg-map .sg-map-cycle { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.sg-map .sg-map-cycle-star { font-size: 1rem; color: rgb(255 255 255 / 35%); }
.sg-map .sg-map-cycle-star.is-on { color: #ffd86f; }
.sg-map .sg-map-cycle-label { margin-left: 6px; font-size: 0.85rem; color: #dbe6ff; }
.sg-map .sg-map-streak { font-size: 0.95rem; font-weight: 700; color: #ffe7a6; }

.sg-map .sg-map-sticky-wrap { display: none; }
@media (max-width: 799px) {
  .sg-map .sg-map-sticky-wrap { display: block; position: sticky; bottom: 12px; z-index: 5; margin-top: 16px; }
  .sg-map .sg-map-sticky { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 18px;
    border-radius: 16px; background: var(--map-coral); color: #fff; font-size: 1rem; font-weight: 800; text-decoration: none;
    box-shadow: 0 8px 22px rgb(189 56 81 / 30%); }
}
.chapter-list-title { margin: 8px 0 18px; font-size: 1.375rem; font-weight: 800; }

@keyframes sg-map-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
  .sg-map .is-next .sg-map-circle, .sg-map .sg-map-signal.is-todo .sg-map-beacon { animation: none; }
}

/* ux-fix-1358 item 16: «Все главы списком» as a collapsed <details>. */
.chapter-list { margin: 8px 0 0; }
.chapter-list-summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.chapter-list-summary::-webkit-details-marker { display: none; }
.chapter-list-summary .chapter-list-title { margin: 8px 0; }
.chapter-list-summary::after { content: ""; width: 10px; height: 10px; flex: none; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .2s ease; }
.chapter-list[open] > .chapter-list-summary::after { transform: rotate(-135deg) translateY(-3px); }
.chapter-list-summary:focus-visible { outline: 3px solid #bd3851; outline-offset: 4px; border-radius: 8px; }
.chapter-list[open] > .chapter-grid { margin-top: 10px; }

/* ---------------------------------------------------------------- T3: entry points ---------------------------------- */
/* Home teaser (between mission-week and how-section). Hidden until sg-map.js fills it: prerender/no-JS HTML unchanged. */
.adventure-teaser { --tz-ink: #202b40; --tz-muted: #5b6474; --tz-coral: #bd3851; display: block; padding-top: 14px; padding-bottom: 30px; }
.adventure-teaser:not([data-sg-teaser-ready]) { display: none; }
.adventure-teaser *, .adventure-teaser *::before, .adventure-teaser *::after { box-sizing: border-box; }
.adventure-teaser .sg-teaser-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 760px) {
  .adventure-teaser .sg-teaser-grid.has-signal { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
.adventure-teaser .sg-teaser-card { position: relative; display: flex; align-items: center; gap: 14px; min-height: 96px; padding: 18px 20px;
  border-radius: 20px; text-decoration: none; color: var(--tz-ink); transition: transform .15s ease, box-shadow .15s ease; }
.adventure-teaser .sg-teaser-card:hover { transform: translateY(-1px); }
.adventure-teaser .sg-teaser-card:focus-visible { outline: 3px solid #2e65c4; outline-offset: 4px; }
.adventure-teaser .sg-teaser-map { background: #fffaf3; border: 1px solid #efe5d8; box-shadow: 0 10px 26px #202b400a; flex-wrap: wrap; }
.adventure-teaser .sg-teaser-signal { background: #243a6b; color: #fff; border: 1px solid #243a6b; }
.adventure-teaser .sg-teaser-signal.is-done { background: #2f4a7f; }
.adventure-teaser .sg-teaser-icon { flex: 0 0 auto; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: rgb(255 255 255 / 12%); }
.adventure-teaser .sg-teaser-signal.is-todo .sg-teaser-beacon { animation: sg-map-pulse 2.4s ease-in-out infinite; }
.adventure-teaser .sg-teaser-body { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.adventure-teaser .sg-teaser-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--tz-muted); }
.adventure-teaser .sg-teaser-signal .sg-teaser-eyebrow { color: #b9c8ea; }
.adventure-teaser .sg-teaser-title { font-size: 1.2rem; line-height: 1.3; font-weight: 800; letter-spacing: -.01em; }
.adventure-teaser .sg-teaser-sub { font-size: .95rem; line-height: 1.45; color: var(--tz-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.adventure-teaser .sg-teaser-signal .sg-teaser-sub { color: #dbe6ff; }
.adventure-teaser .sg-teaser-stars { display: inline-flex; gap: 1px; font-size: 1rem; }
.adventure-teaser .sg-teaser-star { color: rgb(255 255 255 / 30%); }
.adventure-teaser .sg-teaser-star.is-on { color: #ffd86f; }
.adventure-teaser .sg-teaser-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; }
.adventure-teaser .sg-teaser-dots { display: inline-flex; gap: 5px; }
.adventure-teaser .sg-teaser-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #d9cfc3; }
.adventure-teaser .sg-teaser-dot.is-progress { border-color: var(--tz-coral); background: linear-gradient(90deg, var(--tz-coral) 50%, #fff 50%); }
.adventure-teaser .sg-teaser-dot.is-done { border-color: #c98a12; background: #f2b632; }
.adventure-teaser .sg-teaser-dot.is-next { border-color: var(--tz-coral); box-shadow: 0 0 0 3px rgb(189 56 81 / 20%); }
.adventure-teaser .sg-teaser-count { font-size: .9rem; font-weight: 700; color: var(--tz-muted); }
.adventure-teaser .sg-teaser-signal .sg-teaser-count { color: #ffe7a6; }
.adventure-teaser .sg-teaser-go { flex: 0 0 auto; font-size: 1.4rem; font-weight: 800; }
.adventure-teaser .sg-teaser-cta { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 10px 20px; border-radius: 14px; background: var(--tz-coral); color: #fff; font-size: .95rem; font-weight: 800; white-space: nowrap; }
.adventure-teaser .sg-teaser-map:hover .sg-teaser-cta { background: #a82b43; }
@media (max-width: 540px) {
  .adventure-teaser { padding-bottom: 24px; }
  .adventure-teaser .sg-teaser-card { padding: 16px; border-radius: 18px; }
  .adventure-teaser .sg-teaser-title { font-size: 1.1rem; }
  .adventure-teaser .sg-teaser-cta { width: 100%; }
}

/* Finale: «Сигнал дня ждёт →» under the CompleteSceneModal buttons (only with Features:Signal). */
.sg-finale-signal:empty { display: none; }
.sg-finale-signal { display: flex; justify-content: center; padding: 0 16px 18px; }
.sg-finale-signal .sg-finale-signal-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px;
  color: #243a6b; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

/* Map: when the «Дальше: …» bar can float (phones, a next point exists), reserve its height (+ the cookie banner it sits
   above) under the map, so the last chapter card can always be scrolled fully clear of the floating bar. */
@media (max-width: 799px) {
  .sg-map[data-sg-map-ready][data-sg-next]:not([data-sg-next="none"]) { padding-bottom: calc(52px + var(--sg-cookie-h, 0px)); }
}

/* /mir world-navigation: «Карта приключения →» sits right, next to «Перейти к истории →». */
.world-navigation a.sg-mir-map-link { margin-left: auto; }
.world-navigation a.sg-mir-map-link + a:last-child { margin-left: 0; }
@media (max-width: 540px) {
  .world-navigation a.sg-mir-map-link { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .adventure-teaser .sg-teaser-card { transition: none; }
  .adventure-teaser .sg-teaser-signal.is-todo .sg-teaser-beacon { animation: none; }
}
