/* Оформление сайтов «Ойла!»: из прототипов этапов (Oila! 1 этап.html, Oila! 2 этап.html), общее для главного сайта и обоих этапов. */
:root {
  --bg: #F6F5FC;
  --surface: #FFFFFF;
  --field: #F2F3FA;
  --ink: #1A1646;
  --muted: #5E5C7E;
  --line: #E1DFF0;
  --accent: #3A22E0;
  --accent-ink: #FFFFFF;
  --accent-soft: #ECEAFF;
  --dot: #9B3A9B;
  --grad: linear-gradient(90deg, #2F66E8 0%, #3A1FDC 55%, #8A2FA0 100%);
  --warn: #D2420C;
  --warn-soft: #FDE7DC;
  --ok: #12794A;
  --font-display: "Unbounded", "Onest", system-ui, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0D28; --surface: #181548; --field: #121036; --ink: #EEEDFB; --muted: #A5A3C8; --line: #2C2A5C;
    --accent: #8B7CFF; --accent-ink: #0F0D28; --accent-soft: #25226A; --dot: #D07BD0;
    --warn: #FF8F60; --warn-soft: #3A2218; --ok: #4CC98A; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F0D28; --surface: #181548; --field: #121036; --ink: #EEEDFB; --muted: #A5A3C8; --line: #2C2A5C;
  --accent: #8B7CFF; --accent-ink: #0F0D28; --accent-soft: #25226A; --dot: #D07BD0;
  --warn: #FF8F60; --warn-soft: #3A2218; --ok: #4CC98A; color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; 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-block: 0 48px;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 760px; margin: 0 auto; min-width: 0; }
.narrow { max-width: 560px; }

/* Top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding-block: 14px 10px; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.bar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-weight: 600; font-size: 14px; letter-spacing: .02em; display: flex; align-items: center; gap: 10px; }
.brand small { font-family: var(--font-mono); font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.timer { font-family: var(--font-mono); font-weight: 700; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.timer.warn { color: var(--warn); }
.track { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.track i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; }
.track.warn i { background: var(--warn); }

/* Typography */
h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(24px, 5.2vw, 34px); line-height: 1.15; letter-spacing: -.01em; margin: 28px 0 10px; text-wrap: balance; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin: 0 0 12px; text-wrap: balance; }
p { margin: 0 0 12px; }
.lead { color: var(--muted); font-size: 17px; max-width: 52ch; }
.mono { font-family: var(--font-mono); }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Panels & forms */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.stack { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label, .field .lab { font-weight: 700; font-size: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
input[type=text], input[type=tel], input[type=number], select {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink);
}
.hint { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn { min-height: 48px; padding: 10px 22px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.btn.danger { border-color: var(--warn); color: var(--warn); background: transparent; }
.btn.danger.armed { background: var(--warn); color: var(--surface); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.linklike { background: none; border: 0; padding: 4px 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }

/* Rules list */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; padding: 0; list-style: none; }
.facts li { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface); }
.facts b { display: block; font-family: var(--font-mono); font-size: 26px; line-height: 1.1; }
.facts span { font-size: 13px; color: var(--muted); }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; } .facts li { display: flex; align-items: baseline; gap: 12px; } }
.rules { margin: 0 0 22px; padding-left: 20px; display: grid; gap: 8px; }

/* Question */
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-top: 8px; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.tag.lv { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.qtext { font-size: clamp(19px, 3.6vw, 24px); font-weight: 700; line-height: 1.3; margin: 0 0 20px; text-wrap: pretty; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 10px 14px; text-align: left; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-weight: 600; }
.opt .k { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 13px; font-weight: 700; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.opt[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.opt[aria-pressed="true"] .k { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.auto { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-top: 14px; }
.auto input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Number grid */
.map { display: flex; flex-wrap: wrap; gap: 18px 22px; margin-top: 22px; }
.grp { min-width: 0; }
.grp .eyebrow { margin-bottom: 8px; }
.cells { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.cell { width: 100%; height: 40px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-family: var(--font-mono); font-weight: 700; font-size: 14px; display: grid; place-items: center; padding: 0; }
.cell.done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cell.cur { outline: 3px solid var(--accent); outline-offset: 2px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 6px; border: 1px solid var(--line); background: var(--surface); }
.legend i.d { background: var(--accent); border-color: var(--accent); }

/* Done */
.big { font-family: var(--font-mono); font-size: 40px; font-weight: 700; line-height: 1; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.ok i { background: var(--ok); }
.status.bad i { background: var(--warn); }

/* Admin */
.tablebox { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 680px; font-size: 14px; }
th, td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { white-space: normal; vertical-align: bottom; }
td.sv { white-space: normal; min-width: 150px; }
th { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
tr:last-child td { border-bottom: 0; }
tr.pass td { background: var(--accent-soft); }
.sub { color: var(--muted); font-size: 12px; }
.pill { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); }
.pill.y { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.kpis { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0; }
.kpi { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--surface); min-width: 130px; }
.kpi b { display: block; font-family: var(--font-mono); font-size: 24px; }
.kpi span { font-size: 12px; color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.rowbtn { background: none; border: 0; padding: 2px 0; text-align: left; display: grid; font-weight: 700; }
.rowbtn .sub { font-weight: 500; }
tr.drow td { white-space: normal; padding: 0; background: var(--bg); }
.dwrap { padding: 16px; max-width: 100vw; }
.dhead { display: flex; gap: 14px 28px; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.dsum { display: flex; gap: 8px 28px; flex-wrap: wrap; }
.dsum .mono { font-size: 13px; }
.detail { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dq { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); counter-increment: none; }
.dq::before { content: attr(value); flex: none; width: 28px; font-family: var(--font-mono); font-weight: 700; color: var(--muted); }
.dq .dbody { flex: 1; min-width: 0; }
.dtext { font-weight: 600; margin: 2px 0; white-space: normal; }
.dans { font-size: 14px; color: var(--muted); white-space: normal; }
.dans b { color: var(--ink); }
.dq.ok { border-left: 4px solid var(--ok); }
.dq.bad { border-left: 4px solid var(--warn); }
.dq.skip { border-left: 4px solid var(--muted); border-style: dashed; border-left-style: solid; }
.pill.v-ok { color: var(--ok); border-color: var(--ok); }
.pill.v-bad { color: var(--warn); border-color: var(--warn); }
.pill.v-skip { color: var(--muted); }
.dq .pill { flex: none; }
footer { margin-top: 36px; display: flex; gap: 18px; flex-wrap: wrap; }
/* Фирменный стиль Newton Kazakhstan: светлый лавандовый фон, широкий жирный гротеск, сине-фиолетовый градиент */
#app.wrap { max-width: none; }
.inner { margin: 0 auto; }
.inner.n, .wrap.narrow { max-width: 560px; }
.inner.t, .wrap.t { max-width: 880px; margin-left: auto; margin-right: auto; }
.inner.w, .wrap.wide { max-width: 1120px; margin-left: auto; margin-right: auto; }
.top.static { position: static; }
@media (min-width: 900px) {
  .cells { grid-template-columns: repeat(20, minmax(0, 1fr)); }
  .qcard { padding: 34px 36px; }
  .qtext { font-size: 26px; margin-bottom: 26px; }
  .opt { min-height: 62px; font-size: 17px; }
  .timer { font-size: 38px; }
  .hero { padding-top: 24px; }
  .hero .lead { font-size: 19px; }
}
@media (max-width: 520px) {
  .panel, .qcard { padding: 20px; border-radius: 22px; }
  .timer { font-size: 28px; }
  .wm { font-size: 14px; }
  .actions .btn { flex: 1 1 auto; }
  .nav .btn { flex: 1 1 0; }
}
.brand { gap: 12px; }
.logo { flex: none; }
.wm { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.02; letter-spacing: -.01em; }
.stage { font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.kick { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 13px; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.kick::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--dot); }
h1 { font-weight: 700; letter-spacing: -.025em; line-height: 1.1; font-size: clamp(26px, 4.6vw, 44px); }
h2 { font-weight: 700; letter-spacing: -.01em; }
.hero h1 { font-size: clamp(30px, 5.4vw, 54px); margin-top: 18px; }
.gr { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 48px; align-items: start; margin-top: 36px; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 20px; } }
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.pillbox { padding: 10px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.panel { border-radius: 28px; padding: 28px; box-shadow: 0 24px 60px -34px rgba(40, 25, 140, .4); }
.qcard { border-radius: 26px; }
.nocopy, .nocopy * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media print { .qcard { display: none !important; } }
input[type=text], input[type=tel], input[type=number], select { min-height: 54px; border-radius: 16px; background: var(--field); }
.btn { border: 0; background: var(--grad); color: #fff; border-radius: 18px; min-height: 54px; font-weight: 800; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.danger { border: 1px solid var(--warn); }
.btn.small { min-height: 42px; border-radius: 14px; }
.btn.block { width: 100%; }
.chip { background: var(--field); }
.seg { display: grid; grid-template-columns: 1fr 1fr; }
.seg .chip { border-radius: 16px; min-height: 52px; }
.chip[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #fff; }
.opt { border-radius: 16px; background: var(--field); }
.track i, .cell.done { background: var(--grad); }
.cell.done { border-color: transparent; color: #fff; }
.cell.miss { opacity: .45; text-decoration: line-through; }
.cell.cur { cursor: default; }
.track.warn i { background: var(--warn); }
.timer { color: var(--ink); }
.map { margin: 6px 0 12px; }
.map .cells { flex: 1 1 100%; min-width: 0; }
.legend { margin: 12px 0 14px; }
.facts li { border-radius: 18px; }
@media (prefers-reduced-motion: no-preference) { .track i { transition: transform .25s linear; } .opt, .cell { transition: background .12s, border-color .12s; } }

/* ---------- Дополнения для боевых сайтов ---------- */
a { color: var(--accent); }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.btn.ghost, a.btn.ghost { color: var(--ink); }
.logo { width: 40px; height: 40px; display: block; }
.brand a { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lang { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.lang button { min-height: 34px; min-width: 44px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; font-size: 13px; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--grad); color: #fff; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 20; background: var(--surface); padding: 8px 12px; border-radius: 10px; }
.err { color: var(--warn); font-size: 13px; font-weight: 600; margin: 0; }
[aria-invalid="true"] { border-color: var(--warn) !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.note { font-size: 13px; color: var(--muted); margin: 0; }
.spin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; vertical-align: -3px; margin-right: 8px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toasts { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 30; width: min(92vw, 420px); }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .4); }
.pairs { display: grid; gap: 8px; }
.pairs .chip { text-align: left; border-radius: 14px; min-height: 48px; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.codebox { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-radius: 18px; background: var(--accent-soft); }
.codebox b { font-family: var(--font-mono); font-size: 26px; letter-spacing: .04em; }
.count { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.count div { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 8px; text-align: center; }
.count b { display: block; font-family: var(--font-mono); font-size: clamp(26px, 7vw, 40px); line-height: 1; font-variant-numeric: tabular-nums; }
.count span { font-size: 12px; color: var(--muted); }
.opensat { font-weight: 800; font-size: clamp(20px, 4.4vw, 28px); margin: 6px 0 0; }
.tag.e { background: #E3F6EC; color: var(--ok); }
.tag.m { background: var(--accent-soft); color: var(--accent); }
.tag.h { background: var(--warn-soft); color: var(--warn); }
.cells .cell.e { box-shadow: inset 0 -3px 0 #8FD7B1; }
.cells .cell.m { box-shadow: inset 0 -3px 0 #A99BFF; }
.cells .cell.h { box-shadow: inset 0 -3px 0 #F4A27F; }
.cells .cell.done { box-shadow: none; }
.result { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.result div { background: var(--field); border-radius: 16px; padding: 14px 10px; text-align: center; }
.result b { display: block; font-family: var(--font-mono); font-size: 28px; line-height: 1.1; }
.result span { font-size: 12px; color: var(--muted); }
@media (max-width: 420px) { .result { grid-template-columns: 1fr 1fr; } .count { gap: 6px; } }
/* главный сайт */
.sec { margin-top: 56px; }
.sec > h2 { font-size: clamp(22px, 4vw, 30px); margin-bottom: 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 22px; }
.card h3 { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin: 8px 0 6px; }
.card p { color: var(--muted); margin: 0; font-size: 15px; }
.card .when { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.card.hot { background: var(--grad); border-color: transparent; color: #fff; }
.card.hot p, .card.hot .when { color: rgba(255, 255, 255, .86); }
.prizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 18px; }
.prize b { display: block; font-family: var(--font-display); font-size: 26px; margin-top: 4px; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 18px; margin-top: 10px; }
summary { font-weight: 700; cursor: pointer; }
details p { margin: 10px 0 0; color: var(--muted); }
/* тест 1 этапа и карточка для сторис */
.warnbar { margin: 4px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-size: 14px; font-weight: 600; }
.share { margin-top: 18px; }
.achs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ach { display: grid; padding: 8px 12px; border-radius: 14px; background: var(--accent-soft); }
.ach b { font-size: 14px; color: var(--accent); }
.ach small { font-size: 12px; color: var(--muted); }
.cardbox { display: grid; justify-items: center; gap: 8px; }
.cardbox canvas { width: min(100%, 300px); height: auto; aspect-ratio: 9 / 16; border-radius: 18px; box-shadow: 0 20px 50px -30px rgba(40, 25, 140, .6); background: var(--field); }
