/* Приложение OVI — по бренду OVI из прототипа заказчика (тёмно-синий, красный, хоккей), не дизайн-система nego
   (РЕШЕНИЯ.md). Эскизы — ovi/sketch.html. */
:root {
  --navy: #08142b; --navy2: #0f2142; --card: #15294f; --card2: #1c3462; --line: #2a4475;
  --red: #d3122f; --red2: #a80d25; --ice: #eef3f9; --white: #fff; --muted: #9db0cc; --dim: #6f86a8;
  --ok: #22b07d; --warn: #f2b233;
  --head: "Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;
  --body: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bot: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--navy); color: var(--white); font: 15px/1.45 var(--body); min-height: 100%; }
body { overscroll-behavior-y: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }
.boot { min-height: 100vh; display: grid; place-items: center; }

/* общие */
.logo { font: italic 900 24px/1 var(--head); letter-spacing: 1px; }
.logo i { color: var(--red); }
.logo.big { font-size: 52px; }
.big { font: 900 26px/1.12 var(--head); text-transform: uppercase; margin: 0; letter-spacing: .3px; }
.h2 { font: 800 18px/1.2 var(--head); text-transform: uppercase; margin: 0; }
.mut { color: var(--muted); font-size: 14px; }
.small { font-size: 12.5px; }
.btn { display: block; width: 100%; border: 0; border-radius: 12px; padding: 14px; font: 800 15px var(--head);
  text-transform: uppercase; letter-spacing: .4px; background: var(--red); color: #fff; text-align: center;
  text-decoration: none; cursor: pointer; transition: background .18s; }
.btn:active { background: var(--red2); }
.btn.white { background: #fff; color: var(--red); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: #fff; }
.btn:disabled, .btn.off { background: var(--card2); color: var(--dim); cursor: default; }
.btn.sm { display: inline-block; width: auto; padding: 8px 14px; font-size: 12.5px; border-radius: 10px; }
.link { color: var(--muted); font-size: 13px; background: none; border: 0; text-decoration: underline; cursor: pointer; }
.card { background: var(--card); border-radius: 16px; padding: 14px; }
.chip { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 11.5px; color: var(--muted); }
.tag { display: inline-block; background: var(--red); color: #fff; border-radius: 4px; font: 800 10px var(--head); padding: 2px 6px; text-transform: uppercase; letter-spacing: .5px; }
.tag.warn { background: var(--warn); color: #2a1c00; }
.tag.ok { background: var(--ok); }

/* каркас */
.screen { min-height: 100vh; display: flex; flex-direction: column; padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bot) + 90px); max-width: 560px; margin: 0 auto; }
.screen.center { justify-content: center; text-align: center; gap: 16px; padding-bottom: calc(var(--safe-bot) + 24px); }
.screen.full { padding-bottom: calc(var(--safe-bot) + 24px); }
.top { position: sticky; top: 0; z-index: 10; background: var(--navy); display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-top) + 10px) 16px 10px; max-width: 560px; margin: 0 auto; }
.top .sp { flex: 1; }
.top .back { background: none; border: 0; font-size: 26px; line-height: 1; padding: 0 6px 0 0; cursor: pointer; color: #fff; }
.top .title { font: 800 15px var(--head); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ava { width: 34px; height: 34px; border-radius: 50%; background: var(--red); display: grid; place-items: center; font: 800 12px var(--head); border: 0; cursor: pointer; color: #fff; flex: none; }
.ava.org { font-size: 9px; }
.body { padding: 0 16px calc(var(--safe-bot) + 96px); max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.body.full { padding-bottom: calc(var(--safe-bot) + 24px); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: var(--navy2); border-top: 1px solid var(--line);
  padding: 6px 4px calc(var(--safe-bot) + 8px); justify-content: center; }
.tabs .in { display: flex; width: 100%; max-width: 560px; }
.tab { flex: 1; text-align: center; font-size: 11px; color: var(--dim); position: relative; background: none; border: 0; cursor: pointer; padding: 4px 0; }
.tab svg { display: block; margin: 0 auto 2px; width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: #fff; }
.tab.on svg { stroke: var(--red); }
.bdg { position: absolute; top: 0; left: calc(50% + 6px); background: var(--red); color: #fff; font: 700 10px var(--body); border-radius: 999px; padding: 1px 6px; min-width: 18px; }
.dbgbar { position: sticky; top: 0; z-index: 30; background: var(--warn); color: #2a1c00; font-size: 12px; font-weight: 700; padding: calc(var(--safe-top) + 4px) 12px 4px; text-align: center; cursor: pointer; }

/* первый вход */
.steps { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.step { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 12px; padding: 12px; }
.step i { width: 30px; height: 30px; border-radius: 50%; background: var(--red); display: grid; place-items: center; font-style: normal; font-weight: 800; flex: none; }
.step svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2; vertical-align: -4px; }

/* лента */
.today { background: linear-gradient(135deg, var(--red), var(--red2)); border-radius: 16px; padding: 14px 16px; }
.today small { display: block; font: 800 11px var(--head); text-transform: uppercase; letter-spacing: 1px; opacity: .85; }
.today b { display: block; font: 800 18px/1.2 var(--head); margin: 3px 0 10px; text-transform: uppercase; }
.today .row { display: flex; gap: 8px; flex-wrap: wrap; }
.dayhead { font: 800 12px var(--head); text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-top: 6px; }
.dayhead b { color: #fff; }
.post { background: var(--card); border-radius: 16px; overflow: hidden; cursor: pointer; }
.post .in { padding: 12px 14px 14px; }
.media { position: relative; background: #0b1a36; }
.media img { display: block; width: 100%; max-height: 340px; object-fit: cover; }
.media.two { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.media.two img { height: 180px; }
.media video { display: block; width: 100%; max-height: 420px; background: #000; }
.media .play { position: absolute; inset: 0; display: grid; place-items: center; }
.media .play span { width: 60px; height: 60px; border-radius: 50%; background: #000a; display: grid; place-items: center; }
.media .play span::after { content: ""; border-left: 20px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent; margin-left: 5px; }
.rub { font: 800 11px var(--head); color: var(--red); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 3px; }
.ttl { font: 800 17px/1.2 var(--head); text-transform: uppercase; margin: 0 0 6px; }
.txt { color: #d6e0ee; font-size: 14.5px; white-space: pre-line; }
.txt.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cta { font-weight: 700; margin-top: 8px; font-size: 14px; }
.reacts { display: flex; gap: 8px; margin-top: 12px; }
.r { flex: 1; background: var(--card2); border: 0; border-radius: 10px; padding: 8px 0; text-align: center; font-size: 15px; cursor: pointer; color: #fff; transition: background .18s; }
.r.me { background: var(--red); }
.meta { font-size: 12.5px; color: var(--muted); margin-top: 10px; display: flex; justify-content: space-between; }
.stub { font-size: 11.5px; color: var(--warn); margin-top: 6px; }

/* комментарии */
.cms { display: flex; flex-direction: column; gap: 12px; }
.cm { display: flex; gap: 10px; font-size: 14px; }
.cm .a { width: 30px; height: 30px; border-radius: 50%; background: var(--card2); flex: none; display: grid; place-items: center; font: 800 10px var(--head); }
.cm .a.org { background: var(--red); font-size: 8px; }
.cm .n { font-weight: 700; font-size: 13px; }
.cm .n span { color: var(--muted); font-weight: 400; }
.cm .when { color: var(--dim); font-size: 11.5px; font-weight: 400; }
.cm.reply { margin-left: 40px; }
.cm.hid { opacity: .45; }
.cm img { display: block; max-width: 100%; border-radius: 10px; margin-top: 6px; }
.cm .acts { margin-left: auto; display: flex; gap: 6px; align-items: flex-start; }
.mini { font-size: 11px; color: var(--warn); border: 1px solid #f2b23355; border-radius: 6px; padding: 2px 7px; background: none; cursor: pointer; white-space: nowrap; }
.compose { position: sticky; bottom: 0; background: var(--navy); padding: 10px 0 calc(var(--safe-bot) + 10px); display: flex; gap: 8px; }
.compose textarea, .field { flex: 1; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; color: #fff; font: 15px var(--body); padding: 11px 12px; resize: none; min-height: 46px; max-height: 140px; outline: none; }
.compose textarea:focus, .field:focus { border-color: var(--muted); }
.compose .btn { width: auto; padding: 0 16px; }
.replyto { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }

/* кик-офф */
.leader { border-left: 3px solid var(--red); padding: 2px 0 2px 12px; }
.leader b { font: 800 13px var(--head); text-transform: uppercase; display: block; margin-bottom: 4px; }
.ice { background: var(--ice); color: #14223e; border-radius: 16px; padding: 14px; }
.week { display: flex; justify-content: space-between; position: relative; padding-top: 6px; }
.week::before { content: ""; position: absolute; left: 10px; right: 10px; top: 13px; height: 2px; background: #7d95b4; }
.week span { display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; font: 800 10.5px var(--head); text-align: center; }
.week span::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--red); }
.quote { font-style: italic; color: #d6e0ee; }

/* квизы */
.qgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qc { background: var(--card); border-radius: 14px; padding: 12px; min-height: 112px; display: flex; flex-direction: column; gap: 4px; position: relative; border: 1.5px solid transparent; cursor: pointer; text-align: left; color: #fff; }
.qc small { font: 800 10.5px var(--head); text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.qc b { font-size: 14px; }
.qc .res { font: 900 26px var(--head); margin-top: auto; }
.qc .res span { font: 600 12px var(--body); color: var(--muted); }
.qc .go { margin-top: auto; color: var(--red); font: 800 14px var(--head); text-transform: uppercase; }
.qc.lock { opacity: .5; cursor: default; }
.qc.lock::after { content: ""; position: absolute; right: 12px; top: 12px; width: 16px; height: 18px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239db0cc' stroke-width='2.4'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E"); }
.qc.open { border-color: var(--red); }
.qc.final { grid-column: span 2; background: linear-gradient(135deg, #1f3a6e, #12254a); min-height: 96px; }
.qc .top10 { align-self: flex-start; }
.prog { display: flex; gap: 4px; }
.prog i { flex: 1; height: 5px; border-radius: 3px; background: var(--card2); }
.prog i.d { background: #fff; }
.prog i.c { background: var(--red); }
.timer { height: 8px; border-radius: 4px; background: var(--card2); overflow: hidden; }
.timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--warn), var(--red)); transform-origin: left; }
.q { font: 800 20px/1.25 var(--head); margin: 6px 0; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; font-weight: 600; font-size: 15px; text-align: left; color: #fff; cursor: pointer; transition: background .18s, border-color .18s; }
.opt:disabled { cursor: default; }
.opt.ok { border-color: var(--ok); background: #22b07d26; }
.opt.bad { border-color: var(--red); background: #d3122f26; }
.verdict { border-radius: 12px; padding: 12px; font-size: 14px; background: #22b07d22; border: 1px solid #22b07d66; }
.verdict b { color: #5fe0ad; }
.verdict.bad { background: #d3122f22; border-color: #d3122f88; }
.verdict.bad b { color: #ff6b80; }
.num { font: 900 52px/1 var(--head); }
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; text-align: center; }
.stats div { background: var(--card); border-radius: 12px; padding: 10px 4px; }
.stats b { display: block; font: 900 22px var(--head); }
.stats span { font-size: 11px; color: var(--muted); }
.lb { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; }
.lb div { display: flex; gap: 10px; background: var(--card); border-radius: 10px; padding: 9px 12px; }
.lb div span:first-child { width: 22px; color: var(--muted); font-weight: 700; }
.lb div span:last-child { margin-left: auto; color: var(--muted); white-space: nowrap; }
.lb div.me { background: var(--red); }
.lb div.me span { color: #fff !important; }
.seg { display: flex; background: var(--card); border-radius: 10px; padding: 3px; font-size: 13px; }
.seg button { flex: 1; text-align: center; padding: 7px; border-radius: 8px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.seg button.on { background: var(--card2); color: #fff; font-weight: 700; }
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; justify-content: space-between; gap: 10px; background: var(--card); border-radius: 12px; padding: 12px 14px; font-size: 14px; border: 0; color: #fff; text-align: left; cursor: default; }
button.li { cursor: pointer; }
.li span:last-child { color: var(--muted); text-align: right; }
.banner { background: var(--card2); border: 1px dashed var(--line); border-radius: 12px; padding: 12px; text-align: center; font-size: 14px; }
.countdown { font: 900 46px var(--head); text-align: center; }

/* призы */
.prize { display: flex; gap: 12px; background: var(--card); border-radius: 14px; padding: 10px; align-items: center; }
.prize img { width: 70px; height: 70px; border-radius: 10px; object-fit: cover; flex: none; background: var(--card2); }
.prize b { display: block; font-size: 14px; }
.prize span { font-size: 12.5px; color: var(--muted); }
.prize .pr { margin-left: auto; text-align: right; font: 800 15px var(--head); white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.track { display: flex; flex-direction: column; font-size: 14px; }
.track div { display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; }
.track i { width: 16px; height: 16px; border-radius: 50%; background: var(--card2); flex: none; margin-top: 2px; border: 2px solid var(--line); }
.track .d i { background: var(--ok); border-color: var(--ok); }
.track .c i { background: var(--red); border-color: var(--red); }
.track small { display: block; color: var(--muted); font-size: 12px; }

/* входящие и чат */
.msg { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid #1d3157; font-size: 14px; align-items: flex-start; cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; color: #fff; text-align: left; width: 100%; }
.msg .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--card2); flex: none; display: grid; place-items: center; }
.msg .ic svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2; }
.msg b { display: block; font-size: 14px; }
.msg span { color: var(--muted); }
.msg .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); margin-left: auto; margin-top: 6px; flex: none; }
.msg time { font-size: 11px; color: var(--dim); margin-left: auto; white-space: nowrap; }
.chatpin { background: linear-gradient(135deg, #1f3a6e, #15294f); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; cursor: pointer; border: 0; color: #fff; width: 100%; text-align: left; }
.bubs { display: flex; flex-direction: column; gap: 8px; }
.bub { max-width: 82%; padding: 10px 12px; border-radius: 16px; font-size: 14.5px; white-space: pre-line; }
.bub.them { background: var(--card); border-bottom-left-radius: 4px; }
.bub.me { background: var(--red); margin-left: auto; border-bottom-right-radius: 4px; }
.bub small { display: block; font-size: 10.5px; opacity: .7; margin-top: 3px; }

/* отладка */
.debug { border: 1.5px dashed var(--warn); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.debug h4 { margin: 0; font: 800 12px var(--head); color: var(--warn); text-transform: uppercase; letter-spacing: 1px; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.days button { border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; font-size: 13px; background: none; color: #fff; cursor: pointer; }
.days button.on { background: var(--warn); color: #2a1c00; border-color: var(--warn); font-weight: 800; }

/* плашки */
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--safe-bot) + 84px); z-index: 50; background: #fff; color: #14223e; border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 600; max-width: 528px; margin: 0 auto; }
.update { position: fixed; left: 16px; right: 16px; bottom: calc(var(--safe-bot) + 84px); z-index: 49; background: #fff; color: #14223e; border-radius: 14px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; max-width: 528px; margin: 0 auto; }
.update .btn { margin-left: auto; }
.offline { position: fixed; top: calc(var(--safe-top) + 6px); left: 50%; transform: translateX(-50%); z-index: 60; background: var(--warn); color: #2a1c00; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 4px 12px; }
.modal { position: fixed; inset: 0; z-index: 70; background: #000a; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--navy2); border-radius: 18px 18px 0 0; padding: 18px 16px calc(var(--safe-bot) + 18px); width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 12px; }
