:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #030504;
  color: #f4f6ee;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  touch-action: none;
  user-select: none;
}

button { font: inherit; }

.catch-app {
  --acid: #c7ff00;
  --amber: #d78b3b;
  --line: rgba(217, 228, 205, 0.14);
  --muted: rgba(229, 235, 222, 0.58);
  --quiet: rgba(229, 235, 222, 0.44);
  /* Масштаб Хаби и иконок: start — доля высоты колонки, game — доля высоты поля (читает game.js). */
  --habi-start-size: 66%;
  --habi-start-max: 400px;
  --habi-game-ratio: .42;
  --habi-game-min: 130;
  --habi-game-max: 310;
  --falling-object-ratio: .066;
  --falling-object-min: 42;
  --falling-object-max: 64;
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 520px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 17% 96%, rgba(190, 111, 43, 0.08), transparent 34%),
    radial-gradient(ellipse at 78% 5%, rgba(173, 255, 0, 0.05), transparent 32%),
    #030504;
}

.theme-1 { --acid: #8df7ff; }
.theme-2 { --acid: #ffd166; }
.theme-3 { --acid: #ff75bd; }
.theme-4 { --acid: #c4a7ff; }

.catch-app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 8%, transparent 76%);
}

.catch-shell {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 16px;
}

.game-head {
  width: min(1180px, 100%);
  min-height: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.game-kicker,
.start-kicker,
.asset-loader__eyebrow {
  display: block;
  color: var(--acid);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .18em;
  line-height: 1;
  text-transform: uppercase;
}

.game-head h1,
.start-copy h2,
.result-panel h2 {
  margin: 3px 0 0;
  color: #f4f6ee;
  font-family: Impact, "Arial Narrow", sans-serif;
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: .015em;
  line-height: .88;
  text-transform: uppercase;
}

.catch-app[data-screen="menu"] .game-head,
.catch-app[data-screen="loading"] .game-head { visibility: hidden; }

.game-head h1 { font-size: clamp(27px, 2.6vw, 39px); }
.game-head em,
.start-copy em { color: var(--acid); font-style: normal; }

.game-hint {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .04em;
}

.scene-frame {
  position: relative;
  width: min(1180px, calc((100dvh - 90px) * 1.7778), calc(100vw - 40px));
  aspect-ratio: 16 / 9;
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(223, 235, 211, 0.13);
  border-radius: 18px;
  background:
    linear-gradient(150deg, rgba(18, 23, 20, .98), rgba(3, 6, 5, .98) 62%),
    #050706;
  box-shadow: 0 28px 70px rgba(0,0,0,.42), inset 0 0 0 1px rgba(255,255,255,.02);
  isolation: isolate;
}

.scene-frame::before,
.scene-frame::after {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.scene-frame::before {
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255,255,255,.035), transparent 20%),
    radial-gradient(circle at 80% 78%, rgba(199,255,0,.06), transparent 27%),
    radial-gradient(circle at 15% 92%, rgba(215,139,59,.08), transparent 24%);
}

.scene-frame::after {
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 70px rgba(0,0,0,.48);
}

.scene-bg,
.scene-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.scene-bg {
  display: none;
  opacity: .12;
  filter: saturate(.55) contrast(1.08) brightness(.5);
  transform: scale(1.04);
}

.catch-app[data-screen="game"] .scene-bg,
.catch-app[data-screen="result"] .scene-bg { opacity: 0; }

.scene-video { display: none; }

.asset-loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #030504;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.catch-app.is-loaded .asset-loader {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.asset-loader__panel {
  width: min(360px, 100%);
  padding-top: 16px;
  border-top: 1px solid rgba(199,255,0,.45);
}

.asset-loader__label {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.asset-loader__row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.asset-loader__row b { color: var(--acid); font-size: 11px; }
.asset-loader__track { height: 2px; overflow: hidden; background: rgba(255,255,255,.12); }
.asset-loader__track span { display: block; width: 0; height: 100%; background: var(--acid); transition: width 180ms ease; }

.start-scene,
.play-layout,
.result-scene {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.start-scene {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: 24px;
  padding: clamp(34px, 4.8vw, 68px) clamp(42px, 6vw, 84px);
}

.start-copy {
  position: relative;
  z-index: 2;
  align-self: center;
}

.start-copy h2 { margin-top: 10px; font-size: clamp(54px, 5.8vw, 86px); }
.start-copy > p { margin: 14px 0 0; color: rgba(241,245,236,.78); font-size: clamp(14px, 1.25vw, 18px); }

.start-character {
  position: relative;
  align-self: stretch;
  min-width: 0;
}

.start-character img {
  position: absolute;
  z-index: 2;
  left: 56%;
  bottom: 3.5%;
  width: auto;
  max-width: 90%;
  height: min(var(--habi-start-size), var(--habi-start-max));
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
  filter: drop-shadow(0 22px 20px rgba(0,0,0,.62)) drop-shadow(10px 0 18px rgba(215,139,59,.07));
}

.character-glow {
  position: absolute;
  z-index: 1;
  left: 56%;
  bottom: 6%;
  width: 46%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(215,139,59,.16), rgba(215,139,59,.04) 45%, transparent 70%);
  transform: translateX(-50%);
  filter: blur(6px);
  pointer-events: none;
}

.character-halo {
  position: absolute;
  left: 56%;
  bottom: 18%;
  width: 50%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(199,255,0,.13), rgba(199,255,0,.025) 42%, transparent 67%);
  transform: translateX(-50%);
  filter: blur(5px);
}

.character-platform {
  position: absolute;
  z-index: 1;
  left: 56%;
  bottom: 7.5%;
  width: 48%;
  height: 5.5%;
  border: 1px solid rgba(199,255,0,.2);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(199,255,0,.12), rgba(0,0,0,.7) 64%);
  box-shadow: 0 10px 28px rgba(0,0,0,.65), 0 7px 24px rgba(215,139,59,.08);
  transform: translateX(-50%);
}

.menu-data {
  display: grid;
  grid-template-columns: auto;
  gap: 10px 18px;
  width: min(360px, 100%);
  margin-top: clamp(22px, 2.6vw, 34px);
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.menu-player-card { display: none; min-width: 0; }
.menu-data span,
.menu-data dt,
.hud-primary > span,
.nickname span,
.hud-metric > span,
.result-metrics span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.menu-player-card strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: #fff;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-data dl {
  display: flex;
  gap: 28px;
  margin: 0;
}

.menu-data dl div { min-width: 58px; }
.menu-data dt,
.menu-data dd { margin: 0; }
.menu-data dd { margin-top: 4px; color: #fff; font-size: 18px; font-weight: 850; }
.menu-data .menu-best dd { color: var(--acid); }
.menu-data .menu-secondary { display: none; }
.menu-lives { display: none; }

.start-hotspot {
  position: relative;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  column-gap: 28px;
  width: min(260px, 100%);
  min-height: 54px;
  margin-top: 22px;
  padding: 8px 19px;
  border: 0;
  border-radius: 11px;
  background: var(--acid);
  color: #071006;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0,0,0,.3), 0 0 12px rgba(199,255,0,.06), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.start-hotspot:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,.34), 0 0 16px rgba(199,255,0,.1), inset 0 1px 0 rgba(255,255,255,.5);
}

.start-hotspot:active { transform: translateY(0); }
.start-hotspot:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.start-hotspot__label { font-size: 14px; font-weight: 950; letter-spacing: .08em; line-height: 1; text-transform: uppercase; }
.start-hotspot__arrow { grid-row: 1 / 3; grid-column: 2; font-size: 21px; transition: transform 180ms ease; }
.start-hotspot:hover .start-hotspot__arrow { transform: translateX(3px); }
.start-hotspot__meta { grid-column: 1; color: rgba(7,16,6,.66); font-size: 9px; font-weight: 850; line-height: 1.2; }

.start-copy > .start-hint { margin: 10px 0 0; color: rgba(229,235,222,.46); font-size: 10px; letter-spacing: .05em; }

.start-hotspot:disabled,
.start-hotspot.is-limit-ended {
  background: #4a5148;
  color: rgba(255,255,255,.76);
  cursor: default;
  filter: none;
  transform: none;
}

.start-hotspot.is-limit-ended .start-hotspot__meta { color: rgba(255,255,255,.58); }
.start-hotspot.limit-nudge { animation: limitNudge 380ms ease; }

.play-layout {
  display: none;
  grid-template-columns: minmax(0, 1fr) 224px;
  gap: 12px;
  padding: 12px;
}

.catch-app[data-screen="game"] .play-layout { display: grid; }
.catch-app[data-screen="game"] .start-scene,
.catch-app[data-screen="game"] .result-scene,
.catch-app[data-screen="result"] .start-scene,
.catch-app[data-screen="result"] .play-layout { display: none; }

.arena {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(220,230,211,.16);
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 50% 108%, rgba(199,255,0,.11), transparent 35%),
    radial-gradient(circle at 0 100%, rgba(215,139,59,.07), transparent 26%),
    linear-gradient(180deg, rgba(7,13,10,.98), rgba(2,6,4,.99));
  cursor: crosshair;
  box-shadow: inset 0 -32px 60px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.02);
}

.arena::before,
.arena::after {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.arena.is-catch { animation: catchPulse 300ms ease; }
.arena.is-miss { animation: missPulse 300ms ease; }

.arena::before {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,.45), transparent 10%, transparent 90%, rgba(0,0,0,.45)),
    radial-gradient(ellipse at 50% 9%, rgba(255,255,255,.025), transparent 42%);
}

.arena::after {
  left: 2.5%;
  right: 2.5%;
  bottom: 1.7%;
  height: 9%;
  border-top: 1px solid rgba(199,255,0,.4);
  border-radius: 50% 50% 8px 8px;
  background:
    radial-gradient(ellipse at 50% 0, rgba(215,139,59,.07), transparent 55%),
    linear-gradient(180deg, rgba(199,255,0,.06), rgba(12,15,11,.9) 38%, rgba(3,4,3,.95));
  box-shadow: 0 -4px 18px rgba(199,255,0,.06), 0 10px 22px rgba(213,125,48,.06);
}

.arena-floor {
  position: absolute;
  z-index: 2;
  left: 12%;
  right: 12%;
  bottom: calc(1.7% + 9% - 1px);
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(199,255,0,.55) 30%, rgba(199,255,0,.7) 50%, rgba(199,255,0,.55) 70%, transparent);
  box-shadow: 0 0 10px rgba(199,255,0,.18);
  opacity: .7;
  pointer-events: none;
}

.arena-grid {
  position: absolute;
  inset: 0;
  opacity: .34;
  background-image:
    linear-gradient(rgba(199,255,0,.085) 1px, transparent 1px),
    linear-gradient(90deg, rgba(199,255,0,.07) 1px, transparent 1px);
  background-size: 7.5% 9.5%;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.72), rgba(0,0,0,.2));
}

.arena-edge { position: absolute; z-index: 3; background: rgba(199,255,0,.48); pointer-events: none; }
.edge-top { top: 0; left: 9%; width: 21%; height: 1px; box-shadow: 0 0 10px rgba(199,255,0,.25); }
.edge-left { top: 8%; bottom: 48%; left: 0; width: 1px; background: linear-gradient(var(--acid), transparent); }
.edge-right { right: 0; bottom: 7%; width: 1px; height: 17%; background: linear-gradient(transparent, rgba(215,139,59,.55)); }

.catch-zone {
  position: absolute;
  z-index: 4;
  left: 7%;
  right: 7%;
  bottom: 3.4%;
  height: 1px;
  opacity: .55;
  background: linear-gradient(90deg, transparent, rgba(199,255,0,.8), transparent);
}

.dog {
  --dog-w: 220px;
  --dog-h: 330px;
  position: absolute;
  z-index: 7;
  bottom: 2.4%;
  left: 50%;
  width: var(--dog-w);
  height: var(--dog-h);
  pointer-events: none;
  transform: translateX(-50%);
  transition: left 45ms linear;
  filter: drop-shadow(0 16px 14px rgba(0,0,0,.66)) drop-shadow(-6px 4px 10px rgba(215,139,59,.07));
}

.dog::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 8%;
  right: 8%;
  bottom: -5%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(215,139,59,.22), rgba(215,139,59,.05) 48%, transparent 72%);
  filter: blur(4px);
}

.dog img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }

.logo-fall {
  --logo-size: 62px;
  position: absolute;
  z-index: 5;
  width: var(--logo-size);
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16%;
  background: transparent;
  box-shadow: 0 10px 18px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.025);
  filter: drop-shadow(0 0 8px rgba(199,255,0,.13));
  will-change: transform;
}

.logo-fall::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 0;
  height: 1px;
  background: var(--acid);
  opacity: .7;
}

.logo-fall img,
.logo-shatter img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.logo-shatter { position: absolute; z-index: 8; width: calc(var(--logo-size, 40px) * .24); height: calc(var(--logo-size, 40px) * .24); margin: calc(var(--logo-size, 40px) * -.12); pointer-events: none; opacity: 1; filter: drop-shadow(0 0 5px rgba(215,139,59,.35)); }
.logo-shatter.is-burst { animation: logoShatterBurst 420ms cubic-bezier(.22,.84,.32,1) forwards; }

.hud-rail {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 14px;
  border: 1px solid rgba(220,230,211,.1);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(18,23,20,.94), rgba(4,7,5,.98));
}

.hud-primary { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.hud-primary { order: 0; }
.hud-primary > strong { display: block; margin-top: 4px; color: var(--acid); font-size: clamp(50px, 4.4vw, 70px); font-weight: 900; letter-spacing: -.05em; line-height: .92; }
.hud-primary small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.hud-primary small b { color: #fff; }
.hud-side { display: contents; }
.nickname,
.hud-metric { padding: 10px 0; border-bottom: 1px solid var(--line); }
.nickname strong,
.field { display: block; margin-top: 5px; overflow: hidden; color: #fff; font-size: 16px; font-style: normal; font-weight: 800; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.hud-best { order: 1; }
.hud-lives { order: 2; }
.nickname { order: 3; }
.hud-rail .nickname span,
.hud-rail .hud-metric > span { color: var(--quiet); }
.hud-compact { order: 4; }
.hud-lives { position: relative; }
.hud-lives .lives-count { display: none; }
.life-shields { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.life-shields span,
.menu-lives span { position: relative; color: #e9ff9c; font-size: 14px; line-height: 1; transition: opacity 220ms ease, transform 220ms ease; }
.life-shields span.is-empty,
.menu-lives span.is-empty { color: rgba(229,235,222,.2); opacity: .6; transform: scale(.9); }
.attempts-inline { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; font-style: normal; font-weight: 700; }
.hud-balance,
.hud-level { display: none; }
.hud-control { order: 5; margin: auto 0 0; padding-top: 14px; color: rgba(229,235,222,.42); font-size: 9px; line-height: 1.5; }
.metric-pop { animation: metricKick 300ms ease; }

.result-scene {
  display: none;
  grid-template-columns: minmax(240px, .64fr) minmax(340px, 1fr);
  align-items: center;
  gap: clamp(30px, 5vw, 74px);
  padding: 36px clamp(42px, 7vw, 96px);
}

.catch-app[data-screen="result"] .result-scene { display: grid; }
.result-visual { align-self: stretch; position: relative; min-width: 0; }
.result-visual img { position: absolute; inset: -15% 0 -18%; width: 100%; height: 133%; object-fit: cover; object-position: 50% 72%; opacity: .78; filter: saturate(.72) contrast(.94) brightness(.86); mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 78%, transparent), linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-composite: intersect; -webkit-mask-composite: source-in; }
.result-panel { position: relative; z-index: 2; }
.result-panel h2 { margin-top: 8px; font-size: clamp(52px, 5.8vw, 84px); }
.result-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 28px; border-block: 1px solid var(--line); }
.result-metrics div { padding: 13px 18px 13px 0; }
.result-metrics div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.result-metrics strong { display: block; margin-top: 4px; color: #fff; font-size: 29px; line-height: 1; }
.result-metrics div:first-child strong { color: var(--acid); }
.result-copy { min-height: 34px; margin-top: 13px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.restart-hotspot { margin-top: 17px; }
.result-back { display: inline-block; margin-top: 12px; padding: 6px 2px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-decoration: none; transition: color 160ms ease; }
.result-back:hover { color: #fff; }
.result-back:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 4px; }

.touch-controls { display: none; }
.ctrl { min-width: 54px; min-height: 54px; }

@keyframes logoShatterBurst {
  to { opacity: 0; transform: translate3d(var(--dx), var(--dy), 0) scale(.25) rotate(var(--rot)); }
}

@keyframes metricKick {
  35% { transform: translateY(-1px) scale(1.06); filter: brightness(1.15); }
}

@keyframes catchPulse {
  45% { border-color: rgba(199,255,0,.42); box-shadow: inset 0 0 44px rgba(199,255,0,.075), 0 0 16px rgba(199,255,0,.06); }
}

@keyframes missPulse {
  45% { border-color: rgba(215,139,59,.48); box-shadow: inset 0 0 44px rgba(215,139,59,.08), 0 0 16px rgba(215,139,59,.055); }
}

@keyframes limitNudge {
  25% { transform: translateX(-5px); }
  55% { transform: translateX(5px); }
  78% { transform: translateX(-2px); }
}

@media (max-width: 900px) {
  .catch-shell { padding-inline: 12px; }
  .scene-frame { width: min(calc((100dvh - 90px) * 1.5), calc(100vw - 24px)); aspect-ratio: 3 / 2; }
  .start-scene { padding-inline: 42px; }
  .start-copy h2 { font-size: clamp(48px, 8vw, 70px); }
  .play-layout { grid-template-columns: minmax(0, 1fr) 188px; }
  .hud-rail { padding-inline: 14px; }
}

@media (max-width: 700px) {
  .catch-app {
    min-height: 100dvh;
    --habi-start-max: 280px;
    --habi-game-ratio: .34;
    --habi-game-min: 110;
    --habi-game-max: 230;
    --falling-object-ratio: .118;
    --falling-object-min: 40;
    --falling-object-max: 52;
  }
  .catch-app[data-screen="menu"] .game-head,
  .catch-app[data-screen="loading"] .game-head { display: none; }
  .catch-app[data-screen="menu"] .scene-frame { flex: 1 1 auto; height: auto; }
  .catch-shell { gap: 8px; padding: max(8px, env(safe-area-inset-top)) 0 max(8px, env(safe-area-inset-bottom)); }
  .game-head { min-height: 44px; padding: 0 14px; align-items: center; }
  .game-head h1 { font-size: 27px; }
  .game-kicker { display: none; }
  .game-hint { font-size: 9px; max-width: 100px; text-align: right; }
  .scene-frame { width: 100%; height: calc(100dvh - 52px); min-height: 0; aspect-ratio: auto; border-inline: 0; border-bottom: 0; border-radius: 14px 14px 0 0; }
  .scene-frame::after { box-shadow: inset 0 0 42px rgba(0,0,0,.34); }
  .start-scene { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; gap: 0; padding: 22px 20px max(28px, env(safe-area-inset-bottom)); }
  .start-copy { grid-row: 2; display: flex; flex-direction: column; align-items: center; text-align: center; }
  .start-copy h2 { font-size: clamp(52px, 16vw, 70px); }
  .start-copy > p { margin-top: 8px; font-size: 13px; }
  .start-character { grid-row: 1; height: min(290px, 36dvh); min-height: 150px; margin: 0 -20px 14px; }
  .start-character img { left: 50%; bottom: -2px; height: min(100%, var(--habi-start-max)); }
  .character-halo { left: 50%; bottom: 14%; width: min(56vw, 230px); }
  .character-glow { left: 50%; bottom: 0; width: min(46vw, 180px); height: 22px; }
  .character-platform { left: 50%; bottom: 6px; width: min(48vw, 190px); height: 16px; }
  .start-hint { display: none; }
  .menu-data { grid-template-columns: 1fr; gap: 10px; width: 100%; margin-top: 17px; padding-top: 11px; }
  .menu-player-card { display: none; }
  .menu-data dl { justify-content: center; gap: 0; }
  .menu-data dl div { min-width: 88px; padding: 0 14px; }
  .menu-data dl div + div { border-left: 1px solid var(--line); }
  .menu-data dl div:nth-child(n+4) { display: none; }
  .menu-data dd { font-size: 17px; }
  .start-hotspot { width: min(280px, 90vw); min-height: 52px; margin-top: 16px; }
  .play-layout { grid-template-columns: 1fr; grid-template-rows: 84px minmax(0, 1fr); gap: 7px; padding: 0 8px 78px; }
  .arena { grid-row: 2; border-radius: 11px; cursor: none; }
  .hud-rail { grid-row: 1; display: grid; grid-template-columns: 1.12fr .95fr 1fr; gap: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
  .hud-primary,
  .nickname,
  .hud-metric { min-width: 0; padding: 10px 10px 8px; border: 0; border-right: 1px solid var(--line); }
  .hud-primary { display: block; }
  .hud-primary > strong { margin-top: 3px; font-size: 31px; }
  .hud-primary small { display: none; }
  .hud-side { display: contents; }
  .nickname,
  .hud-balance,
  .hud-level,
  .hud-compact { display: none; }
  .hud-lives { grid-column: 2; grid-row: 1; }
  .hud-best { grid-column: 3; grid-row: 1; border-right: 0; }
  .hud-best .field { font-size: 24px; }
  .life-shields { gap: 3px; margin-top: 8px; }
  .life-shields span { font-size: 15px; }
  .attempts-inline { margin-top: 5px; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  .hud-control { display: none; }
  .dog { bottom: 2%; filter: drop-shadow(0 14px 13px rgba(0,0,0,.65)); }
  .logo-fall { padding: calc(var(--logo-size) * .04); }
  .touch-controls { position: fixed; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 20; display: none; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 10px; width: min(330px, calc(100vw - 28px)); transform: translateX(-50%); }
  .catch-app[data-screen="game"] .touch-controls { display: grid; }
  .ctrl { display: grid; place-items: center; min-width: 56px; min-height: 56px; padding: 0; border: 1px solid rgba(199,255,0,.24); border-radius: 50%; background: rgba(12,16,13,.92); color: var(--acid); box-shadow: 0 10px 24px rgba(0,0,0,.38), inset 0 0 0 1px rgba(255,255,255,.025); }
  .ctrl span { font-size: 23px; transition: transform 100ms ease; }
  .ctrl:active span { transform: scale(.9); }
  .ctrl:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
  .touch-label { color: rgba(229,235,222,.48); font-size: 9px; font-weight: 750; letter-spacing: .12em; text-align: center; text-transform: uppercase; }
  .result-scene { grid-template-columns: 1fr; grid-template-rows: minmax(190px, 1fr) auto; gap: 8px; padding: 12px 22px 108px; }
  .result-visual { grid-row: 1; min-height: 190px; }
  .result-visual img { inset: -14% 4% -14%; width: 92%; height: 128%; object-fit: cover; object-position: 50% 76%; }
  .result-panel { grid-row: 2; text-align: center; }
  .result-panel h2 { font-size: clamp(48px, 14vw, 62px); }
  .result-metrics { margin-top: 18px; }
  .result-metrics div { padding: 10px; }
  .result-metrics strong { font-size: 25px; }
  .result-copy { min-height: 28px; margin-top: 10px; font-size: 10px; }
  .restart-hotspot { width: min(290px, calc(100vw - 40px)); margin: 12px auto 0; }
}

@media (max-width: 430px) and (max-height: 760px) {
  .catch-app { --habi-start-max: 220px; }
  .start-character { min-height: 130px; }
  .start-copy h2 { font-size: 49px; }
  .menu-data { margin-top: 11px; }
  .start-hotspot { margin-top: 10px; }
  .play-layout { grid-template-rows: 76px minmax(0,1fr); }
  .hud-primary,
  .nickname,
  .hud-metric { padding-top: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
