/* Пульт чудес. Одна тёмная «космическая» тема — фирменный стиль клуба Ивана. */
:root {
  --bg: #0B0806; --surface: #17110D; --surface-2: #21170F; --surface-3: #2A1D13; --line: #3A2618;
  --fg: #F4EDE6; --muted: #A89A8E; --accent: #FF8A1F; --accent-soft: #FFB36B; --on-accent: #1A0F08;
  --good: #8FD49A; --warn: #F2C063; --bad: #F08A7A;
  --font-display: 'Oswald', 'Arial Narrow', Arial, sans-serif;
  --font-body: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  --font-hand: 'Caveat', cursive;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--fg); }
body { margin: 0; font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-bottom: 24px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
h1, h2, h3 { margin: 0; font-family: var(--font-display); text-transform: uppercase; line-height: 1.05; text-wrap: balance; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17px; letter-spacing: .02em; }
p { margin: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 11px; }
.eyebrow { font-family: var(--font-display); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.hand { font-family: var(--font-hand); color: var(--accent-soft); font-size: 26px; line-height: 1.1; }
.card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card.hot { border-color: var(--accent); background: linear-gradient(180deg, rgba(255,138,31,.16), rgba(255,138,31,.04)), var(--surface-2); }
.row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.btn { border: 0; border-radius: 14px; padding: 13px 16px; font-weight: 700; background: var(--accent); color: var(--on-accent); width: 100%; transition: transform .12s, background .2s; text-align: center; text-decoration: none; display: inline-block; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.small { width: auto; padding: 8px 12px; font-size: 13px; border-radius: 12px; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid rgba(240,138,122,.4); }
.btn[disabled] { opacity: .45; cursor: default; }
.link { background: none; border: 0; color: var(--accent-soft); font-weight: 600; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--fg); white-space: nowrap; }
.chip.sel { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.badge { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px; white-space: nowrap; border: 1px solid var(--line); color: var(--muted); }
.badge.good { color: var(--good); border-color: rgba(143,212,154,.4); }
.badge.warn { color: var(--warn); border-color: rgba(242,192,99,.4); }
.badge.bad { color: var(--bad); border-color: rgba(240,138,122,.4); }
.badge.acc { color: var(--accent-soft); border-color: rgba(255,179,107,.45); }
textarea, input[type="text"], input[type="number"], input[type="email"], input[type="tel"], input[type="password"], select {
  width: 100%; background: #0f0b08; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; resize: vertical; min-width: 0; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); outline: none; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 0; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
label.check input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }

/* ---------- phone layout ---------- */
.app { position: relative; display: flex; flex-direction: column; height: calc(100dvh - 32px); min-height: 560px; max-width: 460px; margin: 16px auto;
  background: radial-gradient(520px 360px at 100% 0%, rgba(255,120,20,.18), transparent 70%), var(--surface);
  border: 1px solid var(--line); border-radius: 32px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 6px #120c09; }
body.appmode { padding: 0; }
@media (max-width: 520px) { .app { margin: 0; height: 100dvh; border-radius: 0; border: 0; box-shadow: none; } }
.spin { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.wide { padding-top: 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; gap: 12px; }
.brand { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 18px; }
.brand span { color: var(--accent); }
.pill { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: transparent; white-space: nowrap; }
.pill.on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.screen { flex: 1; overflow-y: auto; padding: 4px 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.screen > *, .sheet > *, .wide > *, .stack > * { flex-shrink: 0; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: #120d0a; padding-bottom: env(safe-area-inset-bottom, 0px); }
.tab { background: none; border: 0; padding: 10px 4px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--accent); }
.toast { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--fg); color: var(--bg); font-weight: 700; font-size: 13px; padding: 9px 14px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 40; white-space: nowrap; }
.toast.wide { position: fixed; bottom: 24px; }

/* ---------- today ---------- */
.orbwrap { display: flex; align-items: center; gap: 18px; }
.orb { flex: none; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 32% 70%, #3a1a08 0%, #160904 60%, #0a0603 75%); border: 2px solid rgba(255,170,80,.85); }
.orb b { font-family: var(--font-display); font-size: 46px; line-height: 1; color: var(--accent-soft); }
.orb small { position: absolute; bottom: 16px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.orb.empty b { color: var(--muted); font-size: 34px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); text-transform: uppercase; }
.week i { width: 100%; aspect-ratio: 1; max-width: 34px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; font-style: normal; font-family: var(--font-display); font-size: 14px; color: var(--fg); }
.ladder { display: flex; flex-direction: column; gap: 6px; }
.lvl { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 7px 12px; text-align: left; color: var(--fg); background: transparent; position: relative; overflow: hidden; }
.lvl::before { content: ''; position: absolute; inset: 0; width: var(--w); background: linear-gradient(90deg, rgba(255,138,31,.03), rgba(255,138,31,var(--o))); z-index: 0; }
.lvl > * { position: relative; z-index: 1; }
.lvl b { font-family: var(--font-display); font-size: 18px; width: 18px; color: var(--accent-soft); }
.lvl .lt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.lvl .lt span { font-weight: 700; font-size: 14px; }
.lvl .lt small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.lvl.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.stat { display: flex; flex-direction: column; gap: 2px; flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.stat b { font-family: var(--font-display); font-size: 28px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.hero { position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -90px; top: -110px; border: 1.5px solid rgba(255,170,80,.6); box-shadow: 0 0 50px rgba(255,120,20,.35); pointer-events: none; }

/* ---------- practices ---------- */
.group-title { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--muted); margin-top: 6px; }
.prac { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; text-align: left; width: 100%; color: var(--fg); }
.prac .ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,138,31,.14); color: var(--accent); font-family: var(--font-display); font-size: 18px; }
.prac.locked .ico { background: rgba(168,154,142,.1); color: var(--muted); }
.prac .t { flex: 1; min-width: 0; }
.prac .t b { display: block; font-weight: 700; }
.prac .t small { color: var(--muted); font-size: 12px; }

/* ---------- player ---------- */
.progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.timer { font-family: var(--font-display); font-size: 56px; text-align: center; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1; }
.guide { display: flex; flex-direction: column; gap: 8px; }
.guide p { padding: 8px 12px; border-left: 3px solid var(--line); color: var(--muted); transition: color .3s, border-color .3s; }
.guide p.now { color: var(--fg); border-color: var(--accent); }
.mult { display: flex; flex-direction: column; gap: 8px; }
.mult .tier { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.mult .num { font-family: var(--font-display); font-size: 22px; font-variant-numeric: tabular-nums; }
.scale-val { font-family: var(--font-display); font-size: 40px; color: var(--accent); text-align: center; line-height: 1; }
.done-delta { font-family: var(--font-display); font-size: 48px; text-align: center; line-height: 1; }

/* ---------- journal ---------- */
.chart { width: 100%; height: auto; display: block; }
.entry { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.entry summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.entry summary::-webkit-details-marker { display: none; }
.delta { font-family: var(--font-display); font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.up { color: var(--good); } .delta.flat { color: var(--muted); }
.answers { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; font-size: 13px; }
.answers b { color: var(--accent-soft); font-weight: 600; }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.heat i { aspect-ratio: 1; border-radius: 6px; background: #1a120c; border: 1px solid #2a1c12; }

/* ---------- sheet (paywall, intro) ---------- */
.veil { position: absolute; inset: 0; background: rgba(5,3,2,.72); z-index: 30; display: flex; align-items: flex-end; }
.sheet { width: 100%; max-height: 92%; overflow-y: auto; background: var(--surface); border-top: 1px solid var(--accent); border-radius: 26px 26px 0 0; padding: 22px 20px 26px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 -20px 60px rgba(255,110,10,.12); }
.sheet.full { max-height: 100%; height: 100%; border-radius: 0; border-top: 0; }
.price { font-family: var(--font-display); font-size: 44px; line-height: 1; color: var(--accent); }
.price small { font-family: var(--font-body); font-size: 14px; color: var(--muted); font-weight: 600; }
.checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.checks li { display: flex; gap: 10px; } .checks li::before { content: '✦'; color: var(--accent); flex: none; }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); } .dots i.on { background: var(--accent); width: 20px; border-radius: 4px; }
.mock { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: #120c09; display: flex; flex-direction: column; gap: 8px; }
.paybox { border: 1px dashed var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #fff; color: #222; }
.paybox .muted { color: #666; }

/* ---------- cabinet ---------- */
.wide { max-width: 1120px; margin-inline: auto; display: flex; flex-direction: column; gap: 18px; }
.cabhead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cabnav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi b { font-family: var(--font-display); font-size: 30px; line-height: 1.05; color: var(--fg); font-variant-numeric: tabular-nums; }
.kpi.acc b { color: var(--accent); }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.fstep { display: grid; grid-template-columns: 150px minmax(0,1fr) 64px; gap: 10px; align-items: center; font-size: 13px; }
.fstep .bar { height: 30px; border-radius: 8px; background: linear-gradient(90deg, #FF8A1F, #FFB36B); min-width: 38px; display: flex; align-items: center; padding-left: 10px; color: var(--on-accent); font-weight: 700; font-family: var(--font-display); font-size: 16px; white-space: nowrap; }
.fstep .lab { font-weight: 600; } .fstep .cv { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .fstep { grid-template-columns: minmax(0,1fr) 54px; } .fstep .lab { grid-column: 1 / -1; } }
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th, table.t td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.t th { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--muted); }
table.t td.n, table.t th.n { text-align: right; }
.person { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.person > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 14px; }
.person > summary::-webkit-details-marker { display: none; }
.person .body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.person .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .em { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .person > summary { grid-template-columns: minmax(0,1fr) auto; } .person .src { display: none; } }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; font-size: 13px; }
.facts div span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
@media (max-width: 420px) { .cgrid { grid-template-columns: minmax(0,1fr); } }
.linkbox { display: flex; gap: 8px; align-items: center; background: #0f0b08; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: 13px; min-width: 0; }
.linkbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent-soft); }
.form2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.note { font-size: 13px; color: var(--muted); }

.wait { display:flex; flex-direction:column; align-items:center; text-align:center; gap:16px; padding:40px 0; }
.err { color: var(--bad); font-size: 13px; }
.skeleton { color: var(--muted); padding: 30px 0; text-align: center; }
pre.raw { white-space: pre-wrap; word-break: break-all; font-size: 11px; color: var(--muted); max-height: 220px; overflow: auto; background:#0f0b08; border:1px solid var(--line); border-radius:10px; padding:8px; }
.docs-ta { min-height: 220px; font-size: 13px; }
