/* Слепая карта: демо ежедневной игры для городского портала.
   Ночной экран навигатора, сама карта светлая и без подписей. Точка
   читателя синяя, правильный ответ красный, между ними пунктир промаха.
   Таймер полосой под заданием краснеет на последних восьми секундах.
   Колонка до 480 px, на десктопе по центру. ?accent= меняет цвет бренда
   издания: метка бренда, точка читателя, главная кнопка. */

@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/fonts/golos-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/fonts/golos-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2122;
}
@font-face {
  font-family: "Oswald"; font-style: normal; font-weight: 200 700; font-display: swap;
  src: url(/fonts/oswald-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Oswald"; font-style: normal; font-weight: 200 700; font-display: swap;
  src: url(/fonts/oswald-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2116;
}

:root {
  --accent: #3d7bff;        /* бренд издания; в демо синий, как точка на навигаторе */
  --accent-ink: #fff;
  --truth: #ff3b30;
  --ok: #3ddc84;
  --warn: #ffc24b;
  --mid: #ff8a3d;
  --no: #ff5a5f;
  --bg: #0f1420;
  --bg-2: #171e2e;
  --ink: #f2f5fb;
  --ink-2: #a9b3c6;
  --ink-3: #6f7a90;
  --glass: rgba(24, 31, 46, .86);
  --glass-2: rgba(30, 38, 56, .92);
  --edge: rgba(160, 190, 255, .12);
  --sans: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Oswald", "Arial Narrow", sans-serif;
  --r: 18px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}
:root[data-accent="red"] { --accent: #e0263f; --accent-ink: #fff; --truth: #11151f; }
:root[data-accent="green"] { --accent: #1fa463; --accent-ink: #fff; }
:root[data-accent="ink"] { --accent: #e9eef6; --accent-ink: #0b1a2e; }
:root[data-accent="blue"] { --accent: #2563eb; --accent-ink: #fff; }

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font: 15px/1.45 var(--sans); color: var(--ink);
  background: radial-gradient(120% 55% at 50% 0%, #1a2440 0%, var(--bg) 62%) fixed, var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--ink-2); }
svg[viewBox="0 0 24 24"] { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { position: relative; max-width: 480px; margin: 0 auto; padding: calc(10px + var(--sat)) 14px calc(24px + var(--sab)); }

/* шапка издания */
.top { display: flex; align-items: center; gap: 10px; padding: 6px 4px 12px; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand__mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font: 700 17px var(--display); }
.brand__name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.top__crumb { color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.top__tools { margin-left: auto; display: flex; gap: 2px; }
.icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); }
.icon:hover { background: rgba(255, 255, 255, .08); color: var(--ink); }
.embed .top { display: none; }

.title { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 12px; margin: 6px 4px 10px; }
.title h1 { margin: 0; font: 700 38px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.title span { color: var(--accent); font: 500 15px var(--display); text-transform: uppercase; letter-spacing: .08em; filter: brightness(1.25); }

/* города демо: в рабочей версии один город издания */
.cities { display: flex; gap: 4px; padding: 4px; margin-bottom: 10px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--edge); }
.cities button { flex: 1; min-height: 36px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.cities button.on { background: var(--ink); color: var(--bg); }
.cities button:not(.on):hover { background: rgba(255, 255, 255, .07); color: var(--ink); }

/* вызов от друга */
.vs { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 14px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(61, 123, 255, .26), rgba(61, 123, 255, .07)); border: 1px solid rgba(61, 123, 255, .5); font-size: 14px; }
.vs svg { color: var(--accent); filter: brightness(1.3); }
.vs b { font: 700 17px var(--display); }

/* полоса прогресса и счёт */
.bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--edge); }
.segs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; flex: 1; }
.seg { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .14); transition: background .3s; }
.seg.cur { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.seg.g { background: var(--ok); } .seg.y { background: var(--warn); } .seg.o { background: var(--mid); } .seg.r { background: var(--no); }
.bar__score { font: 700 22px/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.bar__score small { display: block; font: 500 10px var(--sans); color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; }

/* задание и таймер */
.task { margin-top: 10px; padding: 12px 16px 12px; border-radius: var(--r) var(--r) 0 0; background: var(--glass-2); border: 1px solid var(--edge); border-bottom: 0; }
.task__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--ink-2); font: 500 12px var(--sans); text-transform: uppercase; letter-spacing: .1em; }
.task__t { font: 700 20px/1 var(--display); color: var(--ink); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.task__name { margin: 4px 0 0; font: 700 28px/1.08 var(--display); letter-spacing: .01em; text-transform: uppercase; animation: rise .35s var(--ease); }
.task.is-shown .task__name { color: var(--truth); filter: brightness(1.15); }
.timer { height: 5px; margin-top: 10px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.timer i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transform-origin: left; will-change: transform; }
.timer i.is-late { background: var(--no); box-shadow: 0 0 12px var(--no); }
.task:has(.is-late) .task__t { color: var(--no); }

/* карта */
.map-wrap { position: relative; isolation: isolate; border-radius: 0 0 var(--r) var(--r); overflow: hidden; border: 1px solid var(--edge); border-top: 0; background: #e6e6e3; }
.map-slot { position: relative; }
#map { height: clamp(300px, 52vh, 460px); width: 100%; background: #e6e6e3; cursor: crosshair; }
#map .maplibregl-canvas-container.maplibregl-interactive { cursor: crosshair; }
.map-wrap.is-locked #map .maplibregl-canvas-container.maplibregl-interactive { cursor: grab; }
.map__hint { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 2; padding: 7px 12px; border-radius: 999px; pointer-events: none;
  background: rgba(15, 20, 32, .88); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.map__ctl { position: absolute; right: 10px; bottom: 30px; z-index: 2; display: grid; gap: 6px; }
.map__ctl button { width: 38px; height: 38px; border-radius: 10px; background: rgba(15, 20, 32, .9); color: var(--ink); font: 700 20px/1 var(--display); box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.maplibregl-ctrl-attrib { font: 10px var(--sans); }
.maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(255, 255, 255, .75); }
.maplibregl-ctrl-attrib a { color: #555; }

/* точка читателя: капля цвета бренда */
.pin { width: 28px; height: 36px; pointer-events: none; }
.pin i { position: absolute; left: 4px; top: 0; width: 20px; height: 20px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent);
  border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); animation: drop .3s var(--ease); }
.pin i::after { content: ""; position: absolute; left: 5px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
@keyframes drop { from { translate: 0 -14px; opacity: 0; } }

/* действия */
.acts { display: grid; gap: 8px; margin-top: 10px; }
.btn { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 8px; min-height: 54px; padding: 8px 14px; border-radius: 14px;
  font-weight: 700; text-align: center; line-height: 1.2; transition: transform .12s, filter .2s, opacity .2s; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn--main { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 28px -10px var(--accent); font-size: 17px; }
.btn--main:hover:not(:disabled) { filter: brightness(1.08); }
.btn--main:disabled { opacity: .4; cursor: default; box-shadow: none; }
.btn--ghost { background: rgba(255, 255, 255, .07); border: 1px solid rgba(160, 190, 255, .22); }
.btn--ghost:hover { background: rgba(255, 255, 255, .13); }
.btn small { flex-basis: 100%; font-weight: 500; font-size: 11.5px; opacity: .75; }
.linkbtn { display: block; margin: 10px auto 0; padding: 6px 10px; color: var(--ink-2); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--ink); }

.sponsor { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 14px; border-radius: 12px;
  border: 1px dashed rgba(160, 190, 255, .24); color: var(--ink-2); font-size: 13px; background: rgba(15, 20, 32, .6); }
.tag { flex: none; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; border: 1px solid rgba(160, 190, 255, .3); color: var(--ink-2); }

/* результат задания */
.res { margin-top: 10px; padding: 14px 16px; border-radius: var(--r); background: var(--glass-2); border: 1px solid var(--edge); animation: rise .4s var(--ease); }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.res__row { display: flex; align-items: flex-end; gap: 12px; }
.res__cap { color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.res__dist { font: 700 40px/1 var(--display); font-variant-numeric: tabular-nums; }
.res__dist.g { color: var(--ok); } .res__dist.y { color: var(--warn); } .res__dist.o { color: var(--mid); } .res__dist.r { color: var(--no); }
.res__pts { margin-left: auto; font: 700 26px/1 var(--display); white-space: nowrap; }
.res__pts small { font: 500 11px var(--sans); color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; margin-left: 4px; }
.res__time { margin: 8px 0 0; color: var(--ink-2); font-size: 13px; }
.crowd { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(160, 190, 255, .18); font-size: 13px; color: var(--ink-2); }
.crowd b { color: var(--ink); }
.crowd__bar { height: 8px; margin-top: 6px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.crowd__bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; animation: grow .7s var(--ease); }
@keyframes grow { from { width: 0; } }

/* итог дня */
.final { margin-top: 12px; padding: 18px 16px 16px; border-radius: var(--r); background: var(--glass-2); border: 1px solid var(--edge); animation: rise .4s var(--ease); }
.final__label { color: var(--ink-2); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; text-align: center; }
.final__pts { text-align: center; font: 700 64px/1.05 var(--display); color: var(--accent); filter: brightness(1.25); font-variant-numeric: tabular-nums; }
.final__pts small { font: 500 13px var(--sans); color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; display: block; }
.final__title { margin: 6px 0 2px; text-align: center; font: 700 26px/1.15 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.final__sub { margin: 0 0 14px; text-align: center; color: var(--ink-2); }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.row__k { font: 500 11px/1.2 var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.row__name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.row__d { color: var(--ink-2); font-size: 12px; }
.row__p { font: 700 18px var(--display); text-align: right; font-variant-numeric: tabular-nums; }
.row__p i { display: block; font: 500 11px var(--sans); font-style: normal; color: var(--ink-3); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; text-align: center; }
.stats div { padding: 10px 6px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.stats b { display: block; font: 700 24px var(--display); color: var(--accent); filter: brightness(1.25); }
.stats span { color: var(--ink-2); font-size: 12px; line-height: 1.25; display: block; }
.demo-note { color: var(--ink-3); font-size: 12px; text-align: center; margin: 10px 0 0; }
.next-day { text-align: center; color: var(--ink-2); font-size: 13px; margin: 12px 0 0; }
.next-day span { font: 600 15px var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }

/* битва районов */
.battle { margin-top: 12px; padding: 14px 14px 12px; border-radius: var(--r); background: linear-gradient(180deg, rgba(61, 123, 255, .16), rgba(30, 38, 56, .92) 45%);
  border: 1px solid rgba(61, 123, 255, .35); }
.battle__head { display: flex; align-items: center; gap: 8px; font: 600 14px var(--display); text-transform: uppercase; letter-spacing: .12em; }
.battle__head svg { color: var(--accent); filter: brightness(1.3); }
.battle__p { margin: 8px 0 10px; color: var(--ink-2); font-size: 14px; }
.battle__p b { color: var(--ink); }
.battle__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.battle__list li { display: grid; grid-template-columns: 22px 1fr 58px 60px; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; }
.battle__list li:nth-child(even):not(.me) { background: rgba(255, 255, 255, .03); }
.battle__list li.me { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.battle__list li.me .battle__cnt, .battle__list li.me .battle__n { color: inherit; opacity: .8; }
.battle__cap { color: var(--ink-3); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.battle__cap span:nth-child(n+3) { text-align: right; }
.battle__n { font: 600 14px var(--display); color: var(--ink-3); text-align: center; }
.battle__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.battle__name i { font-style: normal; font-size: 10px; padding: 1px 5px; margin-left: 4px; border-radius: 4px; background: rgba(0, 0, 0, .2); text-transform: uppercase; letter-spacing: .06em; }
.battle__avg { font: 600 15px var(--display); text-align: right; font-variant-numeric: tabular-nums; }
.battle__cnt { color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.battle .btn { width: 100%; }

.partner { margin-top: 12px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--accent); background: rgba(15, 20, 32, .6); }
.partner__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--accent); filter: brightness(1.25); font: 600 13px var(--display); text-transform: uppercase; letter-spacing: .1em; }
.partner__q { margin: 6px 0 4px; font-weight: 600; }
.partner__p { margin: 0; color: var(--ink-2); font-size: 13px; }

.foot { margin: 18px 4px 0; color: var(--ink-3); font-size: 12px; text-align: center; }

/* окна: правила и выбор района */
.modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(4, 6, 12, .72);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal__box { position: relative; width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow: auto; padding: 20px 20px 18px; border-radius: 20px;
  background: var(--bg-2); border: 1px solid var(--edge); }
.modal__box h2 { margin: 0 0 10px; padding-right: 30px; font: 700 26px/1.1 var(--display); text-transform: uppercase; }
.modal__box ul { margin: 0 0 10px; padding-left: 18px; }
.modal__box li { margin-bottom: 6px; }
.modal__box p { color: var(--ink-2); margin: 0 0 14px; }
.modal__box .btn { width: 100%; }
.modal__x { position: absolute; top: 10px; right: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 9px 13px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(160, 190, 255, .2); font-weight: 600; font-size: 14px; }
.chip:hover { background: rgba(255, 255, 255, .14); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.toast { position: fixed; left: 50%; bottom: calc(22px + var(--sab)); transform: translateX(-50%); z-index: 1200; padding: 12px 16px; border-radius: 12px;
  background: #f4f7fb; color: #0b1a2e; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); white-space: nowrap; }

@media (max-width: 380px) {
  .top__crumb { display: none; }
  .title h1 { font-size: 32px; }
  .task__name { font-size: 24px; }
  .res__dist { font-size: 34px; }
  .battle__list li { grid-template-columns: 20px 1fr 52px 56px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
