/* Пенальти дня и Буллит дня: демо для сайта спортивного издания.
   Мобильный экран первичен, десктоп это та же колонка шириной до 520 px
   по центру. Цвета бренда издания задаются переменными на :root,
   ?accent= в адресе переключает их для показа белой этикетки.
   Сцена (газон и лёд) нарисована в SVG, тут только рамка вокруг неё,
   подписи комментатора и вспышки на гол. */

@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: #12336b;        /* цвет бренда издания в демо: тёмно-синий */
  --accent-ink: #ffffff;
  --accent-soft: #e3e9f4;
  --bg: #f4f5f8;
  --card: #ffffff;
  --ink: #171a21;
  --ink-2: #5b6170;
  --line: #dcdfe6;
  --ok: #2e9e5b;
  --no: #e9ebf0;
  --sans: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Oswald", "Arial Narrow", sans-serif;
  --r: 16px;
  --shadow: 0 14px 40px rgba(20, 30, 60, .12), 0 2px 6px rgba(20, 30, 60, .06);
  --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: #c8102e; --accent-soft: #f7e0e4; }
:root[data-accent="green"] { --accent: #0b6b3a; --accent-soft: #dcefe4; }
:root[data-accent="ink"] { --accent: #1e1a16; --accent-soft: #e6e2dc; }
:root[data-accent="orange"] { --accent: #d9531e; --accent-soft: #fbe4d9; }
/* Внутри рамки-телефона на витрине сверху нарисована чёлка: шапку ниже,
   а полосу прокрутки прячем, чтобы кадр выглядел как экран телефона. */
:root.embed { --sat: 32px; scrollbar-width: none; }
:root.embed::-webkit-scrollbar { display: none; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.45 var(--sans);
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
}
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-bottom: calc(24px + var(--sab));
}
/* Хоккейная тема холоднее: фон уходит в лёд, футбольная теплее. */
.app[data-sport="hockey"] { --bg: #eef3f9; }
.app[data-sport="football"] { --bg: #f3f6f2; }

/* ---------- шапка издания */
.brand {
  position: sticky; top: 0; z-index: 5;
  background: var(--accent); color: var(--accent-ink);
  padding: calc(10px + var(--sat)) 16px 10px;
  display: flex; align-items: center; gap: 10px;
}
.brand__logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent-ink); color: var(--accent);
  display: grid; place-items: center; font: 700 17px/1 var(--display); flex: none;
}
.brand__name { font-weight: 700; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__crumb { opacity: .75; font-size: 13px; white-space: nowrap; }
.brand__tools { margin-left: auto; display: flex; gap: 2px; }
.ibtn {
  width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: inherit;
  display: grid; place-items: center; cursor: pointer;
}
.ibtn:hover, .ibtn:focus-visible { background: rgba(255, 255, 255, .16); outline: none; }
.ibtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ibtn[aria-pressed="true"] svg { fill: currentColor; }

/* ---------- вид спорта */
.sports { display: flex; gap: 6px; padding: 14px 16px 0; }
.sport {
  flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 9px 10px;
  font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.sport[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sport small { font-weight: 400; opacity: .75; font-size: 12px; }

/* ---------- заголовок выпуска */
.head { padding: 16px 16px 6px; display: flex; align-items: flex-end; gap: 12px; }
.head h1 { margin: 0; font: 500 30px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.head__meta { color: var(--ink-2); font-size: 14px; padding-bottom: 3px; }
.head__meta b { color: var(--ink); font-weight: 600; }
.linkbtn { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- пять ударов */
.strip { display: flex; gap: 6px; padding: 6px 16px 10px; }
.slot {
  flex: 1; height: 38px; border-radius: 10px; border: 1.5px dashed var(--line); background: transparent;
  display: grid; place-items: center; font: 500 16px var(--display); color: var(--ink-2); letter-spacing: .04em;
}
.slot--now { border-style: solid; border-color: var(--accent); color: var(--accent); background: var(--card); }
.slot--goal, .slot--save, .slot--miss, .slot--post { border-style: solid; background: var(--card); font-size: 20px; animation: pop .35s var(--ease) both; }
.slot--goal { border-color: var(--ok); background: #e6f6ec; }
.slot--save { border-color: #c9ced9; }
.slot--miss, .slot--post { border-color: #e6c7c3; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- сцена. SVG сам держит пропорцию 360×260, рамка задаёт стиль. */
.scene {
  position: relative; margin: 0 16px; border-radius: 18px; overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow); user-select: none; -webkit-user-select: none; touch-action: manipulation;
  outline: none;
}
.scene:focus-visible { box-shadow: var(--shadow), 0 0 0 3px var(--accent); }
.scene--football { border: 3px solid #1f6b2c; background: #2f8f3e; }
.scene--hockey { border: 3px solid #d0342c; background: #eef3f9; }
.pitch { display: block; width: 100%; height: auto; }
.scene--done .pitch { filter: saturate(.75); }
.scene--done { cursor: default; }
.mark { transition: opacity .15s; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.siren circle { opacity: .25; }
.scene--goal .siren circle { animation: blink .28s steps(1) 6; }
/* Вспышка на гол: футбол светлеет от трибун, хоккей мигает красным. */
.scene::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
}
.scene--football.scene--goal::after { background: rgba(255, 255, 255, .55); animation: flash .7s ease-out both; }
.scene--hockey.scene--goal::after { background: rgba(208, 52, 44, .38); animation: flash 1.2s steps(2) both; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.scene--post .pitch { animation: shake .3s ease-out both; }
@keyframes shake { 20% { transform: translateX(-3px); } 50% { transform: translateX(3px); } 80% { transform: translateX(-2px); } }

/* Подпись комментатора. В футболе белая плашка с зелёным текстом, в хоккее
   тёмно-синяя плашка капителью: две разные интонации. */
.call {
  position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 10px 14px; border-radius: 12px;
  font-weight: 700; font-size: 16px; line-height: 1.25; text-align: center;
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .25s var(--ease);
}
.call--on { opacity: 1; transform: none; }
.scene--football .call { background: rgba(255, 255, 255, .94); color: #1f6b2c; }
.scene--football .call--goal { background: #ffd84d; color: #1b1b1f; }
.scene--hockey .call { background: rgba(30, 42, 68, .94); color: #fff; font-family: var(--display); font-weight: 500; font-size: 19px; text-transform: uppercase; letter-spacing: .04em; }
.scene--hockey .call--goal { background: #d0342c; }
.hint {
  position: absolute; left: 12px; right: 12px; top: 12px; padding: 8px 12px; border-radius: 10px;
  background: rgba(23, 26, 33, .78); color: #fff; font-size: 14px; font-weight: 500; text-align: center;
  animation: rise .5s var(--ease) both;
}
.hint[hidden] { display: none; }
.badge {
  position: absolute; left: 12px; top: 12px; padding: 4px 10px; border-radius: 999px;
  background: rgba(23, 26, 33, .78); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.under { padding: 10px 16px 0; font-size: 13.5px; color: var(--ink-2); }

/* ---------- результат */
.result {
  margin: 14px 16px 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 18px 16px; box-shadow: var(--shadow); animation: rise .5s var(--ease) both; text-align: center;
}
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.result__eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.result__line { font-size: 30px; line-height: 1.2; letter-spacing: .06em; margin: 8px 0 2px; }
.result h2 { margin: 0; font: 500 40px/1.05 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.result__title { font: 500 22px/1.1 var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin: 4px 0 10px; }
.result__msg { margin: 0 0 14px; color: var(--ink-2); }
.result__btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.btn {
  border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; gap: 8px;
}
.btn--ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.result__next { margin-top: 12px; color: var(--ink-2); font-size: 14px; }
.result__next b { font: 500 16px var(--display); color: var(--ink); letter-spacing: .04em; }
.result .linkbtn { margin-top: 10px; }

/* ---------- модальные окна */
.overlay {
  position: fixed; inset: 0; z-index: 20; background: rgba(15, 20, 35, .45);
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
.modal {
  width: 100%; max-width: 520px; max-height: 88vh; max-height: 88dvh; overflow: auto; background: var(--card);
  border-radius: 20px 20px 0 0; padding: 18px 18px calc(22px + var(--sab)); animation: up .35s var(--ease) both;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 560px) {
  .overlay { align-items: center; padding: 20px; }
  .modal { border-radius: 20px; padding-bottom: 22px; }
}
.modal__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.modal__head h2 { margin: 0; font: 500 26px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.modal__head .ibtn { margin-left: auto; color: var(--ink); }
.modal__head .ibtn:hover { background: var(--no); }
.modal p { margin: 0 0 10px; }
.modal p.muted { color: var(--ink-2); font-size: 13px; }
.modal ul.rules { padding-left: 18px; margin: 0 0 10px; }
.modal ul.rules li { margin-bottom: 6px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 14px; text-align: center; }
.stats b { display: block; font: 500 30px/1 var(--display); }
.stats span { font-size: 12px; color: var(--ink-2); }
.dist { display: grid; gap: 5px; margin-bottom: 6px; }
.dist div { display: grid; grid-template-columns: 16px 1fr; gap: 8px; align-items: center; font-size: 13px; }
.dist i { display: block; height: 20px; min-width: 22px; background: var(--no); border-radius: 4px; font-style: normal; color: var(--ink); font-size: 12px; font-weight: 600; text-align: right; padding: 0 6px; line-height: 20px; }
.dist i.hit { background: var(--ok); color: #fff; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--sab)); transform: translateX(-50%); z-index: 30;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow); animation: up .3s var(--ease) both;
}

.foot { padding: 16px 16px 0; font-size: 12px; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  .slot--goal, .slot--save, .slot--miss, .slot--post, .result, .hint, .modal, .toast { animation: none; }
  .scene--post .pitch { animation: none; }
}
