*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --orange: #FF6A00;
  --orange-light: #FF8C38;
  --black: #080808;
  --dark: #111111;
  --dark2: #1A1A1A;
  --white: #FFFFFF;
  --gray: #888888;
  --border: rgba(255,106,0,0.2);
  --sidebar: 260px;
}
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--black); color: var(--white); overflow-x: hidden; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--orange); border-radius: 2px; }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar);
  background: var(--dark); border-right: 1px solid rgba(255,255,255,0.05);
  display: flex; flex-direction: column; z-index: 200; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #333 transparent;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: #333; }
.sidebar-logo {
  padding: 28px 24px 20px; font-size: 13px; font-weight: 900; letter-spacing: 3px;
  text-transform: uppercase; color: var(--orange); border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.sidebar-logo span { color: #666; font-weight: 400; }

.sidebar-about-btn {
  display: block; width: calc(100% - 32px); margin: 0 16px 12px;
  padding: 10px 12px;
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: 0.4px; line-height: 1.35; text-align: left;
  color: #bbb; background: rgba(255,106,0,0.06);
  border: 1px solid rgba(255,106,0,0.2); border-radius: 6px;
  cursor: pointer; transition: background .2s, color .2s, border-color .2s;
  flex-shrink: 0;
}
.sidebar-about-btn:hover {
  color: var(--orange);
  background: rgba(255,106,0,0.1);
  border-color: rgba(255,106,0,0.35);
}

/* ── SIDEBAR NEWS ── */
.sidebar-news {
  flex-shrink: 0;
  margin: 0 16px 14px;
  border: 1px solid rgba(255,106,0,0.22);
  border-radius: 6px;
  background: var(--dark2);
  overflow: hidden;
}
.sidebar-news-head {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  padding: 10px 12px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: 'Inter', sans-serif;
  color: var(--white);
  transition: background .2s;
}
.sidebar-news-head:hover { background: rgba(255,106,0,0.06); }
.sidebar-news-title {
  grid-column: 1;
  grid-row: 1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--orange);
}
.sidebar-news-hint {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: 11px;
  font-weight: 400;
  color: #666;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-news-chev {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 10px;
  color: var(--gray);
  transition: transform .25s ease;
}
.sidebar-news.expanded .sidebar-news-chev { transform: rotate(180deg); color: var(--orange); }
.sidebar-news-panel {
  display: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  max-height: min(52vh, 280px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.sidebar-news.expanded .sidebar-news-panel { display: block; }
.sidebar-news-list {
  list-style: none;
  padding: 8px 0 10px;
}
.sidebar-news-list li {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 11px;
  line-height: 1.45;
  color: #aaa;
}
.sidebar-news-list li:last-child { border-bottom: none; }
.sidebar-news-list .news-when {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #555;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.sidebar-news-list .news-what { color: #bbb; font-weight: 400; }
.sidebar-news-list .news-kind {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--orange);
  opacity: 0.85;
  margin-right: 6px;
}
.sidebar-news-list code {
  font-size: 10px;
  color: #666;
  font-family: ui-monospace, monospace;
}

.sidebar-comments {
  flex-shrink: 0;
  margin: 0 16px 14px;
}
.sidebar-comments-head {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  padding: 12px;
  border: 1px solid rgba(255,106,0,0.22);
  border-radius: 6px;
  background: var(--dark2);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  text-align: left;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}
.sidebar-comments-head:hover {
  background: rgba(255,106,0,0.08);
  border-color: rgba(255,106,0,0.35);
  transform: translateY(-1px);
}
.sidebar-comments-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--orange);
}
.sidebar-comments-count {
  justify-self: end;
  font-size: 11px;
  font-weight: 600;
  color: #bbb;
  white-space: nowrap;
}
.sidebar-comments-hint {
  grid-column: 1 / -1;
  font-size: 11px;
  line-height: 1.45;
  color: #777;
}
.sidebar-comments-open {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  color: var(--orange-light);
}

.sidebar-audio-mode {
  margin: 0 20px 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  background: rgba(0,0,0,0.2);
}
.sidebar-audio-mode-label {
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: #555; margin-bottom: 10px;
}
.sidebar-audio-opt {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #888; cursor: pointer; margin-bottom: 6px;
}
.sidebar-audio-opt:last-child { margin-bottom: 0; }
.sidebar-audio-opt input { accent-color: var(--orange); flex-shrink: 0; }
.sidebar-audio-opt:hover span { color: #bbb; }

.sidebar-chapters {
  flex: 1;
  min-height: 0;
  padding: 0 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* Иначе .chapter-block как flex-элемент сжимается (flex-shrink:1) + overflow:hidden — списки обрезаются без скролла */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.sidebar-chapters::-webkit-scrollbar { width: 4px; }
.sidebar-chapters::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 2px; }
.chapter-block {
  flex-shrink: 0;
  border: 1px solid rgba(255,106,0,0.2);
  border-radius: 8px;
  background: linear-gradient(165deg, rgba(255,106,0,0.06) 0%, rgba(0,0,0,0.35) 48%, rgba(0,0,0,0.45) 100%);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
.chapter-block-head {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(90deg, rgba(255,106,0,0.12) 0%, transparent 55%);
  border: none; color: var(--white);
  padding: 14px 16px;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 800; letter-spacing: 0.5px;
  text-transform: none; cursor: pointer; text-align: left; transition: background .2s, color .2s;
}
.chapter-block-head:hover { background: linear-gradient(90deg, rgba(255,106,0,0.18) 0%, transparent 60%); color: var(--orange-light); }
.chapter-block.open .chapter-block-head {
  color: var(--orange);
  background: linear-gradient(90deg, rgba(255,106,0,0.15) 0%, transparent 50%);
}
.chapter-block-chev {
  font-size: 11px; transition: transform .25s; flex-shrink: 0; margin-left: 10px;
  color: var(--orange); opacity: 0.75;
}
.chapter-block.open .chapter-block-chev { transform: rotate(180deg); opacity: 1; }
.chapter-block-body { display: none; padding: 2px 0 6px; background: rgba(0,0,0,0.2); }
.chapter-block.open .chapter-block-body { display: block; }
.chapter-block-body .dropdown { border-bottom-color: rgba(255,255,255,0.05); }
.chapter-block-body .dropdown:last-child { border-bottom: none; }
.chapter-block-body .dropdown-btn {
  padding: 11px 14px 11px 18px;
  font-size: 9px;
  letter-spacing: 2px;
  color: #777;
}
.chapter-block-body .dropdown-btn:hover { color: #ccc; }
.chapter-block-body .dropdown-btn.active { color: var(--orange); }
.chapter-block-body .dropdown-list { padding: 2px 0 10px; }
.chapter-block-body .dropdown-list a {
  padding-left: 22px;
  font-size: 12px;
}
.dropdown-empty {
  display: block;
  padding: 8px 24px 8px 36px;
  font-size: 12px;
  color: #444;
}

.dropdown { border-bottom: 1px solid rgba(255,255,255,0.04); }
.dropdown-btn {
  width: 100%; background: none; border: none; color: var(--gray); padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; transition: color .2s; text-align: left;
}
.dropdown-btn:hover { color: var(--white); }
.dropdown-btn.active { color: var(--orange); }
.dropdown-arrow { transition: transform .25s; font-size: 10px; }
.dropdown-btn.active .dropdown-arrow { transform: rotate(180deg); }
.dropdown-list { display: none; padding: 4px 0 12px; }
/* Видимость по классу на .dropdown — надёжнее, чем button + div (между тегами может быть текстовый узел) */
.dropdown.open > .dropdown-list { display: block; }
.dropdown-list a {
  display: block; padding: 8px 24px 8px 32px; color: #666; text-decoration: none;
  font-size: 13px; font-weight: 400; transition: color .2s; line-height: 1.4;
}
.dropdown-list a:hover { color: var(--white); }
.dropdown-list a.scene-link { cursor: pointer; }
.dropdown-list a.scene-link:hover { color: var(--orange); }
.dropdown-list a.loc-item {
  display: block; padding: 7px 24px 7px 32px; color: #666; font-size: 12px; line-height: 1.4;
  text-decoration: none; transition: color .2s;
}
.dropdown-list a.loc-item:hover { color: var(--orange); }

/* ── MAIN ── */
.main { margin-left: var(--sidebar); min-height: 100vh; }

/* ── LIVE STRIP (верх главной) ── */
.main-live {
  position: sticky; top: 0; z-index: 80;
  display: block; width: 100%;
  padding: 11px 28px;
  text-align: center;
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--orange);
  background: linear-gradient(180deg, rgba(255,106,0,0.12) 0%, rgba(255,106,0,0.04) 100%);
  border: none; border-bottom: 1px solid rgba(255,106,0,0.18);
  cursor: pointer;
  transition: background .2s, filter .2s;
}
.main-live:hover { filter: brightness(1.08); }
.main-live:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.main-live-text { color: var(--orange); }
.main-live-sep { color: rgba(255,106,0,0.45); font-weight: 600; }
.main-live-cta { color: var(--orange-light); font-weight: 800; }

/* ── О проекте (модальное окно) ── */
.project-about-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  max-width: min(640px, calc(100vw - 32px));
  width: 100%;
  max-height: min(88vh, 820px);
  padding: 0;
  border: none;
  background: transparent;
  color: var(--white);
  box-sizing: border-box;
}
.project-about-modal::backdrop {
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
}
.project-about-card {
  position: relative;
  background: var(--dark);
  border: 1px solid rgba(255,106,0,0.22);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(255,106,0,0.06) inset,
    0 24px 80px rgba(0,0,0,0.55);
  padding: 0;
  max-height: min(88vh, 820px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.project-about-body {
  padding: 28px 28px 26px;
  padding-right: 22px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,106,0,0.35) transparent;
}
.project-about-body::-webkit-scrollbar { width: 5px; }
.project-about-body::-webkit-scrollbar-thumb {
  background: rgba(255,106,0,0.35);
  border-radius: 4px;
}
.project-about-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17,17,17,0.85); border: 1px solid rgba(255,255,255,0.08);
  color: var(--gray); font-size: 20px; line-height: 1;
  cursor: pointer; border-radius: 10px;
  transition: color .2s, background .2s, border-color .2s;
}
.project-about-close:hover {
  color: var(--white);
  background: rgba(255,106,0,0.12);
  border-color: rgba(255,106,0,0.25);
}
.project-about-kicker {
  font-size: 10px; font-weight: 700; letter-spacing: 2.8px; text-transform: uppercase;
  color: var(--orange); margin: 0 0 10px;
}
.project-about-title {
  font-size: clamp(1.15rem, 3.8vw, 1.45rem); font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.25; margin: 0 44px 20px 0; color: var(--white);
  text-transform: none;
}
.project-about-body p {
  font-size: 14px; line-height: 1.78; color: #bbb; font-weight: 400;
  margin-bottom: 14px; text-transform: none; letter-spacing: normal;
}
.project-about-body > .project-about-kicker { margin-bottom: 10px; }
.project-about-step p { margin-bottom: 12px; }
.project-about-step p:last-child { margin-bottom: 0; }
.project-about-callout p { margin-bottom: 12px; }
.project-about-callout p:last-child { margin-bottom: 0; }
.project-about-highlight {
  margin: 16px 0 0 !important;
  padding: 14px 16px;
  background: rgba(255,106,0,0.07);
  border-left: 3px solid var(--orange);
  border-radius: 0 8px 8px 0;
  color: #ccc !important;
  font-weight: 500 !important;
}
.project-about-rule {
  border: none; height: 1px;
  margin: 22px 0;
  background: linear-gradient(90deg, transparent, rgba(255,106,0,0.35), transparent);
}
.project-about-h {
  font-size: 10px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--orange); margin: 4px 0 10px;
}
.project-about-muted-intro {
  font-size: 13px !important; color: #888 !important; margin: -4px 0 16px !important;
}
.project-about-step {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.project-about-step:last-of-type { border-bottom: none; padding-bottom: 0; margin-bottom: 8px; }
.project-about-step-head {
  display: flex; align-items: center; gap: 12px;
  font-size: 15px; font-weight: 700; color: var(--white);
  margin-bottom: 10px; letter-spacing: -0.02em;
}
.project-about-step-num {
  flex-shrink: 0; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,106,0,0.15); border: 1px solid rgba(255,106,0,0.35);
  border-radius: 8px; font-size: 13px; font-weight: 800; color: var(--orange);
}
.project-about-step .project-about-step-foot {
  font-size: 13px !important; color: #888 !important; margin-bottom: 0 !important; font-style: italic;
}
.project-about-quote {
  margin: 12px 0 14px; padding: 14px 16px 14px 18px;
  border-left: 3px solid rgba(255,106,0,0.5);
  background: rgba(255,255,255,0.03);
  border-radius: 0 10px 10px 0;
  font-size: 14px; line-height: 1.65; color: #aaa; font-style: italic;
}
.project-about-agents {
  list-style: none; padding: 0; margin: 10px 0 0;
}
.project-about-agents li {
  position: relative;
  padding: 8px 0 8px 18px;
  font-size: 13px; line-height: 1.55; color: #b8b8b8;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.project-about-agents li:last-child { border-bottom: none; }
.project-about-agents li::before {
  content: ''; position: absolute; left: 0; top: 15px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--orange); opacity: 0.65;
}
.project-about-agents strong { color: #e8e8e8; font-weight: 600; }
.project-about-callout {
  margin-top: 4px;
  padding: 18px 18px 16px;
  background: linear-gradient(165deg, rgba(255,106,0,0.1) 0%, rgba(255,106,0,0.03) 100%);
  border: 1px solid rgba(255,106,0,0.2);
  border-radius: 12px;
}
.project-about-callout p { margin-bottom: 12px; font-size: 14px; line-height: 1.75; color: #bbb; }
.project-about-callout p:last-child { margin-bottom: 0; }
.project-about-callout-lead {
  font-size: 15px !important; font-weight: 600 !important; color: var(--white) !important;
  margin-bottom: 12px !important;
}
.project-about-status {
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 14px !important; line-height: 1.75 !important; color: #9a9a9a !important;
  margin-bottom: 0 !important;
}
.project-about-status a {
  color: var(--orange, #ff6a00);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.project-about-status a:hover {
  color: #ff8533;
}

.comments-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(1100px, calc(100vw - 40px));
  max-height: min(90vh, 940px);
  padding: 0;
  border: none;
  background: transparent;
  color: var(--white);
}
.comments-modal::backdrop {
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(8px);
}
.comments-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 940px);
  background: linear-gradient(180deg, rgba(26,26,26,0.98) 0%, rgba(12,12,12,0.98) 100%);
  border: 1px solid rgba(255,106,0,0.22);
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(255,106,0,0.05) inset,
    0 24px 80px rgba(0,0,0,0.6);
  overflow: hidden;
}
.comments-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17,17,17,0.88);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: #888;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
}
.comments-modal-close:hover {
  color: var(--white);
  background: rgba(255,106,0,0.12);
  border-color: rgba(255,106,0,0.28);
}
.comments-modal-body {
  padding: 28px 28px 32px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,106,0,0.35) transparent;
}
.comments-modal-body::-webkit-scrollbar { width: 5px; }
.comments-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255,106,0,0.35);
  border-radius: 4px;
}
.comments-modal-head {
  margin-bottom: 20px;
  padding-right: 52px;
}
.comments-modal-kicker {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.8px;
  text-transform: uppercase;
  color: var(--orange);
}
.comments-modal-title {
  margin: 0;
  font-size: clamp(1.5rem, 3.8vw, 2.3rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.comments-modal-sub {
  margin: 10px 0 0;
  font-size: 14px;
  color: #888;
  line-height: 1.5;
}

/* ── HERO ── */
#hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; position: relative; overflow: hidden; padding: 40px;
}
.hero-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 55%, rgba(255,106,0,0.1) 0%, transparent 65%),
              radial-gradient(ellipse 40% 30% at 80% 20%, rgba(255,106,0,0.05) 0%, transparent 60%);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,106,0,0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,106,0,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}
.hero-content { position: relative; z-index: 1; }
.hero-label {
  display: inline-block; background: rgba(255,106,0,0.1); border: 1px solid var(--border);
  color: var(--orange); font-size: 11px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; padding: 6px 18px; border-radius: 100px; margin-bottom: 36px;
}
.hero-title {
  font-size: clamp(72px, 14vw, 160px); font-weight: 900; line-height: .95;
  letter-spacing: -4px; cursor: pointer; transition: color .3s; user-select: none;
}
.hero-title:hover { color: var(--orange); }
.hero-sub {
  font-size: 15px; font-weight: 300; color: var(--gray); margin-top: 24px;
  letter-spacing: 1px; line-height: 1.7;
}
.hero-hint {
  margin-top: 48px; display: flex; align-items: center; justify-content: center;
  gap: 10px; color: #444; font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
  animation: pulse 2s ease-in-out infinite;
}
.hero-hint-arrow { font-size: 18px; }
@keyframes pulse { 0%,100%{opacity:.4} 50%{opacity:1} }

/* ── SCENES ── */
/* Статический сайт: .scene-lazy; PHP: .scene-section--server сразу в DOM */
.scene-section {
  padding: 100px 60px; border-top: 1px solid rgba(255,255,255,0.05);
}
.scene-section.scene-section--server {
  opacity: 1;
  transform: none;
}
.scene-meta {
  font-size: 11px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  color: var(--orange); margin-bottom: 10px;
}
.scene-title { font-size: clamp(28px, 4vw, 44px); font-weight: 900; letter-spacing: -1px; margin-bottom: 8px; }
.scene-subtitle { font-size: 13px; color: var(--gray); margin-bottom: 36px; font-style: italic; }
.scene-img {
  width: 100%; max-height: 500px; object-fit: cover; border-radius: 4px;
  display: block; margin-bottom: 52px;
}
.scene-body { max-width: 680px; }
.scene-body p { font-size: 16px; line-height: 2; margin-bottom: 1.2em; color: #ccc; font-weight: 300; }
.scene-body p em { color: #aaa; font-style: italic; }
.scene-body hr { border: none; border-top: 1px solid rgba(255,255,255,0.07); margin: 22px 0; }

/* ── CHARACTER PANEL ── */
.char-panel {
  position: fixed; top: 0; right: -520px; bottom: 0; width: 500px;
  background: var(--dark); border-left: 1px solid rgba(255,255,255,0.07);
  z-index: 500; overflow-y: auto; transition: right .35s cubic-bezier(.4,0,.2,1);
  padding: 0;
}
.char-panel.open { right: 0; }
/* Локации: панель чуть шире, чтобы таблицы и текст помещались */
.char-panel.loc-wide {
  width: 600px;
  right: -620px;
}
.char-panel.loc-wide.open { right: 0; }
.char-panel-close {
  position: sticky; top: 0; width: 100%; background: rgba(17,17,17,.95);
  border-bottom: 1px solid rgba(255,255,255,0.07); padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; backdrop-filter: blur(10px);
}
.char-panel-close span { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--gray); }
.char-panel-close button {
  background: none; border: none; color: var(--gray); cursor: pointer;
  font-size: 20px; line-height: 1; transition: color .2s; padding: 0 4px;
}
.char-panel-close button:hover { color: var(--white); }
.char-panel-body { padding: 32px 32px 60px; }
.char-panel-body img { width: 100%; max-height: 340px; object-fit: cover; border-radius: 4px; margin-bottom: 28px; display: block; }
.char-panel-body h2 { font-size: 2em; font-weight: 900; letter-spacing: -1px; margin-bottom: 8px; }
.char-panel-body .tags { margin-bottom: 24px; }
.char-panel-body .tag { display: inline-block; background: rgba(255,106,0,.1); border: 1px solid rgba(255,106,0,.25); color: var(--orange); padding: 3px 10px; border-radius: 100px; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-right: 5px; margin-bottom: 5px; }
.char-panel-body .section-lbl { font-size: 10px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--orange); margin-top: 24px; margin-bottom: 6px; }
.char-panel-body ul { padding-left: 18px; line-height: 1.9; color: #bbb; }
.char-panel-body ul li { margin-bottom: 3px; font-size: 14px; }
.char-panel-body p { font-size: 14px; color: #bbb; line-height: 1.8; }
/* Контент страниц локаций (h2 там = подзаголовки секций, не имя как у персонажа) */
.char-panel-body .loc-content h2 {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--orange);
  margin-top: 24px;
  margin-bottom: 8px;
}
.char-panel-body .loc-content h2:first-child { margin-top: 0; }
.char-panel-body .loc-content .tags { margin-bottom: 20px; }
.char-panel-body .loc-content ul { padding-left: 18px; line-height: 1.9; color: #bbb; }
.char-panel-body .loc-content ul li { font-size: 14px; }
.char-panel-body .loc-content table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.char-panel-body .loc-content td, .char-panel-body .loc-content th {
  padding: 8px 10px; border: 1px solid rgba(255,255,255,.07); color: #bbb;
}
.char-panel-body .loc-content th {
  color: var(--orange); font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: 1px;
}
.char-panel-body .loc-content hr { border: none; border-top: 1px solid rgba(255,255,255,.07); margin: 24px 0; }
.char-panel-body .loc-content img.hero { max-height: 380px; }
.panel-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 499; }
.panel-overlay.open { display: block; }

/* ── FOOTER ── */
.sim-footer {
  margin-left: 0; background: var(--dark); padding: 40px 60px;
  border-top: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.sim-footer-name { font-size: 18px; font-weight: 900; letter-spacing: 2px; }
.sim-footer-name span { color: var(--orange); }
.sim-footer-copy { font-size: 13px; color: var(--gray); }

@media(max-width:900px){
  .sidebar {
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 290;
    box-shadow: none;
  }
  .sidebar.mob-open {
    transform: translateX(0);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.45);
  }
  .main { margin-left: 0; }

  /* Затемнение контента: тап и свайп закрывают меню */
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 280;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .sidebar-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  #hero { padding: 80px 20px 60px; }
  .hero-title {
    font-size: clamp(40px, 13vw, 72px);
    letter-spacing: -2px;
    word-break: break-word;
  }
  .hero-sub { font-size: 14px; }
  .hero-label { font-size: 10px; letter-spacing: 2px; }

  .scene-section { padding: 52px 20px; }
  .scene-title { font-size: clamp(22px, 6vw, 36px); }
  .scene-body p { font-size: 15px; }

  /* Плеер на всю ширину экрана (без сдвига из‑за var(--sidebar)) */
  .tts-bar {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw;
    margin: 0;
    padding: 10px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    box-sizing: border-box;
  }
  .tts-bar-row-main { gap: 8px; flex-wrap: wrap; }
  .tts-bar-row-seek { gap: 8px; }
  .tts-speed-wrap label { display: none; }
  .tts-speed-wrap input[type=range] { width: 72px; }

  .sim-footer { padding: 32px 20px; }
  .mob-menu-btn { display: flex !important; }

  .char-panel { width: 100%; right: -100%; }
  .char-panel.loc-wide { width: 100%; right: -100%; }

  .sidebar-news { margin: 0 12px 12px; }
  .sidebar-comments { margin: 0 12px 12px; }
  .sidebar-chapters { margin: 0 8px; }
  .chapter-feed-marker { padding: 40px 16px 32px; }
  .chapter-feed-marker__title { font-size: clamp(32px, 11vw, 52px) !important; }
  .sidebar-audio-mode { margin: 0 12px 12px; }
  .sidebar-news-panel { max-height: min(40vh, 220px); }

  .main-live { padding: 10px 16px; font-size: 10px; letter-spacing: 1.5px; }

  .comments-modal {
    width: calc(100vw - 16px);
    max-height: 92vh;
  }
  .comments-modal-body {
    padding: 18px 16px 20px;
  }
  .comments-modal-head {
    padding-right: 44px;
  }
  .comments-modal-form {
    padding: 14px;
  }
  .comment-item {
    padding: 16px;
  }
  .comment-header {
    align-items: flex-start;
    gap: 8px;
    flex-direction: column;
  }
  .comment-actions {
    gap: 8px;
  }
}
.mob-menu-btn {
  display: none; position: fixed; top: 16px; left: 16px; z-index: 310;
  background: var(--dark); border: 1px solid rgba(255,255,255,.1); color: var(--white);
  padding: 10px 14px; border-radius: 4px; cursor: pointer; font-size: 18px;
  align-items: center; justify-content: center;
}

/* ── VISIT COUNTER ── */
.visit-counter {
  padding: 18px 24px; border-top: 1px solid rgba(255,255,255,0.05);
  display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;
}
.vc-row { display: flex; align-items: center; gap: 9px; }
.vc-num { font-size: 17px; font-weight: 900; color: var(--white); font-variant-numeric: tabular-nums; min-width: 36px; line-height: 1; }
.vc-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.vc-dot.orange { background: var(--orange); }
.vc-dot.gray   { background: #3a3a3a; }

/* ── LAZY SCENE WRAPPER ── */
.scene-lazy {
  border-top: 1px solid rgba(255,255,255,0.05);
  min-height: 120px;
  position: relative;
}
.scene-lazy.loaded { min-height: 0; }
.scene-lazy .scene-section {
  padding: 100px 60px;
  opacity: 0; transform: translateY(40px);
  transition: opacity .7s ease, transform .7s ease;
}
.scene-lazy .scene-section.visible { opacity: 1; transform: translateY(0); }
.scene-section:focus { outline: none; }
.scene-section:focus-visible { outline: 2px solid rgba(255,106,0,0.45); outline-offset: 6px; }
.scene-skeleton {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; color: #222; font-size: 11px; letter-spacing: 2px;
  text-transform: uppercase;
}
.scene-skeleton--err { color: #a65; text-transform: none; letter-spacing: 0; padding: 24px; text-align: center; font-size: 13px; }
@media(max-width:900px){
  .scene-lazy .scene-section { padding: 52px 20px; }
}

/* ── BACK TO TOP ── */
.back-top {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  width: 44px; height: 44px; background: var(--dark2);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--gray); font-size: 18px; line-height: 1;
  transition: all .2s; opacity: 0; pointer-events: none; transform: translateY(8px);
}
.back-top.show { opacity: 1; pointer-events: all; transform: translateY(0); }
.back-top:hover { background: var(--orange); border-color: var(--orange); color: var(--white); }

/* ── TTS BAR ── */
.tts-bar {
  position: fixed; bottom: 0; left: var(--sidebar); right: 0; z-index: 400;
  background: rgba(17,17,17,0.97); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border); padding: 12px 32px 14px;
  transform: translateY(100%); transition: transform .3s ease;
  pointer-events: none; opacity: 0;
  box-sizing: border-box;
}
.tts-bar.visible { transform: translateY(0); pointer-events: all; opacity: 1; }
.tts-bar-rows { display: flex; flex-direction: column; gap: 10px; width: 100%; min-width: 0; }
.tts-bar-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tts-bar-row-main { width: 100%; }
.tts-bar-row-mode {
  width: 100%; flex-wrap: wrap; gap: 8px 14px;
  padding-bottom: 2px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.tts-mode-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: #444; flex-shrink: 0;
}
.tts-mode-seg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.tts-mode-opt {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: #888; cursor: pointer; user-select: none;
}
.tts-mode-opt input { accent-color: var(--orange); }
.tts-mode-opt:hover { color: #bbb; }
.tts-bar-row-seek { width: 100%; gap: 12px; }
.tts-time {
  font-size: 11px; font-variant-numeric: tabular-nums; color: var(--gray);
  min-width: 2.5em; flex-shrink: 0;
}
.tts-seek {
  flex: 1; min-width: 0; height: 6px; accent-color: var(--orange); cursor: pointer;
}
.tts-ctrl-btn {
  background: none; border: none; color: var(--gray); cursor: pointer;
  font-size: 19px; line-height: 1; transition: color .2s; padding: 4px 6px; flex-shrink: 0;
}
.tts-ctrl-btn:hover { color: var(--white); }
.tts-title { font-size: 12px; color: #888; flex: 1; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tts-speed-wrap { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tts-speed-wrap label { font-size: 10px; color: #444; letter-spacing: 1px; text-transform: uppercase; }
.tts-speed-wrap input[type=range] { width: 90px; accent-color: var(--orange); cursor: pointer; }
.tts-speed-val { font-size: 11px; color: var(--gray); min-width: 30px; }
.scene-listen-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 32px;
  background: none; border: 1px solid rgba(255,106,0,0.3); color: var(--orange);
  padding: 7px 16px; border-radius: 4px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .2s; font-family: 'Inter', sans-serif; letter-spacing: .5px;
}
.scene-listen-btn:hover { background: rgba(255,106,0,0.1); border-color: var(--orange); }
.scene-listen-btn.playing { background: rgba(255,106,0,0.12); border-color: var(--orange); color: var(--white); }

/* ── COMMENTS ── */
.comment-form { display: flex; flex-direction: column; gap: 12px; max-width: 640px; margin-bottom: 32px; }
.comments-modal-form {
  max-width: none;
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
}
.comment-inp {
  background: var(--dark2); border: 1px solid rgba(255,255,255,0.07);
  color: var(--white); padding: 12px 16px; font-size: 14px;
  font-family: 'Inter', sans-serif; border-radius: 4px; outline: none; transition: border-color .2s;
}
.comment-inp:focus { border-color: var(--orange); }
.comment-inp::placeholder { color: #333; }
textarea.comment-inp { resize: vertical; min-height: 88px; }
.comment-submit {
  align-self: flex-start; background: var(--orange); color: var(--white);
  border: none; padding: 11px 28px; font-size: 14px; font-weight: 700;
  border-radius: 4px; cursor: pointer; transition: background .2s; font-family: 'Inter', sans-serif;
}
.comment-submit:hover { background: var(--orange-light); }
.comment-flash { font-size: 13px; margin-bottom: 16px; padding: 10px 14px; border-radius: 4px; max-width: 640px; }
.comment-flash--ok { background: rgba(255,106,0,0.12); border: 1px solid rgba(255,106,0,0.35); color: #ccc; }
.comment-flash--err { background: rgba(180,40,40,0.15); border: 1px solid rgba(255,80,80,0.35); color: #e88; }
.comments-list { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.comments-list--modal { max-width: none; }
.like-inline { display: inline; margin: 0; padding: 0; }
.like-inline .like-btn { margin-top: 0; }
.comment-item { background: var(--dark); border: 1px solid rgba(255,255,255,0.04); padding: 20px 24px; border-radius: 12px; }
.comment-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.comment-author { font-size: 13px; font-weight: 700; }
.comment-time { font-size: 11px; color: #444; }
.comment-text { font-size: 14px; color: #aaa; line-height: 1.75; margin-bottom: 14px; }
.comment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1px solid rgba(255,255,255,0.08); color: #555;
  padding: 5px 13px; border-radius: 100px; font-size: 12px; cursor: pointer;
  transition: all .2s; font-family: 'Inter', sans-serif;
}
.like-btn:hover { border-color: var(--orange); color: var(--orange); }
.like-btn.liked { border-color: var(--orange); color: var(--orange); background: rgba(255,106,0,0.08); }
.comment-action-btn,
.comment-cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: #999;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.comment-action-btn:hover,
.comment-cancel-btn:hover {
  color: var(--white);
  border-color: rgba(255,106,0,0.32);
  background: rgba(255,106,0,0.08);
}
.comment-action-btn--danger:hover {
  color: #ffb0b0;
  border-color: rgba(255,80,80,0.35);
  background: rgba(180,40,40,0.14);
}
.comment-inline-form {
  margin: 0;
}
.comment-edit-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.comment-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.no-comments { font-size: 14px; color: #333; padding: 10px 0; }

/* Маркер главы в ленте — по центру, крупно, в стиле сайта */
.chapter-feed-marker {
  position: relative;
  padding: clamp(56px, 10vw, 96px) 28px clamp(40px, 6vw, 64px);
  text-align: center;
  border-top: 1px solid rgba(255,106,0,0.22);
  background:
    radial-gradient(ellipse 55% 80% at 50% 0%, rgba(255,106,0,0.14) 0%, transparent 62%),
    linear-gradient(180deg, rgba(255,106,0,0.06) 0%, transparent 70%);
  overflow: hidden;
}
.chapter-feed-marker__glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,106,0,0.12) 0%, transparent 55%);
  pointer-events: none;
}
.chapter-feed-marker__title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(40px, 7.5vw, 88px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -3px;
  color: var(--white);
  text-shadow: 0 0 60px rgba(255,106,0,0.18);
}
.chapter-feed-marker__rule {
  position: relative;
  z-index: 1;
  width: min(200px, 40vw);
  height: 3px;
  margin: 28px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  opacity: 0.85;
}

/* Переключатель глав: отдельные «страницы» ?ch= — в ленте только сцены активной главы */
.chapter-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  padding: 20px 20px 8px;
  border-bottom: 1px solid rgba(255, 106, 0, 0.15);
  background: rgba(0, 0, 0, 0.2);
}
.chapter-tabs__current {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--orange);
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid rgba(255, 106, 0, 0.45);
  background: rgba(255, 106, 0, 0.08);
}
.chapter-tabs__link {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: #aaa;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.chapter-tabs__link:hover {
  color: var(--white);
  border-color: rgba(255, 106, 0, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.chapter-empty {
  padding: 4rem 1.5rem 5rem; text-align: center; color: #666; font-size: 15px; line-height: 1.6; max-width: 520px; margin: 0 auto;
}
.chapter-empty__switch { margin-top: 1rem; }
.chapter-empty__switch a {
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
}
.chapter-empty__switch a:hover { text-decoration: underline; }
