/* Шрифт Rubik (OFL, локально, как на сайте) — у игры и сайта один голос */
@font-face { font-family: Rubik; font-weight: 400; font-display: swap; src: url(vendor/fonts/rubik-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0400-04FF; }
@font-face { font-family: Rubik; font-weight: 600; font-display: swap; src: url(vendor/fonts/rubik-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0400-04FF; }
@font-face { font-family: Rubik; font-weight: 800; font-display: swap; src: url(vendor/fonts/rubik-cyrillic-800-normal.woff2) format("woff2"); unicode-range: U+0400-04FF; }
@font-face { font-family: Rubik; font-weight: 900; font-display: swap; src: url(vendor/fonts/rubik-cyrillic-900-normal.woff2) format("woff2"); unicode-range: U+0400-04FF; }
@font-face { font-family: Rubik; font-weight: 400; font-display: swap; src: url(vendor/fonts/rubik-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2013-2014, U+2018-201D, U+2022, U+2026; }
@font-face { font-family: Rubik; font-weight: 600; font-display: swap; src: url(vendor/fonts/rubik-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2013-2014, U+2018-201D, U+2022, U+2026; }
@font-face { font-family: Rubik; font-weight: 800; font-display: swap; src: url(vendor/fonts/rubik-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2013-2014, U+2018-201D, U+2022, U+2026; }
@font-face { font-family: Rubik; font-weight: 900; font-display: swap; src: url(vendor/fonts/rubik-latin-900-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2013-2014, U+2018-201D, U+2022, U+2026; }
:root {
  --ink: #2b1d14;
  --muted: #8a7565;
  --card: #fffdf8;
  --accent: #ff7a1a;
  --accent-d: #d65f0c;
  --line: rgba(43, 29, 20, .12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #efe1cc;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

#game { position: fixed; inset: 0; display: block; touch-action: none; }

[hidden] { display: none !important; }

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  pointer-events: none;
}
.hud-side { display: flex; gap: 10px; align-items: center; pointer-events: auto; }

.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255, 253, 248, .94);
  box-shadow: 0 2px 0 var(--line), 0 6px 18px rgba(43, 29, 20, .08);
  font-size: 16px;
  white-space: nowrap;
}
.chip b { font-size: 19px; font-variant-numeric: tabular-nums; }
.chip.score span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.chip.score b { min-width: 3.2em; text-align: right; }
.lvl-num {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 14px;
}

.iconbtn {
  width: 44px; height: 44px; padding: 0;     /* без этого у <button> остаётся 1px 6px от браузера и значок уезжает вправо (11.10) */
  display: grid; place-items: center;
  border: 0; border-radius: 14px;
  background: rgba(255, 253, 248, .94);
  color: var(--ink);
  box-shadow: 0 2px 0 var(--line), 0 6px 18px rgba(43, 29, 20, .08);
  cursor: pointer;
  transition: transform .12s;
}
.iconbtn:hover { transform: translateY(-1px); }
.iconbtn:active { transform: translateY(1px); }
.iconbtn.flat { box-shadow: none; background: transparent; }

#tip {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 96px);   /* 14.10.2026: была внизу по центру и закрывала пол с мышами; теперь под счётчиком очков */
  transform: translateX(-50%);
  font-size: 15px;
  pointer-events: none;
  max-width: min(560px, calc(100vw - 32px));
  opacity: .92;
}
@media (max-height: 560px) { #tip { top: calc(env(safe-area-inset-top, 0px) + 84px); font-size: 12px; max-width: min(420px, 56vw); height: 30px; padding: 0 10px; } #tip b { font-size: 13px; } }   /* телефон в горизонте: под звёздами счётчика, компактно */
#tip b { font-size: 16px; }
#tip .dim { color: var(--muted); }

#rotate {
  position: fixed; left: 50%; top: 70px; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 14px;
  padding: 8px 14px; border-radius: 12px; pointer-events: none; white-space: nowrap;
}

/* ---------- Экраны ---------- */
.screen {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(43, 29, 20, .38);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fade .2s ease-out;
}
@keyframes fade { from { opacity: 0; } }

.panel {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--card);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 4px 0 rgba(43, 29, 20, .15), 0 24px 60px rgba(43, 29, 20, .25);
  text-align: center;
  animation: pop .28s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop { from { transform: scale(.9); opacity: 0; } }

.logo { font-size: clamp(42px, 8vw, 64px); font-weight: 900; letter-spacing: -.02em; line-height: 1; }
.logo span { color: var(--accent); }
.sub { color: var(--muted); font-size: 17px; line-height: 1.5; margin: 14px 0 24px; }

h2 { margin: 0; font-size: 28px; font-weight: 800; }

.btn {
  border: 0; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 17px;
  padding: 13px 24px;
  border-radius: 14px;
  background: #f1e6d6; color: var(--ink);
  box-shadow: 0 4px 0 #d9c7ae;
  transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #d9c7ae; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-d); }
.btn.primary:active { box-shadow: 0 1px 0 var(--accent-d); }
.btn.big { font-size: 20px; padding: 16px 44px; }

.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.levels-panel { width: min(760px, 100%); text-align: left; }
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.lvcard {
  border: 0; cursor: pointer; font: inherit; color: inherit; text-align: left;
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px;
  border-radius: 18px;
  background: #f7eee1;
  box-shadow: 0 3px 0 #e2d2bb;
  transition: transform .12s;
}
.lvcard:hover { transform: translateY(-2px); }
.lvcard .n { font-size: 30px; font-weight: 900; color: var(--accent); line-height: 1; }
.lvcard .t { font-weight: 700; font-size: 15px; min-height: 2.5em; line-height: 1.25; }
.lvcard .st { font-size: 18px; letter-spacing: 2px; color: #d9c7ae; }
.lvcard .st i { font-style: normal; color: #ffb21a; }

.chapter-meta { color: var(--muted); font-size: 14px; margin-top: 4px; }
.chapter-meta span { color: var(--ink); font-weight: 700; }
.levels { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.lvcard.locked { cursor: default; opacity: .55; box-shadow: 0 3px 0 #e2d2bb; }
.lvcard.locked:hover { transform: none; }
.lvcard.locked .n { font-size: 22px; }
.lvcard.boss { background: #ffe9d6; box-shadow: 0 3px 0 #f2c49c; }
.lvcard .st em { font-style: normal; margin-left: 6px; color: #e2d2bb; }
.lvcard .st em.got { color: #e8a91c; }
.dim { color: var(--muted); }

.intro-panel { width: min(420px, 100%); }
.intro-tag {
  display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: #fff1e4; padding: 6px 12px; border-radius: 10px;
}
#introCanvas { display: block; width: 220px; height: 180px; margin: 8px auto 0; }
.intro-panel .sub { margin: 10px 0 20px; }

.result-panel { width: min(440px, 100%); }
.stars { display: flex; justify-content: center; gap: 10px; margin: 18px 0 6px; }
.stars span {
  font-size: 54px; line-height: 1; color: #e8dccb;
  animation: star .45s cubic-bezier(.2, 1.6, .4, 1) both;
}
.stars span.on { color: #ffb21a; text-shadow: 0 3px 0 #d98c00; }
.stars span:nth-child(2) { animation-delay: .15s; }
.stars span:nth-child(3) { animation-delay: .3s; }
@keyframes star { from { transform: scale(0) rotate(-40deg); } }
.res-score { color: var(--muted); font-size: 17px; margin: 8px 0 22px; }
.res-score b { color: var(--ink); font-size: 22px; }

@media (max-height: 520px) {
  .chip, .iconbtn { height: 38px; }
  .iconbtn { width: 38px; }
  .chip { padding: 0 10px; font-size: 14px; }
  .chip b { font-size: 16px; }
  .lvl b { display: none; }
  .panel { padding: 20px; }
  .sub { margin: 10px 0 16px; font-size: 15px; }
}
@media (max-width: 640px) {
  .lvl b { display: none; }
  .chip.score span { display: none; }
}

/* карта главы */
.map-screen { background: linear-gradient(180deg, #f6e8d2, #ecd8b6); backdrop-filter: none; -webkit-backdrop-filter: none; align-items: stretch; }
.map-wrap { width: min(1100px, 100%); margin: 0 auto; display: flex; flex-direction: column; min-height: 0; }
.map-wrap .panel-head { margin-bottom: 8px; }
.map-wrap .chapter-meta .story { color: var(--muted); font-weight: 400; }
#mapSvg { flex: 1; min-height: 0; width: 100%; height: 100%; filter: drop-shadow(0 8px 0 rgba(43,29,20,.12)); }
#mapSvg .floor { stroke: #c9a877; stroke-width: 4; }
#mapSvg .rug { fill: #f7b98a; fill-opacity: .35; stroke: #e48a4a; stroke-width: 3; stroke-dasharray: 3 10; stroke-linecap: round; }
#mapSvg .road { fill: none; stroke: #d4b184; stroke-width: 26; stroke-linecap: round; }
#mapSvg .road.done { stroke: #ffb35c; }
#mapSvg .dots { fill: none; stroke: #fff6e6; stroke-width: 5; stroke-linecap: round; stroke-dasharray: .1 15; }
#mapSvg .node { cursor: pointer; }
#mapSvg .node.locked { cursor: default; }
#mapSvg .disc { fill: #fffdf8; stroke: var(--accent); stroke-width: 6; transition: transform .12s; transform-box: fill-box; transform-origin: center; }
#mapSvg .node:not(.locked):hover .disc { transform: scale(1.08); }
#mapSvg .node.done .disc { fill: #ffe9b8; }
#mapSvg .node.boss .disc { stroke: #c8402a; stroke-width: 7; }
#mapSvg .node.locked .disc { fill: #e3d6c3; stroke: #bba98f; }
#mapSvg .num { font: 900 36px "Segoe UI", system-ui, sans-serif; fill: var(--accent-d); }
#mapSvg .node.boss .num { font-size: 44px; fill: #c8402a; }
#mapSvg .lock { font-size: 28px; }
#mapSvg .crown { fill: #ffc93c; stroke: #c9891a; stroke-width: 3; stroke-linejoin: round; }
#mapSvg .mstar { font: 700 26px "Segoe UI", system-ui, sans-serif; fill: #cdb99b; }
#mapSvg .mstar.on { fill: #ffb21a; stroke: #c9891a; stroke-width: 1; }
#mapSvg .nm { font: 700 17px "Segoe UI", system-ui, sans-serif; fill: #6b5646; paint-order: stroke; stroke: #fdf1dc; stroke-width: 5px; stroke-linejoin: round; }
#mapSvg .gold { fill: #e2d2bb; stroke: #fffdf8; stroke-width: 3; }
#mapSvg .gold.got { fill: #ffc93c; }
#mapSvg .pulse { fill: none; stroke: var(--accent); stroke-width: 5; opacity: .6; animation: mapPulse 1.3s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes mapPulse { from { transform: scale(.9); opacity: .8; } to { transform: scale(1.25); opacity: 0; } }
#mapSvg.low .nm { display: none; }
@media (max-height: 520px) {
  .map-screen { padding: 8px 16px; }
  .map-wrap h2 { font-size: 20px; }
  .map-wrap .panel-head { margin-bottom: 4px; }
  .map-wrap .chapter-meta .story { display: none; }
}
.map-wrap .chapter-meta .story::before { content: "· "; }

/* вкладки глав */
.ctabs { display: flex; gap: 8px; margin: 0 0 8px; flex-wrap: wrap; }
.ctab { border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 15px; padding: 8px 16px; border-radius: 12px; background: #f1e6d6; color: var(--ink); box-shadow: 0 3px 0 #d9c7ae; display: inline-flex; gap: 8px; align-items: baseline; }
.ctab small { font-size: 12px; font-weight: 600; color: var(--muted); }
.ctab.on { background: var(--accent); color: #fff; box-shadow: 0 3px 0 var(--accent-d); }
.ctab.on small { color: rgba(255,255,255,.85); }
.ctab:disabled { cursor: default; opacity: .55; }
@media (max-height: 520px) { .ctab { padding: 5px 12px; font-size: 13px; } .ctabs { margin-bottom: 4px; } }

/* карта: тема «Огород» */
#mapSvg[data-theme="garden"] .floor { stroke: #7aa655; }
#mapSvg[data-theme="garden"] .rug { fill: #9ed07a; fill-opacity: .35; stroke: #5f9a3e; }
#mapSvg[data-theme="garden"] .road { stroke: #b99565; }
#mapSvg[data-theme="garden"] .road.done { stroke: #ffb35c; }
#mapSvg[data-theme="garden"] .node.locked .disc { fill: #dfe6cf; stroke: #a9b595; }
.map-screen { background: linear-gradient(180deg, #f6e8d2, #ecd8b6); }

/* телефон лёжа: карточка котёнка и итоги в компактном виде, без прокрутки */
@media (max-height: 520px) {
  .intro-panel { width: min(560px, 100%); display: grid; grid-template-columns: auto 1fr; column-gap: 20px; align-items: center; text-align: left; padding: 16px 22px; }
  .intro-panel .intro-tag { grid-column: 2; justify-self: start; }
  #introCanvas { grid-column: 1; grid-row: 1 / 5; width: 150px; height: 123px; margin: 0; }
  .intro-panel h2 { grid-column: 2; font-size: 24px; }
  .intro-panel .sub { grid-column: 2; margin: 6px 0 10px; font-size: 14px; line-height: 1.35; }
  .intro-panel .btn { grid-column: 2; justify-self: start; padding: 10px 28px; font-size: 17px; }
  .stars { margin: 6px 0 2px; }
  .stars span { font-size: 40px; }
  .res-score { margin: 4px 0 10px; font-size: 14px; }
  .res-score b { font-size: 18px; }
  #scrResult .panel h2 { font-size: 22px; }
  #scrResult .btn { padding: 10px 20px; font-size: 15px; }
}

/* подсказка «поверните телефон» на узких экранах стоя */
#rotate { position: fixed; inset: 0; transform: none; top: 0; left: 0; background: rgba(43, 29, 20, .55); padding: 16px; display: grid; place-items: center; pointer-events: auto; white-space: normal; z-index: 5; }
#rotate .rot-card { background: var(--card); color: var(--ink); border-radius: 22px; padding: 22px 24px; max-width: 320px; text-align: center; box-shadow: 0 24px 60px rgba(43, 29, 20, .3); }
#rotate .rot-card svg { color: var(--accent); }
#rotate .rot-card p { margin: 10px 0 16px; font-size: 17px; line-height: 1.4; }
@media (max-width: 480px) {
  #hud { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .hud-side { gap: 6px; }
  .chip { padding: 0 9px; gap: 5px; }
  .lvl { display: none; }
}
@media (max-height: 520px) { .btn { min-height: 40px; } }

/* карта на низком экране: вкладки в одной строке с заголовком */
@media (max-height: 520px) {
  /* заголовок | вкладки (занимают остаток, при нехватке прокручиваются) | кнопки — в одной строке, без наложений */
  .map-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); column-gap: 10px; align-items: center; }
  .map-wrap .panel-head { display: contents; }
  .map-wrap .panel-head > div:first-child { grid-column: 1; grid-row: 1; min-width: 0; }
  .map-wrap .ctabs { grid-column: 2; grid-row: 1; margin: 0; flex-wrap: nowrap; justify-content: center; min-width: 0; }
  .map-wrap .head-btns { grid-column: 3; grid-row: 1; }
  .map-wrap #mapSvg { grid-column: 1 / -1; grid-row: 2; min-height: 0; width: 100%; height: 100%; }
  .map-wrap .chapter-meta { display: none; }
  .map-wrap h2 { white-space: nowrap; }
  .ctab small { display: none; }
}

/* карта: тема «Чердак» */
#mapSvg[data-theme="attic"] .floor { stroke: #8f7fb0; }
#mapSvg[data-theme="attic"] .rug { fill: #b7a6d8; fill-opacity: .3; stroke: #7d6aa6; }
#mapSvg[data-theme="attic"] .road { stroke: #b7a58e; }
#mapSvg[data-theme="attic"] .road.done { stroke: #ffb35c; }
#mapSvg[data-theme="attic"] .node.locked .disc { fill: #e3dcee; stroke: #b3a7c8; }

/* три и больше вкладок глав на узких экранах: без счётчиков, в одну строку */
@media (max-width: 480px) {
  .ctabs { flex-wrap: nowrap; gap: 6px; }
  .ctab { padding: 7px 11px; font-size: 14px; }
  .ctab small { display: none; }
}

/* карта: тема «Подвал» */
#mapSvg[data-theme="cellar"] .floor { stroke: #6f8f94; }
#mapSvg[data-theme="cellar"] .rug { fill: #8fb5ba; fill-opacity: .3; stroke: #5d8288; }
#mapSvg[data-theme="cellar"] .road { stroke: #a8a49a; }
#mapSvg[data-theme="cellar"] .road.done { stroke: #ffb35c; }
#mapSvg[data-theme="cellar"] .node.locked .disc { fill: #dce6e8; stroke: #a9bcc0; }

/* плашка ветра и карта: тема «Крыша» */
.chip.wind span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.chip.wind b { color: #3f8fd8; letter-spacing: -1px; }
@media (max-width: 640px) { .chip.wind span { display: none; } }
#mapSvg[data-theme="roof"] .floor { stroke: #c08a78; }
#mapSvg[data-theme="roof"] .rug { fill: #f0a896; fill-opacity: .3; stroke: #c27560; }
#mapSvg[data-theme="roof"] .road { stroke: #b99a8e; }
#mapSvg[data-theme="roof"] .road.done { stroke: #ffb35c; }
#mapSvg[data-theme="roof"] .node.locked .disc { fill: #eadcd6; stroke: #bfa79d; }

/* пять и больше вкладок глав на узких экранах: плотнее, а при нехватке места — прокрутка внутри полосы вкладок */
.map-wrap { min-width: 0; }
.ctabs { overflow-x: auto; scrollbar-width: none; }
.ctabs::-webkit-scrollbar { display: none; }
.ctab { flex: 0 0 auto; }
@media (max-width: 480px) {
  .ctabs { gap: 4px; }
  .ctab { padding: 7px 8px; font-size: 13px; }
}

/* баннер-подсказка о новой механике */
#banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(max(14px, env(safe-area-inset-top)) + 54px);
  width: max-content; max-width: min(520px, calc(100vw - 32px));
  background: var(--card); color: var(--ink); font-size: 15px; line-height: 1.4; font-weight: 600;
  padding: 10px 16px; border-radius: 14px; border-left: 5px solid var(--accent);
  box-shadow: 0 2px 0 var(--line), 0 8px 24px rgba(43, 29, 20, .18);
  cursor: pointer; z-index: 4; animation: bannerIn .35s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes bannerIn { from { transform: translate(-50%, -12px); opacity: 0; } }
@media (max-height: 520px) { #banner { top: 58px; font-size: 13px; padding: 7px 12px; max-width: min(460px, calc(100vw - 32px)); } }

/* кнопка «Крепость дня» на заставке */
.title-panel .btn.daily { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 14px auto 0; padding: 10px 26px; }
.btn.daily small { font-size: 13px; font-weight: 600; color: var(--muted); }
@media (max-height: 520px) { .title-panel .btn.daily { margin-top: 8px; padding: 6px 20px; } }

/* ---- кнопка звука на каждом экране ---- */
.panel { position: relative; }
.mutebtn.corner { position: absolute; top: 10px; right: 10px; }
.mutebtn.off { color: var(--muted); }
.head-btns { display: flex; gap: 4px; align-items: center; }

/* ---- общие мелочи для новых экранов ---- */
.btn.ghost { background: transparent; box-shadow: none; color: var(--muted); font-weight: 600; }
.btn.ghost:hover { color: var(--ink); }
.btn.small { font-size: 15px; padding: 9px 16px; }
.btn.danger { background: #d9534f; color: #fff; box-shadow: 0 4px 0 #a83d3a; }
.col { display: flex; flex-direction: column; gap: 12px; align-items: stretch; max-width: 320px; margin: 0 auto; }
.title-panel .btn.ghost { display: block; margin: 8px auto 0; }

/* ---- загрузка (заставка приложения): тот же вид, что значок и картинки запуска iOS; подпись разработчика — из config.js ---- */
.load-screen { position: fixed; inset: 0; overflow: hidden; display: grid; place-items: center; background: radial-gradient(ellipse 80% 70% at 50% 42%, #4fc3d1 0, #238a9c 46%, #0e3f50 100%); color: #fff3dd; backdrop-filter: none; -webkit-backdrop-filter: none; z-index: 20; }
.load-screen[hidden] { display: none; }
.ld-rays { position: absolute; left: 50%; top: 42%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax; background: repeating-conic-gradient(rgba(255,255,255,.1) 0 7deg, rgba(255,255,255,0) 7deg 15deg); -webkit-mask: radial-gradient(circle, #000 0, #000 12%, transparent 40%); mask: radial-gradient(circle, #000 0, #000 12%, transparent 40%); animation: ldSpin 70s linear infinite; pointer-events: none; }
@keyframes ldSpin { to { transform: rotate(360deg); } }
.ld-st { position: absolute; bottom: -40px; left: var(--x); width: var(--s); height: var(--s); background: #ffd23f; clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%); opacity: 0; animation: ldRise 5.5s ease-in infinite; animation-delay: var(--d); pointer-events: none; }
@keyframes ldRise { 0% { transform: translateY(0) rotate(0); opacity: 0; } 12% { opacity: .85; } 100% { transform: translateY(-86vh) rotate(200deg); opacity: 0; } }
.ld { position: relative; width: min(440px, calc(100vw - 40px)); text-align: center; display: flex; flex-direction: column; align-items: center; margin-top: -4vh; }
.ld-mark { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 8px 0 rgba(8,34,44,.55), 0 18px 40px rgba(0,0,0,.35); animation: ldBob 1.7s ease-in-out infinite; }
@keyframes ldBob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
.ld-word { height: 64px; width: auto; margin: 22px 0 28px; filter: drop-shadow(0 4px 0 rgba(8,34,44,.5)); animation: ldIn .8s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes ldIn { from { transform: scale(.7); opacity: 0; } }
.ld-bar { position: relative; width: min(320px, 78vw); height: 18px; border-radius: 12px; background: rgba(8,34,44,.55); border: 3px solid #2a1a12; box-shadow: 0 4px 0 rgba(8,34,44,.5); }
.ld-bar i { display: block; position: relative; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(#ffd23f, #ff8a1f); transition: width .15s; }
.ld-kit { position: absolute; right: -22px; top: -17px; width: 44px; height: 44px; background: url(assets/site/kit-red.png) center / contain no-repeat; animation: ldRoll .9s linear infinite; filter: drop-shadow(0 3px 0 rgba(8,34,44,.5)); }
@keyframes ldRoll { to { transform: rotate(360deg); } }
.load-text { font-weight: 800; font-size: 17px; margin: 18px 0 4px; text-shadow: 0 2px 0 rgba(8,34,44,.6); }
.load-tip { color: #d6f1f5; font-size: 15px; line-height: 1.45; margin: 0; min-height: 2.9em; max-width: 24em; text-shadow: 0 1px 0 rgba(8,34,44,.6); }
.ld-foot { position: absolute; left: 0; right: 0; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; padding: 0 16px; text-align: center; text-shadow: 0 1px 0 rgba(6,28,38,.55); }
.ld-ru { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #fff3dd; }
.ld-ru b { font-weight: 600; }
.ld-flag { display: inline-flex; flex-direction: column; flex: none; width: 22px; height: 15px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1.5px rgba(255,255,255,.55), 0 2px 4px rgba(0,0,0,.35); }
.ld-flag b { flex: 1; display: block; } .ld-flag b:nth-child(1) { background: #fff; } .ld-flag b:nth-child(2) { background: #1c57a5; } .ld-flag b:nth-child(3) { background: #d52b1e; }
.ld-city { margin-top: 3px; font-size: 11.5px; font-weight: 400; color: #a9d8e0; }
.ld-sep { width: 96px; height: 1px; margin: 12px 0 10px; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.4), rgba(255,255,255,0)); }
.ld-by em { display: block; margin-bottom: 4px; font-style: normal; font-size: 11px; font-weight: 400; color: #8fc5cf; }
.ld-name { display: inline-flex; align-items: center; gap: 8px; }
.ld-name img { width: 18px; height: 18px; filter: drop-shadow(0 1px 0 rgba(0,0,0,.35)); }
.ld-name b { font-size: 14px; font-weight: 600; letter-spacing: .02em; color: #fff; }
.ld-foot [hidden] { display: none; }
.ld-city:empty { display: none; }
@media (max-height: 560px) { .ld-foot { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); } .ld-sep { margin: 8px 0 7px; } .ld-by em { display: none; } .ld-city { margin-top: 2px; } }
@media (max-height: 560px) { .ld-mark { width: 72px; height: 72px; border-radius: 18px; } .ld-word { height: 40px; margin: 12px 0 16px; } .load-tip { display: none; } .ld { margin-top: -4vh; } }
@media (prefers-reduced-motion: reduce) { .ld-rays, .ld-st, .ld-mark, .ld-kit, .ld-word { animation: none; } .ld-st { display: none; } }

/* ---- пауза ---- */
.pause-panel { width: min(400px, 100%); }
.pause-panel .sub { margin: 6px 0 18px; }

/* ---- настройки ---- */
.settings-panel { width: min(460px, 100%); text-align: left; }
.settings-panel .panel-head { margin-bottom: 8px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.set-row > span { flex: 1; }
.set-row b { width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.set-row input[type=range] { flex: 1.4; accent-color: var(--accent); height: 28px; }
.switch { position: relative; width: 62px; height: 36px; border: 0; border-radius: 18px; background: #d9c7ae; cursor: pointer; padding: 0; flex: none; }
.switch i { position: absolute; top: 3px; left: 3px; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .15s; }
.switch.on { background: var(--accent); }
.switch.on i { left: 29px; }
.confirm { background: #fff1ef; border-radius: 14px; padding: 12px 14px; margin-top: 10px; }
.confirm p { margin: 0 0 10px; line-height: 1.4; }
.confirm .row { justify-content: flex-end; }
.about { margin-top: 12px; }
.about summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.credits { color: var(--muted); font-size: 14px; line-height: 1.55; margin-top: 6px; }

/* ---- сценки глав и финал ---- */
.story-panel { width: min(460px, 100%); }
#storyCanvas { display: block; width: 100%; max-width: 380px; height: auto; aspect-ratio: 2 / 1; margin: 10px auto 4px; border-radius: 18px; }
.story-panel .sub { margin: 8px 0 12px; }
.story-extra { margin: 0 0 16px; color: var(--muted); }
.story-extra b { color: var(--ink); }
.story-extra .credits { margin-top: 10px; }

@media (max-height: 520px) {
  .col { gap: 8px; }
  .set-row { padding: 6px 0; }
  #storyCanvas { max-width: 240px; margin: 4px auto 0; }
  .story-panel .sub { margin: 4px 0 8px; font-size: 15px; }
}

/* ---- новые экраны на низких и узких окнах (проверка: dev/hudtest.js, dev/maptest.js) ---- */
/* узкий телефон стоя: шапка карты не должна расти от кнопки звука */
@media (max-width: 400px) {
  .map-wrap h2 { font-size: 21px; }
  .map-wrap .chapter-meta .story { display: none; }
  .head-btns { gap: 0; }
  .head-btns .iconbtn { width: 38px; height: 38px; }
}
/* заставка на очень низком окне: без подзаголовка */
@media (max-height: 400px) {
  .title-panel .sub { display: none; }
  .title-panel .logo { margin: 4px 0 12px; }
}
/* пауза: кнопки сеткой 2×2 */
@media (max-height: 440px) {
  .pause-panel { width: min(520px, 100%); padding: 18px 22px; }
  .pause-panel .sub { margin: 2px 0 10px; }
  .pause-panel .col { display: grid; grid-template-columns: 1fr 1fr; max-width: none; gap: 8px; }
  .pause-panel .col .btn.big { grid-column: 1 / -1; padding: 10px 24px; font-size: 18px; }
  .pause-panel .col .btn { padding: 10px 14px; font-size: 15px; }
}
/* настройки: две колонки на низком широком окне */
@media (max-height: 560px) and (min-aspect-ratio: 5/4) {
  .settings-panel { width: min(760px, 100%); display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; padding: 16px 24px; align-content: start; }
  .settings-panel .panel-head, .settings-panel .confirm { grid-column: 1 / -1; }
  /* слева всё про звук, справа подсказки, прогресс и «Об игре» */
  .settings-panel .r-sound { grid-area: 2 / 1; } .settings-panel .r-music { grid-area: 3 / 1; } .settings-panel .r-sfx { grid-area: 4 / 1; }
  .settings-panel .r-tips { grid-area: 2 / 2; } .settings-panel .r-reset { grid-area: 3 / 2; } .settings-panel .about { grid-area: 4 / 2; margin-top: 0; align-self: center; }
  .settings-panel .confirm { grid-row: 5; }
  .set-row { padding: 8px 0; }
  .about summary { padding: 6px 0; }
}
/* сценки: картинка слева, текст справа */
@media (max-height: 720px) and (min-aspect-ratio: 5/4) {
  .story-panel { width: min(760px, 100%); display: grid; grid-template-columns: minmax(170px, 42%) 1fr; column-gap: 24px; align-items: center; text-align: left; padding: 20px 24px; }
  .story-panel > #storyCanvas { grid-column: 1; grid-row: 1 / span 5; width: 100%; max-width: none; margin: 0; }
  .story-panel > :not(#storyCanvas):not(.mutebtn) { grid-column: 2; }
  .story-panel > .intro-tag { justify-self: start; margin-right: 44px; }
  .story-panel .sub { margin: 6px 0 8px; font-size: 16px; }
  .story-panel .story-extra { margin: 0 0 12px; }
  .story-panel .btn.big { justify-self: start; padding: 11px 30px; font-size: 18px; }
}
@media (max-height: 420px) and (min-aspect-ratio: 5/4) {
  .story-panel h2 { font-size: 22px; }
  .story-panel .sub { font-size: 14px; line-height: 1.4; }
  .story-panel .story-extra, .story-panel .credits { font-size: 13px; }
  .story-panel .btn.big { padding: 8px 24px; font-size: 16px; }
}
/* самый низкий телефон лёжа (высота до 360): ещё плотнее */
@media (max-height: 360px) and (min-aspect-ratio: 5/4) {
  .settings-panel { padding: 12px 20px; }
  .settings-panel h2 { font-size: 22px; }
  .settings-panel .panel-head { margin-bottom: 2px; }
  .set-row { padding: 5px 0; }
  .story-extra .credits { display: none; }      /* титры целиком — в «Настройки → Об игре» */
}
/* подтверждение сброса на низком экране — плашкой поверх нижней части панели, чтобы не раздувать её */
@media (max-height: 560px) and (min-aspect-ratio: 5/4) {
  .settings-panel .confirm { position: absolute; left: 14px; right: 14px; bottom: 14px; margin: 0; display: flex; align-items: center; gap: 12px; box-shadow: 0 8px 24px rgba(43, 29, 20, .25); z-index: 2; }
  .settings-panel .confirm p { margin: 0; flex: 1; font-size: 14px; }
  .settings-panel .confirm .row { flex-wrap: nowrap; }
  .settings-panel .confirm .btn { padding: 9px 14px; font-size: 15px; }
}

/* ?embed: игра внутри главной страницы сайта — только сцена, остальным управляет родительская страница */
.embed #hud, .embed .screen, .embed #tip, .embed #banner, .embed #rotate { display: none !important; }

/* ================= фирменный вид интерфейса (10.10.2026): как на сайте — Rubik, чернильный контур, жёсткая тень =================
   Заставка: логотип-картинка, «Играть» и «Крепость дня» в одну строку, настройки и звук — значками в углах.
   Пауза и итоги — плитки-значки в ряд (главное действие — круглая оранжевая), а не столбик кнопок. */
html, body { font-family: Rubik, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
.screen:not(.map-screen):not(.load-screen) { background: rgba(30, 20, 14, .46); }
.panel { background: #fff8ec; border: 4px solid var(--ink); border-radius: 26px; box-shadow: 0 8px 0 var(--ink), 0 28px 60px rgba(30, 20, 14, .35); }
h2 { font-weight: 900; letter-spacing: -.01em; }
.sub { color: #7a6656; font-weight: 600; }
.btn { border: 3px solid var(--ink); border-radius: 16px; background: #fff; color: var(--ink); font-weight: 800; box-shadow: 0 5px 0 var(--ink); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 5px 0 var(--ink); text-shadow: 0 2px 0 rgba(130, 45, 0, .45); }
.btn.primary:active { box-shadow: 0 1px 0 var(--ink); }
.btn.big { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 24px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; padding: 13px 34px 13px 26px; }
.btn.big svg { filter: drop-shadow(0 2px 0 rgba(130, 45, 0, .45)); }
.btn.ghost { border: 0; box-shadow: none; background: transparent; }
.btn.small { padding: 8px 14px; box-shadow: 0 4px 0 var(--ink); }
.btn.danger { background: #e2564f; color: #fff; box-shadow: 0 5px 0 var(--ink); }
.btn:focus-visible, .iconbtn:focus-visible, .ctab:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.iconbtn { border: 3px solid var(--ink); border-radius: 14px; background: #fff8ec; box-shadow: 0 4px 0 var(--ink); }
.iconbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.iconbtn.flat { background: #fff; box-shadow: 0 3px 0 var(--ink); }
.mutebtn.off { color: #b4a08c; }
.chip { border: 3px solid var(--ink); border-radius: 14px; background: #fff8ec; box-shadow: 0 4px 0 var(--ink); font-weight: 700; }
.chip b { font-weight: 900; }
.chip.score span, .chip.wind span { font-weight: 800; }
.lvl-num { border: 2px solid var(--ink); border-radius: 9px; }
.intro-tag { border: 2px solid var(--ink); background: #ffe1c4; color: var(--ink); }
#banner { border: 3px solid var(--ink); border-left-width: 8px; border-left-color: var(--accent); box-shadow: 0 4px 0 var(--ink); }

/* заставка */
.title-panel { width: min(600px, 100%); padding: 30px 28px 30px; }
.title-panel .logo { margin: 8px 0 0; font-size: 0; line-height: 0; }
.title-panel .logo img { display: block; width: min(430px, 80%); height: auto; margin: 0 auto; animation: logoIn .7s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes logoIn { from { transform: scale(.7) rotate(-4deg); opacity: 0; } }
.title-panel .sub { margin: 12px auto 22px; max-width: 30em; }
.title-btns { display: flex; gap: 14px; justify-content: center; align-items: stretch; flex-wrap: wrap; }
.title-panel .btn.daily { margin: 0; padding: 8px 20px; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.btn.daily span { font-weight: 900; }
.btn.daily small { font-weight: 700; }
.corner-l { position: absolute; top: 12px; left: 12px; }
.mutebtn.corner { top: 12px; right: 12px; }

/* плитки: пауза и итоги */
.tiles { display: flex; gap: 10px 14px; justify-content: center; align-items: flex-end; flex-wrap: wrap; }
.tile { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 7px; width: 96px; -webkit-tap-highlight-color: transparent; }
.tile i { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 20px; background: #fff; color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); transition: transform .1s, box-shadow .1s; }
.tile .lb { font-weight: 800; font-size: 13.5px; line-height: 1.15; text-align: center; color: var(--ink); }
.tile.go i { width: 86px; height: 86px; border-radius: 50%; background: var(--accent); color: #fff; }
.tile.go i svg { width: 40px; height: 40px; filter: drop-shadow(0 2px 0 rgba(130, 45, 0, .45)); }
.tile:hover i { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.tile:active i { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.tile:focus-visible i { outline: 3px solid var(--accent); outline-offset: 3px; }
.tile[hidden] { display: none !important; }
.pause-panel { width: min(540px, 100%); }
.pause-panel .sub { margin: 6px 0 20px; }
.result-panel { width: min(470px, 100%); }
.result-panel .res-score { margin: 8px 0 20px; }

/* звёзды итогов — как на сайте */
.stars { gap: 4px; margin: 14px 0 4px; align-items: flex-end; }
.stars span { font-size: 0; line-height: 0; animation: star .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.stars span svg { width: 64px; height: 64px; }
.stars span:nth-child(2) svg { width: 82px; height: 82px; margin-bottom: 10px; }
.stars span svg path { fill: #ece0cd; stroke: #bfa98d; }
.stars span svg .gl { stroke: #fff; opacity: .6; fill: none; }
.stars span.on svg path { fill: #ffc93c; stroke: var(--ink); }
.stars span.on svg .gl { stroke: #fff6c8; opacity: 1; fill: none; }

/* карта, вкладки, настройки */
.ctab { border: 3px solid var(--ink); background: #fff; box-shadow: 0 3px 0 var(--ink); font-weight: 800; }
.ctab.on { background: var(--accent); box-shadow: 0 3px 0 var(--ink); }
@media (min-width: 560px) and (min-height: 521px) { .map-wrap h2 { font-size: 30px; } }   /* на низком экране заголовок не раздувать (11.10: перекрывал вкладки) */
#mapSvg .num, #mapSvg .mstar, #mapSvg .nm { font-family: Rubik, "Segoe UI", system-ui, sans-serif; }
#mapSvg .disc { stroke: var(--ink); stroke-width: 6; }
#mapSvg .node:not(.locked):not(.done) .disc { fill: #fff; }
#mapSvg .node.boss .disc { stroke: var(--ink); stroke-width: 7; fill: #ffe1c4; }
.set-row { border-bottom: 2px dashed rgba(43, 29, 20, .16); }
.switch { border: 3px solid var(--ink); height: 38px; width: 66px; }
.switch i { top: 2px; left: 2px; border: 2px solid var(--ink); box-shadow: none; }
.switch.on i { left: 28px; }
.confirm { border: 3px solid var(--ink); }

/* низкий экран (телефон лёжа) */
@media (max-height: 520px) {
  .title-panel { padding: 18px 22px 20px; }
  .title-panel .logo img { width: min(300px, 62%); }
  .title-panel .sub { margin: 8px auto 14px; }
  .btn.big { font-size: 20px; padding: 9px 26px 9px 20px; }
  .btn.big svg { width: 24px; height: 24px; }
  .tile { width: 82px; gap: 5px; }
  .tile i { width: 54px; height: 54px; border-radius: 16px; }
  .tile i svg { width: 24px; height: 24px; }
  .tile.go i { width: 68px; height: 68px; }
  .tile.go i svg { width: 32px; height: 32px; }
  .tile .lb { font-size: 12.5px; }
  .pause-panel { padding: 16px 22px 18px; }
  .pause-panel .sub { margin: 2px 0 12px; }
  .stars span svg { width: 46px; height: 46px; }
  .stars span:nth-child(2) svg { width: 58px; height: 58px; margin-bottom: 6px; }
}
@media (max-width: 420px) {
  .tile { width: 72px; } .tile .lb { font-size: 12px; }
  .title-panel .btn.daily { width: 100%; }
}

/* ---- поправки после автотестов (11.10.2026): рамки и Rubik сделали элементы крупнее ---- */
#mapSvg .nm { font-weight: 600; font-size: 15px; }                         /* «Кастрюльная крепость» не вылезает за пол */
@media (max-width: 480px) { .ctab { border-width: 2px; box-shadow: 0 2px 0 var(--ink); padding: 5px 8px; } .ctabs { margin-bottom: 4px; } }
@media (max-width: 820px) { .chip { padding: 0 9px; gap: 5px; border-width: 2px; } .iconbtn { border-width: 2px; } .hud-side { gap: 6px; } }
@media (max-height: 340px) {
  .result-panel { padding: 10px 18px 12px; }
  #scrResult .panel h2 { font-size: 19px; }
  .stars { margin: 2px 0 0; }
  .stars span svg { width: 34px; height: 34px; } .stars span:nth-child(2) svg { width: 42px; height: 42px; margin-bottom: 4px; }
  .result-panel .res-score { margin: 2px 0 8px; font-size: 13px; line-height: 1.3; }
  .tile { width: 70px; gap: 3px; } .tile i { width: 44px; height: 44px; border-radius: 13px; } .tile.go i { width: 54px; height: 54px; }
  .tile i svg { width: 20px; height: 20px; } .tile.go i svg { width: 26px; height: 26px; } .tile .lb { font-size: 11.5px; }
}
@media (max-height: 700px) { .settings-panel { padding: 18px 24px; } .set-row { padding: 9px 0; } .settings-panel .panel-head { margin-bottom: 4px; } }
@media (max-width: 340px) { .ctab { padding: 3px 7px; font-size: 12.5px; } .map-wrap h2 { font-size: 19px; } .map-wrap .panel-head { margin-bottom: 2px; } }
@media (max-height: 340px) {
  .settings-panel { padding: 8px 18px; }
  .settings-panel h2 { font-size: 19px; }
  .set-row { padding: 3px 0; font-size: 14px; }
  .switch { width: 54px; height: 30px; } .switch i { width: 22px; height: 22px; } .switch.on i { left: 26px; }
  .settings-panel .btn.small { padding: 4px 10px; font-size: 13px; box-shadow: 0 3px 0 var(--ink); }
  .settings-panel .iconbtn { width: 34px; height: 34px; }
  .about summary { padding: 2px 0; font-size: 14px; }
}
@media (max-height: 340px) { .switch { width: 60px; height: 36px; } .switch i { width: 28px; height: 28px; } .switch.on i { left: 26px; } .settings-panel .iconbtn { width: 36px; height: 36px; } .set-row { padding: 2px 0; } }

/* ---------- 11.10.2026: шапка игры (HUD) в фирменном стиле: карточка уровня, счёт со шкалой звёзд, мыши, кнопки ---------- */
#hud { align-items: flex-start; gap: 10px; }
#hud .hud-l, #hud .hud-r { gap: 10px; flex: 1 1 0; min-width: 0; }
#hud .hud-r { justify-content: flex-end; }
#hud .hud-mid { flex: 0 1 auto; display: flex; justify-content: center; pointer-events: none; }
#hud .iconbtn { width: 46px; height: 46px; border-radius: 15px; }
#hud .pausebtn { width: 52px; height: 52px; border-radius: 17px; background: var(--accent); color: #fff; box-shadow: 0 5px 0 var(--ink); }
#hud .pausebtn:active { box-shadow: 0 1px 0 var(--ink); }
.lvlcard { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px 0 6px; border: 3px solid var(--ink); border-radius: 17px; background: #fff8ec; box-shadow: 0 5px 0 var(--ink); min-width: 0; }
.lvlbadge { flex: none; display: grid; place-items: center; width: 38px; height: 38px; font-style: normal; font-weight: 900; font-size: 18px; color: #fff; background: var(--accent); border: 3px solid var(--ink); border-radius: 12px; text-shadow: 0 2px 0 rgba(130, 45, 0, .45); transform: rotate(-4deg); }
.lvltxt { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.lvltxt small { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #8a5a35; }
.lvltxt b { font-size: 17px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scorecard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 190px; padding: 5px 18px 9px; border: 3px solid var(--ink); border-radius: 17px; background: #fff8ec; box-shadow: 0 5px 0 var(--ink); }
.scorecard b { font-size: 26px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.scorecard b.pop { animation: scpop .35s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes scpop { 40% { transform: scale(1.22); color: var(--accent); } }
.smeter { position: relative; width: 100%; height: 10px; margin-top: 2px; border: 2px solid var(--ink); border-radius: 6px; background: #ead9bf; }
.smfill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; background: linear-gradient(90deg, #ffc247, var(--accent)); transition: width .5s cubic-bezier(.3, 1.3, .5, 1); }
.smeter .st { position: absolute; top: 50%; width: 22px; height: 22px; margin: -13px 0 0 -11px; display: grid; place-items: center; font: 900 20px/1 Rubik, sans-serif; text-decoration: none; color: #cdbba2; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; transition: color .25s, transform .25s; }
.smeter .st.s1 { left: 3%; } .smeter .st.s2 { left: var(--p2, 55%); } .smeter .st.s3 { left: 97%; }
.smeter .st.on { color: #ffc247; transform: scale(1.18) rotate(-8deg); }
#hud .chip.mice { height: 46px; padding: 0 14px 0 10px; border-radius: 15px; }
#hud .chip.mice b { font-size: 22px; }
@media (max-width: 900px) { .scorecard { min-width: 150px; padding: 4px 12px 8px; } .scorecard b { font-size: 22px; } .lvltxt b { max-width: 24vw; } }
@media (max-width: 640px) { .lvltxt small { display: none; } .lvltxt b { max-width: 22vw; font-size: 15px; } .lvlcard { padding-right: 12px; } .scorecard { min-width: 128px; } }
@media (max-width: 520px) { .lvltxt { display: none; } .lvlcard { padding: 0 6px; } #hud .pausebtn { width: 46px; height: 46px; } .lvlcard { height: 46px; } #hud .iconbtn { width: 40px; height: 40px; } }
@media (max-height: 520px) { #hud .pausebtn, .lvlcard { height: 42px; width: auto; } #hud .pausebtn { width: 42px; } .scorecard { padding: 3px 12px 7px; } .scorecard b { font-size: 20px; } #hud .iconbtn { width: 38px; height: 38px; } #hud .chip.mice { height: 38px; } .lvlbadge { width: 32px; height: 32px; font-size: 16px; } }

/* чип профиля на заставке и значок на карте */
.title-panel { padding-top: 62px; }
.profchip { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; height: 42px; max-width: calc(100% - 140px); padding: 0 14px 0 5px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; color: var(--ink); font: 800 14px/1 Rubik, sans-serif; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.profchip:active { transform: translateX(-50%) translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.profchip .pf-ava { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: #ffe1c4; overflow: hidden; }
.profchip .pf-ava img { width: 28px; height: 28px; object-fit: contain; }
.profchip .pf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* звёзды шкалы — рисунком, а не символом шрифта */
.smeter { height: 12px; margin-top: 4px; }
.smeter .st { width: 30px; height: 30px; margin: -17px 0 0 -15px; font-size: 0; color: transparent; -webkit-text-stroke: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.2l3.1 6.4 7 .9-5.1 4.9 1.3 7L12 18l-6.3 3.4 1.3-7L1.9 9.5l7-.9z' fill='%23dccab0' stroke='%232b1d14' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform .25s; }
.smeter .st.on { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.2l3.1 6.4 7 .9-5.1 4.9 1.3 7L12 18l-6.3 3.4 1.3-7L1.9 9.5l7-.9z' fill='%23ffc247' stroke='%232b1d14' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M9 7.5l1.8-.2' stroke='%23fff6d8' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); transform: scale(1.12) rotate(-8deg); }
.scorecard { padding-bottom: 12px; }
@media (max-height: 520px) { .smeter .st { width: 24px; height: 24px; margin: -14px 0 0 -12px; } }

.smbonus { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; background: repeating-linear-gradient(135deg, rgba(255, 194, 71, .55) 0 4px, rgba(255, 194, 71, .22) 4px 8px); transition: width .5s cubic-bezier(.3, 1.3, .5, 1); }
.smfill { z-index: 1; }
.smeter .st { z-index: 2; }

.r-update small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
