/* ========== Variables ========== */
:root {
  --cream: #faf7f0;
  --cream2: #f2ede1;
  --cream3: #e8e0cf;
  --sand: #d4c9a8;
  --khaki: #7a6a3d;
  --khaki-dark: #5a4e2e;
  --gold: #c8941a;
  --gold-light: #e8b040;
  --text: #2c2416;
  --text-muted: #6b5f44;
  --text-light: #9e8f6e;
  --border: #d4c9a8;
  --border-light: #e8e0cf;
  --link: #5a7a3a;
  --link-hover: #3d5626;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(44,36,22,.08);
  --shadow: 0 4px 12px rgba(44,36,22,.1);
  --shadow-lg: 0 8px 24px rgba(44,36,22,.12);
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ========== Reset ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { background: var(--cream); color: var(--text); font-family: var(--font); line-height: 1.7; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

/* ========== Layout ========== */
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.main-content { min-height: calc(100vh - 200px); }
.page-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; padding: 32px 0 60px; align-items: start; }
.page-main { min-width: 0; }

/* ========== Header ========== */
.site-header { background: var(--white); border-bottom: 2px solid var(--cream3); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; height: 64px; gap: 16px; }
.site-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text) !important; text-decoration: none !important; }
.logo-img { border-radius: 6px; }
.logo-dot { color: var(--gold); }
.site-nav { display: flex; gap: 2px; margin-left: auto; }
.nav-link { padding: 7px 14px; border-radius: var(--radius); color: var(--text-muted); font-size: 0.9rem; font-weight: 500; transition: all .18s; }
.nav-link:hover { background: var(--cream2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--gold); color: var(--white); }
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; margin-left: auto; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all .2s; }

/* ========== Hero ========== */
.hero { background: linear-gradient(135deg, #3d2e0e 0%, #5a4520 40%, #7a6030 100%); color: var(--white); padding: 64px 0; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.hero-badge { display: inline-block; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); padding: 5px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 16px; }
.hero-title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; margin-bottom: 16px; }
.hero-accent { color: var(--gold-light); }
.hero-subtitle { font-size: 1.05rem; opacity: .88; line-height: 1.7; margin-bottom: 28px; max-width: 440px; }
.hero-downloads { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.downloads-label { font-size: 0.85rem; opacity: .7; font-weight: 500; }
.btn-hero { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius); font-weight: 600; font-size: 0.88rem; transition: all .18s; text-decoration: none !important; }
.btn-rustore { background: #1a73e8; color: var(--white); }
.btn-rustore:hover { background: #1557b0; color: var(--white); }
.btn-gplay { background: #34a853; color: var(--white); }
.btn-gplay:hover { background: #2d9248; color: var(--white); }
.btn-appstore { background: #555; color: var(--white); }
.btn-appstore:hover { background: #333; color: var(--white); }
.hero-image { text-align: center; }
.hero-image img { max-width: 100%; border-radius: var(--radius-lg); }

/* ========== Sections ========== */
.section { padding: 52px 0; }
.section-features { background: var(--cream2); border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.section-title { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.see-all { color: var(--gold); font-weight: 600; font-size: 0.9rem; }
.see-all:hover { color: var(--khaki-dark); }

/* ========== Article Cards ========== */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.article-card { background: var(--white); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column; }
.article-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.card-img img { width: 100%; height: 180px; object-fit: cover; }
.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 0.8rem; color: var(--text-light); }
.tag { padding: 3px 9px; border-radius: 4px; font-size: 0.76rem; font-weight: 600; }
.tag-guides { background: #e8f4e8; color: #2d6a2d; }
.tag-tier-lists { background: #fff3e0; color: #b35900; }
.card-title { font-size: 1rem; font-weight: 700; line-height: 1.4; margin-bottom: 8px; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--gold); text-decoration: none; }
.card-desc { font-size: 0.87rem; color: var(--text-muted); line-height: 1.6; flex: 1; margin-bottom: 14px; }
.card-read-more { font-size: 0.85rem; color: var(--gold); font-weight: 700; margin-top: auto; }
.card-read-more:hover { color: var(--khaki-dark); }

/* ========== Features ========== */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.feature-card { background: var(--white); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 28px; text-align: center; box-shadow: var(--shadow-sm); }
.feature-icon { font-size: 2.4rem; margin-bottom: 14px; }
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.feature-card p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 14px; }
.feature-link { font-size: 0.85rem; color: var(--gold); font-weight: 700; }
.feature-link:hover { color: var(--khaki-dark); }

/* ========== Breadcrumbs ========== */
.breadcrumbs { margin-bottom: 20px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; font-size: 0.82rem; color: var(--text-light); }
.breadcrumbs li:not(:last-child)::after { content: '›'; margin-left: 6px; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--gold); text-decoration: none; }

/* ========== Article ========== */
.article { }
.article-header { margin-bottom: 28px; }
.article-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.article-date { font-size: 0.84rem; color: var(--text-light); }
.article-title { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; line-height: 1.25; margin-bottom: 14px; color: var(--text); }
.article-lead { font-size: 1.05rem; color: var(--text-muted); line-height: 1.75; margin-bottom: 20px; border-left: 3px solid var(--gold); padding-left: 14px; background: var(--cream2); padding: 14px 14px 14px 16px; border-radius: 0 var(--radius) var(--radius) 0; }
.article-banner { margin-bottom: 28px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border-light); }
.article-banner img { width: 100%; height: 280px; object-fit: cover; }

/* ========== TOC ========== */
.toc { background: var(--cream2); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 32px; overflow: hidden; }
.toc-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: var(--cream3); font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--khaki); }
.toc-toggle { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: var(--khaki); line-height: 1; }
.toc-body { padding: 12px 18px 16px; }
.toc-body ul { list-style: none; }
.toc-body li { margin: 4px 0; }
.toc-body a { font-size: 0.9rem; color: var(--text-muted); }
.toc-body a:hover, .toc-body a.active { color: var(--gold); }
.toc-body ul ul { padding-left: 16px; }
.toc-body.collapsed { display: none; }

/* ========== Article Body ========== */
.article-body { font-size: 1rem; line-height: 1.8; }
.article-body h2 { font-size: 1.55rem; font-weight: 800; margin: 40px 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--cream3); color: var(--khaki-dark); }
.article-body h3 { font-size: 1.2rem; font-weight: 700; margin: 28px 0 12px; color: var(--text); }
.article-body p { margin-bottom: 18px; }
.article-body ul, .article-body ol { margin: 0 0 18px 24px; }
.article-body li { margin-bottom: 7px; line-height: 1.75; }
.article-body strong { color: var(--khaki-dark); font-weight: 700; }
.article-body em { font-style: italic; color: var(--text-muted); }
.article-body hr { border: none; border-top: 2px solid var(--cream3); margin: 36px 0; }
.article-body blockquote { border-left: 4px solid var(--gold); padding: 14px 20px; margin: 24px 0; background: var(--cream2); border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; color: var(--text-muted); }
.article-body a { color: var(--link); font-weight: 500; }
.article-body a:hover { color: var(--link-hover); }
.article-body code { background: var(--cream3); padding: 2px 6px; border-radius: 4px; font-size: 0.88em; color: var(--khaki-dark); font-family: 'Fira Code', 'Cascadia Code', monospace; }
.article-body pre { background: var(--khaki-dark); color: #f0e8c8; padding: 18px; border-radius: var(--radius); overflow-x: auto; margin: 20px 0; }
.article-body pre code { background: none; padding: 0; color: inherit; }
.article-body table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.92rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.article-body th { background: var(--khaki); color: var(--white); padding: 12px 16px; text-align: left; font-weight: 700; font-size: 0.85rem; }
.article-body td { padding: 10px 16px; border-bottom: 1px solid var(--border-light); }
.article-body tr:last-child td { border-bottom: none; }
.article-body tr:nth-child(even) td { background: var(--cream2); }
.article-body tr:hover td { background: var(--cream3); }

/* ========== Related Articles ========== */
.related-articles { margin-top: 48px; padding-top: 32px; border-top: 2px solid var(--cream3); }
.related-articles h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 20px; color: var(--text); }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.related-card a { display: block; text-decoration: none !important; }
.related-card img { width: 100%; height: 100px; object-fit: cover; border-radius: var(--radius); margin-bottom: 8px; border: 1px solid var(--border-light); }
.related-card h4 { font-size: 0.85rem; font-weight: 600; color: var(--text); line-height: 1.4; }
.related-card a:hover h4 { color: var(--gold); }

/* ========== Sidebar ========== */
.sidebar { }
.sidebar-widget { background: var(--white); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.widget-title { font-size: 0.85rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--khaki); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--cream3); }
.download-buttons { display: flex; flex-direction: column; gap: 9px; }
.btn-download { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--radius); font-weight: 600; font-size: 0.85rem; text-decoration: none !important; transition: opacity .18s; }
.btn-download:hover { opacity: .85; }
.btn-download.btn-rustore { background: #1a73e8; color: var(--white); }
.btn-download.btn-gplay { background: #34a853; color: var(--white); }
.btn-download.btn-appstore { background: #333; color: var(--white); }
.popular-list { list-style: none; }
.popular-list li { border-bottom: 1px solid var(--border-light); padding: 8px 0; }
.popular-list li:last-child { border-bottom: none; }
.popular-list a { font-size: 0.88rem; color: var(--text); line-height: 1.4; display: block; }
.popular-list a:hover { color: var(--gold); text-decoration: none; }

/* ========== List Page ========== */
.list-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 2px solid var(--cream3); }
.list-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.list-description { color: var(--text-muted); font-size: 1rem; }

/* ========== Footer ========== */
.site-footer { background: var(--khaki-dark); color: rgba(255,255,255,.85); padding: 40px 0 0; margin-top: 60px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer-logo .site-logo { color: var(--white) !important; margin-bottom: 10px; }
.footer-logo .logo-dot { color: var(--gold-light); }
.footer-desc { font-size: 0.85rem; opacity: .7; margin-top: 8px; line-height: 1.6; }
.footer-nav h4, .footer-download h4 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .6; margin-bottom: 12px; }
.footer-nav { display: flex; flex-direction: column; gap: 0; }
.footer-nav a, .footer-download .dl-link { display: block; color: rgba(255,255,255,.75); font-size: 0.88rem; padding: 4px 0; }
.footer-nav a:hover, .footer-download .dl-link:hover { color: var(--gold-light); text-decoration: none; }
.footer-bottom { padding: 16px 0; }
.footer-bottom p { font-size: 0.8rem; opacity: .5; text-align: center; }

/* ========== Responsive ========== */
@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
  .page-sidebar { order: -1; display: none; } /* Скрываем сайдбар на мобильных */
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-image { display: none; }
}

@media (max-width: 640px) {
  .site-nav { display: none; flex-direction: column; position: fixed; top: 64px; left: 0; right: 0; background: var(--white); padding: 12px; border-bottom: 2px solid var(--cream3); box-shadow: var(--shadow); z-index: 99; }
  .site-nav.open { display: flex; }
  .nav-link { padding: 12px 16px; border-radius: 0; border-bottom: 1px solid var(--border-light); }
  .nav-toggle { display: flex; }
  .header-inner { position: relative; }
  .hero { padding: 40px 0; }
  .hero-downloads { flex-direction: column; align-items: flex-start; }
  .article-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .article-title { font-size: 1.5rem; }
}
