/*
 * Лендинг PirateCraft.
 *
 * Материи те же, что в игре: латунь по тёмному дереву, пергамент под текст,
 * бирюзовое море на картинках. Цвета взяты из client/src/ui/styles.css, имена
 * оставлены теми же, чтобы правка палитры читалась в обоих местах одинаково.
 * Тема одна, тёмная: лендинг — продолжение интерфейса игры, а не документ.
 */

:root {
  /* Layout: ночное море с пергаментом входа сверху, дальше тёмное дерево с картинками игры, площадки — на карте архипелага. */
  --deep: #21160b;
  --wood: #2c1e10;
  --wood-line: rgba(217, 154, 43, 0.28);
  --foam: #fdfbe2;
  --foam-mute: #cbbd9b;
  --sea: #1fb5c4;

  --sheet: #f7f2d8;
  --sheet-line: #8a6a44;
  --sheet-text: #3d1c05;
  --sheet-mute: #7d5f3c;
  --ink: #682805;
  --danger: #a8321c;

  --brass-top: #f0b73f;
  --brass-bottom: #d08c1c;
  --brass-shadow: #8a5a12;

  --font: 'PT Sans Narrow', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Alice', Georgia, 'Times New Roman', serif;
  --font-hand: 'Marck Script', 'Segoe Script', cursive;

  --step-h1: clamp(2.5rem, 5.6vw, 4.4rem);
  --step-h2: clamp(2rem, 3.6vw, 2.9rem);
  --step-h3: 1.4rem;

  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Скрытое скрыто, даже если правило элемента задаёт ему display: иначе
   display: grid у панелей галереи перебивал hidden, и вкладки шли все разом. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--deep);
  color: var(--foam);
  font: 400 1.15rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; }
a { color: var(--brass-top); }
:focus-visible { outline: 3px solid var(--brass-top); outline-offset: 3px; border-radius: 3px; }

.wrap { max-width: 1180px; margin-inline: auto; padding-inline: max(16px, 4vw); }
.hand { font: 400 1.7rem/1.1 var(--font-hand); color: var(--brass-top); }

/* ---------- кнопки: латунь, как в игре ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 400 1.2rem/1 var(--font-display);
  text-decoration: none; cursor: pointer; border: 0;
  padding: 15px 28px; border-radius: 6px;
  transition: transform .12s ease, filter .12s ease;
}
.btn--brass {
  color: var(--sheet-text);
  background: linear-gradient(180deg, var(--brass-top), var(--brass-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, .6), 0 3px 0 var(--brass-shadow), 0 6px 14px rgba(0, 0, 0, .35);
}
.btn--brass:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn--brass:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 240, 200, .6), 0 1px 0 var(--brass-shadow); }
.btn--small { padding: 10px 18px; font-size: 1.05rem; }
.btn--wide { width: 100%; }

/* ---------- шапка ---------- */
.top {
  position: absolute; inset: 0 0 auto 0; z-index: 5;
  padding-top: env(safe-area-inset-top, 0px);
}
.top__row { display: flex; align-items: center; gap: 28px; padding-block: 16px; }
.brand {
  display: flex; align-items: center; gap: 12px;
  font: 400 1.5rem/1 var(--font-display); color: var(--foam); text-decoration: none;
}
.brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 0 0 1px var(--wood-line); }
.top__nav { display: flex; gap: 26px; margin-left: auto; }
.top__nav a { color: var(--foam-mute); text-decoration: none; font-size: 1.1rem; }
.top__nav a:hover { color: var(--foam); }
@media (max-width: 760px) {
  .top__nav { display: none; }
  .top .btn { margin-left: auto; }
}

/* ---------- первый экран ---------- */
.hero {
  position: relative;
  background:
    linear-gradient(90deg, rgba(14, 10, 6, .92) 0%, rgba(14, 10, 6, .55) 48%, rgba(14, 10, 6, .2) 100%),
    linear-gradient(180deg, rgba(33, 22, 11, 0) 60%, var(--deep) 100%),
    url("../images/hero-siege.webp") 100% 30% / cover no-repeat,
    #0b1420;
}
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  gap: 56px; align-items: center;
  padding-block: 128px 96px;
}
.hero__copy { display: grid; gap: 20px; min-width: 0; }
.hero h1 { font: 400 var(--step-h1)/1.05 var(--font-display); color: var(--foam); text-shadow: 0 2px 18px rgba(0, 0, 0, .6); }
.lede { font-size: 1.35rem; line-height: 1.45; max-width: 36ch; color: var(--foam); opacity: .92; }
.hero__facts { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 36px; }
.hero__facts li { display: grid; gap: 2px; }
.hero__facts b { font: 400 2rem/1 var(--font-display); color: var(--brass-top); font-variant-numeric: tabular-nums; }
.hero__facts span { color: var(--foam-mute); font-size: 1rem; }
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; padding-block: 104px 64px; gap: 40px; }
  .hero { background-position: 0 0, 0 0, 70% center, 0 0; }
}

/* ---------- пергамент ---------- */
.sheet {
  position: relative;
  color: var(--sheet-text);
  background: var(--sheet) url("../images/paper.webp") center / cover;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(138, 106, 68, .5), 0 22px 50px rgba(0, 0, 0, .5);
}
.sheet::before {
  content: ""; position: absolute; inset: 9px; pointer-events: none;
  border: 1px solid rgba(138, 106, 68, .45); border-radius: 4px;
}

/* ---------- вход ---------- */
.login { padding: 30px 28px 26px; display: grid; gap: 16px; }
.login .hand { font-size: 2.3rem; color: var(--ink); }
.login__sub { color: var(--sheet-mute); font-size: 1.08rem; }
.login__socials { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.social {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 10px 12px; cursor: pointer;
  font: 400 1.1rem/1.1 var(--font); color: var(--sheet-text);
  background: rgba(255, 252, 238, .72);
  border: 1px solid rgba(138, 106, 68, .55); border-radius: 6px;
  transition: background .12s, border-color .12s;
}
.social:hover { background: #fffdf3; border-color: var(--sheet-line); }
.social:disabled { opacity: .55; cursor: progress; }
.social svg { width: 28px; height: 28px; flex: none; }
.social span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login__error { color: var(--danger); font-size: 1rem; }
.login__or {
  display: flex; align-items: center; gap: 12px;
  font: 400 1.25rem/1 var(--font-hand); color: var(--sheet-mute);
}
.login__or::before, .login__or::after { content: ""; flex: 1; height: 1px; background: rgba(138, 106, 68, .5); }
.login__reg { text-align: center; font-size: 1.05rem; }
.login__reg a { color: var(--ink); font-weight: 700; }
.login__fine a { color: var(--ink); }
.login__fine { font-size: .95rem; color: var(--sheet-mute); line-height: 1.4; border-top: 1px dashed rgba(138, 106, 68, .5); padding-top: 12px; }

/* ---------- секции ---------- */
section { padding-block: 96px; }
.hero { padding-block: 0; }
.sec-head { display: grid; gap: 6px; margin-bottom: 40px; }
.sec-head h2 { font: 400 var(--step-h2)/1.1 var(--font-display); }
.sec-head__sub { font-size: 1.15rem; max-width: 52ch; margin-top: 6px; }
.sec-head--row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; }

/* ---------- об игре ---------- */
.harbour { background: linear-gradient(180deg, var(--deep), var(--wood)); }
.harbour__art {
  margin-bottom: 48px; border-radius: 8px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--wood-line), 0 20px 50px rgba(0, 0, 0, .45);
  aspect-ratio: 2000 / 965; max-width: 100%;
}
.harbour__art img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 40px; }
.feature { display: grid; gap: 8px; align-content: start; min-width: 0; padding-top: 18px; border-top: 1px solid var(--wood-line); }
.feature h3 { font: 400 var(--step-h3)/1.2 var(--font-display); color: var(--brass-top); }
.feature p { color: var(--foam-mute); }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } .harbour__art { aspect-ratio: 1.6 / 1; } }

/* ---------- галерея ---------- */
.gallery { background: var(--wood); border-block: 1px solid var(--wood-line); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; border-radius: 8px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px var(--wood-line); }
.tab {
  font: 400 1.1rem/1 var(--font-display); color: var(--foam-mute);
  background: none; border: 0; border-radius: 5px; padding: 10px 16px; cursor: pointer;
}
.tab:hover { color: var(--foam); }
.tab[aria-selected="true"] { color: var(--sheet-text); background: linear-gradient(180deg, var(--brass-top), var(--brass-bottom)); }

.panel { display: grid; gap: 16px; }
.panel--game { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.panel--ships { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.panel--crew { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.panel--isles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.panel--forts { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.panel--loot { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.shot { margin: 0; display: grid; gap: 8px; min-width: 0; }
.shot a {
  display: block; overflow: hidden; border-radius: 6px; background: var(--deep);
  box-shadow: 0 0 0 1px var(--wood-line);
}
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.shot a:hover img { transform: scale(1.04); }
.shot figcaption { font: 400 1.05rem/1.2 var(--font-display); color: var(--foam); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.shot figcaption small { font: 400 1.15rem/1 var(--font-hand); color: var(--brass-top); }

/*
 * «Игра» на широком экране — мозаика без дыр, места заданы явно:
 *   гавань гавань  вблизи  море
 *   гавань гавань  фортуна команда
 *   лазарет лазарет мир    телефон
 *   лазарет лазарет задания телефон
 * Высоту рядов задают мелкие кадры 16:9. Большие картинку кладут поверх
 * своей клетки (position: absolute) и потому ряды не раздувают: иначе
 * высокий снимок телефона растягивал свои ряды, и рядом зияла пустота.
 */
.panel--game .shot a { aspect-ratio: 16 / 9; position: relative; }
.panel--game .shot--wide, .panel--game .shot--phone { grid-template-rows: minmax(0, 1fr) auto; }
.panel--game .shot--wide a, .panel--game .shot--phone a { aspect-ratio: auto; height: 100%; min-height: 0; }
.panel--game .shot--wide img, .panel--game .shot--phone img { position: absolute; inset: 0; }
.panel--game .shot--phone img { object-position: top; }
@media (min-width: 901px) {
  .panel--game > :nth-child(1) { grid-area: 1 / 1 / 3 / 3; }
  .panel--game > :nth-child(2) { grid-area: 1 / 3; }
  .panel--game > :nth-child(3) { grid-area: 1 / 4; }
  .panel--game > :nth-child(4) { grid-area: 2 / 3; }
  .panel--game > :nth-child(5) { grid-area: 2 / 4; }
  .panel--game > :nth-child(6) { grid-area: 3 / 1 / 5 / 3; }
  .panel--game > :nth-child(7) { grid-area: 3 / 3; }
  .panel--game > :nth-child(8) { grid-area: 4 / 3; }
  .panel--game > :nth-child(9) { grid-area: 3 / 4 / 5 / 5; }
}
.panel--ships .shot a { aspect-ratio: 531 / 230; }
.panel--crew .shot a { aspect-ratio: 2 / 3; }
.panel--crew .shot img { object-position: top; }
.panel--isles .shot a {
  aspect-ratio: 4 / 3;
  background: radial-gradient(ellipse at 50% 60%, rgba(31, 181, 196, .22), transparent 70%), var(--deep);
}
.panel--isles .shot img { object-fit: contain; padding: 8px; }
/* «Форты»: три больших арта в ряд, под ними панорамы обороны по две */
.panel--forts .shot--art { grid-column: span 2; }
.panel--forts .shot--art a { aspect-ratio: 3 / 2; }
.panel--forts .shot--strip { grid-column: span 3; }
.panel--forts .shot--strip a { aspect-ratio: 4 / 1; }
.panel--loot .shot a { aspect-ratio: 5 / 7; }

@media (max-width: 900px) {
  .panel--game, .panel--ships, .panel--crew, .panel--isles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel--loot { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .panel--forts { grid-template-columns: 1fr 1fr; }
  .panel--forts .shot--art:first-child { grid-column: span 2; }
  .panel--forts .shot--art, .panel--forts .shot--strip { grid-column: auto; }
  /* В две колонки телефон встаёт во всю ширину, иначе остаётся один в ряду */
  .panel--game .shot--wide { grid-column: span 2; }
  .panel--game .shot--phone { grid-column: span 2; }
  .panel--game .shot--wide a, .panel--game .shot--phone a { aspect-ratio: 16 / 9; height: auto; }
  .panel--game .shot--phone img { object-position: center 65%; }
}
@media (max-width: 520px) {
  .panel--game, .panel--ships { grid-template-columns: 1fr; }
  .panel--loot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel--forts { grid-template-columns: 1fr; }
  .panel--forts .shot--art:first-child { grid-column: auto; }
  .panel--game .shot--wide, .panel--game .shot--phone { grid-column: auto; }
}

/* ---------- просмотр картинки ---------- */
.lightbox {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%;
  margin: 0; padding: 56px 16px; border: 0;
  background: rgba(14, 10, 6, .94); color: var(--foam);
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(0, 0, 0, .6); }
.lightbox figure { margin: 0; display: grid; gap: 12px; justify-items: center; max-width: min(1400px, 100%); }
.lightbox img { max-height: calc(100vh - 170px); width: auto; border-radius: 6px; box-shadow: 0 0 0 1px var(--wood-line); }
.lightbox figcaption { font: 400 1.25rem/1.2 var(--font-display); text-align: center; }
.lightbox__btn {
  position: fixed; width: 48px; height: 48px; border-radius: 50%;
  font: 400 2rem/1 var(--font-display); cursor: pointer;
  color: var(--sheet-text); border: 0;
  background: linear-gradient(180deg, var(--brass-top), var(--brass-bottom));
  box-shadow: 0 3px 0 var(--brass-shadow);
}
.lightbox__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__close { right: 16px; top: calc(16px + env(safe-area-inset-top, 0px)); }
@media (max-width: 600px) {
  .lightbox__prev, .lightbox__next { top: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: none; }
}

/* ---------- первые шаги ---------- */
.voyage { background: var(--deep); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; counter-reset: none; }
.steps li { display: grid; gap: 8px; align-content: start; min-width: 0; position: relative; }
.steps__n {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font: 400 1.3rem/1 var(--font-display); color: var(--sheet-text);
  background: linear-gradient(180deg, var(--brass-top), var(--brass-bottom));
  box-shadow: 0 0 0 4px var(--deep), 0 0 0 5px var(--wood-line);
  margin-bottom: 8px;
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 26px; left: 66px; right: -18px;
  border-top: 2px dashed var(--wood-line);
}
.steps h3 { font: 400 var(--step-h3)/1.2 var(--font-display); }
.steps p { color: var(--foam-mute); }
@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li::after { display: none; }
}
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ---------- площадки: на карте архипелага ---------- */
.ports { background: linear-gradient(180deg, var(--deep), var(--wood)); }
.sheet--chart {
  background:
    linear-gradient(rgba(247, 242, 216, .82), rgba(247, 242, 216, .82)),
    url("../images/world-chart.webp") center / cover,
    var(--sheet);
}
.ports__sheet { padding: clamp(28px, 5vw, 56px); }
.ports__sheet .hand { color: var(--ink); font-size: 2rem; }
.ports__sheet .sec-head { margin-bottom: 28px; }
.ports__sheet .sec-head__sub { color: var(--sheet-mute); }
.ports__label { font: 400 1.6rem/1 var(--font-hand); color: var(--sheet-mute); margin: 8px 0 12px; }
.ports__list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 12px; }
.ports__list:last-child { margin-bottom: 0; }
.port {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 6px; min-width: 0;
  background: rgba(255, 252, 238, .75); border: 1px solid rgba(138, 106, 68, .5);
  color: var(--sheet-text); text-decoration: none;
}
a.port:hover { border-color: var(--ink); background: #fffdf3; }
.port__mark {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  font: 700 .85rem/1 var(--font); color: #fff;
}
.port__mark svg { width: 24px; height: 24px; display: block; }
/* Знак площадки, который сам и есть плитка (RuStore, ВК): во весь квадрат. */
.port__mark--tile { overflow: hidden; }
.port__mark--tile svg { width: 100%; height: 100%; }
.port__name { font: 400 1.15rem/1.2 var(--font-display); display: grid; min-width: 0; overflow-wrap: anywhere; }
.port__name small { font: 400 .95rem/1.3 var(--font); color: var(--sheet-mute); }
.pill { font: 700 .8rem/1 var(--font); letter-spacing: .06em; text-transform: uppercase; padding: 6px 9px; border-radius: 4px; border: 1px dashed var(--sheet-mute); color: var(--sheet-mute); white-space: nowrap; }
.pill--live { border: 0; color: var(--sheet-text); background: linear-gradient(180deg, var(--brass-top), var(--brass-bottom)); }
.port--soon { opacity: .78; }

/* ---------- вопросы ---------- */
.faq { background: var(--wood); }
.faq__wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; }
.faq__list { display: grid; }
.faq details { border-bottom: 1px solid var(--wood-line); padding-block: 18px; }
.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px;
  font: 400 1.35rem/1.25 var(--font-display);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brass-top); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: 10px; color: var(--foam-mute); max-width: 62ch; }
@media (max-width: 800px) { .faq__wrap { grid-template-columns: 1fr; gap: 0; } }

/* ---------- финал и подвал ---------- */
.final {
  padding-block: 72px;
  background:
    linear-gradient(90deg, rgba(14, 10, 6, .9), rgba(14, 10, 6, .55)),
    url("../images/hero-night.webp") center / cover,
    var(--deep);
}
.final__row { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 32px; }
.final img { width: 96px; height: 96px; border-radius: 20px; box-shadow: 0 0 0 1px var(--wood-line); }
.final h2 { font: 400 clamp(1.7rem, 3vw, 2.4rem)/1.15 var(--font-display); flex: 1 1 300px; }
.foot { padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); color: var(--foam-mute); font-size: 1rem; border-top: 1px solid var(--wood-line); }
.foot__row { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a { color: var(--foam-mute); }
.age { border: 1px solid var(--foam-mute); border-radius: 3px; padding: 2px 6px; color: var(--foam); margin-right: 6px; }

/* ---------- документы: соглашение и политика ---------- */
.doc-page { background: linear-gradient(180deg, #0e0a06 0, var(--deep) 420px); }
.doc-top { padding-top: env(safe-area-inset-top, 0px); }
.doc-top .btn { margin-left: auto; }
.doc-wrap { padding-block: 24px 72px; }
.doc {
  max-width: 860px; margin-inline: auto;
  padding: clamp(28px, 6vw, 64px) clamp(20px, 6vw, 72px);
  display: grid; gap: 14px;
  font-size: 1.15rem; line-height: 1.55;
}
.doc .hand { color: var(--ink); font-size: 1.9rem; }
.doc h1 { font: 400 clamp(2rem, 4.5vw, 2.8rem)/1.1 var(--font-display); color: var(--sheet-text); }
.doc h2 { font: 400 1.6rem/1.2 var(--font-display); color: var(--ink); margin-top: 22px; margin-bottom: 4px; }
.doc section { display: grid; gap: 10px; scroll-margin-top: 16px; }
.doc p, .doc li { max-width: 68ch; }
.doc a { color: var(--ink); }
.doc ul { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.doc__meta { color: var(--sheet-mute); }
.doc__lead { padding: 14px 18px; border-radius: 6px; background: rgba(255, 252, 238, .6); border-left: 3px solid var(--brass-bottom); }
.doc__toc { border-block: 1px solid rgba(138, 106, 68, .45); padding-block: 12px; }
.doc__toc ol { margin: 0; padding-left: 1.4em; columns: 2 240px; column-gap: 32px; }
.doc__toc li { padding-block: 2px; break-inside: avoid; }
.doc__table { overflow-x: auto; }
.doc table { width: 100%; border-collapse: collapse; font-size: 1.05rem; min-width: 480px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-bottom: 1px solid rgba(138, 106, 68, .4); }
.doc th { font: 400 1.1rem/1.2 var(--font-display); color: var(--ink); }
.doc td:first-child { font-weight: 700; width: 46%; }
.doc__props { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 20px; margin: 4px 0 0; }
.doc__props dt { color: var(--sheet-mute); }
.doc__props dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .doc__props { grid-template-columns: 1fr; gap: 0; } .doc__props dd { margin-bottom: 8px; } }
.doc table.price td:first-child { font-weight: 400; width: auto; }
.doc table.price td:not(:first-child), .doc table.price th:not(:first-child) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc table.price td:nth-child(3) { font-weight: 700; }
.doc table.price--spend td:not(:first-child) { white-space: normal; min-width: 7em; }
.doc__steps { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; }
/* Гайды: оглавление, хлебные крошки и переход к соседнему гайду. */
.doc ol { margin: 0; }
/* Общий отступ разделов лендинга (96px) в гайде рвал бы текст на острова. */
.doc--guide section { padding-block: 0; }
.doc__crumbs { color: var(--sheet-mute); font-size: 1rem; }
.guide-list { list-style: none; padding: 0; display: grid; gap: 14px; counter-reset: guide; }
.guide-list li { counter-increment: guide; display: grid; gap: 4px; padding: 14px 18px; border-radius: 6px; background: rgba(255, 252, 238, .6); border-left: 3px solid var(--brass-bottom); max-width: none; }
.guide-list a { font: 400 1.35rem/1.25 var(--font-display); text-decoration: none; }
.guide-list a::before { content: counter(guide) ". "; }
.guide-list a:hover { text-decoration: underline; }
.guide-list span { color: var(--sheet-mute); }
.doc__turn { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: 24px; padding-top: 14px; border-top: 1px solid rgba(138, 106, 68, .45); }
.doc__play { margin-top: 10px; text-align: center; max-width: none; }
.doc .doc__play .btn { color: #2b1a05; }
.foot a[aria-current="page"] { color: var(--foam); text-decoration: none; }

/* ---------- новости: пергамент с картинкой, как доска объявлений в гавани ---------- */
.news-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 900px) { .news-strip { grid-template-columns: 1fr; } }
.news-card { overflow: hidden; display: flex; flex-direction: column; }
.news-card__picture { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.news-card__body { position: relative; display: grid; gap: 10px; align-content: start; padding: 22px 26px 26px; }
.news-card__date { font: 400 1.35rem/1 var(--font-hand); color: var(--ink); }
.news-card__title { font: 400 1.45rem/1.2 var(--font-display); color: var(--sheet-text); }
.news-card__title a { color: inherit; text-decoration: none; }
.news-card__title a:hover { color: var(--ink); text-decoration: underline; }
.news-card__text { color: var(--sheet-text); white-space: pre-line; overflow-wrap: anywhere; }
.news-strip .news-card__text { color: var(--sheet-mute); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.news-more { margin-top: 32px; text-align: center; }

.news-page { max-width: 900px; }
.news-page__head { margin-bottom: 28px; }
.news-page__head h1 { font: 400 var(--step-h1)/1.05 var(--font-display); }
.news-feed { display: grid; gap: 32px; }
.news-card--full { scroll-margin-top: 24px; }
.news-card--full .news-card__body { padding: clamp(22px, 5vw, 44px) clamp(20px, 5vw, 56px); gap: 14px; font-size: 1.15rem; line-height: 1.55; }
.news-card--full .news-card__title { font-size: clamp(1.6rem, 3.2vw, 2.1rem); }
.news-card--full .news-card__text { max-width: 68ch; }
.news-page__empty { color: var(--foam-mute); font-size: 1.2rem; }
.news-page__more { margin-top: 36px; text-align: center; }
/* Страница одной новости (/news/<номер>, собирает сервер). */
.news-page__back { margin-bottom: 20px; font-size: 1.15rem; }
.news-page__back a { color: var(--foam-mute); text-decoration: none; }
.news-page__back a:hover { color: var(--foam); text-decoration: underline; }
.news-page__others { margin-top: 40px; }
.news-page__others h2 { font: 400 1.6rem/1.2 var(--font-display); margin-bottom: 14px; }
.news-page__others ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.news-page__others li { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: 1.15rem; }
.news-page__others a { color: var(--foam); }
.news-page__others time { color: var(--foam-mute); font-size: 1rem; }

/* ---------- сообщение ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 6px;
  background: var(--sheet); color: var(--sheet-text); font-size: 1.05rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  transition: opacity .2s, transform .2s;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
