/* ========================================================================
   TohaProBets — tohaprobets.com
   Аналитический тёмный стиль. Мобильный-first. Без внешних шрифтов.
   ======================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: #f0e5c8;
  background: #0a1a10;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #d4a642; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 0.6em; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin-top: 0; }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
li { margin: 0.3em 0; }
code {
  background: #14251a; padding: 2px 6px; border-radius: 4px;
  font-family: "SF Mono", Consolas, Menlo, monospace; font-size: 0.9em;
}

/* Skip-link для доступности */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: #d4a642; color: #0a1a10; padding: 8px 14px; z-index: 100;
  font-weight: 700;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Обёртка */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ================= ХЕДЕР ================= */
.site-header {
  background: #0a1a10;
  border-bottom: 1px solid #1f3126;
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; gap: 20px;
}
.logo {
  font-weight: 800; font-size: 1.4rem; color: #f0e5c8;
  display: flex; align-items: center; gap: 12px;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  display: inline-block;
  height: 64px;
  width: 64px;
  vertical-align: middle;
  flex-shrink: 0;
}
.logo-mark img {
  height: 100%; width: 100%; display: block;
  object-fit: contain;
}
@media (max-width: 500px) {
  .logo-mark { height: 52px; width: 52px; }
  .logo { font-size: 1.2rem; gap: 10px; }
}
.nav { display: flex; gap: 22px; align-items: center; }
.nav a { color: #dbceb0; font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: #d4a642; text-decoration: none; }
.nav a.active { color: #d4a642; }
.tg-btn {
  background: #229ED9; color: #fff !important; padding: 8px 16px;
  border-radius: 6px; font-weight: 600; font-size: 0.9rem;
  min-height: 44px; display: inline-flex; align-items: center; gap: 6px;
}
.tg-btn:hover { background: #1a8ac0; text-decoration: none; }

/* Мобильное меню */
.mobile-toggle {
  display: none; background: none; border: 1px solid #2a3d30; color: #dbceb0;
  width: 44px; height: 44px; border-radius: 6px; cursor: pointer;
  font-size: 1.4rem;
}
@media (max-width: 820px) {
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #0a1a10; border-bottom: 1px solid #1f3126;
    flex-direction: column; padding: 12px 20px 18px; gap: 8px; align-items: stretch; }
  .nav.open { display: flex; }
  .nav a { padding: 10px 4px; border-bottom: 1px solid #1f3126; }
  .nav .tg-btn { justify-content: center; margin-top: 8px; }
  .mobile-toggle { display: inline-flex; align-items: center; justify-content: center; margin-right: 8px; }
}
@media (max-width: 500px) {
  .mobile-toggle { margin-right: 12px; }
}

/* ================= HERO ================= */
.hero {
  padding: 60px 0 40px;
  background:
    radial-gradient(ellipse at top left, rgba(212,166,66,0.15), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(34,158,217,0.1), transparent 60%);
}
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); margin-bottom: 16px; }
.hero .lead {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: #dbceb0; max-width: 720px; margin-bottom: 28px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 8px; font-weight: 600; font-size: 1rem;
  min-height: 48px; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.btn-primary { background: #229ED9; color: #fff; }
.btn-primary:hover { background: #1a8ac0; text-decoration: none; }
.btn-outline { background: transparent; color: #f0e5c8; border-color: #2a3d30; }
.btn-outline:hover { border-color: #d4a642; color: #d4a642; text-decoration: none; }
.btn:active { transform: translateY(1px); }

/* Статистика в hero */
.hero-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px; margin-top: 40px; max-width: 720px;
}
.stat {
  background: #14251a; border: 1px solid #1f3126; border-radius: 10px;
  padding: 18px 16px;
}
.stat-value { font-size: 1.6rem; font-weight: 800; color: #d4a642; line-height: 1.1; }
.stat-label { font-size: 0.85rem; color: #a89b7a; margin-top: 4px; }

/* ================= СЕКЦИИ ================= */
main { padding: 40px 0 60px; }
.section { padding: 40px 0; }
.section-title { margin-bottom: 8px; }
.section-lead { color: #a89b7a; margin-bottom: 28px; max-width: 720px; }

/* Карточная сетка */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.card {
  background: #14251a; border: 1px solid #1f3126; border-radius: 10px;
  padding: 22px; transition: border-color 0.15s ease, transform 0.15s ease;
  display: flex; flex-direction: column;
}
.card:hover { border-color: #d4a642; transform: translateY(-2px); }
.card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.card h3 a { color: #f0e5c8; }
.card h3 a:hover { color: #d4a642; text-decoration: none; }
.card p { color: #a89b7a; margin: 0 0 14px; font-size: 0.95rem; flex: 1; }
.card-link { color: #d4a642; font-weight: 600; font-size: 0.92rem; margin-top: auto; }

/* ================= КОНТЕНТНАЯ СТАТЬЯ ================= */
.article { max-width: 780px; margin: 0 auto; padding: 24px 20px 40px; }
.article h1 { margin-bottom: 8px; }
.article .meta {
  color: #a89b7a; font-size: 0.9rem; margin-bottom: 32px;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
}
.article .meta a { color: #a89b7a; }
.article h2 { margin-top: 2em; border-top: 1px solid #1f3126; padding-top: 1.5em; }
.article h2:first-of-type { border-top: none; padding-top: 0; }
/* Таблицы — горизонтальный скролл через .table-wrap обёртку */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 1.4em 0;
  border: 1px solid #2a3d30; border-radius: 6px;
  background: #14251a55;
}
.article table {
  width: 100%; border-collapse: collapse;
  margin: 0;
  font-size: 0.95rem;
}
.article th, .article td {
  padding: 10px 12px; border: 1px solid #2a3d30; text-align: left;
  white-space: nowrap;
}
.article th { background: #14251a; font-weight: 700; }
.article td.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 500px) {
  .article th, .article td { padding: 8px 10px; font-size: 0.85rem; }
}
/* Мобильный article — крошки на весь контейнер */
@media (max-width: 500px) {
  .article { padding: 18px 16px 32px; }
  .article h1 { font-size: 1.6rem; }
  .article h2 { font-size: 1.3rem; }
}
.article blockquote {
  border-left: 3px solid #d4a642; padding: 4px 16px; margin: 1.4em 0;
  color: #dbceb0; background: #d4a64208;
}
.article ul li::marker { color: #d4a642; }

/* Callout / инфоблок */
.callout {
  background: #14251a; border: 1px solid #1f3126; border-left: 3px solid #d4a642;
  padding: 18px 20px; border-radius: 6px; margin: 1.6em 0;
}
.callout.warn { border-left-color: #f59e0b; background: #f59e0b0d; }
.callout.danger { border-left-color: #ef4444; background: #ef44440d; }
.callout strong { color: #f0e5c8; }

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.85rem; color: #a89b7a; padding: 20px 0 0;
}
.breadcrumbs a { color: #a89b7a; }
.breadcrumbs a:hover { color: #d4a642; }
.breadcrumbs .sep { margin: 0 6px; opacity: 0.5; }

/* ================= БАННЕР TG (в контенте) ================= */
.tg-banner {
  background: linear-gradient(135deg, #229ED9 0%, #1a8ac0 100%);
  border-radius: 12px; padding: 22px 24px; margin: 30px 0;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.tg-banner-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 24px;
}
.tg-banner-text { flex: 1; min-width: 200px; color: #fff; }
.tg-banner-text strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.tg-banner-text span { opacity: 0.9; font-size: 0.92rem; }
.tg-banner .btn {
  background: #fff; color: #229ED9; border-color: #fff;
}
.tg-banner .btn:hover { background: #f0f0f0; text-decoration: none; }

/* ================= СЛОТ ПОД БАННЕР БК (пока пустой) ================= */
.ad-slot {
  border: 1px dashed #2a3d30; border-radius: 8px;
  padding: 24px; margin: 28px 0; text-align: center;
  color: #7d7458; font-size: 0.9rem; background: #14251a55;
}
.ad-slot::before { content: "рекламный слот"; display: block;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px;
  color: #7d7458; margin-bottom: 6px; }

/* Sticky нижний баннер TG */
.tg-sticky {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: #229ED9; color: #fff;
  padding: 10px 20px; display: flex; align-items: center; gap: 14px;
  transform: translateY(100%); transition: transform 0.3s ease;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
}
.tg-sticky.visible { transform: translateY(0); }
.tg-sticky-text { flex: 1; font-size: 0.92rem; }
.tg-sticky-text strong { display: inline; margin-right: 6px; }
.tg-sticky .btn {
  background: #fff; color: #229ED9; padding: 8px 14px; min-height: 40px;
  font-size: 0.9rem;
}
.tg-sticky-close {
  background: transparent; border: none; color: #fff; cursor: pointer;
  width: 32px; height: 32px; font-size: 20px; opacity: 0.7;
}
.tg-sticky-close:hover { opacity: 1; }
@media (max-width: 600px) {
  .tg-sticky-text span { display: none; }
}

/* ================= FAQ ================= */
.faq { margin: 2em 0; }
.faq-item {
  border: 1px solid #1f3126; border-radius: 8px; margin-bottom: 10px;
  background: #14251a; overflow: hidden;
}
.faq-item summary {
  padding: 16px 20px; cursor: pointer; font-weight: 600; color: #f0e5c8;
  list-style: none; position: relative; padding-right: 44px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  color: #d4a642; font-size: 1.3rem; font-weight: 400;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item-body { padding: 0 20px 18px; color: #dbceb0; }
.faq-item-body p:last-child { margin-bottom: 0; }

/* ================= ФУТЕР ================= */
.site-footer {
  background: #061109; border-top: 1px solid #1f3126;
  padding: 40px 0 24px; margin-top: 60px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px;
  margin-bottom: 30px;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-col h4 { font-size: 0.95rem; margin: 0 0 14px; color: #f0e5c8; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin: 8px 0; }
.footer-col a { color: #a89b7a; font-size: 0.92rem; }
.footer-col a:hover { color: #d4a642; }
.footer-about { color: #a89b7a; font-size: 0.9rem; line-height: 1.6; }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social a {
  width: 40px; height: 40px; border-radius: 8px; background: #14251a;
  border: 1px solid #1f3126; display: grid; place-items: center;
  color: #dbceb0; transition: all 0.15s ease;
}
.footer-social a:hover {
  border-color: #d4a642; color: #d4a642; text-decoration: none;
}
.footer-bottom {
  padding-top: 20px; border-top: 1px solid #1f3126;
  display: flex; justify-content: space-between; align-items: center;
  color: #7d7458; font-size: 0.85rem; flex-wrap: wrap; gap: 12px;
}
.footer-disclaimer {
  background: #14251a; border: 1px solid #1f3126; border-radius: 8px;
  padding: 14px 18px; margin-bottom: 20px;
  color: #a89b7a; font-size: 0.85rem; text-align: center;
}
.footer-disclaimer strong { color: #f59e0b; }

/* ================= КАЛЬКУЛЯТОРЫ ================= */
.calc {
  background: #14251a; border: 1px solid #2a3d30; border-radius: 12px;
  padding: 24px; margin: 30px 0;
}
.calc-title {
  font-size: 1.15rem; font-weight: 700; color: #f0e5c8;
  margin: 0 0 6px;
}
.calc-sub {
  color: #a89b7a; font-size: 0.9rem; margin: 0 0 20px;
}
.calc-row {
  display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px;
}
.calc-row.cols-2 { grid-template-columns: 1fr 1fr; }
.calc-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 560px) {
  .calc-row.cols-2, .calc-row.cols-3 { grid-template-columns: 1fr; }
}
.calc-field label {
  display: block; font-size: 0.85rem; color: #a89b7a;
  margin-bottom: 6px; font-weight: 500;
}
.calc-field label .hint {
  color: #7d7458; font-weight: 400; margin-left: 4px;
}
.calc-input {
  width: 100%; background: #0a1a10; color: #f0e5c8;
  border: 1px solid #2a3d30; border-radius: 8px;
  padding: 12px 14px; font-size: 1rem; font-family: inherit;
  min-height: 48px; transition: border-color 0.15s ease;
  -moz-appearance: textfield;
}
.calc-input::-webkit-outer-spin-button,
.calc-input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.calc-input:focus {
  outline: none; border-color: #d4a642;
  box-shadow: 0 0 0 3px rgba(212,166,66,0.15);
}
.calc-input.error {
  border-color: #ef4444;
}
.calc-select {
  width: 100%; background: #0a1a10; color: #f0e5c8;
  border: 1px solid #2a3d30; border-radius: 8px;
  padding: 12px 14px; font-size: 1rem; font-family: inherit;
  min-height: 48px; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23a89b7a' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.calc-btn {
  background: #d4a642; color: #0a1a10;
  border: none; border-radius: 8px;
  padding: 12px 20px; font-size: 0.95rem; font-weight: 700;
  min-height: 48px; cursor: pointer; font-family: inherit;
  transition: background 0.15s ease;
}
.calc-btn:hover { background: #b8892a; }
.calc-btn.secondary {
  background: transparent; color: #f0e5c8; border: 1px solid #2a3d30;
}
.calc-btn.secondary:hover { border-color: #d4a642; color: #d4a642; background: transparent; }
.calc-btn.small { padding: 8px 14px; min-height: 40px; font-size: 0.85rem; }
.calc-btn.danger { background: transparent; border: 1px solid #2a3d30; color: #ef4444; }
.calc-btn.danger:hover { border-color: #ef4444; }

.calc-actions {
  display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 20px;
}

.calc-result {
  background: #0a1a10; border: 1px solid #1f3126; border-radius: 10px;
  padding: 18px 20px; margin-top: 20px;
}
.calc-result-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid #1f3126;
  gap: 12px; flex-wrap: wrap;
}
.calc-result-row:last-child { border-bottom: none; }
.calc-result-label { color: #a89b7a; font-size: 0.9rem; }
.calc-result-value {
  font-size: 1.15rem; font-weight: 700; color: #f0e5c8;
  font-variant-numeric: tabular-nums;
}
.calc-result-value.big { font-size: 1.6rem; color: #d4a642; }
.calc-result-value.warn { color: #f59e0b; }
.calc-result-value.bad { color: #ef4444; }
.calc-result-value.mono {
  font-family: "SF Mono", Consolas, Menlo, monospace;
}

.calc-verdict {
  margin-top: 20px; padding: 16px 18px; border-radius: 10px;
  font-weight: 600;
}
.calc-verdict.good {
  background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.3);
  color: #10b981;
}
.calc-verdict.bad {
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
}
.calc-verdict.warn {
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.3);
  color: #f59e0b;
}

.calc-events {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px;
}
.calc-event {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 10px;
  align-items: center;
}
.calc-event-num {
  color: #a89b7a; font-size: 0.85rem; text-align: center;
  font-variant-numeric: tabular-nums;
}
.calc-mini-btn {
  width: 40px; height: 40px; border-radius: 8px; border: 1px solid #2a3d30;
  background: transparent; color: #a89b7a; cursor: pointer;
  font-size: 1.2rem; line-height: 1;
}
.calc-mini-btn:hover { border-color: #ef4444; color: #ef4444; }

/* Мини-таблица (для монте-карло / распределений) */
.calc-mini-table {
  width: 100%; border-collapse: collapse; margin: 12px 0;
  font-size: 0.9rem;
}
.calc-mini-table th, .calc-mini-table td {
  padding: 8px 10px; border: 1px solid #1f3126; text-align: right;
  font-variant-numeric: tabular-nums;
}
.calc-mini-table th {
  background: #14251a; color: #a89b7a; font-weight: 500;
  text-align: center;
}
.calc-mini-table td:first-child { text-align: left; color: #a89b7a; }

/* Bar-график (для монте-карло) */
.calc-hist { display: flex; align-items: flex-end; gap: 2px; height: 120px; margin-top: 14px; }
.calc-hist-bar {
  flex: 1; background: linear-gradient(180deg, #d4a642, #a67c1e);
  border-radius: 2px 2px 0 0; min-height: 2px;
  position: relative;
}
.calc-hist-labels {
  display: flex; justify-content: space-between; font-size: 0.75rem;
  color: #7d7458; margin-top: 4px;
}

/* ================= ХЕЛПЕРЫ ================= */
.text-muted { color: #a89b7a; }
.text-accent { color: #10b981; }
.text-danger { color: #ef4444; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
