/* Альтиус — стили интерфейса */

:root {
  --paper: #f3f1ec;
  --card: #fbfaf7;
  --card-2: #f7f5f0;
  --ink: #17181a;
  --ink-2: #3a3b3d;
  --muted: #74726c;
  --line: #e1ddd4;
  --line-2: #cfcabf;
  --accent: #e2531f;
  --accent-ink: #ffffff;
  --accent-soft: #fbe3d8;
  --green: #2f6b4f;
  --green-soft: #dcebe2;
  --amber: #a86a12;
  --amber-soft: #f6e8cc;
  --red: #b3261e;
  --red-soft: #f6dcd9;
  --blue: #2d5a8a;
  --blue-soft: #dce7f2;
  --side: #17181a;
  --side-ink: #d8d5ce;
  --side-muted: #8a877f;
  --field: #ffffff;
  --on-ink: #ffffff;
  --accent-text: #9c3511;

  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 6px;
  --r-lg: 10px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
::selection { background: var(--accent); color: #fff; }

.num, .amt, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.label {
  font: 500 11px/1.3 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- загрузка ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--ink); }
.boot-mark { width: 40px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }

.side {
  background: var(--side);
  color: var(--side-ink);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 26px; text-decoration: none; color: #fff; }
.brand svg { width: 26px; color: var(--accent); }
.brand b { font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.brand small { display: block; font: 400 10px/1 var(--mono); color: var(--side-muted); letter-spacing: .06em; margin-top: 3px; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-title { font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--side-muted); padding: 18px 10px 8px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: 5px;
  text-decoration: none; color: var(--side-ink); font-size: 14px;
  position: relative;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.on { background: rgba(255,255,255,.09); color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 3px; background: var(--accent); border-radius: 0 2px 2px 0; }
.nav a.on svg { opacity: 1; color: var(--accent); }
.nav .count { margin-left: auto; font: 500 11px/1 var(--mono); background: var(--accent); color: #fff; padding: 3px 6px; border-radius: 10px; }

.side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); }
.me-mini { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 6px; text-decoration: none; color: inherit; }
.me-mini:hover { background: rgba(255,255,255,.06); }
.me-mini .who { min-width: 0; }
.me-mini .who b { display: block; font-weight: 500; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-mini .who span { font-size: 12px; color: var(--side-muted); }
.side-links { display: flex; gap: 14px; padding: 8px 10px 0; font-size: 12px; }
.side-links a, .side-links button { color: var(--side-muted); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.side-links a:hover, .side-links button:hover { color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 36px; border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky; top: 0; z-index: 20;
}
.top h1 { font-size: 22px; letter-spacing: -0.02em; margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .burger { display: none; }
.wallet-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 30px;
  text-decoration: none; background: var(--card); white-space: nowrap;
}
.wallet-chip .amt { font-weight: 600; }
.icon-btn {
  position: relative; width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 50%; background: var(--card); cursor: pointer; text-decoration: none; flex: none;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--ink); }
.dot-count {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--accent); color: #fff; border-radius: 9px; font: 600 11px/18px var(--mono); text-align: center;
}
.content { padding: 28px 36px 64px; max-width: 1240px; width: 100%; }

/* ---------- элементы ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--r);
  border: 1px solid var(--ink); background: var(--ink); color: var(--on-ink);
  font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: #000; }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.accent:hover { background: #c94515; border-color: #c94515; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; }
.btn.plain { background: none; border-color: transparent; color: var(--ink); padding: 0 8px; }
.btn.plain:hover { background: rgba(0,0,0,.05); }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; }
.btn.ok { background: var(--green); border-color: var(--green); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn.ghost.loading::after, .btn.plain.loading::after { border-color: rgba(0,0,0,.2); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; }
.card-head a { font-size: 13px; color: var(--muted); }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; line-height: 18px;
  background: var(--card-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
.tag.accent { background: var(--accent-soft); border-color: transparent; color: #9c3511; }
.tag.green { background: var(--green-soft); border-color: transparent; color: var(--green); }
.tag.amber { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.tag.red { background: var(--red-soft); border-color: transparent; color: var(--red); }
.tag.blue { background: var(--blue-soft); border-color: transparent; color: var(--blue); }
.tag.dark { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

.coin { display: inline-block; width: .95em; height: .95em; vertical-align: -0.12em; margin-left: .22em; flex: none; }
.amt { white-space: nowrap; }
.amt.plus { color: var(--green); }
.amt.minus { color: var(--ink); }

.ava {
  --c: #8a877f;
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--c); color: #fff;
  font: 600 13px/1 var(--font); letter-spacing: .02em; text-decoration: none;
}
.ava.sm { width: 28px; height: 28px; font-size: 11px; }
.ava.xs { width: 22px; height: 22px; font-size: 9px; }
.ava.lg { width: 56px; height: 56px; font-size: 19px; }
.ava.xl { width: 92px; height: 92px; font-size: 30px; }
.ava-stack { display: flex; }
.ava-stack .ava { border: 2px solid var(--card); margin-left: -8px; }
.ava-stack .ava:first-child { margin-left: 0; }

.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .who { min-width: 0; }
.person .who b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .who > span { font-size: 13px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.plink { text-decoration: none; font-weight: 500; }
a.plink:hover { text-decoration: underline; text-underline-offset: 2px; }

/* формы */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--field); border: 1px solid var(--line-2); border-radius: var(--r);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.select { appearance: none; padding-right: 32px; background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2317181a' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center / 11px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,24,26,.08); }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--ink); margin: 0; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 11px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 38px; }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); padding: 3px; gap: 2px; background: var(--card); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--ink); color: var(--on-ink); }
.seg button:not(.on):hover { color: var(--ink); }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
  border: 0; background: none; padding: 0 0 11px; cursor: pointer; text-decoration: none;
  color: var(--muted); font-weight: 500; font-size: 14px; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .count { font: 500 11px var(--mono); color: var(--accent); margin-left: 4px; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--field); }
.qty button { width: 30px; height: 32px; border: 0; background: none; cursor: pointer; font-size: 17px; line-height: 1; }
.qty button:hover { background: var(--card-2); }
.qty span { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 500; }

/* таблицы */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 500 11px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--card-2); }
.table .r { text-align: right; }
.table .nowrap { white-space: nowrap; }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 56px; margin: 0 auto 14px; color: var(--line-2); }
.empty b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 4px; }

.err-box { padding: 14px 16px; background: var(--red-soft); color: var(--red); border-radius: var(--r); font-size: 14px; }
.note { padding: 12px 14px; background: var(--card-2); border: 1px dashed var(--line-2); border-radius: var(--r); font-size: 13px; color: var(--ink-2); }

.skeleton { height: 120px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--card-2) 0, #ece9e2 50%, var(--card-2) 100%); background-size: 200% 100%; animation: sk 1.3s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* модальные окна */
.modal-back {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(23,24,26,.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 7vh 16px 16px; overflow-y: auto;
  animation: fade .15s ease-out;
}
.modal {
  width: 100%; max-width: 520px; background: var(--card); border-radius: 12px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.35);
  animation: rise .18s ease-out;
}
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--card-2); border-radius: 0 0 12px 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink); color: var(--on-ink); padding: 12px 16px; border-radius: 8px; font-size: 14px;
  max-width: 360px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.4); animation: rise .2s ease-out;
  display: flex; gap: 10px; align-items: flex-start;
}
.toast.err { background: var(--red); }
.toast.ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #7fd1a2; margin-top: 6px; flex: none; }

.pop {
  position: absolute; z-index: 60; background: var(--card); border: 1px solid var(--line-2);
  border-radius: 10px; box-shadow: 0 20px 40px -18px rgba(0,0,0,.3); overflow: hidden;
}

/* ---------- вход ---------- */
.login { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.login-art {
  background: var(--side); color: var(--side-ink); position: relative; overflow: hidden;
  padding: 44px 52px; display: flex; flex-direction: column;
}
.login-art .topo { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.login-art > *:not(.topo) { position: relative; }
.login-art h1 { font-size: clamp(34px, 4.2vw, 56px); color: #fff; letter-spacing: -0.035em; line-height: 1.02; margin-top: auto; max-width: 11ch; }
.login-art h1 em { font-style: normal; color: var(--accent); }
.login-art p { max-width: 42ch; margin-top: 18px; color: var(--side-ink); }
.login-meta { display: flex; gap: 28px; margin-top: 36px; font: 400 12px/1.4 var(--mono); color: var(--side-muted); flex-wrap: wrap; }
.login-meta b { display: block; color: #fff; font: 500 22px/1.2 var(--font); margin-bottom: 2px; }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(20px, 6vw, 88px); }
.login-form form { max-width: 380px; width: 100%; }
.login-form h2 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 6px; }
.demo { margin-top: 34px; max-width: 520px; }
.demo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.demo-list button {
  text-align: left; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--card); cursor: pointer; line-height: 1.3;
}
.demo-list button:hover { border-color: var(--ink); }
.demo-list b { display: block; font-size: 13px; font-weight: 600; }
.demo-list span { font-size: 12px; color: var(--muted); }

/* ---------- страницы ---------- */
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-intro h2 { font-size: 28px; letter-spacing: -0.025em; }
.page-intro p { color: var(--muted); margin-top: 4px; }

.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.sticky { position: sticky; top: 96px; }

/* высота (уровень) */
.alti { padding: 20px; background: var(--side); color: #fff; border-color: var(--side); position: relative; overflow: hidden; }
.alti .topo { position: absolute; right: -40px; top: -30px; width: 260px; opacity: .35; pointer-events: none; }
.alti .label { color: var(--side-muted); }
.alti-num { font-size: 42px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.alti-num small { font-size: 18px; font-weight: 500; color: var(--side-muted); margin-left: 4px; }
.alti-level { color: var(--accent); font-weight: 500; }
.ridge { margin-top: 18px; }
.ridge-bar { height: 6px; background: rgba(255,255,255,.12); border-radius: 3px; overflow: hidden; }
.ridge-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.ridge-meta { display: flex; justify-content: space-between; font: 400 12px var(--mono); color: var(--side-muted); margin-top: 8px; }

.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.bar.accent i { background: var(--accent); }
.bar.green i { background: var(--green); }

/* серия отметок */
.streak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 14px 0 16px; }
.streak div { text-align: center; }
.streak i { display: block; height: 30px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--field); }
.streak .on i { background: var(--ink); border-color: var(--ink); }
.streak .next i { border: 1.5px dashed var(--accent); background: var(--accent-soft); }
.streak span { display: block; font: 400 11px var(--mono); color: var(--muted); margin-top: 4px; }

/* лента */
.feed { display: flex; flex-direction: column; }
.post { padding: 18px 20px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 14px; }
.post:last-child { border-bottom: 0; }
.post.award { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); box-shadow: inset 3px 0 0 var(--accent); }
.post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: 14px; }
.post-head .arrow { color: var(--muted); }
.post-head time { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.post-text { margin: 6px 0 10px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.post-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.like { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: none; border-radius: 20px; padding: 3px 10px; font-size: 13px; cursor: pointer; color: var(--muted); }
.like svg { width: 14px; height: 14px; }
.like.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.like:hover { border-color: var(--ink); color: var(--ink); }
.post-amt { margin-left: auto; font-weight: 600; font-size: 15px; }

/* активности */
.acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.act { display: flex; flex-direction: column; padding: 20px; gap: 12px; }
.act-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.act h3 { font-size: 17px; letter-spacing: -0.015em; }
.act p { font-size: 14px; color: var(--ink-2); }
.act-reward { text-align: right; flex: none; }
.act-reward b { font-size: 20px; font-weight: 600; display: block; line-height: 1; }
.act-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-top: auto; padding-top: 4px; }
.act-actions { border-top: 1px solid var(--line); padding-top: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.act.done { background: var(--card-2); }

/* игры */
.games { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 30px; }
.quiz-q { margin-bottom: 20px; }
.quiz-q h4 { font-size: 15px; font-weight: 500; margin-bottom: 10px; }
.quiz-opts { display: grid; gap: 6px; }
.quiz-opts button { text-align: left; border: 1px solid var(--line-2); background: var(--field); border-radius: var(--r); padding: 9px 12px; cursor: pointer; font-size: 14px; }
.quiz-opts button:hover { border-color: var(--ink); }
.quiz-opts button.pick { border-color: var(--ink); background: var(--ink); color: var(--on-ink); }
.quiz-opts button.right { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.quiz-opts button.wrong { border-color: var(--red); background: var(--red-soft); color: var(--red); }

/* магазин */
.shop-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.shop-bar .search { flex: 1; min-width: 220px; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 16px; }
.prod { display: flex; flex-direction: column; overflow: hidden; cursor: pointer; transition: border-color .15s; }
.prod:hover { border-color: var(--line-2); }
.prod:hover .prod-img img { transform: scale(1.04); }
.prod-img { aspect-ratio: 4 / 3; position: relative; overflow: hidden; background: var(--c, #e9e4da); }
.prod-img img { width: 100%; height: 100%; object-fit: contain; padding: 8%; transition: transform .25s; }
.prod-img img.photo { object-fit: cover; padding: 0; }
.prod-badges { position: absolute; left: 10px; top: 10px; display: flex; gap: 4px; flex-wrap: wrap; }
.fav {
  position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.75); display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.fav svg { width: 16px; height: 16px; }
.fav.on { color: var(--accent); }
.fav.on svg path { fill: currentColor; }
.prod-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.prod-body h3 { font-size: 15px; font-weight: 500; line-height: 1.3; }
.prod-meta { font-size: 12px; color: var(--muted); }
.prod-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 8px; }
.price { font-size: 18px; font-weight: 600; }
.price s { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.prod.soldout .prod-img img { filter: grayscale(1); opacity: .45; }

.pmodal { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.pmodal .prod-img { border-radius: 8px; }
.stars { display: inline-flex; gap: 2px; color: var(--accent); }
.stars svg { width: 14px; height: 14px; }
.stars.pick button { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--line-2); }
.stars.pick button.on { color: var(--accent); }
.stars.pick svg { width: 22px; height: 22px; }

/* корзина */
.cart-line { display: grid; grid-template-columns: 76px minmax(0,1fr) auto auto; gap: 16px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.thumb { width: 76px; height: 58px; border-radius: 6px; background: var(--c, #e9e4da); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.thumb img.photo { object-fit: cover; padding: 0; }
.thumb.sm { width: 48px; height: 38px; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.sum-row.total { font-size: 18px; font-weight: 600; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; }

/* заказы */
.order { margin-bottom: 16px; }
.order-steps { display: flex; gap: 0; margin: 4px 0 2px; }
.order-steps div { flex: 1; font-size: 12px; color: var(--muted); position: relative; padding-top: 14px; }
.order-steps div::before { content: ""; position: absolute; top: 0; left: 0; right: 4px; height: 4px; border-radius: 2px; background: var(--line); }
.order-steps div.on { color: var(--ink); }
.order-steps div.on::before { background: var(--ink); }
.order-steps div.cur::before { background: var(--accent); }
.code { font: 500 14px var(--mono); background: var(--card-2); border: 1px dashed var(--line-2); padding: 4px 10px; border-radius: 4px; letter-spacing: .04em; }

/* история */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi { padding: 16px 18px; }
.kpi b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi.dark { background: var(--side); color: #fff; border-color: var(--side); }
.kpi.dark .label, .kpi.dark small { color: var(--side-muted); }

/* рейтинг */
.rank { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.rank:last-child { border-bottom: 0; }
.rank .pos { font: 500 16px var(--mono); color: var(--muted); }
.rank.top .pos { color: var(--accent); font-size: 22px; }
.rank.me { background: var(--accent-soft); }

/* профиль */
.prof-head { display: flex; gap: 22px; align-items: center; padding: 24px; flex-wrap: wrap; }
.prof-head h2 { font-size: 26px; letter-spacing: -0.025em; }
.prof-head .meta { display: flex; gap: 6px 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-top: 4px; }
.prof-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.prof-stats div { padding: 14px 24px; border-right: 1px solid var(--line); }
.prof-stats div:last-child { border-right: 0; }
.prof-stats b { display: block; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.prof-stats span { font-size: 12px; color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 16px 20px 20px; }
.badge { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--field); }
.badge svg { width: 30px; height: 30px; color: var(--accent); }
.badge b { font-size: 13px; font-weight: 600; line-height: 1.25; }
.badge span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.badge.locked { background: transparent; border-style: dashed; }
.badge.locked svg { color: var(--line-2); }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; background: var(--c); }
.colors button.on { border-color: var(--ink); box-shadow: inset 0 0 0 2px #fff; }

/* благодарность */
.picker { position: relative; }
.picker-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; max-height: 240px; overflow-y: auto; background: var(--field); border: 1px solid var(--line-2); border-radius: var(--r); z-index: 5; box-shadow: 0 16px 30px -16px rgba(0,0,0,.3); }
.picker-list button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: none; cursor: pointer; text-align: left; }
.picker-list button:hover, .picker-list button.hl { background: var(--card-2); }
.picked { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--field); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line-2); background: var(--field); border-radius: 20px; padding: 5px 12px; cursor: pointer; font-size: 13px; }
.chips button.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.amount-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.amount-row .input { width: 96px; text-align: center; font-weight: 600; }

/* поддержка */
.thread { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.msg { max-width: 78%; display: flex; gap: 10px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble { background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.msg.mine .msg-bubble { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.msg.staff .msg-bubble { background: var(--green-soft); border-color: transparent; }
.msg-bubble p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.msg-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.msg.mine .msg-meta { color: var(--side-muted); }
details.faq { border-bottom: 1px solid var(--line); padding: 12px 20px; }
details.faq:last-child { border-bottom: 0; }
details.faq summary { cursor: pointer; font-weight: 500; font-size: 14px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.faq summary::after { content: "+"; font: 400 18px/1 var(--mono); color: var(--muted); }
details.faq[open] summary::after { content: "−"; }
details.faq p { margin-top: 8px; font-size: 14px; color: var(--ink-2); }

/* уведомления */
.notif { width: 360px; max-width: calc(100vw - 24px); }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-list a { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 14px; }
.notif-list a:last-child { border-bottom: 0; }
.notif-list a:hover { background: var(--card-2); }
.notif-list a.unread { box-shadow: inset 3px 0 0 var(--accent); }
.notif-list time { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* админка */
.admin-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font: 400 11px var(--mono); fill: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: 150px minmax(0,1fr) 64px; gap: 12px; align-items: center; font-size: 13px; padding: 6px 0; }
.hbar .bar { height: 8px; }
.hbar .r { text-align: right; font-variant-numeric: tabular-nums; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.role-card { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); }
.role-card b { display: block; margin-bottom: 4px; font-size: 14px; }
.role-card p { font-size: 13px; color: var(--muted); }
.rank-pips { display: flex; gap: 3px; margin-bottom: 8px; }
.rank-pips i { width: 14px; height: 4px; border-radius: 2px; background: var(--line); }
.rank-pips i.on { background: var(--accent); }
.img-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; max-height: 150px; overflow-y: auto; }
.img-pick button { aspect-ratio: 1; border: 1px solid var(--line-2); border-radius: 6px; background: var(--field); cursor: pointer; padding: 4px; }
.img-pick button.on { border: 2px solid var(--ink); }

/* ---------- адаптив ---------- */
@media (max-width: 1100px) {
  .layout-2 { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 90;
    transform: translateX(-100%); transition: transform .2s ease-out;
  }
  .app.menu-open .side { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.3); }
  .app.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 80; }
  .top .burger { display: grid; }
  .top { padding: 12px 16px; gap: 8px; }
  .top h1 { font-size: 18px; }
  .wallet-chip .label { display: none; }
  .top .btn-thanks span { display: none; }
  .top .btn-thanks { width: 38px; padding: 0; border-radius: 50%; }
  .content { padding: 20px 16px 48px; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 28px 20px; min-height: 0; }
  .login-art h1 { margin-top: 60px; }
  .login-form { padding: 32px 16px 48px; }
  .games { grid-template-columns: 1fr; }
  .pmodal { grid-template-columns: 1fr; }
  .prof-stats { grid-template-columns: 1fr 1fr; }
  .prof-stats div:nth-child(2) { border-right: 0; }
  .prof-stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .cart-line { grid-template-columns: 56px minmax(0,1fr); }
  .cart-line .thumb { width: 56px; height: 44px; }
  .cart-line > :nth-child(3), .cart-line > :nth-child(4) { grid-column: 2; }
  .hbar { grid-template-columns: 100px minmax(0,1fr) 54px; }
  .msg { max-width: 92%; }
  .page-intro h2 { font-size: 23px; }
  .acts { grid-template-columns: 1fr; }
  .post { padding: 16px; grid-template-columns: 32px minmax(0,1fr); gap: 10px; }
  .post .ava { width: 32px; height: 32px; font-size: 11px; }
  .table th, .table td { padding: 10px; }
}
@media (max-width: 520px) {
  .wallet-chip { padding: 6px 10px; }
  .products { grid-template-columns: 1fr 1fr; gap: 10px; }
  .prod-body { padding: 10px; }
  .prod-body h3 { font-size: 14px; }
  .price { font-size: 16px; }
  .prod-foot .btn span { display: none; }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
}

/* ---------- движение ---------- */

/* появление блоков при открытии страницы */
.reveal { animation: reveal .5s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } }

/* пятно света под курсором */
.prod, .act, .kpi, .badge, .role-card, .demo-list button, .post, .rank, .alti, .login-form form { position: relative; }
.prod::after, .act::after, .kpi::after, .badge::after, .role-card::after,
.demo-list button::after, .post::after, .rank::after, .alti::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(226, 83, 31, .09), transparent 65%);
  opacity: 0; transition: opacity .3s;
}
.alti::after, .kpi.dark::after { background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .08), transparent 65%); }
.prod:hover::after, .act:hover::after, .kpi:hover::after, .badge:hover::after, .role-card:hover::after,
.demo-list button:hover::after, .post:hover::after, .rank:hover::after, .alti:hover::after { opacity: 1; }
.prod-img, .prod-body, .act > *, .post > * { position: relative; z-index: 1; }

/* лёгкий наклон карточек */
.prod, .badge, .kpi {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), border-color .15s, box-shadow .3s;
}
.prod.tilting, .badge.tilting, .kpi.tilting { transition: transform .12s linear, border-color .15s, box-shadow .3s; }
.prod:hover { box-shadow: 0 18px 34px -24px rgba(23, 24, 26, .45); }
.act { transition: border-color .2s, box-shadow .3s, transform .3s; }
.act:hover { border-color: var(--line-2); box-shadow: 0 14px 30px -24px rgba(23, 24, 26, .4); transform: translateY(-2px); }

/* горизонтали плавно следуют за мышью */
.login-art .topo, .alti .topo, .doc-hero .topo { transition: transform .9s cubic-bezier(.2, .7, .2, 1); will-change: transform; }
.login-art .topo { animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { to { translate: -14px 10px; } }

/* кнопки: притяжение к курсору и волна от нажатия */
.btn, .chips button, .seg button { position: relative; overflow: hidden; }
.btn.accent, .btn.lg { transform: translate(var(--tx, 0px), var(--ty, 0px)); transition: background .15s, border-color .15s, color .15s, transform .25s cubic-bezier(.2, .7, .2, 1); }
.btn:active:not([disabled]) { scale: .98; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .18; pointer-events: none; transform: scale(0); animation: ripple .55s ease-out forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* стрелка в пунктах меню и ссылках чуть смещается */
.nav a svg { transition: transform .2s, opacity .2s; }
.nav a:hover svg { transform: translateX(2px); }
.icon-btn { transition: border-color .15s, transform .2s; }
.icon-btn:hover { transform: translateY(-1px); }

/* отклики */
.boing { animation: boing .4s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes boing { 40% { transform: scale(1.18); } }
.like.on.boing svg { animation: heart .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes heart { 30% { transform: scale(1.45) rotate(-8deg); } }
.wallet-chip.bump { animation: bump .7s ease-out; }
@keyframes bump { 30% { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); } }
.streak i { transition: background .3s, border-color .3s, transform .3s; }
.streak .next i { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scaleY(.88); } }
.bar i, .ridge-bar i { animation: grow .9s cubic-bezier(.2, .7, .2, 1) both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.chart rect[rx] { transform-box: fill-box; transform-origin: bottom; animation: rise-bar .7s cubic-bezier(.2, .7, .2, 1) both; }
.chart g:nth-child(odd) rect[rx] { animation-delay: .05s; }
@keyframes rise-bar { from { transform: scaleY(0); } }
.chart g:hover rect[rx] { opacity: .75; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .prod, .badge, .kpi, .btn { transform: none !important; }
}

/* вход: текст и форма появляются по очереди */
.login-art .brand, .login-art h1, .login-art p, .login-meta, .login-form form, .demo { animation: reveal .7s cubic-bezier(.2, .7, .2, 1) both; }
.login-art h1 { animation-delay: .08s; }
.login-art p { animation-delay: .16s; }
.login-meta { animation-delay: .24s; }
.login-form form { animation-delay: .12s; }
.demo { animation-delay: .28s; }
.demo-list button { transition: border-color .15s, transform .2s; }
.demo-list button:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .demo-list button:hover { transform: none; } }

/* ---------- правки по отзыву: новые разделы ---------- */

/* контент по центру, без пустой полосы справа на широких экранах */
.content { margin: 0 auto; max-width: 1360px; }

/* шапка: баланс и благодарность спокойнее */
.wallet-chip { border-color: var(--line); background: transparent; padding: 6px 10px; }
.wallet-chip .amt { font-weight: 500; }
.wallet-chip:hover { border-color: var(--line-2); }

/* вход */
.link { background: none; border: 0; padding: 0; color: var(--ink-2); font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.link:hover { color: var(--accent); text-decoration-color: currentColor; }
.login-alt { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.code-input { font: 500 22px var(--mono); letter-spacing: .35em; text-align: center; height: 52px; }

/* игры дня в три колонки */
.games-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .games-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .games-3 { grid-template-columns: 1fr; } }

/* колесо удачи */
.wheel { position: relative; width: min(190px, 100%); margin: 12px auto 16px; }
.wheel-disc { width: 100%; height: auto; transform-origin: 50% 50%; filter: drop-shadow(0 6px 10px rgba(0,0,0,.12)); }
.wheel-disc text { font: 600 13px var(--font); text-anchor: middle; dominant-baseline: middle; }
.wheel-pin { position: absolute; left: 50%; top: -6px; width: 22px; transform: translateX(-50%); }

/* календарь анонсов */
.cal-wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; padding: 16px 20px 20px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; align-content: start; }
.cal-wd { font: 500 10px var(--mono); text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: 4px; }
.cal-day { aspect-ratio: 1; border: 1px solid transparent; background: none; border-radius: 6px; padding: 0; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: default; }
.cal-day.has { cursor: pointer; background: var(--card-2); border-color: var(--line); color: var(--ink); font-weight: 500; }
.cal-day.has:hover { border-color: var(--ink); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.cal-day i { display: flex; gap: 2px; height: 4px; }
.cal-day em, .cal-legend em { display: inline-block; width: 4px; height: 4px; border-radius: 50%; }
.dot-event { background: var(--accent); }
.dot-birthday { background: var(--blue); }
.dot-holiday { background: var(--green); }
.cal-legend { grid-column: 1 / -1; display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 8px; }
.cal-legend em { width: 6px; height: 6px; margin-right: 5px; vertical-align: 1px; }
.ann-list { min-width: 0; }
.ann { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ann:last-of-type { border-bottom: 0; }
.ann-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: #9c3511; }
.ann-ico svg { width: 15px; height: 15px; }
.ann-birthday .ann-ico { background: var(--blue-soft); color: var(--blue); }
.ann-holiday .ann-ico { background: var(--green-soft); color: var(--green); }
.ann b { display: block; font-weight: 500; font-size: 14px; }
.ann span { font-size: 12px; color: var(--muted); }
.ann p { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
@media (max-width: 860px) { .cal-wrap { grid-template-columns: 1fr; } .cal { max-width: 340px; } }

/* офлайн-квест */
.quest { background: var(--card-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.quest ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.quest li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.quest li svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--muted); }
.quest li.found { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.quest li.found svg { color: var(--green); }

/* игры в обед */
.match { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.match:last-child { border-bottom: 0; }
.seg label { cursor: pointer; }
.seg label span { display: block; padding: 5px 12px; border-radius: 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
.seg input:checked + span { background: var(--ink); color: var(--on-ink); }
.seg button svg { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; }

/* битва отделов */
.battle-map { width: 100%; height: auto; display: block; }
.hex { cursor: pointer; outline: none; }
.hex polygon { fill: var(--c); fill-opacity: .9; stroke: var(--paper); stroke-width: 4; transition: fill-opacity .2s, transform .2s; transform-box: fill-box; transform-origin: center; }
.hex:hover polygon, .hex:focus-visible polygon { fill-opacity: 1; transform: scale(1.04); }
.hex.mine polygon { stroke: var(--ink); stroke-width: 3; }
.hex.contested polygon { fill: #cfc8bb; stroke-dasharray: 6 4; stroke: var(--ink-2); stroke-width: 2; }
.hex text { text-anchor: middle; dominant-baseline: middle; pointer-events: none; fill: #fff; }
.hex.free text, .hex.contested text { fill: var(--ink); }
.hex-name { font: 500 11.5px var(--font); }
.hex-owner { font: 600 12px var(--mono); opacity: .9; }
.standing { display: flex; align-items: center; gap: 10px; padding: 8px 20px; font-size: 14px; }
.standing i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.standing.mine { background: var(--accent-soft); }
.standing b { font-variant-numeric: tabular-nums; }

/* обсуждения */
.topics { display: grid; gap: 12px; }
.topic { display: block; padding: 18px 20px; text-decoration: none; transition: border-color .15s; }
.topic:hover { border-color: var(--line-2); }
.topic h3 { font-size: 16px; }
.topic .tag svg { width: 12px; height: 12px; }
.topic-stats { display: flex; gap: 12px; color: var(--muted); font-size: 13px; flex: none; }
.topic-stats span { display: inline-flex; align-items: center; gap: 4px; }
.topic-stats svg { width: 15px; height: 15px; }
.topic-stats .on { color: var(--accent); }
.comments { padding: 6px 0; }
.comment { display: flex; gap: 12px; padding: 12px 20px; }
.comment p { font-size: 14px; margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.member-pick { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; margin-top: 8px; display: grid; gap: 4px; background: var(--field); }
.member-pick .check { gap: 8px; font-size: 13px; }

/* вопросы и ответы, команды */
.faq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 520px) { .faq-grid { grid-template-columns: 1fr; } }
.team-row { padding: 8px 0; }
.team-row.mine { background: linear-gradient(90deg, var(--accent-soft), transparent); margin: 0 -20px; padding: 8px 20px; }

/* заказ: что делать дальше */
.howto { display: grid; gap: 10px; }
.howto-step { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); text-align: left; }
.howto-step svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 2px; }
.howto-step b { display: block; font-weight: 600; font-size: 14px; }
.howto-step p { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

/* фото товаров */
.thumbs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.thumbs button { width: 60px; height: 48px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--c); padding: 0; overflow: hidden; cursor: pointer; }
.thumbs button.on { border: 2px solid var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: contain; }
.thumbs img.photo { object-fit: cover; }
.prod-count { position: absolute; left: 10px; bottom: 10px; display: inline-flex; gap: 4px; align-items: center; font-size: 11px; background: rgba(255,255,255,.85); padding: 2px 7px; border-radius: 10px; }
.prod-count svg { width: 12px; height: 12px; }
.gallery-edit { display: flex; gap: 6px; flex-wrap: wrap; }
.g-item { position: relative; width: 72px; height: 56px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.g-item img { width: 100%; height: 100%; object-fit: cover; }
.g-item button { position: absolute; right: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.g-item button svg { width: 12px; height: 12px; }

/* ---------- тёмная тема ---------- */
/* Включается кнопкой в шапке; без выбора — следует настройке системы */

:root[data-theme="dark"] {
  --paper: #141517;
  --card: #1b1c1f;
  --card-2: #222327;
  --ink: #ecebe6;
  --ink-2: #c9c7c1;
  --muted: #908e88;
  --line: #2d2e33;
  --line-2: #3c3d43;
  --accent: #ee6a36;
  --accent-soft: #3b231a;
  --accent-text: #f4a382;
  --green: #6cc39a;
  --green-soft: #1c3329;
  --amber: #e2ab4c;
  --amber-soft: #3a2f1b;
  --red: #f07c72;
  --red-soft: #3b201e;
  --blue: #86afdc;
  --blue-soft: #1c2a3b;
  --side: #0d0e0f;
  --side-ink: #d8d5ce;
  --field: #202124;
  --on-ink: #141517;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141517;
    --card: #1b1c1f;
    --card-2: #222327;
    --ink: #ecebe6;
    --ink-2: #c9c7c1;
    --muted: #908e88;
    --line: #2d2e33;
    --line-2: #3c3d43;
    --accent: #ee6a36;
    --accent-soft: #3b231a;
    --accent-text: #f4a382;
    --green: #6cc39a;
    --green-soft: #1c3329;
    --amber: #e2ab4c;
    --amber-soft: #3a2f1b;
    --red: #f07c72;
    --red-soft: #3b201e;
    --blue: #86afdc;
    --blue-soft: #1c2a3b;
    --side: #0d0e0f;
    --side-ink: #d8d5ce;
    --field: #202124;
    --on-ink: #141517;
    color-scheme: dark;
  }
}

/* мелочи, которые в тёмной теме нужно поправить точечно */
.tag.accent, .ann-ico { color: var(--accent-text); }
.btn:hover { background: color-mix(in srgb, var(--ink) 88%, var(--paper)); }
.btn.accent:hover { background: #c94515; }
.btn.ghost:hover, .btn.danger:hover { background: transparent; }
.btn.danger:hover { background: var(--red); color: #fff; }
.fav, .prod-count { color: #17181a; }
.toast.err { color: #fff; }
.skeleton { background: linear-gradient(90deg, var(--card-2) 0, var(--line) 50%, var(--card-2) 100%); background-size: 200% 100%; }
:root[data-theme="dark"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23ecebe6' stroke-width='1.6'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23ecebe6' stroke-width='1.6'/%3E%3C/svg%3E"); }
}
.prod-img, .thumb, .thumbs button { transition: filter .2s; }
:root[data-theme="dark"] .prod-img img:not(.photo), :root[data-theme="dark"] .thumb img:not(.photo) { filter: brightness(.92); }
:root[data-theme="dark"] .modal { box-shadow: 0 30px 60px -20px rgba(0,0,0,.7); }

/* переключатель темы */
.theme-btn svg { transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.theme-btn:hover svg { transform: rotate(-20deg); }
.login-theme { position: absolute; top: 20px; right: 20px; }
.login-form { position: relative; }
body, .card, .top, .input, .select, .textarea { transition: background-color .25s, border-color .25s, color .25s; }
