/* ============================================================
   castlebusters.ru — стиль «Осада на закате»
   Закатный градиент + каменные панели + красные vs синие армии.
   Системные шрифты, без внешних CDN.
   ============================================================ */

:root {
  --sunset-1: #FFE8D1;   /* персиковое небо */
  --sunset-2: #FFC894;   /* закат */
  --sunset-3: #FF9E5E;   /* оранжевое небо */
  --stone:    #8D7B6A;   /* камень замка */
  --stone-d:  #6E5F52;   /* тёмный камень */
  --ink:      #3D2B1F;   /* чернильный текст */
  --paper:    #FFF8EF;   /* бумага панелей */
  --red:      #E23B2E;   /* красная армия */
  --blue:     #2E6FE2;   /* синяя армия */
  --teal:     #3BB8B0;   /* бирюзовый акцент */
  --gold:     #F2A93B;   /* золото наград */
  --radius:   14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sunset-1) 0%, var(--sunset-2) 55%, var(--sunset-3) 100%);
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.02em; }
h1 { font-size: clamp(30px, 5vw, 44px); margin: 18px 0 10px; }
h2 { font-size: clamp(23px, 3.4vw, 30px); margin: 34px 0 12px; }
h3 { font-size: 19px; margin: 22px 0 8px; }
p  { margin: 0 0 14px; }
a  { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--red); }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 248, 239, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 3px solid var(--stone);
}
.header-in { display: flex; align-items: center; gap: 18px; min-height: 60px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 19px; color: var(--ink); text-decoration: none; letter-spacing: -0.03em; white-space: nowrap; }
.logo:hover { color: var(--ink); }
.logo-castle { width: 28px; height: 28px; flex: none; }
.logo small { display: block; font-size: 11px; font-weight: 600; color: var(--stone-d); margin-top: -3px; }
.burger { display: none; margin-left: auto; background: none; border: 2px solid var(--stone-d); border-radius: 10px; font-size: 20px; line-height: 1; padding: 6px 12px; cursor: pointer; color: var(--ink); }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: 15px;
  padding: 7px 13px; border-radius: 999px; border: 2px solid transparent;
}
.nav a:hover { background: var(--sunset-1); border-color: var(--stone); }
.nav a.active { background: var(--teal); color: #fff; border-color: transparent; box-shadow: 3px 3px 0 rgba(61,43,31,.25); }

/* ---------- Хлебные крошки (внутри .container — генерирует build.py) ---------- */
.crumbs { padding-top: 14px; font-size: 14px; color: var(--stone-d); }
.crumbs a { color: var(--stone-d); }
.crumbs a:hover { color: var(--red); }

/* ---------- Карточки и сетки ---------- */
main { padding-bottom: 56px; }
.card {
  background: var(--paper);
  border: 2px solid var(--stone);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 rgba(110, 95, 82, 0.35);   /* жёсткая каменная тень */
  padding: 20px 22px;
  margin: 16px 0;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 16px 0; }
.card-grid .card { margin: 0; display: flex; flex-direction: column; }
.card h3 { margin-top: 0; }
.card .more { margin-top: auto; font-weight: 700; }

.vs-band {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-weight: 900; letter-spacing: 0.06em; font-size: 14px;
  margin: 26px 0 6px;
}
.vs-band .r { color: var(--red); } .vs-band .b { color: var(--blue); }
.vs-band::before, .vs-band::after { content: ""; flex: 1; height: 4px; border-radius: 2px; }
.vs-band::before { background: linear-gradient(90deg, var(--red), transparent); }
.vs-band::after  { background: linear-gradient(270deg, var(--blue), transparent); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-block; font-weight: 800; text-decoration: none; text-align: center;
  border-radius: 999px; padding: 11px 24px; font-size: 16px; line-height: 1.3;
  border: 2px solid var(--ink); box-shadow: 4px 4px 0 rgba(61,43,31,.3);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 rgba(61,43,31,.3); color: #fff; }
.btn-red  { background: var(--red);  color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-lg   { font-size: 19px; padding: 15px 34px; }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 28px; align-items: center;
  padding: 30px 0 6px;
}
.hero h1 { margin-top: 0; }
.hero .lead { font-size: 18px; font-weight: 500; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 20px; }
.badge {
  display: inline-block; background: var(--paper); border: 2px solid var(--stone);
  border-radius: 999px; padding: 4px 13px; font-size: 13.5px; font-weight: 700; color: var(--stone-d);
}
.badge b { color: var(--ink); }
.hero-icon { width: min(320px, 70%); margin: 0 auto; display: block; border-radius: 58px; box-shadow: 12px 12px 0 rgba(110,95,82,.35); }

/* ---------- Галерея скриншотов ---------- */
.screenshot-stack { display: grid; grid-template-columns: 1fr; gap: 18px; margin: 14px 0 22px; }
.screenshot-stack img {
  width: 100%; height: auto; display: block;
  border: 3px solid var(--stone-d); border-radius: 12px; background: var(--paper);
  box-shadow: 6px 6px 0 rgba(110,95,82,.3);
}
.screenshot-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 14px 0; }
.screenshot-row img {
  width: 100%; height: 430px; object-fit: cover;
  border: 3px solid var(--stone-d); border-radius: 12px; background: var(--paper);
  box-shadow: 6px 6px 0 rgba(110,95,82,.3);
}
@media (max-width: 720px) {
  .screenshot-row { grid-template-columns: 1fr; }
  .screenshot-row img { height: auto; aspect-ratio: 16/9; }
}

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; margin: 14px 0 22px; }
table { border-collapse: collapse; width: 100%; background: var(--paper); font-size: 15px; }
th, td { padding: 10px 13px; border: 1.5px solid #D9CBBB; vertical-align: top; text-align: left; }
thead th { background: var(--stone); color: #fff; border-color: var(--stone-d); font-size: 14px; letter-spacing: 0.04em; }
tbody tr:nth-child(even) { background: #FBF1E4; }
td code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #F3E7D7; border: 1px solid #DECDB8; border-radius: 6px;
  padding: 3px 9px; font-size: 14.5px; white-space: nowrap; color: var(--ink);
}

/* ---------- Бейджи статуса ---------- */
.tag-active   { display:inline-block; background:#DFF3E4; color:#1E7A38; font-weight:800; font-size:13px; padding:3px 12px; border-radius:999px; border:1.5px solid #58B368; }
.tag-expired  { display:inline-block; background:#FBE3E0; color:#B3372E; font-weight:800; font-size:13px; padding:3px 12px; border-radius:999px; border:1.5px solid #E23B2E; }
.tag-soon     { display:inline-block; background:#FCF0DA; color:#8A6210; font-weight:800; font-size:13px; padding:3px 12px; border-radius:999px; border:1.5px solid #F2A93B; }
.tag-tier-s   { background: linear-gradient(90deg, #FFE08A, #FFC94D); }
.tier-chip { display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:10px; font-weight:900; font-size:17px; border:2px solid var(--ink); box-shadow:3px 3px 0 rgba(61,43,31,.25); }
.tc-s { background:#FFC94D; } .tc-a { background:#DFF3E4; } .tc-b { background:#DCEBFA; } .tc-c { background:#F0E4D7; }

/* ---------- FAQ (аккордеон) ---------- */
.faq-item { background: var(--paper); border: 2px solid var(--stone); border-radius: var(--radius); margin: 12px 0; overflow: hidden; }
.faq-item summary {
  cursor: pointer; font-weight: 800; padding: 14px 18px; list-style: none; position: relative;
  border-left: 8px solid var(--teal); border-radius: var(--radius) 0 0 var(--radius);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 900; color: var(--stone-d); }
.faq-item[open] summary::after { content: "–"; }
.faq-item[open] summary { border-bottom: 2px dashed #D9CBBB; }
.faq-item .faq-body { padding: 13px 18px 15px; }
.faq-c-red   { border-left-color: var(--red) !important; }
.faq-c-blue  { border-left-color: var(--blue) !important; }
.faq-c-gold  { border-left-color: var(--gold) !important; }
.faq-c-stone { border-left-color: var(--stone) !important; }

/* ---------- Юниты ---------- */
.unit-card { border-top: 8px solid var(--teal); }
.unit-card.uc-red   { border-top-color: var(--red); }
.unit-card.uc-blue  { border-top-color: var(--blue); }
.unit-card.uc-gold  { border-top-color: var(--gold); }
.unit-card.uc-stone { border-top-color: var(--stone); }
.unit-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.role-chip { display:inline-block; background:#F3E7D7; border:1.5px solid #DECDB8; border-radius:999px; padding:2px 12px; font-size:13px; font-weight:700; color:var(--stone-d); }

/* ---------- Новости ---------- */
.news-date { font-size: 13.5px; font-weight: 800; color: var(--stone-d); text-transform: uppercase; letter-spacing: 0.06em; }
.news-card { border-left: 8px solid var(--gold); }

/* ---------- Гайды: шаги ---------- */
.steps { counter-reset: step; margin: 18px 0; padding: 0; list-style: none; }
.steps > li {
  counter-increment: step; position: relative; background: var(--paper);
  border: 2px solid var(--stone); border-radius: var(--radius);
  box-shadow: 5px 5px 0 rgba(110,95,82,.3);
  padding: 14px 18px 14px 64px; margin: 0 0 14px;
}
.steps > li::before {
  content: counter(step); position: absolute; left: 14px; top: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--sunset-3); color: var(--ink); font-weight: 900; font-size: 18px;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--ink);
}
.steps > li h3 { margin: 0 0 6px; }
.steps > li p:last-child { margin-bottom: 0; }

.callout {
  background: #FCF0DA; border: 2px solid var(--gold); border-radius: var(--radius);
  padding: 13px 17px; margin: 16px 0; font-size: 15px;
}
.callout-warn { background: #FBE3E0; border-color: var(--red); }
.callout-info { background: #DCEBFA; border-color: var(--blue); }

/* ---------- Футер ---------- */
.site-footer {
  background: var(--stone-d); color: #F7EFE3; padding: 30px 0 26px; border-top: 4px solid var(--ink);
}
.site-footer a { color: #FFD9AD; }
.foot-links { text-align: center; font-size: 15px; }
.disclaimer { text-align: center; font-size: 12.5px; opacity: 0.75; margin: 14px auto 0; max-width: 760px; }

/* ---------- Адаптив ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-badges, .btn-row { justify-content: center; }
  .burger { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; margin: 6px 0 10px; }
  .nav.open { display: flex; }
  .nav a { text-align: center; }
}
@media (max-width: 720px) {
  table { font-size: 13px; }
  th, td { padding: 7px 8px; }
  thead th { font-size: 12px; letter-spacing: 0.02em; }
}
