/* ────────────────────────────────────────────────
   CharCraft website — общий стиль
   Цвета и шрифты синхронизированы с приложением
   ──────────────────────────────────────────────── */

:root {
  --bg: #1A0F08;
  --surface: #2A1A0E;
  --card: #F0DEB0;
  --parchment: #F4E4C1;
  --parchment-shadow: #B8A88F;
  --gold: #D4A843;
  --gold-light: #E8C77A;
  --gold-dim: rgba(212, 168, 67, 0.3);
  --crimson: #8B2E2E;
  --ink: #2C1810;
  --ink-light: #5C4530;
  --border: rgba(212, 168, 67, 0.3);

  --container: 1100px;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--parchment);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  letter-spacing: 0.5px;
  font-weight: 700;
}

h1 { font-size: 40px; line-height: 1.2; }
h2 { font-size: 28px; margin-bottom: 16px; }
h3 { font-size: 20px; margin-bottom: 8px; }
h4 { font-size: 16px; margin-bottom: 6px; letter-spacing: 1px; text-transform: uppercase; }

p { margin-bottom: 16px; }
a { color: var(--gold-light); text-decoration: none; }
a:hover { color: var(--gold); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ────────────────────────────────────────────────
   HEADER / NAVIGATION
   ──────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 15, 8, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 32px;
}

.logo {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 2px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  color: var(--parchment-shadow);
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}

.lang-switch {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1.5px solid var(--gold);
  border-radius: 8px;
  padding: 3px;
  box-shadow: 0 0 10px rgba(212, 168, 67, 0.15);
}
.lang-switch button {
  background: transparent;
  border: none;
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 1px;
  transition: all 0.15s;
}
.lang-switch button:hover:not(.active) {
  background: rgba(212, 168, 67, 0.1);
}
.lang-switch button.active {
  background: var(--gold);
  color: var(--ink);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--gold-light);
  width: 40px;
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
}

/* ────────────────────────────────────────────────
   LANGUAGE VISIBILITY
   Один язык всегда скрыт через !important чтобы
   не было FOUC и наложения текстов.
   ──────────────────────────────────────────────── */
html[lang="ru"] [data-lang="en"] { display: none !important; }
html[lang="en"] [data-lang="ru"] { display: none !important; }

/* ────────────────────────────────────────────────
   HERO SECTION
   ──────────────────────────────────────────────── */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  background: radial-gradient(ellipse at center top, rgba(212, 168, 67, 0.08), transparent 60%);
}
.hero h1 {
  font-size: 52px;
  margin-bottom: 16px;
}
.hero .tagline {
  font-size: 20px;
  color: var(--parchment-shadow);
  font-style: italic;
  max-width: 640px;
  margin: 0 auto 32px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  text-align: left;
  padding: 60px 0;
}
.hero-grid h1 { font-size: 44px; }
.hero-grid .tagline { text-align: left; margin-left: 0; }

/* ────────────────────────────────────────────────
   CTA BUTTONS
   ──────────────────────────────────────────────── */
.cta-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}
.hero-grid .cta-group { justify-content: flex-start; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 10px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--gold);
  color: var(--ink);
}
.btn-primary:hover {
  background: var(--gold-light);
  color: var(--ink);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--gold-light);
  border-color: var(--gold);
}
.btn-outline:hover {
  background: rgba(212, 168, 67, 0.1);
  color: var(--gold-light);
}
.btn-disabled {
  opacity: 0.7;
  cursor: default;
  pointer-events: none;
}
.btn small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.7;
  margin-top: 2px;
  font-family: 'Crimson Text', serif;
}

/* ────────────────────────────────────────────────
   PHONE MOCKUP (placeholder для скриншотов)
   ──────────────────────────────────────────────── */
.phone-mockup {
  position: relative;
  width: 280px;
  height: 570px;
  margin: 0 auto;
  background: linear-gradient(145deg, #2a1a0e, #1a0f08);
  border-radius: 40px;
  border: 3px solid #3a2a1e;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.5),
    0 0 0 6px #0a0604,
    inset 0 0 40px rgba(212, 168, 67, 0.05);
  padding: 8px;
}
.phone-mockup::before {
  content: '';
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 18px;
  background: #0a0604;
  border-radius: 0 0 10px 10px;
  z-index: 2;
}
.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 32px;
  background:
    radial-gradient(ellipse at top, rgba(212, 168, 67, 0.15), transparent 60%),
    linear-gradient(180deg, #1a0f08, #0f0805);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 14px;
  letter-spacing: 3px;
  text-align: center;
  padding: 24px;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.phone-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 32px;
  display: block;
}

/* ────────────────────────────────────────────────
   SECTIONS
   ──────────────────────────────────────────────── */
section {
  padding: 64px 0;
}
section.alt {
  background: rgba(212, 168, 67, 0.03);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  text-align: center;
  margin-bottom: 48px;
}
.section-title .eyebrow {
  display: block;
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section-title h2 {
  font-size: 32px;
}

/* ────────────────────────────────────────────────
   FEATURE CARDS
   ──────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color 0.15s, transform 0.15s;
}
.feature-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.feature-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(212, 168, 67, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 24px;
  color: var(--gold);
}
/* Иконки Telegram / Discord (Simple Icons, CC0) */
.brand-icon {
  width: 26px;
  height: 26px;
  display: inline-block;
  vertical-align: middle;
}
/* Два отдельных квадратика 48×48 бок о бок */
.feature-card .icon.brand-stack {
  background: transparent;
  width: fit-content;
  padding: 0;
  gap: 8px;
  justify-content: flex-start;
  align-self: flex-start;
}
.feature-card .icon.brand-stack .brand-icon {
  width: 26px;
  height: 26px;
  padding: 11px;
  border-radius: 12px;
  background: rgba(212, 168, 67, 0.12);
  box-sizing: content-box;
}
.feature-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.feature-card p {
  color: var(--parchment-shadow);
  font-size: 15px;
  margin-bottom: 0;
}

/* ────────────────────────────────────────────────
   SHOWCASE — 6 фич в 2 колонки + phone screen
   При наведении на карточку — экран меняется
   ──────────────────────────────────────────────── */
.showcase-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
}
.showcase-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.showcase-features .feature-card {
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.showcase-features .feature-card.active,
.showcase-features .feature-card:hover {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(212, 168, 67, 0.1), var(--surface));
}
.showcase-phone {
  position: sticky;
  top: 96px;
}
.showcase-phone .phone-mockup {
  margin: 0 auto;
}
.showcase-screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  border-radius: 32px;
}
.showcase-screen.active { opacity: 1; }
.showcase-screen .screen-icon {
  font-size: 56px;
  margin-bottom: 24px;
  color: var(--gold);
}
.showcase-screen .screen-icon .dm-badge {
  width: 64px;
  height: 44px;
  border-width: 2.5px;
  border-radius: 10px;
  font-size: 22px;
}
.showcase-screen .screen-title {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  color: var(--gold-light);
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.showcase-screen .screen-desc {
  font-family: 'Crimson Text', serif;
  font-size: 13px;
  color: var(--parchment-shadow);
  font-style: italic;
  max-width: 220px;
  line-height: 1.5;
}
/* Экран с реальной картинкой */
.showcase-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 32px;
}

@media (max-width: 920px) {
  .showcase-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .showcase-phone { position: static; order: -1; }
}
@media (max-width: 520px) {
  .showcase-features {
    grid-template-columns: 1fr;
  }
}

/* DM badge — используется в нескольких местах */
.dm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 22px;
  border: 1.5px solid var(--gold);
  border-radius: 5px;
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.5px;
}

/* ────────────────────────────────────────────────
   PRICING TIERS
   ──────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  position: relative;
}
.price-card.featured {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(212, 168, 67, 0.1), var(--surface));
}
.price-card .tier {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.price-card .price {
  font-family: 'Cinzel', serif;
  font-size: 32px;
  color: var(--gold-light);
  font-weight: 700;
  margin-bottom: 4px;
}
.price-card .price-note {
  font-size: 13px;
  color: var(--parchment-shadow);
  font-style: italic;
  margin-bottom: 20px;
}
.price-card ul {
  list-style: none;
  text-align: left;
}
.price-card li {
  padding: 8px 0;
  color: var(--parchment);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.price-card li::before {
  content: '✓ ';
  color: var(--gold);
  font-weight: 700;
}
.price-card li:last-child { border-bottom: none; }
.price-card .badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--ink);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 10px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ────────────────────────────────────────────────
   COMPARISON TABLE (why us)
   ──────────────────────────────────────────────── */
.comparison {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  overflow-x: auto;
}
.comparison table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.comparison th,
.comparison td {
  padding: 14px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.comparison th {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--gold-light);
  background: rgba(0, 0, 0, 0.2);
  letter-spacing: 1px;
}
.comparison th:first-child,
.comparison td:first-child {
  text-align: left;
  color: var(--parchment-shadow);
}
.comparison th.us,
.comparison td.us {
  background: rgba(212, 168, 67, 0.08);
  color: var(--gold-light);
  font-weight: 700;
}
.comparison tbody tr:last-child td { border-bottom: none; }
.comparison .yes { color: #6cb26c; }
.comparison .no { color: #c15252; }
.comparison .partial { color: #e8a847; }

/* ────────────────────────────────────────────────
   PRICING TABLE (одна таблица со всеми тирами)
   ──────────────────────────────────────────────── */
.pricing-table table { font-size: 15px; }
.pricing-table td { vertical-align: middle; padding: 16px 14px; }
.pricing-table tbody tr:hover { background: rgba(212, 168, 67, 0.04); }
.pricing-table tr.tier-free td:first-child { border-left: 3px solid var(--parchment-shadow); }
.pricing-table tr.tier-featured td {
  background: rgba(212, 168, 67, 0.08);
}
.pricing-table tr.tier-featured td:first-child {
  border-left: 3px solid var(--gold);
}
.pricing-table tr.group-header td {
  background: var(--bg);
  padding: 20px 14px 10px;
  text-align: left;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--gold-dim);
}
.pricing-table .price-big {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-light);
  white-space: nowrap;
}
.pricing-table .price-per {
  font-size: 13px;
  color: var(--parchment-shadow);
  margin-left: 2px;
}
.pricing-table .tier-hint {
  display: block;
  font-size: 12px;
  color: var(--parchment-shadow);
  font-style: italic;
  margin-top: 4px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.pricing-table .badge-inline {
  display: inline-block;
  background: var(--gold);
  color: var(--ink);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
/* Бейджи редкости — один-в-один как в приложении (lib/screens/misc_screen.dart) */
.rarity-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid;
  vertical-align: middle;
  margin-left: 4px;
}
.rarity-common {
  color: #AAAAAA;
  background: rgba(136, 136, 136, 0.15);
  border-color: rgba(136, 136, 136, 0.5);
}
.rarity-uncommon {
  color: #4CC44C;
  background: rgba(30, 138, 30, 0.15);
  border-color: rgba(30, 138, 30, 0.6);
}
.rarity-rare {
  color: #5B8FD6;
  background: rgba(26, 92, 168, 0.15);
  border-color: rgba(26, 92, 168, 0.7);
}
.rarity-very-rare {
  color: #B47CE8;
  background: rgba(123, 47, 190, 0.15);
  border-color: rgba(123, 47, 190, 0.6);
}
.rarity-legendary {
  color: #E8A847;
  background: rgba(212, 121, 10, 0.15);
  border-color: rgba(212, 121, 10, 0.6);
}
.rarity-artifact {
  color: #E25555;
  background: rgba(184, 28, 28, 0.15);
  border-color: rgba(184, 28, 28, 0.6);
}
.pricing-table td:first-child {
  text-align: left;
  color: var(--parchment);
}
.pricing-table td:first-child b {
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 14px;
  letter-spacing: 1px;
  display: block;
}
@media (max-width: 700px) {
  .pricing-table table { font-size: 13px; }
  .pricing-table td { padding: 12px 10px; }
  .pricing-table .price-big { font-size: 18px; }
}

/* ────────────────────────────────────────────────
   FAQ
   ──────────────────────────────────────────────── */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-item summary {
  padding: 18px 24px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--gold-light);
  font-size: 16px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::after {
  content: '+';
  font-size: 24px;
  color: var(--gold);
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item .answer {
  padding: 0 24px 20px;
  color: var(--parchment-shadow);
}
.faq-item .answer p:last-child { margin-bottom: 0; }

/* ────────────────────────────────────────────────
   CHANGELOG
   ──────────────────────────────────────────────── */
.release {
  background: var(--surface);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 28px;
  margin-bottom: 24px;
}
.release .version {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  color: var(--gold-light);
  letter-spacing: 1px;
}
.release .date {
  font-style: italic;
  color: var(--parchment-shadow);
  font-size: 13px;
  margin-bottom: 14px;
}
.release ul {
  margin-left: 20px;
  color: var(--parchment);
}
.release ul li { margin: 4px 0; }

/* ────────────────────────────────────────────────
   FOOTER
   ──────────────────────────────────────────────── */
.site-footer {
  padding: 48px 0 32px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
  text-align: center;
  color: var(--parchment-shadow);
  font-size: 14px;
}
.site-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.site-footer .footer-links a {
  color: var(--parchment-shadow);
  font-size: 13px;
}
.site-footer .footer-links a:hover { color: var(--gold-light); }
.site-footer .copyright {
  font-size: 12px;
  opacity: 0.6;
}

/* ────────────────────────────────────────────────
   CONTACT BLOCK
   ──────────────────────────────────────────────── */
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 540px;
  margin: 0 auto;
  text-align: center;
}
.contact-card h3 { color: var(--gold-light); margin-bottom: 12px; }
.contact-card .email {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--gold);
  margin: 8px 0;
}

/* ────────────────────────────────────────────────
   RESPONSIVE
   ──────────────────────────────────────────────── */
@media (max-width: 860px) {
  h1, .hero h1 { font-size: 32px; }
  .hero { padding: 48px 0 32px; }
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 32px 0;
  }
  .hero-grid h1 { font-size: 32px; }
  .hero-grid .tagline { text-align: center; margin-left: auto; margin-right: auto; }
  .hero-grid .cta-group { justify-content: center; }
  .phone-mockup { width: 240px; height: 490px; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(26, 15, 8, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
  }
  .nav-links.open { display: flex; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }

  section { padding: 48px 0; }
  h2 { font-size: 24px; }
}
