/* Сайт (лендинг и статьи). Игра (/app) использует style.css. */
:root {
  --felt: #154330;
  --felt-2: #1d5a41;
  --gold: #e8c46a;
  --bg: #f7f4ec;
  --paper: #fffdf7;
  --ink: #1f2420;
  --muted: #5d665f;
  --line: #e2dccb;
  --red: #b3261e;
  --link: #17603f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101814;
    --paper: #16211b;
    --ink: #e8ece8;
    --muted: #a3b0a8;
    --line: #2a3a31;
    --red: #ff8a80;
    --link: #7fd1a6;
  }
}
:root[data-theme="dark"] {
  --bg: #101814; --paper: #16211b; --ink: #e8ece8; --muted: #a3b0a8; --line: #2a3a31; --red: #ff8a80; --link: #7fd1a6;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); }
img, svg { max-width: 100%; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }

/* шапка */
.nav { background: var(--felt); color: #fff; }
.nav .wrap { display: flex; align-items: center; gap: 18px; min-height: 56px; flex-wrap: wrap; }
.nav a { color: #fff; text-decoration: none; opacity: .9; }
.nav a:hover { opacity: 1; text-decoration: underline; }
.nav .logo { font-weight: 700; font-size: 18px; margin-right: auto; opacity: 1; }
.nav .logo span { color: var(--gold); }

/* первый экран */
.hero { background: radial-gradient(ellipse at 50% 0%, var(--felt-2), var(--felt) 70%); color: #fff; padding: 40px 0 48px; }
.hero .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.15; margin: 0 0 14px; }
.hero p.lead { font-size: 19px; margin: 0 0 24px; color: #dfeee6; }
.hero .note { font-size: 14px; color: #b9d4c5; margin-top: 14px; }
.fan { position: relative; height: 230px; }
.fan .card {
  position: absolute; left: 50%; top: 20px; width: 110px; height: 160px; margin-left: -55px;
  background: #fff; color: #111; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.35);
  font: 700 30px/1 Georgia, serif; padding: 10px; transform-origin: 50% 120%;
}
.fan .card.r { color: #c62828; }
.fan .card:nth-child(1) { transform: rotate(-24deg); }
.fan .card:nth-child(2) { transform: rotate(-8deg); }
.fan .card:nth-child(3) { transform: rotate(8deg); }
.fan .card:nth-child(4) { transform: rotate(24deg); }
.fan .card b { position: absolute; right: 12px; bottom: 10px; font-size: 44px; }

.btn {
  display: inline-block; background: var(--gold); color: #1b1b1b; font-weight: 700; text-decoration: none;
  padding: 13px 22px; border-radius: 10px; margin: 0 8px 8px 0; border: 0; font-size: 17px; cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.btn.ghost.dark { color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }

/* содержимое */
main { padding: 8px 0 40px; }
section { padding: 28px 0 8px; }
h1, h2, h3 { line-height: 1.25; }
h2 { font-size: 27px; margin: 0 0 14px; }
h3 { font-size: 20px; margin: 22px 0 8px; }
.article h1 { font-size: clamp(28px, 4.5vw, 38px); margin: 28px 0 10px; }
.article .lead { font-size: 19px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.tile h3 { margin-top: 0; }
.tile p { margin: 0; color: var(--muted); }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 14px 48px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--felt); color: #fff; display: grid; place-items: center; font-weight: 700;
}
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--paper); font-size: 16px; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: rgba(21, 67, 48, .08); }
td.num, th.num { text-align: right; white-space: nowrap; }
.s, .c { white-space: nowrap; }
.d, .h { color: var(--red); white-space: nowrap; }
details { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
summary { font-weight: 600; cursor: pointer; }
details p { margin: 10px 0 0; }
.cta { background: var(--felt); color: #fff; border-radius: 14px; padding: 24px; margin: 32px 0 8px; }
.cta h2 { margin-top: 0; }
.cta p { color: #dfeee6; }
.toc { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 20px; }
.toc ol { margin: 6px 0; padding-left: 20px; }
dl.terms dt { font-weight: 700; margin-top: 12px; }
dl.terms dd { margin: 2px 0 0 0; color: var(--muted); }
.footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 15px; }
.footer a { margin-right: 14px; }

/* калькулятор */
.calc { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.calc .opts { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.calc label { font-size: 15px; color: var(--muted); }
.calc input {
  width: 100%; min-width: 0; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--ink);
}
.calc .opts input { width: 90px; }
.calc table input { width: 100%; }
.calc td label { display: block; font-size: 13px; }
.calc td, .calc th { padding: 6px; }
.res-plus { color: #1b7f46; font-weight: 700; }
.res-minus { color: var(--red); font-weight: 700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .res-plus { color: #7fd1a6; } }

@media (max-width: 720px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .fan { height: 200px; }
  .nav .wrap { gap: 12px; font-size: 15px; padding: 8px 16px; }
  .nav .logo { width: 100%; }
}
@media (max-width: 560px) {
  .calc { padding: 12px 8px; }
  .calc table { font-size: 14px; }
  .calc td, .calc th { padding: 3px; }
  .calc table input { padding: 4px 3px; font-size: 15px; min-width: 2.4em; }
  .calc td.num { min-width: 3.2em; }
}
