/* Fortochka — the pixel room is the brand; around it a pixel-trimmed native Telegram interface.
   Telegram theme colours for surfaces and text; endesga32 only on what we draw (room, plaque, buttons, toast, meters). */
/* Tiny5 (OFL, Google Fonts): a pixel face with full Cyrillic, single weight — never ask it for bold. */
/* Flag emoji where the system has none (Windows): Twemoji art, CC BY 4.0, via country-flag-emoji-polyfill (MIT). */
@font-face { font-family: 'Twemoji Country Flags'; font-display: swap; src: url(flags.woff2) format('woff2');
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F; }
@font-face { font-family: Tiny5; font-weight: 400; font-display: swap; src: url(tiny5-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Tiny5; font-weight: 400; font-display: swap; src: url(tiny5-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* Telegram theme (native surfaces) */
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #181425);
  --hint: var(--tg-theme-hint-color, #5a6988);
  --link: var(--tg-theme-link-color, #124e89);
  --page: var(--tg-theme-secondary-bg-color, #ead4aa);
  --section: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #fbf3e4));
  --sep: var(--tg-theme-section-separator-color, rgba(90, 105, 136, .25));
  --section-head: var(--tg-theme-section-header-text-color, var(--hint));
  /* endesga32 */
  --ink: #181425;
  --amber: #feae34;
  --pine: #265c42;
  --blood: #a22633;
  --rose: #f6757a;
  --slate: #5a6988;
  --mist: #c0cbdc;
  --navy: #3a4466;
  --cream: #ead4aa;
  --leaf: #3e8948;
  --edge: var(--slate);
  --shadow: var(--ink);
  --danger: var(--blood);
  --track: var(--mist);
  --px: Tiny5, "Courier New", monospace;   /* one font pixel = 1/8 of the size: use 16, 24, 32 or 48 px only */
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
}
:root[data-scheme="dark"] { --shadow: #000; --danger: var(--rose); --track: var(--navy); --edge: #8b9bb4; }
:root[data-scheme="dark"] .room,
:root[data-scheme="dark"] .plaque { box-shadow: 0 0 0 3px var(--cream); }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text); }
body {
  font: 1rem/1.4 var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding: calc(12px + var(--tg-content-safe-area-inset-top, 0px)) calc(var(--gutter) + var(--tg-content-safe-area-inset-right, 0px))
           calc(28px + var(--tg-content-safe-area-inset-bottom, env(safe-area-inset-bottom))) calc(var(--gutter) + var(--tg-content-safe-area-inset-left, 0px));
}
main { max-width: 520px; margin: 0 auto; animation: in .12s linear; }
@keyframes in { from { opacity: 0; } }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- type ---------- */
/* Tiny5 lowercase is only 4 px tall (а reads as о), so pixel headings are set in its 5 px capitals. */
h1 { font: 400 32px/1.1 var(--px); text-transform: uppercase; letter-spacing: 0; margin: 6px 0 14px; text-wrap: balance; }
h2 { font: 600 .875rem/1.3 var(--ui); color: var(--section-head); margin: 10px 0 8px; }
p { margin: 8px 0; }
.lead { font-size: .9375rem; color: var(--hint); margin: -6px 0 16px; }
.foot { font-size: .875rem; color: var(--hint); margin: 8px 2px 0; line-height: 1.4; }
b { font-weight: 600; }

/* ---------- pixel icons ---------- */
.pi { width: 16px; height: 16px; flex: none; }
.ri { width: 32px; height: 32px; padding: 6px; flex: none; color: var(--text); background: var(--page); box-shadow: inset 0 0 0 2px var(--sep); }
/* Colour pixel icons (ic-*.png, 32×32 art) in rows at 1×, in tiles at 2×. */
img.pi { image-rendering: pixelated; image-rendering: crisp-edges; }
img.pi.smooth { image-rendering: auto; }   /* the official СБП mark is not pixel art */
img.ri { padding: 0; background: none; box-shadow: none; }
.ti { width: 32px; height: 32px; flex: none; }
img.ti { width: 64px; height: 64px; }
.chev { width: 16px; height: 16px; color: var(--hint); margin-left: auto; }

/* ---------- the room ---------- */
.roomwrap { display: grid; justify-items: center; gap: 0; margin: 0 0 12px; padding: 3px 0; }
.room { display: block; image-rendering: pixelated; image-rendering: crisp-edges; max-width: 100%; touch-action: manipulation;
  box-shadow: 0 0 0 3px var(--ink); }
.roomwrap { position: relative; }
/* What the room says: a pixel speech bubble over the floor, gone after a few seconds. */
.bubble { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(92%, 320px); margin: 0; padding: 8px 10px;
  background: var(--ink); color: var(--cream); box-shadow: 0 0 0 3px var(--cream), 4px 4px 0 3px var(--shadow); font: 400 16px/1.25 var(--px); pointer-events: none; }
.bubble { text-transform: uppercase; letter-spacing: .5px; }
.bubble small { text-transform: none; letter-spacing: 0; display: block; font: .8125rem/1.35 var(--ui); color: var(--mist); margin-top: 2px; }
.bubble.pop { animation: pop .18s steps(3) both; }
.bubble.top { top: 14px; bottom: auto; }
.bubble.top.pop { animation-name: pop-down; }
@keyframes pop-down { from { transform: translateX(-50%) translateY(-6px); opacity: 0; } }
@keyframes pop { from { transform: translateX(-50%) translateY(6px); opacity: 0; } }

/* «Другое устройство»: a quiet text button under the actions; stays visible when Telegram's MainButton replaces ours. */
.pick { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin: -4px 0 10px; padding: 4px 12px;
  background: none; border: 0; color: var(--link); font: 500 .9375rem/1.2 var(--ui); cursor: pointer; }
.pick img.bi { width: 32px; height: 32px; }
.pick:active { opacity: .7; }

/* Plain informational rows (countries, past speed tests): no tap, no chevron. */
.row.static { cursor: default; }
.row.static:active { background: none; }
/* Speed test: progress under the big number. */
.gauge .speedbar { display: block; margin: 14px auto 0; max-width: 260px; }
.gauge .speedbar i { transition: width .15s linear; }
/* Kids: name field and the child's QR. */
.field { display: block; width: 100%; min-height: 44px; padding: 10px 12px; margin: 6px 0 12px; border: 2px solid var(--edge); border-radius: 0;
  background: var(--page); color: var(--text); font: inherit; }
.field:focus { outline: 2px solid var(--amber); }
.panel.kid .qr { margin: 6px auto 10px; }

/* Section tiles under the urgent action. */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.tile { display: grid; justify-items: center; align-content: start; gap: 6px; min-height: 92px; padding: 10px 4px 8px; margin: 0;
  background: var(--section); color: var(--text); border: 2px solid var(--sep); font: 500 .8125rem/1.15 var(--ui); cursor: pointer; }
.tile:active { transform: translate(1px, 1px); border-color: var(--edge); }
.tile span { min-height: 2.3em; max-width: 100%; overflow-wrap: break-word; hyphens: manual; text-align: center; font-size: .75rem; }

/* ---------- cards, groups, rows ---------- */
.card { display: block; width: 100%; margin: 0 0 12px; padding: 12px 14px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--section); border: 2px solid var(--edge); border-radius: 0; }
.card:active { transform: translate(1px, 1px); }
.card-head { display: flex; align-items: center; gap: 12px; }
.card .label { flex: 1; min-width: 0; }
.card .label b { display: block; font-weight: 600; }
.card .sub { display: block; color: var(--hint); font-size: .875rem; }
.card .sub.nowrap { white-space: nowrap; }
.card .sub.soon { color: #7a3e1d; font-weight: 600; }
:root[data-scheme="dark"] .card .sub.soon { color: var(--amber); }
.card .meter { margin: 10px 0 2px; }
.card-line { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 2px dotted var(--sep); font-size: .875rem; color: var(--hint); }
.card-line .pi { color: var(--leaf); }
.card.shut, .access-block.shut { border-color: var(--danger); }
.access-block { margin: 0 0 12px; background: var(--section); border: 2px solid var(--edge); }
.access-block > .card { margin: 0; border: 0; background: transparent; }
.access-block > div.card { cursor: default; }
.access-block > .ads { border-top: 2px dotted var(--sep); }
.access-block .ads .card-line { margin: 0; padding: 0; border: 0; width: 100%; }
.access-block .ads .card-line > span { flex: 1; min-width: 0; }

.group { background: var(--section); border: 2px solid var(--sep); margin: 0 0 12px; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; margin: 0; padding: 8px 12px; background: none; border: 0;
  color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.row + .row { border-top: 2px solid var(--sep); }
.row:active { background-color: var(--page); }
.row .label { flex: 1; min-width: 0; }
.row .sub { display: block; color: var(--hint); font-size: .875rem; margin-top: 1px; }
.row.selected .label { font-weight: 600; }
.row .val { color: var(--hint); font: 600 .9375rem/1 var(--ui); }
.row .row-act { flex: none; min-height: 36px; padding: 0 12px; border: 2px solid var(--sep); border-radius: 10px; background: none; color: var(--danger); font: 600 .875rem/1 var(--ui); cursor: pointer; }
.flag { font-size: 22px; width: 32px; height: 32px; line-height: 32px; display: grid; place-items: center; flex: none; }

/* ---------- buttons: primary amber with a stepped shadow; secondary outlined; danger; renew ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; margin: 0 0 12px; padding: 8px 16px;
  border: 2px solid var(--edge); border-radius: 0; font: 600 1rem/1.2 var(--ui); cursor: pointer; text-decoration: none;
  background: var(--section); color: var(--text);
}
/* One icon slot everywhere: 32 px, no negative margins (colour PNG, or a one-colour SVG on danger buttons). */
.btn .pi, .btn img.bi, .btn svg.dg { width: 32px; height: 32px; margin: 0; }
.btn svg.dg { color: var(--danger); }
/* Buttons with a hard 4 px shadow are 4 px narrower, so the shadow ends on the same edge as every other block. */
.btn.primary, .btn.renew { width: calc(100% - 4px); margin-right: 4px; }
.btn.primary { background: var(--amber); color: var(--ink); border-color: var(--ink); box-shadow: 4px 4px 0 var(--shadow); }
.btn.primary:active { transform: translate(4px, 4px); box-shadow: none; }
.btn.renew { background: var(--pine); color: #fff; border-color: var(--ink); box-shadow: 4px 4px 0 var(--shadow); }
.btn.renew:active { transform: translate(4px, 4px); box-shadow: none; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.secondary:active, .btn.danger:active { transform: translate(2px, 2px); }
.btn[disabled] { opacity: .5; }
.inline { border: 0; background: none; padding: 0; font: inherit; color: var(--pine); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
:root[data-scheme="dark"] .inline { color: var(--amber); }

/* ---------- steps (a real sequence, so numbered) ---------- */
.steps { list-style: none; margin: 0 0 6px; padding: 0; counter-reset: s; }
.steps > li { position: relative; margin: 0 0 12px; padding: 14px 14px 4px 58px; background: var(--section); border: 2px solid var(--sep); counter-increment: s; }
.steps > li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 30px; height: 30px; display: grid; place-items: center;
  font: 400 24px/1 var(--px); color: var(--ink); background: var(--amber); box-shadow: 0 0 0 2px var(--ink); }
.steps > li > .title { font-weight: 600; margin: 4px 0 10px; }
.steps .note { font-size: .875rem; color: var(--hint); margin: -2px 0 12px; }

/* ---------- panels, code, misc ---------- */
.panel { background: var(--section); border: 2px solid var(--sep); padding: 14px; margin: 0 0 12px; }
.panel > .title { font-weight: 600; margin: 0 0 6px; }
.panel > .note { font-size: .875rem; color: var(--hint); margin: 0 0 12px; }
.panel .btn:last-child { margin-bottom: 0; }
.code { font: .8125rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; overflow-x: auto; background: var(--page);
  border: 2px dashed var(--sep); padding: 10px 12px; margin: 0 0 12px; user-select: all; }
details > summary { font-weight: 600; cursor: pointer; padding: 8px 0; }
.qr { display: block; width: 210px; max-width: 100%; margin: 0 auto; background: #fff; padding: 8px; image-rendering: auto; }
.linkbox .qrslot { display: grid; place-items: center; min-height: 226px; margin: 0 0 12px; }
.meter { display: block; height: 8px; background: var(--track); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--amber); }
.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0; }
.stepper .btn { width: 56px; min-height: 44px; margin: 0; justify-content: center; font-size: 22px; }
.stepper b { min-width: 48px; text-align: center; font-size: 22px; }
.kvline { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 2px dotted var(--sep); }
.kvline span { color: var(--hint); }
.kvline:last-of-type { border-bottom: 0; margin-bottom: 10px; }
.panel .meter { margin: 0 0 14px; }
textarea { width: 100%; min-height: 140px; padding: 12px 14px; margin: 0 0 12px; resize: vertical; border: 2px solid var(--edge); border-radius: 0;
  background: var(--section); color: var(--text); font: inherit; }
textarea:focus { outline: 2px solid var(--amber); }

#toast { position: fixed; left: 50%; bottom: calc(22px + var(--tg-content-safe-area-inset-bottom, env(safe-area-inset-bottom))); transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 10px 14px; background: var(--ink); color: #fff; font-size: .9375rem; text-align: center;
  border: 2px solid var(--amber); box-shadow: 4px 4px 0 rgba(0,0,0,.35); z-index: 10; }

/* the cat in empty / error / loading states (a frame of px-cat.png at 4x) */
.cat-art { display: block; width: 88px; height: 64px; margin: 0 auto 12px; background: url(px-cat.png?v=2026-10-04c) no-repeat; background-size: 704px 64px;
  background-position: calc(var(--f) * -88px) 0; image-rendering: pixelated; }
.empty { text-align: center; padding: 12vh 12px 0; }
.empty h1 { margin-bottom: 8px; }
.empty p { color: var(--hint); max-width: 320px; margin: 0 auto 20px; }
.loading { padding-top: 30vh; text-align: center; color: var(--hint); font: 400 16px var(--px); }
.loading .cat-art { animation: walk .28s steps(1) infinite; }
@keyframes walk { 50% { background-position: -352px 0; } }

/* ---------- things (achievements) ---------- */
.things-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 0 0 12px; }
.thing { background: var(--section); border: 2px solid var(--sep); padding: 10px; display: grid; gap: 4px; align-content: start; min-width: 0; min-height: 44px; }
button.thing { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.thing:active { transform: translate(1px, 1px); }
.thing .ico { height: 42px; display: flex; align-items: flex-end; }
.thing .ico img { height: 100%; width: auto; image-rendering: pixelated; }
.thing b { font: 600 .9375rem/1.25 var(--ui); }
.thing p { margin: 0; font-size: .8125rem; color: var(--hint); line-height: 1.35; }
.thing.lock .ico img { filter: brightness(0); opacity: .3; }
:root[data-scheme="dark"] .thing.lock .ico img { filter: brightness(0) invert(1); opacity: .25; }
.thing .meter { height: 6px; margin-top: 4px; }

/* ---------- step-by-step guide with screenshots ---------- */
.guide-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.guide-head h1 { margin-bottom: 10px; }
.counter { font: 400 16px/1 var(--px); color: var(--hint); white-space: nowrap; }
.progress { display: flex; gap: 4px; margin: 0 0 14px; }
.progress i { flex: 1; height: 8px; background: var(--track); }
.progress i.done { background: var(--amber); }
.step-text { min-height: 3em; margin: 0 0 14px; }
.shot { position: relative; margin: 0 auto 16px; max-width: 290px; overflow: hidden; background: var(--section); border: 3px solid var(--ink); touch-action: pan-y; }
.shot img { display: block; width: 100%; height: auto; user-select: none; }
.mark { position: absolute; border: 3px solid #e43b44; pointer-events: none; animation: pulse 1.2s steps(2) infinite; }
@keyframes pulse { 50% { border-color: #feae34; } }
.nav { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; margin-top: 4px; }

/* compact numbered checklist (help) */
.checklist { list-style: none; padding: 0; }
.checklist .row { cursor: default; align-items: flex-start; }
.checklist .num { flex: none; width: 30px; height: 30px; display: grid; place-items: center; margin-top: 0;
  font: 400 24px/1 var(--px); color: var(--ink); background: var(--amber); box-shadow: 0 0 0 2px var(--ink); }

/* speed and the ad counter */
.gauge { background: var(--section); border: 2px solid var(--sep); padding: 24px 16px 20px; margin: 0 0 12px; text-align: center; }
.gauge .big { display: block; font: 400 48px/1 var(--px); font-variant-numeric: tabular-nums; }
.gauge .unit { display: block; color: var(--hint); margin-top: 6px; }
.gauge .ping { display: block; color: var(--hint); font-size: .875rem; margin-top: 10px; }

/* key/value rows with copy (FoxyProxy fields) */
.kv .row { min-height: 48px; gap: 8px; padding-right: 12px; }
.kv .k { flex: none; width: 76px; color: var(--hint); font-size: .875rem; }
.kv .v { flex: 1; min-width: 0; font: .8125rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.kv .cp, .kv img.ri { flex: none; width: 32px; height: 32px; }

/* admin */
.dot { flex: none; width: 8px; height: 8px; margin: 0 12px; background: var(--hint); }
.dot.on { background: #63c74d; box-shadow: 0 0 0 2px var(--pine); }
.dot.warn { background: var(--amber); }
.dot.off { background: #e43b44; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; }
.stats > div { background: var(--section); border: 2px solid var(--sep); padding: 12px 8px; text-align: center; }
.stats b { display: block; font: 400 32px/1.1 var(--px); color: var(--text); }
.stats span { display: block; font-size: .75rem; color: var(--hint); margin-top: 3px; }
.panel.warn { border-color: var(--amber); }
.panel.warn p { margin: 2px 0; font-size: .875rem; display: flex; align-items: center; }
.search { width: 100%; padding: 12px 14px; margin: 0 0 12px; border: 2px solid var(--edge); border-radius: 0; background: var(--section); color: var(--text); font: inherit; }
.search:focus { outline: 2px solid var(--amber); }
.row .k { flex: none; width: 84px; color: var(--hint); font-size: .875rem; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.actions .btn { margin: 0; min-height: 52px; font-size: .9375rem; width: 100%; }
.actions .btn.primary, .actions .btn.renew { width: calc(100% - 4px); }

/* filters: switch inside a row */
.switch { position: relative; flex: none; width: 40px; height: 22px; border-radius: 0; background: var(--track); box-shadow: inset 0 0 0 2px var(--ink); }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 14px; height: 14px; border-radius: 0; background: var(--cream); box-shadow: 0 0 0 2px var(--ink); }
.switch.on { background: var(--leaf); }
.switch.on::after { transform: translateX(18px); }
.row[role="switch"]:disabled { opacity: .6; }

@media (prefers-reduced-motion: reduce) {
  main, .bubble.pop, .loading .cat-art, .mark, .switch, .switch::after { animation: none !important; transition: none !important; }
  .btn:active, .card:active { transform: none; }
}
.card-line img.bi { width: 32px; height: 32px; margin: 0; }
:root[data-scheme="dark"] .code { background: var(--ink); }
.note.warn-note { color: var(--text); border-left: 3px solid var(--amber); padding-left: 8px; }
/* Purchase: tariff rows work as radio buttons. */
.tariff .radio { flex: none; width: 22px; height: 22px; box-shadow: inset 0 0 0 2px var(--edge); background: var(--page); }
.tariff.picked .radio { background: var(--amber); box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 6px var(--amber); }
.tariff.picked { background: var(--page); }
.tariff .price { flex: none; display: grid; justify-items: end; gap: 2px; font-variant-numeric: tabular-nums; }
.tariff .price small { color: var(--hint); font-size: .8125rem; }

/* «Листок календаря»: the question of the day over the room */
.quiz { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgb(24 20 37 / .55); }
.quiz-card { width: min(100%, 420px); max-height: calc(100dvh - 32px); overflow: auto; padding: 16px; background: var(--section); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--shadow); }
.quiz-head { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 10px; font: 400 16px/1.2 var(--px); text-transform: uppercase; color: var(--hint); }
.quiz-cat { color: var(--danger); }
.quiz-q { margin: 0 0 14px; font: 600 1.0625rem/1.35 var(--ui); color: var(--text); }
.quiz-a .btn { justify-content: flex-start; text-align: left; min-height: 48px; margin-bottom: 8px; }
.quiz-a .btn.right { background: var(--leaf); color: #fff; border-color: var(--ink); opacity: 1; }
.quiz-a .btn.wrong { background: var(--danger); color: #fff; border-color: var(--ink); opacity: 1; }
.quiz-why { margin: 4px 0 12px; font: 400 .9375rem/1.4 var(--ui); color: var(--text); }
.quiz-nav { display: flex; justify-content: center; gap: 8px; }   /* a lone «Закрыть» sits in the middle */
.quiz-nav .btn { margin: 0; flex: 0 1 calc(50% - 4px); min-width: 0; }
.quiz-nav .btn.primary { flex-basis: calc(50% - 8px); }
.quiz-score { margin: 10px 0 0; text-align: center; }
.quiz-score.credit { margin-top: 8px; font-size: .6875rem; opacity: .55; }
.quiz [hidden] { display: none; }
.flag-big { margin: 4px 0 14px; text-align: center; font: 400 96px/1.1 'Twemoji Country Flags', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
/* «Ковры»: a 4×3 grid of vertical rugs, sized so the whole card fits the screen without scrolling */
.rugs { display: grid; grid-template-columns: repeat(4, auto); justify-content: center; gap: 8px; margin: 4px 0 12px; }
.rug { --h: min(calc((100dvh - 230px) / 3), calc((min(100vw - 32px, 420px) - 62px) / 4 * 1.5));
  position: relative; height: var(--h); width: calc(var(--h) * 2 / 3); padding: 3px; border: 3px solid var(--ink);
  background: repeating-linear-gradient(45deg, #a22633 0 6px, #be4a2f 6px 12px); cursor: pointer; }
.rug.up { background: #ead4aa; }
.rug svg { display: block; width: 100%; height: 100%; }
.rug span { position: absolute; left: 0; right: 0; bottom: -2px; padding: 1px 0; background: var(--ink); color: #fff; font: 600 .6875rem/1.3 var(--ui); text-align: center; }
.phrase { margin: 0 0 12px; padding: 10px; border: 2px dashed var(--edge); font: 400 16px/1.3 var(--px); text-transform: uppercase; text-align: center; word-break: break-word; color: var(--text); }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.chips .btn.chip { margin: 0; min-height: 44px; }
/* «Лови!»: an LCD handheld on the TV — the screen and the four round keys sit in one red case, like the original */
.catch-device { padding: 10px 10px 8px; margin: 0 0 10px; background: #a22633; border: 3px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 3px #e43b44, inset 0 -6px 0 3px #7a1c28; }
.catch-lcd { display: block; width: 100%; aspect-ratio: 320 / 220; background: #c3cdb0; border: 4px solid #181425; border-radius: 4px; touch-action: none; }
.catch-pad { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin-top: 10px; }
.catch-col { display: grid; gap: 10px; }
.catch-key { width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--ink); background: radial-gradient(circle at 35% 30%, #ffd17a, #feae34 45%, #be4a2f); color: #3e2731; font: 700 22px/1 var(--ui);
  box-shadow: 0 4px 0 #3e2731; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.catch-key:active { transform: translateY(3px); box-shadow: 0 1px 0 #3e2731; }
.catch-brand { margin: 0; padding: 4px; background: none; border: 0; cursor: pointer; text-align: center; color: #fbe9d0; font: 400 16px/1.2 var(--px); letter-spacing: 1px; opacity: .85; }
.catch-brand b { display: block; font-weight: 400; font-size: 24px; color: #fee761; }
.catch-brand small { display: block; margin-top: 4px; font: 400 .6875rem/1 var(--ui); color: #fbe9d0; opacity: .7; }
/* «Трубы»: the field fits the screen height; the thermometer cools down under it */
.pipes-cv { display: block; margin: 0 auto 8px; width: min(100%, calc((100dvh - 290px) * var(--ar, 1))); border: 3px solid var(--ink); touch-action: none; }
.pipes-temp { height: 10px; margin: 0 0 10px; border: 2px solid var(--ink); background: #c0cbdc; }
.pipes-temp i { display: block; height: 100%; transition: width .25s linear, background .5s; }
/* «Позывные»: a valve radio with four band keys */
.radio-set { margin: 0 0 10px; padding: 12px; background: #733e39; border: 3px solid var(--ink); box-shadow: inset 0 0 0 3px #b86f50; }
.radio-set.noise { animation: radio-noise .1s steps(2) 6; }
@keyframes radio-noise { 50% { transform: translateX(3px); filter: contrast(1.6) grayscale(.6); } }
.radio-top { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; margin-bottom: 10px; }
.radio-grill { height: 64px; border: 3px solid var(--ink); background: repeating-linear-gradient(0deg, #3e2731 0 3px, #e4a672 3px 6px); }
.radio-scale { position: relative; height: 64px; border: 3px solid var(--ink); background: #ead4aa repeating-linear-gradient(90deg, transparent 0 9px, #b86f50 9px 10px) 0 70% / 100% 30% no-repeat; }
.radio-scale i { position: absolute; top: 4px; bottom: 4px; left: 8%; width: 3px; background: #e43b44; transition: left .18s; }
.radio-lamp { margin: 0 0 10px; padding: 4px; border: 3px solid var(--ink); background: #3e2731; color: #8b6d5c; font: 400 16px/1 var(--px); text-align: center; letter-spacing: 1px; }
.radio-lamp.on { color: #fee761; text-shadow: 0 0 6px #feae34; }
.radio-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.radio-key { min-height: 58px; border: 3px solid var(--ink); background: var(--c); color: #fff; font: 400 16px/1 var(--px); cursor: pointer; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .3);
  touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: transform .05s; }
.radio-key.lit { background: var(--lit); color: var(--ink); box-shadow: 0 0 14px var(--lit), inset 0 -2px 0 rgba(0, 0, 0, .3); transform: translateY(3px); }
.radio-key:disabled { cursor: default; }
/* «Кошачий прыжок»: a pixel canvas sized to the screen height */
.jump-cv { display: block; margin: 0 auto 10px; width: min(100%, calc((100dvh - 200px) * 120 / 168)); aspect-ratio: 120 / 168; image-rendering: pixelated; border: 3px solid var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* «Игротека»: a joystick in the room corner and the list of games */
.arcade-btn { position: absolute; top: 9px; left: 6px; z-index: 1; width: 40px; height: 40px; padding: 6px; border: 3px solid var(--ink); background: #fbe9d0; box-shadow: 2px 2px 0 var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.arcade-btn svg { display: block; width: 100%; height: 100%; }
.arcade-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.arcade { display: grid; gap: 6px; margin: 4px 0 4px; }
.arcade-row { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 8px; padding: 9px 12px; text-align: left; border: 2px solid var(--edge); background: var(--card, transparent); color: var(--text); font: 1rem/1.25 var(--ui); cursor: pointer; }
.arcade-row b { grid-column: 1; }
.arcade-row span { grid-column: 1; font-size: .8125rem; color: var(--hint); }
.arcade-row em { grid-column: 2; grid-row: 1 / 3; align-self: center; font: 400 16px/1 var(--px); font-style: normal; color: var(--accent, #a22633); text-align: right; }
.arcade-row em.new { font: .75rem/1.2 var(--ui); color: var(--hint); }
.arcade-row:active { transform: translateY(1px); }
.roomwrap .bubble { z-index: 3; }   /* a speech bubble covers the joystick, not the other way round */
/* «Клубок»: a round tilt maze; the board fits the screen height */
.maze-cv { display: block; margin: 0 auto 8px; width: min(100%, calc(100dvh - 250px)); aspect-ratio: 1; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* «Подоконник»: 2048 with houseplants; tiles slide by transform, the plant is a slice of px-plants.png */
.sill-ladder { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; margin: 0 0 10px; }
.sill-step { aspect-ratio: 1; background: url(px-plants.png?v=1) calc(var(--i) * 100% / 11) 0 / 1200% 100% no-repeat; image-rendering: pixelated; }
.sill-step.unseen { filter: brightness(0); opacity: .22; }
.sill-step.next { opacity: .5; }
.sill-board { --gap: 6px; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); width: min(100%, calc(100dvh - 330px)); margin: 0 auto 8px; padding: var(--gap);
  background: #733e39; border: 3px solid var(--ink); box-sizing: border-box; touch-action: none; user-select: none; -webkit-user-select: none; }
.sill-board > i { aspect-ratio: 1; background: #5d3a32; }
.sill-board.bump { animation: sill-bump .18s; }
@keyframes sill-bump { 30% { transform: translateX(-3px); } 70% { transform: translateX(3px); } }
.sill-tile { position: absolute; left: var(--gap); top: var(--gap); width: calc((100% - 5 * var(--gap)) / 4); aspect-ratio: 1; border: 2px solid var(--ink); box-sizing: border-box;
  transform: translate(calc(var(--c) * (100% + var(--gap))), calc(var(--r) * (100% + var(--gap)))); transition: transform .1s ease-out; }
.sill-pic { position: absolute; inset: 6%; background: url(px-plants.png?v=1) calc(var(--i) * 100% / 11) 0 / 1200% 100% no-repeat; image-rendering: pixelated; }
.sill-tile b { position: absolute; left: 3px; top: 1px; font: 700 10px/1 var(--ui); opacity: .85; }
.sill-tile.gone { z-index: 0; opacity: .6; }
.sill-tile.born { animation: sill-born .16s ease-out; }
.sill-tile.pop { z-index: 2; animation: sill-pop .18s ease-out; }
@keyframes sill-born { from { scale: .2; opacity: 0; } }
@keyframes sill-pop { 50% { scale: 1.16; } }
/* «Сундук с матрёшками»; the message keeps two lines so the buttons never move under a finger while dolls merge */
.chest-msg { min-height: 2.8em; }
.chest-cv { display: block; width: min(100%, calc((100dvh - 250px) * 120 / 170)); aspect-ratio: 120 / 170; margin: 0 auto 8px; image-rendering: pixelated; border: 3px solid var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* «Уложи ящик» */
.drawer-cv { display: block; width: min(100%, calc((100dvh - 300px) * var(--ar, .72))); aspect-ratio: 160 / 224; margin: 0 auto 8px; image-rendering: pixelated; border: 3px solid var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.drawer-tools { display: flex; gap: 6px; margin: 0 0 6px; }
.drawer-tools .btn { flex: 1; margin: 0; min-height: 40px; padding: 6px 4px; font-size: .875rem; }
/* «Кто под пледом?» */
.plaid-cv { display: block; width: 100%; aspect-ratio: 150 / 118; margin: 0 0 8px; image-rendering: pixelated; border: 3px solid var(--ink); touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* «Витраж абажура» */
.stained-cv { display: block; width: min(100%, calc((100dvh - 300px) * 150 / 176)); aspect-ratio: 150 / 176; margin: 0 auto 8px; border: 3px solid var(--ink); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
/* «Банки»: smooth drawing, sized by the canvas aspect the game sets */
.jars-cv { display: block; width: 100%; margin: 0 0 8px; border: 3px solid var(--ink); border-radius: 2px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
