:root {
  --ink: #14203f;
  --night: #0d1330;
  --night2: #1b2554;
  --cream: #f4ead7;
  --orange: #e8792b;
  --warm: #ffd27a;
  --teal: #7dffe6;
  --glass: rgba(26, 34, 78, 0.62);
  --glass-line: rgba(255, 236, 200, 0.16);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--night);
  color: var(--cream);
  font-family: 'Golos Text', system-ui, sans-serif;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }

#sky {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% 42%, rgba(88, 104, 190, 0.38), transparent 70%),
    radial-gradient(ellipse 60% 40% at 15% 100%, rgba(232, 121, 43, 0.12), transparent 70%),
    linear-gradient(180deg, #0a0f28 0%, #141c45 55%, #0d1330 100%);
}
#sky::before, #sky::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 78% 12%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 35% 8%, #fff7 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 90% 30%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 22%, #fff8 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 5% 45%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 95% 62%, #fff6 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 22% 78%, #fff4 50%, transparent 51%),
    radial-gradient(1px 1px at 68% 88%, #fff5 50%, transparent 51%);
}
#sky::after { transform: translate(37%, 23%) scale(1.3); opacity: 0.6; animation: twinkle 5s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: 0.25; } to { opacity: 0.7; } }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.screen {
  position: fixed; inset: 0; display: none; flex-direction: column; justify-content: space-between;
  align-items: center; pointer-events: none; z-index: 5;
}
.screen.show { display: flex; }
.screen button, .screen .house { pointer-events: auto; }

/* Загрузка */
#loading { justify-content: center; }
.loader { display: flex; gap: 10px; }
.loader span { width: 12px; height: 12px; border-radius: 50%; background: var(--warm); animation: dot 1s ease-in-out infinite; }
.loader span:nth-child(2) { animation-delay: .15s; background: var(--teal); }
.loader span:nth-child(3) { animation-delay: .3s; background: var(--orange); }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-10px); opacity: 1; } }

/* Кнопки */
.btn-main {
  font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: 0.02em;
  padding: 18px 46px; border-radius: 999px; color: #2a1606;
  background: linear-gradient(180deg, #ffd88f 0%, #f39a45 100%);
  box-shadow: 0 10px 30px rgba(243, 154, 69, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 rgba(160, 70, 10, 0.35);
  transition: transform .12s;
}
.btn-main:active { transform: scale(0.95); }
.btn-sec {
  font-family: 'Unbounded', sans-serif; font-weight: 500; font-size: 16px;
  padding: 16px 26px; border-radius: 999px; background: var(--glass);
  border: 1px solid var(--glass-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .12s;
}
.btn-sec:active { transform: scale(0.95); }
.icon-btn {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--glass); border: 1px solid var(--glass-line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform .12s, background .2s;
}
.icon-btn:active { transform: scale(0.9); }
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: var(--cream); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.big { width: 66px; height: 66px; }
.icon-btn.big svg { width: 30px; height: 30px; }
.icon-btn.off svg .wave { display: none; }

/* Начало */
.start-top { padding-top: calc(7vh + var(--safe-t)); text-align: center; }
.title { margin: 0; font-family: 'Unbounded', sans-serif; line-height: 1.05; }
.title .t1 { display: block; font-size: clamp(30px, 9vw, 52px); font-weight: 800; letter-spacing: -0.01em;
  background: linear-gradient(180deg, #fff3d6, #ffc77a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(255, 190, 110, 0.35)); }
.title .t2 { display: block; margin-top: 10px; font-size: clamp(15px, 4.4vw, 22px); font-weight: 500; color: var(--teal); letter-spacing: 0.18em; text-transform: uppercase; }
.start-bottom { padding-bottom: calc(9vh + var(--safe-b)); }
#screen-start.show .title, #screen-start.show .btn-main { animation: rise .9s cubic-bezier(.2, .8, .2, 1) both; }
#screen-start.show .btn-main { animation-delay: .25s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Список комнат */
#screen-levels { justify-content: flex-start; background: radial-gradient(ellipse 90% 60% at 50% 100%, rgba(30, 40, 90, .9), transparent 70%); }
.levels-head { width: 100%; max-width: 560px; display: flex; align-items: center; justify-content: space-between; padding: calc(14px + var(--safe-t)) 16px 0; pointer-events: auto; }
.total-stars, .final-stars { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 22px; display: flex; align-items: center; gap: 8px; }
.total-stars small, .final-stars small { font-size: 14px; opacity: .6; font-weight: 500; }
.star-ic { width: 26px; height: 26px; fill: var(--warm); filter: drop-shadow(0 0 8px rgba(255, 210, 122, .6)); }
.house-wrap { position: relative; flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: calc(18px + var(--safe-b)); }
.moon { position: absolute; top: 3%; right: 12%; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #fffbea, #ffe6a8 60%, #f5cf7c);
  box-shadow: 0 0 40px 10px rgba(255, 226, 160, 0.35), 0 0 120px 40px rgba(160, 180, 255, 0.15); }
.house { position: relative; width: min(84vw, 380px, calc((100vh - 200px) / 1.95)); display: flex; flex-direction: column; align-items: center; }
.house > * { flex-shrink: 0; }
.roof { position: relative; width: 112%; height: 0; padding-bottom: 34%; }
.roof::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #4a3768, #2f2347);
  clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 6px; }
.chimney { position: absolute; right: 22%; bottom: 40%; width: 9%; height: 60%; background: #3a2b55; border-radius: 3px 3px 0 0; }
.attic { position: absolute; left: 50%; bottom: 18%; width: 14%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle, #ffd27a 0 30%, #f39a45 60%, #b8612a); box-shadow: 0 0 22px rgba(255, 190, 110, .6); }
.facade { width: 100%; border-radius: 0;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 18px),
    linear-gradient(180deg, #2f366d, #232a5c);
  padding: 7% 7% 5%; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 3.2vh, 26px) 9%; box-shadow: inset 0 -20px 40px rgba(0, 0, 0, .25), inset 6px 0 0 rgba(255,255,255,.03); }
.win-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: auto; }
.win-pane { width: 100%; aspect-ratio: 0.86; border-radius: 12px 12px 4px 4px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #1a2048 0 40%, #141a3c 40% 100%); border: 3px solid #4b5394; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .3), 0 6px 0 -1px #1b2150;
  display: grid; place-items: center; font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: clamp(14px, 4.4vw, 20px); color: #4b5394; }
.win-pane::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; background: rgba(75, 83, 148, .8); }
.win-pane span { position: relative; z-index: 1; }
.win-btn.open .win-pane { background: radial-gradient(circle at 50% 70%, #3c4a8a, #1d2450); color: var(--cream); border-color: #8f98d8;
  animation: beckon 1.8s ease-in-out infinite; }
@keyframes beckon { 0%, 100% { box-shadow: 0 0 0 0 rgba(125, 255, 230, 0); } 50% { box-shadow: 0 0 22px 3px rgba(125, 255, 230, .45); } }
.win-btn.done .win-pane { background:
    linear-gradient(90deg, rgba(200, 80, 60, .55) 0 14%, transparent 14% 86%, rgba(200, 80, 60, .55) 86%),
    radial-gradient(circle at 50% 65%, #fff4cf, #ffcf72 50%, #f39a45); color: #6a3410; border-color: #f4ead7;
  box-shadow: 0 0 30px rgba(255, 196, 100, .6), 0 6px 0 -1px #1b2150; animation: none; }
.win-btn.done .win-pane::after { background: rgba(160, 90, 30, .35); }
.win-btn.locked { cursor: default; }
.mini-stars { display: flex; gap: 2px; height: 14px; }
.mini-stars svg { width: 14px; height: 14px; fill: rgba(255, 255, 255, .14); }
.mini-stars svg.on { fill: var(--warm); filter: drop-shadow(0 0 4px rgba(255, 210, 122, .7)); }
.porch { width: 100%; display: flex; justify-content: center; align-items: flex-end; background: #232a5c; padding: 2% 0 0; border-radius: 0 0 6px 6px; position: relative; }
.porch .door { width: 15%; aspect-ratio: .62; background: linear-gradient(180deg, #7a4630, #4c2a1d); border-radius: 30px 30px 0 0; border: 3px solid #3a2016; position: relative; }
.porch .door::after { content: ''; position: absolute; right: 18%; top: 52%; width: 9%; aspect-ratio: 1; border-radius: 50%; background: #ffd27a; }
.porch::before, .porch::after { content: ''; position: absolute; bottom: -4px; width: 26%; aspect-ratio: 2.4; border-radius: 50% 50% 10px 10px;
  background: radial-gradient(circle at 30% 30%, #3f7a5a, #23463a); }
.porch::before { left: -6%; }
.porch::after { right: -6%; }
.roof-cat { position: absolute; left: 18%; bottom: 22%; width: 13%; }
.roof-cat svg { width: 100%; display: block; fill: #0b0f24; }
.ground { width: 130%; max-width: 640px; height: 22px; border-radius: 50%; background: radial-gradient(ellipse, #2a4a3a, transparent 70%); margin-top: -8px; }

/* В комнате */
#hud { position: fixed; inset: 0; display: none; pointer-events: none; z-index: 6; }
#hud.show { display: block; }
#hud button { pointer-events: auto; }
.hud-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(12px + var(--safe-t)) 14px 0; max-width: 640px; margin: 0 auto; }
.hud-info { text-align: center; flex: 1; min-width: 0; }
.room-name { font-size: 13px; letter-spacing: .04em; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-name b { font-family: 'Unbounded', sans-serif; color: var(--warm); margin-right: 6px; }
.moves { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 26px; line-height: 1.15; }
.moves small { font-family: 'Golos Text', sans-serif; font-size: 13px; font-weight: 500; opacity: .7; margin-left: 6px; }
.moves .bump { display: inline-block; animation: bumpn .25s; }
@keyframes bumpn { 50% { transform: scale(1.25); } }
.hud-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 16px calc(18px + var(--safe-b)); max-width: 640px; margin: 0 auto; }
.portraits { display: flex; gap: 12px; }
.portrait { width: 70px; height: 70px; border-radius: 50%; position: relative; overflow: visible;
  background: radial-gradient(circle at 50% 35%, #3a4790, #1b2252); border: 2px solid rgba(255, 236, 200, .18);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3); transition: transform .2s, border-color .2s, box-shadow .2s, opacity .2s; opacity: .62; }
.portrait img { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; }
.portrait.active { opacity: 1; transform: scale(1.08); border-color: var(--warm); box-shadow: 0 0 0 4px rgba(255, 210, 122, .25), 0 0 26px rgba(255, 210, 122, .55); }
.portrait.hidden { display: none; }
.actions { display: flex; align-items: center; gap: 12px; }
.keys-hint { position: absolute; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); font-size: 12px; opacity: .45; white-space: nowrap; display: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 700px) { .keys-hint { display: block; } }

/* Победа */
.overlay { position: fixed; inset: 0; display: none; align-items: flex-end; justify-content: center; z-index: 8;
  background: linear-gradient(180deg, transparent 30%, rgba(8, 11, 30, .65)); padding: 0 16px calc(26px + var(--safe-b)); }
.overlay.show { display: flex; animation: fade .3s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.card { width: 100%; max-width: 400px; border-radius: 28px; padding: 22px 20px 20px; text-align: center;
  background: rgba(24, 31, 72, .82); border: 1px solid var(--glass-line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45); animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.win-title { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 20px; }
.win-stars { display: flex; justify-content: center; gap: 10px; margin: 18px 0 8px; }
.ws { width: 64px; height: 64px; }
.ws:nth-child(2) { transform: translateY(-12px); }
.ws svg { width: 100%; height: 100%; fill: rgba(255, 255, 255, .1); stroke: rgba(255, 255, 255, .15); stroke-width: .6; }
.ws.on svg { fill: url(#none); fill: var(--warm); stroke: #fff4d6; filter: drop-shadow(0 0 12px rgba(255, 200, 100, .8)); animation: starIn .55s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes starIn { from { transform: translateY(80px) scale(.2) rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.win-note { font-size: 14px; opacity: .75; min-height: 20px; margin-bottom: 16px; }
.win-btns { display: flex; gap: 12px; justify-content: center; }
.win-btns .btn-main { padding: 16px 34px; font-size: 17px; }

/* Финал */
.final-top { padding-top: calc(7vh + var(--safe-t)); text-align: center; }
.final-title { margin: 0; font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: clamp(26px, 8vw, 44px); line-height: 1.12;
  background: linear-gradient(180deg, #fff6e0, #ffb98a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 20px rgba(255, 170, 120, .45)); }
#screen-final.show .final-title { animation: rise .9s cubic-bezier(.2, .8, .2, 1) both; }
.final-bottom { padding-bottom: calc(8vh + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* Нет объёмной картинки */
#nogl { justify-content: center; padding: 24px; }
.nogl-card { max-width: 380px; text-align: center; background: rgba(24, 31, 72, .85); border-radius: 24px; padding: 28px 24px; border: 1px solid var(--glass-line); }
.nogl-card h2 { font-family: 'Unbounded', sans-serif; font-size: 20px; margin: 10px 0; }
.nogl-card p { line-height: 1.5; opacity: .85; margin: 0; }
.nogl-ic { font-size: 44px; }

/* Рука-подсказка */
#hand { position: fixed; left: 0; top: 0; width: 58px; height: 58px; z-index: 7; pointer-events: none; opacity: 0;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
#hand.show { opacity: 1; }
#hand svg { width: 100%; height: 100%; overflow: visible; }
.hand-fill { fill: #fff6e6; stroke: var(--ink); stroke-width: 3.2; stroke-linejoin: round; }
#hand .ripple { fill: none; stroke: var(--warm); stroke-width: 3; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9; }

@media (min-width: 700px) {
  .portrait { width: 76px; height: 76px; }
}

/* Телефон боком: портреты слева, кнопки справа, поле — по всей высоте */
@media (orientation: landscape) and (max-height: 560px) {
  .hud-bottom { max-width: none; padding-left: calc(16px + env(safe-area-inset-left, 0px)); padding-right: calc(16px + env(safe-area-inset-right, 0px)); }
  .hud-top { max-width: none; }
  .actions { flex-direction: column-reverse; }
  .keys-hint { display: none !important; }
}

/* ---------- Понятность: цель, подписи, подсказка, «Как играть» ---------- */
.head-right { display: flex; gap: 10px; }
.icon-btn { position: relative; }
.icon-btn svg .dot { fill: var(--cream); stroke-width: 2.6; }
.keys-hint { bottom: calc(1px + var(--safe-b)); font-size: 11.5px; }

/* Метки цели */
.goals { position: absolute; left: 0; right: 0; top: 70px; display: flex; justify-content: center; gap: 8px; padding: 0 10px; }
.goal { position: relative; display: flex; align-items: center; gap: 7px; padding: 4px 12px 4px 4px; border-radius: 999px; white-space: nowrap;
  background: var(--glass); border: 1.5px solid var(--glass-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 15px; font-weight: 600; opacity: .55; transition: opacity .35s, border-color .35s, box-shadow .35s, transform .35s; }
.goal img { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #3a4790, #1b2252); display: block; }
.goal .tick { display: none; place-items: center; position: absolute; left: 22px; top: -3px; width: 19px; height: 19px; border-radius: 50%;
  font-style: normal; font-size: 12px; font-weight: 900; color: #1b1406; box-shadow: 0 0 0 2px #1b2252; }
.goal.done { opacity: 1; transform: scale(1.04); }
.goal.done .tick { display: grid; }
#goal-v.done { border-color: #ffab5e; box-shadow: 0 0 18px rgba(255, 150, 60, .5); }
#goal-v.done .tick { background: #f6a04f; }
#goal-k.done { border-color: #44e6cf; box-shadow: 0 0 18px rgba(47, 224, 200, .45); }
#goal-k.done .tick { background: #44e6cf; }
.goal.hidden { display: none; }
.goal.pop { animation: goalPop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes goalPop { 40% { transform: scale(1.18); } }

/* Подпись внизу поля */
.caption { position: absolute; left: 50%; bottom: 110px; transform: translate(-50%, 8px); width: max-content; max-width: min(94vw, 520px);
  text-align: center; font-size: 17px; font-weight: 600; line-height: 1.3; padding: 10px 16px; border-radius: 18px;
  background: rgba(20, 26, 66, .86); border: 1px solid var(--glass-line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .35); opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
.caption.show { opacity: 1; transform: translate(-50%, 0); }
.caption.warn { background: rgba(78, 28, 46, .9); border-color: rgba(255, 150, 130, .55); }
.caption.good { border-color: rgba(255, 210, 122, .6); }

/* Всплывающая строка у портрета */
.bubble { position: absolute; left: 16px; bottom: 110px; max-width: 72vw; padding: 9px 14px; border-radius: 14px; background: #fff3d6; color: var(--ink);
  font-weight: 700; font-size: 15.5px; line-height: 1.25; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); opacity: 0; transform: translateY(6px);
  transition: opacity .25s, transform .25s; pointer-events: none; }
.bubble::after { content: ''; position: absolute; left: var(--arrow-x, 30px); bottom: -7px; width: 14px; height: 14px; background: #fff3d6; transform: rotate(45deg); border-radius: 2px; }
.bubble.show { opacity: 1; transform: none; }
.portrait.nudge { opacity: 1; animation: wobble 1.2s ease-in-out infinite; border-color: #fff3d6; }
@keyframes wobble {
  0%, 100% { transform: rotate(0) scale(1.04); } 15% { transform: rotate(-13deg) scale(1.1); } 30% { transform: rotate(11deg) scale(1.1); }
  45% { transform: rotate(-7deg) scale(1.06); } 60% { transform: rotate(4deg) scale(1.04); } }

/* Кнопка-подсказка и внимание к кнопкам */
#btn-hint .lamp { stroke: var(--warm); }
#btn-hint .spin { display: none; position: absolute; inset: 7px; border-radius: 50%; border: 3px solid rgba(255, 210, 122, .2); border-top-color: var(--warm); animation: spin .8s linear infinite; }
#btn-hint.busy .spin { display: block; }
#btn-hint.busy .lamp { opacity: .35; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn.attention { animation: attention 1.3s ease-in-out infinite; border-color: rgba(255, 210, 122, .8); }
@keyframes attention { 50% { box-shadow: 0 0 0 6px rgba(255, 210, 122, .28), 0 0 30px rgba(255, 210, 122, .8); background: rgba(96, 80, 34, .75); } }

/* Страничка «Как играть» */
.help-overlay { align-items: center; background: rgba(8, 11, 30, .74); padding: 12px; z-index: 10; }
.help-card { position: relative; width: 100%; max-width: 470px; max-height: 100%; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; background: rgba(24, 31, 72, .97); border: 1px solid var(--glass-line); border-radius: 26px;
  padding: 20px 18px 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); animation: rise .35s cubic-bezier(.2, .8, .2, 1) both; }
.help-title { font-family: 'Unbounded', sans-serif; font-size: 22px; margin: 4px 0 6px; text-align: center; }
.help-close { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; }
.help-sec { margin: 16px 0 0; }
.help-sec h3 { margin: 0 0 8px; font-family: 'Unbounded', sans-serif; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--warm); }
.help-goal { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.help-goal .pair { display: flex; align-items: center; gap: 2px; padding: 4px 10px; border-radius: 18px; background: rgba(255, 255, 255, .05); }
.help-goal img { width: 64px; height: 64px; }
.help-goal .arr { font-size: 22px; opacity: .8; }
.help-note { font-size: 15.5px; line-height: 1.35; text-align: center; margin: 6px 0 0; opacity: .9; }
.help-hero { display: flex; gap: 12px; align-items: center; }
.help-hero img { width: 76px; height: 76px; flex: none; }
.help-hero ul { list-style: none; margin: 0; padding: 0; font-size: 15.5px; line-height: 1.35; }
.help-hero li::before { display: inline-block; width: 1.3em; font-weight: 800; }
.help-hero li.can::before { content: '✓'; color: #44e6cf; }
.help-hero li.cant::before { content: '✕'; color: #ff8f8f; }
.help-row { display: flex; align-items: center; gap: 12px; margin: 4px 0; font-size: 15.5px; line-height: 1.3; }
.help-row img { width: 58px; height: 58px; flex: none; }
.help-row b { color: var(--cream); }
.help-keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; font-size: 15px; line-height: 1.3; align-items: center; }
.help-keys .k { font-weight: 700; color: var(--warm); white-space: nowrap; }
.help-stars div { font-size: 15.5px; margin: 4px 0; }
.help-stars .s { color: var(--warm); letter-spacing: 2px; display: inline-block; min-width: 3.4em; }
.help-ok { display: block; margin: 18px auto 2px; }

@media (max-width: 380px) {
  .portrait { width: 60px; height: 60px; }
  .portraits, .actions { gap: 8px; }
  .icon-btn { width: 46px; height: 46px; }
  .icon-btn.big { width: 58px; height: 58px; }
  .hud-bottom { padding-left: 12px; padding-right: 12px; }
  .goal { font-size: 13.5px; padding-right: 9px; }
  .goal img { width: 26px; height: 26px; }
  .caption { font-size: 15.5px; }
}

/* Телефон боком: метки и подпись — в левой колонке над портретами, поле — по всей высоте */
@media (orientation: landscape) and (max-height: 560px) {
  /* Метки и подпись — в левой колонке, поле — по всей высоте */
  .goals { left: 16px; right: auto; flex-direction: column; align-items: flex-start; width: 240px; padding: 0; }
  .caption { left: 16px; width: 240px; max-width: 240px; text-align: left; font-size: 15px; padding: 9px 12px; transform: translateY(8px); }
  .caption.show { transform: none; }
  .portrait { width: 60px; height: 60px; }
}
