/* Игры 3/4: бежевый лист брендбука, коричневые силуэты, оранжевый — очки и тревога. Одна светлая тема:
   цвета Telegram игру не перекрашивают. */
:root { --bg: #FDF1E3; --surface: #FFF8EF; --fg: #342626; --muted: #6B5858; --accent: #E8492B; --blue: #BEDDFC; --line: rgba(52,38,38,.14);
  --sans: Manrope, "Helvetica Neue", Arial, system-ui, sans-serif; color-scheme: light; }
@font-face { font-family: Manrope; font-weight: 400 800; font-display: swap; src: url("/static/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Manrope; font-weight: 400 800; font-display: swap; src: url("/static/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 var(--sans); overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
.screen { min-height: 100%; padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 28px max(16px, env(safe-area-inset-left, 0px));
  max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; }
.logo { width: 54px; height: auto; display: block; }
.head { display: flex; align-items: center; gap: 12px; }
h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0; font-size: 14px; }
.plate { background: var(--blue); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.game { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-bottom: 10px; }
.game .ico { width: 60px; height: 60px; border-radius: 16px; background: var(--bg); display: grid; place-items: center; }
.game .ico svg { width: 42px; height: 42px; }
.game b { display: block; font-size: 17px; }
.game small { color: var(--muted); font-size: 13px; display: block; }
.game .best { font-weight: 800; color: var(--fg); }
button { font: 700 15px var(--sans); border: 0; border-radius: 12px; min-height: 48px; padding: 0 18px; cursor: pointer; background: var(--fg); color: var(--bg); }
button.ghost { background: var(--surface); color: var(--fg); border: 1px solid var(--line); }
button.sm { min-height: 38px; padding: 0 12px; font-size: 14px; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .55; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.row button { flex: 1 1 auto; }
#play { position: fixed; inset: 0; background: var(--bg); display: none; }
#play canvas { width: 100%; height: 100%; display: block; touch-action: none; }
#play .x { position: absolute; top: calc(32px + env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  min-height: 32px; font-size: 13px; padding: 0 12px; background: rgba(52,38,38,.08); color: var(--fg); }
.result { text-align: center; display: grid; gap: 10px; justify-items: center; padding-top: 30px; }
.result .big { font-size: 72px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.rec { background: var(--blue); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 14px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { min-height: 38px; padding: 0 14px; font-size: 14px; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 999px; }
.seg button.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.board { list-style: none; margin: 4px 0 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.board li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.board li:last-child { border-bottom: 0; }
.board li.me { background: var(--blue); }
.board .pl { font-weight: 800; color: var(--muted); }
.board li:nth-child(-n+3) .pl { color: var(--accent); }
.board b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board small { color: var(--muted); font-size: 12.5px; }
.board .sc { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.board .empty { display: block; text-align: center; color: var(--muted); padding: 22px; }
.check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px 10px; align-items: start; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--fg); margin: 1px 0 0; }
.check small { grid-column: 2; color: var(--muted); font-weight: 500; font-size: 13px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg);
  border-radius: 14px; padding: 12px 14px; font-weight: 600; z-index: 10; }
[hidden] { display: none !important; }
