:root {
  --paper: #f2ebdd;
  --paper2: #e8dfcc;
  --ink: #161412;
  --muted: #6b6359;
  --red: #c7362b;
  --gold: #b08a3e;
  --blue: #2e6fb7;
  --line: rgba(22,20,18,.15);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Rubik", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); }
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- Верхняя панель ---------- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 32px; background: rgba(242,235,221,.92); backdrop-filter: blur(6px); border-bottom: 2px solid var(--ink); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; text-decoration: none; }
.logo-sq { width: 18px; height: 18px; background: var(--ink); display: inline-block; }
.topbar nav { display: flex; gap: 24px; }
.topbar nav a { text-decoration: none; font-weight: 500; }
.topbar nav a:hover { color: var(--red); }

/* ---------- Обложка ---------- */
.hero { position: relative; min-height: 88vh; display: flex; align-items: center; padding: 60px 8vw; overflow: hidden; border-bottom: 2px solid var(--ink); }
.hero-text { position: relative; z-index: 2; max-width: 720px; }
.kicker { text-transform: uppercase; letter-spacing: .2em; font-size: 13px; font-weight: 700; color: var(--red); }
.hero h1 { font-family: var(--serif); font-size: clamp(44px, 7vw, 92px); line-height: 1; margin: 12px 0 24px; font-weight: 700; }
.hero h1 span { font-family: var(--sans); font-weight: 900; text-transform: uppercase; font-size: .78em; letter-spacing: -.01em; display: inline-block; background: var(--ink); color: var(--paper); padding: 4px 14px; margin-top: 10px; transform: rotate(-2deg); }
.lead { font-size: 19px; max-width: 600px; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.btn { display: inline-block; padding: 14px 26px; font-weight: 700; text-decoration: none; text-transform: uppercase; letter-spacing: .06em; font-size: 14px; border: 2px solid var(--ink); cursor: pointer; font-family: var(--sans); transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translate(-3px,-3px); box-shadow: 4px 4px 0 var(--ink); }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--paper); }

.hero-shapes .sh { position: absolute; display: block; }
.hero-shapes .circle { width: 38vw; height: 38vw; max-width: 520px; max-height: 520px; border-radius: 50%; background: var(--red); right: 6vw; top: 10%; opacity: .9; }
.hero-shapes .square { width: 22vw; height: 22vw; max-width: 300px; max-height: 300px; background: var(--ink); right: 24vw; bottom: 8%; transform: rotate(-12deg); }
.hero-shapes .bar { width: 50vw; height: 22px; background: var(--ink); right: -4vw; top: 52%; transform: rotate(-28deg); }
.hero-shapes .bar2 { width: 18vw; height: 60px; background: var(--gold); right: 4vw; bottom: 18%; transform: rotate(14deg); opacity: .9; }

/* ---------- Секции ---------- */
.section { padding: 90px 6vw; border-bottom: 2px solid var(--ink); }
.section-dark { background: var(--ink); color: var(--paper); }
.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head .num { font-weight: 900; font-size: 15px; color: var(--red); letter-spacing: .1em; }
.section-head h2 { font-family: var(--serif); font-size: clamp(34px, 5vw, 56px); margin: 6px 0 12px; line-height: 1.05; }
.section-head p { color: var(--muted); margin: 0; }
.section-dark .section-head p { color: #b8ae9f; }

/* ---------- Игра ---------- */
.game { background: #fffaf0; border: 2px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); min-height: 560px; }
.g-start { display: grid; place-items: center; text-align: center; padding: 70px 24px; min-height: 560px; }
.g-start h3 { font-family: var(--serif); font-size: 36px; margin: 0 0 10px; }
.g-start p { color: var(--muted); max-width: 520px; margin: 0 auto 24px; }
.g-start input { font: 18px var(--sans); padding: 12px 16px; border: 2px solid var(--ink); width: 260px; max-width: 100%; background: #fff; margin-right: 8px; margin-bottom: 10px; }
.g-start .resume { margin-top: 14px; font-size: 14px; }
.g-start .resume button { background: none; border: none; text-decoration: underline; cursor: pointer; font: inherit; color: var(--red); }

.g-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); min-height: 560px; }
.g-stage { position: relative; background: var(--paper2); border-right: 2px solid var(--ink); display: flex; flex-direction: column; }
.g-label { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 18px; border-bottom: 2px solid var(--ink); background: var(--paper); }
.g-chapter { background: var(--ink); color: var(--paper); font-weight: 700; padding: 3px 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.g-year { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--red); }
.g-place { font-size: 14px; color: var(--muted); width: 100%; }
.g-frame { flex: 1; display: grid; place-items: center; padding: 22px; }
.g-frame figure { margin: 0; text-align: center; animation: fadeIn .5s ease; }
.g-frame .art { max-height: 330px; width: auto; margin: 0 auto; border: 10px solid #3b2d1e; box-shadow: 0 10px 30px rgba(0,0,0,.3), inset 0 0 0 2px #8a6a3a; background: #3b2d1e; }
.g-frame figcaption { font-size: 14px; margin-top: 12px; color: var(--muted); }
.g-frame figcaption b { color: var(--ink); }
.g-new { display: inline-block; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.g-empty { width: 70%; aspect-ratio: 1; display: grid; place-items: center; }
.g-empty .mini-comp { position: relative; width: 100%; height: 100%; }

.g-dialog { display: flex; flex-direction: column; padding: 26px; }
.g-speaker { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; min-height: 64px; }
.portrait { width: 64px; height: 64px; flex: none; border: 2px solid var(--ink); background: var(--paper2) center/cover no-repeat; display: grid; place-items: center; font-weight: 900; font-size: 18px; }
.portrait.sq { background: #fff; }
.portrait.sq::after { content: ""; width: 34px; height: 34px; background: var(--ink); }
.portrait.hero-p { background: var(--red); color: #fff; }
.g-name { font-weight: 700; font-size: 18px; }
.g-name small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.g-text { font-family: var(--serif); font-size: 21px; line-height: 1.5; flex: 1; animation: fadeIn .35s ease; }
.g-text.narr { font-family: var(--sans); font-size: 18px; color: #3c3730; font-style: normal; }
.g-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.choice { text-align: left; font: 16px/1.4 var(--sans); padding: 13px 16px; border: 2px solid var(--ink); background: #fff; cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s; }
.choice:hover { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--red); background: #fff6ea; }
.next-btn { align-self: flex-end; }
.g-meters { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); }
.meter { padding: 10px 16px; border-right: 1px solid var(--line); font-size: 13px; }
.meter:last-child { border-right: none; }
.meter .bar { height: 8px; background: var(--paper2); margin-top: 6px; }
.meter .fill { height: 100%; transition: width .5s ease; }
.g-progress { height: 4px; background: var(--paper2); grid-column: 1 / -1; }
.g-progress div { height: 100%; background: var(--red); transition: width .4s; }

.g-end { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); min-height: 560px; }
.g-end .g-frame { background: var(--paper2); border-right: 2px solid var(--ink); }
.g-end-text { padding: 40px; }
.g-end-text .kicker { margin: 0; }
.g-end-text h3 { font-family: var(--serif); font-size: 40px; margin: 8px 0 16px; line-height: 1.1; }
.g-end-text .res { margin: 22px 0; display: grid; gap: 8px; }
.res-row { display: grid; grid-template-columns: 150px 1fr 30px; gap: 10px; align-items: center; font-size: 14px; }
.res-row .bar { height: 12px; background: var(--paper2); }
.res-row .fill { height: 100%; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Галерея ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.filter { font: 500 14px var(--sans); padding: 8px 16px; border: 2px solid var(--paper); background: transparent; color: var(--paper); cursor: pointer; }
.filter.active, .filter:hover { background: var(--paper); color: var(--ink); }
.filter .dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.card { position: relative; background: #24201c; cursor: pointer; border: 2px solid transparent; transition: transform .2s, border-color .2s; overflow: hidden; }
.card:hover { transform: translateY(-4px); border-color: var(--paper); }
.card .thumb { aspect-ratio: 4/5; overflow: hidden; background: #2c2722; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .thumb img { transform: scale(1.06); }
.card .info { padding: 12px 14px 14px; border-top: 4px solid var(--c, #888); }
.card h3 { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.25; }
.card .meta { font-size: 13px; color: #b8ae9f; margin-top: 4px; }
.card .seen { position: absolute; top: 10px; right: 10px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; }
.card.hide { display: none; }

.ph { width: 100%; height: 100%; min-height: 160px; display: grid; place-items: center; text-align: center; padding: 16px; color: #fff; font-family: var(--serif); font-size: 18px; background: var(--c, #555);
  background-image: radial-gradient(circle at 70% 30%, rgba(255,255,255,.18) 0 22%, transparent 23%), linear-gradient(135deg, transparent 60%, rgba(0,0,0,.25) 60%); }
.ph small { display: block; font-family: var(--sans); font-size: 12px; opacity: .8; margin-top: 6px; }

/* ---------- Лайтбокс ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(12,10,8,.94); display: flex; align-items: center; justify-content: center; padding: 30px 70px; color: var(--paper); }
.lightbox[hidden] { display: none; }
.lb-fig { margin: 0; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 34px; align-items: center; max-width: 1200px; width: 100%; animation: fadeIn .3s; }
.lb-img img { max-height: 80vh; width: auto; margin: 0 auto; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lb-img .ph { min-height: 50vh; }
.lb-fig h3 { font-family: var(--serif); font-size: 34px; margin: 10px 0 6px; line-height: 1.1; }
.lb-meta { color: #b8ae9f; margin: 0 0 14px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 4px 10px; color: #fff; }
.lb-close { position: absolute; top: 14px; right: 22px; font-size: 42px; background: none; border: none; color: var(--paper); cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 54px; background: none; border: none; color: var(--paper); cursor: pointer; padding: 10px; }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
.lb-nav:hover, .lb-close:hover { color: var(--red); }

/* ---------- Лента времени ---------- */
.tl-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 30px; font-size: 14px; }
.tl-legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; background: var(--c); margin-right: 6px; vertical-align: -1px; }
.tl { list-style: none; margin: 0; padding: 0; position: relative; max-width: 1000px; }
.tl::before { content: ""; position: absolute; left: 110px; top: 0; bottom: 0; width: 3px; background: var(--ink); }
.tl li { position: relative; display: grid; grid-template-columns: 90px 1fr; gap: 50px; padding: 0 0 30px; opacity: 0; transform: translateX(-20px); transition: opacity .5s, transform .5s; }
.tl li.vis { opacity: 1; transform: none; }
.tl .y { font-family: var(--serif); font-weight: 700; font-size: 26px; text-align: right; line-height: 1.2; }
.tl li::before { content: ""; position: absolute; left: 103px; top: 8px; width: 17px; height: 17px; background: var(--c); border: 2px solid var(--ink); }
.tl .box { background: #fffaf0; border: 2px solid var(--ink); padding: 14px 18px; border-left: 8px solid var(--c); cursor: pointer; transition: box-shadow .15s, transform .15s; }
.tl .box:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--ink); }
.tl .box h4 { margin: 0; font-size: 18px; }
.tl .box p { margin: 8px 0 0; color: #3c3730; display: none; }
.tl .box.open p { display: block; }
.tl .box .more { font-size: 12px; color: var(--muted); }

.footer { padding: 40px 6vw; font-size: 14px; }
.footer .muted { color: var(--muted); }

@media (max-width: 1200px) {
  .hero-shapes .square { right: 6vw; bottom: 4%; }
  .hero-shapes .circle { right: -4vw; }
}
/* ---------- Мобильные ---------- */
@media (max-width: 860px) {
  .topbar { padding: 10px 16px; }
  .topbar nav { gap: 14px; font-size: 14px; }
  .logo { font-size: 0; }
  .hero { padding: 50px 16px; min-height: 80vh; }
  .hero-shapes .circle { width: 70vw; height: 70vw; right: -20vw; top: 4%; opacity: .25; }
  .hero-shapes .square { opacity: .2; }
  .hero-shapes .bar, .hero-shapes .bar2 { opacity: .25; }
  .section { padding: 60px 16px; }
  .game { box-shadow: 5px 5px 0 var(--ink); }
  .g-main, .g-end { grid-template-columns: 1fr; }
  .g-stage, .g-end .g-frame { border-right: none; border-bottom: 2px solid var(--ink); }
  .g-frame .art { max-height: 230px; }
  .g-meters { grid-template-columns: repeat(2, 1fr); }
  .g-dialog, .g-end-text { padding: 18px; }
  .g-text { font-size: 18px; }
  .res-row { grid-template-columns: 110px 1fr 24px; }
  .lightbox { padding: 50px 16px 20px; overflow-y: auto; align-items: flex-start; }
  .lb-fig { grid-template-columns: 1fr; gap: 16px; }
  .lb-img img { max-height: 50vh; }
  .lb-nav { top: auto; bottom: 10px; transform: none; font-size: 40px; }
  .tl::before { left: 8px; }
  .tl li { grid-template-columns: 1fr; gap: 6px; padding-left: 34px; }
  .tl li::before { left: 1px; }
  .tl .y { text-align: left; font-size: 22px; }
}
