  * { margin: 0; padding: 0; box-sizing: border-box; }

  body {
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(#1b2a4a 0%, #2c3e6b 55%, #3c5a4f 55.5%, #243b33 100%);
    font-family: system-ui, sans-serif;
    touch-action: none; /* не даём браузеру скроллить/зумить от пальца */
  }

  /* ---- ЛУНА И ЗВЁЗДЫ ---- */
  .moon {
    position: absolute; top: 40px; right: 80px;
    width: 90px; height: 90px; border-radius: 50%;
    background: #f4f1de;
    box-shadow: 0 0 40px 12px rgba(244,241,222,.35);
  }
  .star {
    position: absolute; width: 3px; height: 3px; border-radius: 50%;
    background: #fff; opacity: .8;
    animation: twinkle 2s infinite alternate;
  }
  .star:nth-child(2) { animation-delay: .5s; }
  .star:nth-child(3) { animation-delay: 1s; }
  .star:nth-child(4) { animation-delay: 1.4s; }
  @keyframes twinkle { from { opacity: .25; } to { opacity: 1; } }

  /* ---- ТРАВА (скроллится, когда гриб идёт) ---- */
  .ground {
    position: absolute; bottom: 0; width: 100%; height: 45px;
    background: #2f4a3a;
    border-top: 3px solid #41604b;
  }
  .grass {
    position: absolute; bottom: 44px; left: 0;
    width: 200vw; height: 22px;
    display: flex; align-items: flex-end;
    animation: scroll 1.4s linear infinite;
    animation-play-state: paused;
  }
  .grass.moving-left  { animation-direction: reverse; animation-play-state: running; }
  .grass.moving-right { animation-direction: normal;  animation-play-state: running; }
  .blade {
    flex: 0 0 auto; width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 18px solid #3d5c46;
    margin: 0 7px;
  }
  .blade:nth-child(odd) { border-bottom-color: #466a4f; border-bottom-width: 24px; }
  .blade:nth-child(3n)  { border-bottom-width: 13px; }
  @keyframes scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50vw); }
  }

  /* ---- ПОЛОСКИ ЖИЗНИ ---- */
  .hp {
    position: absolute; top: 16px; z-index: 10;
    display: flex; align-items: center; gap: 8px;
    color: #fff; font-size: 14px; user-select: none;
  }
  .hp .track {
    width: 220px; height: 18px;
    background: rgba(0,0,0,.5);
    border: 2px solid rgba(255,255,255,.35);
    border-radius: 9px; overflow: hidden;
  }
  .hp .fill {
    height: 100%; width: 100%;
    background: linear-gradient(#7ee06a, #3fa332);
    transition: width .15s;
  }
  .hp .fill.hurt { background: linear-gradient(#f0c04a, #d97a2a); }
  .hp .fill.crit { background: linear-gradient(#f06a5a, #c03a2a); }
  /* полоска гриба — в правом верхнем углу (по центру там таймер) */
  .hp.mush { left: auto; right: 16px; top: 16px; transform: none; }
  .hp.sq {
    position: absolute; top: -34px; left: 50%; transform: translateX(-50%);
    width: 110px; top: -30px;
  }
  .hp.sq .track { width: 100px; height: 12px; }
  .hp.sq .label { font-size: 11px; }

  /* ---- ГРИБ ---- */
  .mushroom {
    position: absolute; bottom: 44px; left: 0;
    width: 220px; height: 300px;
    will-change: transform;
  }
  .mushroom.hit .body { filter: brightness(1.4) sepia(.6) hue-rotate(-30deg) saturate(3); }
  .flip {
    position: absolute; inset: 0;
    transform-origin: 50% 100%;
  }
  /* обёртка спрайта гриба: на мобильном масштабируется (см. мобильный блок) */
  .flip .sprite {
    position: absolute; inset: 0;
    transform-origin: 50% 100%;
  }
  .squirrel .sprite { transform-origin: 50% 100%; }

  .body {
    position: absolute; inset: 0;
    transform-origin: 50% 100%;
  }
  .walking .body { animation: bob .35s ease-in-out infinite alternate; }
  @keyframes bob {
    from { transform: translateY(0) rotate(-2deg); }
    to   { transform: translateY(-10px) rotate(2deg); }
  }

  /* ШАПКА */
  .cap {
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 210px; height: 120px;
    background: radial-gradient(circle at 35% 30%, #e2504a, #b5322e 70%);
    border-radius: 50% 50% 45% 45% / 95% 95% 55% 55%;
    box-shadow: inset -12px -10px 24px rgba(0,0,0,.25);
    z-index: 3;
  }
  .spot { position: absolute; background: #f6e9d8; border-radius: 50%;
    box-shadow: inset -3px -3px 6px rgba(0,0,0,.15); }
  .spot1 { width: 34px; height: 30px; top: 22px; left: 34px; }
  .spot2 { width: 26px; height: 22px; top: 52px; left: 92px; }
  .spot3 { width: 40px; height: 34px; top: 30px; left: 148px; }
  .spot4 { width: 18px; height: 16px; top: 82px; left: 26px; }
  .spot5 { width: 20px; height: 18px; top: 84px; left: 160px; }

  /* НОЖКА (тело) */
  .stem {
    position: absolute; top: 95px; left: 50%; transform: translateX(-50%);
    width: 120px; height: 140px;
    background: linear-gradient(#f3e6cf, #d9c4a0);
    border-radius: 20px 20px 34px 34px;
    z-index: 2;
    box-shadow: inset -14px 0 20px rgba(0,0,0,.12);
  }

  /* ЛИЦО */
  .eye {
    position: absolute; top: 118px; width: 34px; height: 40px;
    background: #fff; border-radius: 50%;
    z-index: 4;
    animation: blink 4s infinite;
  }
  .eye.left  { left: 74px; }
  .eye.right { left: 112px; }
  @keyframes blink {
    0%, 94%, 100% { transform: scaleY(1); }
    96%           { transform: scaleY(.08); }
  }
  .pupil {
    position: absolute; top: 14px; left: 9px;
    width: 14px; height: 16px; background: #1c1c1c; border-radius: 50%;
  }
  .walking .pupil { animation: look .35s ease-in-out infinite alternate; }
  @keyframes look {
    from { transform: translateX(0); }
    to   { transform: translateX(5px); }
  }
  .brow {
    position: absolute; top: 106px; width: 40px; height: 8px;
    background: #7a4a2b; border-radius: 4px; z-index: 5;
  }
  .brow.left  { left: 70px; transform: rotate(8deg); }
  .brow.right { left: 108px; transform: rotate(-8deg); }
  .struck .brow.left  { transform: rotate(24deg); }
  .struck .brow.right { transform: rotate(-24deg); }
  .mouth {
    position: absolute; top: 168px; left: 50%; transform: translateX(-50%);
    width: 44px; height: 20px;
    border-bottom: 4px solid #7a4a2b;
    border-radius: 0 0 40px 40px;
    z-index: 4;
  }
  .struck .mouth { width: 26px; height: 26px; border: 4px solid #7a4a2b; border-radius: 50%; background: #5a2020; }

  /* РУКИ */
  .arm {
    position: absolute; top: 135px; width: 46px; height: 20px;
    background: #e5d3b3; border-radius: 10px; z-index: 3;
    transform-origin: 0 50%;
  }
  .arm.left  { left: 20px; transform: rotate(28deg); }
  .arm.right { right: 20px; transform: rotate(178deg); transform-origin: 100% 50%; }
  .walking .arm.left  { animation: armL .35s ease-in-out infinite alternate; }
  .walking .arm.right { animation: armR .35s ease-in-out infinite alternate; }
  @keyframes armL { from { transform: rotate(18deg); } to { transform: rotate(42deg); } }
  @keyframes armR { from { transform: rotate(172deg); } to { transform: rotate(196deg); } }

  /* ЛОЖКА в правой руке */
  .spoon {
    position: absolute; right: 30px; top: 146px;
    width: 124px; height: 44px; z-index: 5;
    transform-origin: 10px 22px;
    animation: idleSwing 2.4s ease-in-out infinite;
  }
  .struck .spoon { animation: strike .3s ease-out; }
  @keyframes idleSwing {
    0%, 100% { transform: rotate(30deg); }
    50%      { transform: rotate(14deg); }
  }
  @keyframes strike {
    0%   { transform: rotate(55deg); }
    35%  { transform: rotate(-75deg); }
    100% { transform: rotate(30deg); }
  }
  /* длинная ручка */
  .spoon .handle {
    position: absolute; left: 0; top: 18px;
    width: 82px; height: 8px;
    background: linear-gradient(#d6dee8, #8f9aa8);
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0,0,0,.3);
  }
  .spoon .handle::before {
    /* наконечник-накрутка на конце ручки */
    content: ''; position: absolute; right: -6px; top: -3px;
    width: 12px; height: 14px;
    background: linear-gradient(#c3ccd8, #7f8a99);
    border-radius: 6px 10px 10px 6px;
  }
  /* ложка-чашка */
  .spoon .bowl {
    position: absolute; left: 78px; top: 2px;
    width: 46px; height: 40px;
    background: radial-gradient(circle at 35% 30%, #eef3f8, #9aa6b6 78%);
    border-radius: 50%;
    box-shadow: inset -5px -6px 10px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.35);
  }
  .spoon .bowl::after {
    /* вогнутый блик внутри */
    content: ''; position: absolute; top: 8px; left: 12px;
    width: 22px; height: 16px;
    background: rgba(255,255,255,.5);
    border-radius: 50%;
    transform: rotate(-15deg);
  }

  /* НОГИ */
  .leg {
    position: absolute; bottom: 26px; width: 20px; height: 42px;
    background: #e5d3b3; border-radius: 10px 10px 12px 12px; z-index: 1;
    transform-origin: top center;
  }
  .leg.left  { left: 82px; }
  .leg.right { left: 118px; }
  .walking .leg.left  { animation: stepL .35s ease-in-out infinite; }
  .walking .leg.right { animation: stepR .35s ease-in-out infinite; }
  @keyframes stepL { 0%,100% { transform: rotate(26deg); } 50% { transform: rotate(-22deg); } }
  @keyframes stepR { 0%,100% { transform: rotate(-22deg); } 50% { transform: rotate(26deg); } }
  .foot {
    position: absolute; bottom: -8px; left: -8px;
    width: 34px; height: 14px; background: #b0895c; border-radius: 8px 14px 6px 6px;
  }

  /* ПЫЛЬ ЗА СПИНОЙ */
  .dust {
    position: absolute; bottom: 10px; left: 60px;
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(255,255,255,.35);
    opacity: 0;
  }
  .dust.d2 { left: 40px; }
  .walking .dust { animation: puff .7s infinite; }
  .walking .dust.d2 { animation-delay: .3s; }
  @keyframes puff {
    from { transform: translate(0,0) scale(1); opacity: .5; }
    to   { transform: translate(-40px,-20px) scale(2.4); opacity: 0; }
  }

  /* ТЕНЬ */
  .shadow {
    position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 170px; height: 16px; border-radius: 50%;
    background: rgba(0,0,0,.3);
    z-index: 0;
  }

  /* ---- БЕЛКА ---- */
  .squirrel {
    position: absolute; bottom: 44px; left: 0;
    width: 110px; height: 130px;
    will-change: transform;
  }
  .squirrel.dead { display: none; }
  .squirrel .flipper {
    position: absolute; inset: 0;
    transform-origin: 50% 100%;
  }
  .squirrel .sprite {
    position: absolute; inset: 0;
    transform-origin: 50% 100%;
  }
  .squirrel.pooping .sprite { animation: squat .3s ease-out; }
  @keyframes squat {
    0%   { transform: scaleY(1) rotate(0deg); }
    40%  { transform: scaleY(.78) rotate(4deg); }
    100% { transform: scaleY(1) rotate(0deg); }
  }
  .squirrel.hurt .sprite { filter: brightness(1.5) sepia(.7) hue-rotate(-25deg) saturate(3); }

  /* крик белки перед выстрелом */
  .shout {
    position: absolute; top: -78px; left: 50%; transform: translateX(-50%);
    display: none; white-space: nowrap;
    color: #ffe082; font-weight: 900; font-size: 19px;
    text-shadow: 0 2px 0 #7a2a1a, 0 0 12px rgba(255,120,40,.6);
    animation: shoutPop .85s ease-in-out infinite;
    z-index: 6;
  }
  .squirrel.strain .shout { display: block; }
  @keyframes shoutPop {
    0%   { transform: translateX(-50%) scale(.4) rotate(-6deg); opacity: 0; }
    30%  { transform: translateX(-50%) scale(1.15) rotate(3deg); opacity: 1; }
    100% { transform: translateX(-50%) scale(1) rotate(-2deg); opacity: 1; }
  }

  /* ---- НАПРЯЖЕНИЕ БЕЛКИ ПЕРЕД ВЫСТРЕЛОМ ---- */
  .sq-squint, .sq-grimace, .sq-vein, .sq-sweat, .sq-cheek { display: none; }
  .squirrel.strain .sq-squint, .squirrel.strain .sq-grimace,
  .squirrel.strain .sq-vein, .squirrel.strain .sq-sweat,
  .squirrel.strain .sq-cheek { display: block; }
  .squirrel.strain .sq-eye { display: none; }
  .squirrel.strain .sq-teeth { opacity: 0; }
  .squirrel.strain .sprite { animation: squirm .16s ease-in-out infinite alternate; }
  @keyframes squirm {
    from { transform: scaleY(.84) rotate(-3deg); }
    to   { transform: scaleY(.76) rotate(3deg); }
  }
  .squirrel.strain .sq-tail { animation: tailRage .1s ease-in-out infinite alternate; }
  @keyframes tailRage {
    from { transform: rotate(-32deg) scale(1.2); }
    to   { transform: rotate(-8deg) scale(1.35); }
  }
  .squirrel.strain .sq-ear { transform: rotate(-30deg); }
  .squirrel.strain .sq-ear.inner { transform: rotate(25deg); }
  .squirrel.strain .sq-head { background: radial-gradient(circle at 40% 35%, #c9702a, #8f351c 80%); }
  /* зажмуренные глаза */
  .sq-squint {
    position: absolute; top: 17px; left: 28px;
    width: 12px; height: 7px;
    border-bottom: 3px solid #1c1c1c;
    border-radius: 0 0 10px 10px;
  }
  /* оскал со стиснутыми зубами */
  .sq-grimace {
    position: absolute; top: 27px; left: 36px;
    width: 16px; height: 12px;
    background: #3d1a10; border-radius: 3px 3px 6px 6px;
    overflow: hidden;
  }
  .sq-grimace::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px;
    background: repeating-linear-gradient(90deg, #fff 0 3px, #3d1a10 3px 4px);
  }
  /* вена на виске */
  .sq-vein::before {
    content: '✚'; position: absolute; top: 2px; left: 2px;
    color: #e03a2a; font-size: 15px; line-height: 1;
    animation: veinPulse .22s ease-in-out infinite alternate;
  }
  @keyframes veinPulse {
    from { transform: scale(.8); opacity: .6; }
    to   { transform: scale(1.3); opacity: 1; }
  }
  /* капли пота */
  .sq-sweat {
    position: absolute; top: 6px; left: 46px;
    width: 8px; height: 11px;
    background: #9fd8ff;
    border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
    animation: sweatDrop .7s ease-in infinite;
  }
  @keyframes sweatDrop {
    0%   { transform: translateY(0) scale(.7); opacity: 0; }
    25%  { opacity: 1; transform: translateY(4px) scale(1); }
    100% { transform: translateY(22px) scale(1); opacity: 0; }
  }
  /* красные щёки */
  .sq-cheek {
    position: absolute; top: 24px; left: 24px;
    width: 11px; height: 9px;
    background: rgba(226, 74, 50, .65); border-radius: 50%;
    animation: veinPulse .22s ease-in-out infinite alternate;
  }
  .sq-tail {
    position: absolute; bottom: 20px; left: -6px;
    width: 52px; height: 92px;
    background: radial-gradient(circle at 30% 30%, #b5722f, #7c4a1d 75%);
    border-radius: 60% 40% 50% 50% / 80% 80% 40% 40%;
    transform: rotate(-18deg);
    animation: tailSwish 1.2s ease-in-out infinite alternate;
    transform-origin: bottom center;
  }
  @keyframes tailSwish {
    from { transform: rotate(-18deg); }
    to   { transform: rotate(-4deg); }
  }
  .sq-body {
    position: absolute; bottom: 12px; left: 26px;
    width: 62px; height: 68px;
    background: radial-gradient(circle at 40% 30%, #a96a2c, #7c4a1d 80%);
    border-radius: 50% 50% 45% 45%;
  }
  .sq-belly {
    position: absolute; bottom: 14px; left: 42px;
    width: 34px; height: 46px;
    background: #d8b183; border-radius: 50%;
  }
  .sq-head {
    position: absolute; top: 8px; left: 44px;
    width: 48px; height: 44px;
    background: radial-gradient(circle at 40% 35%, #a96a2c, #7c4a1d 80%);
    border-radius: 50%;
    z-index: 2;
  }
  .sq-ear {
    position: absolute; top: -10px; left: 8px;
    width: 16px; height: 18px;
    background: #7c4a1d; border-radius: 50% 50% 40% 40%;
  }
  .sq-ear.inner { left: 22px; background: #6a3d15; }
  .sq-eye {
    position: absolute; top: 16px; left: 30px;
    width: 8px; height: 10px; background: #1c1c1c; border-radius: 50%;
  }
  .sq-nose {
    position: absolute; top: 24px; left: 44px;
    width: 7px; height: 6px; background: #3d2210; border-radius: 50%;
  }
  .sq-teeth {
    position: absolute; top: 30px; left: 38px;
    width: 8px; height: 8px; background: #fff;
    border-radius: 0 0 3px 3px;
  }
  .sq-paw {
    position: absolute; bottom: 40px; left: 56px;
    width: 16px; height: 26px;
    background: #8a5526; border-radius: 8px;
    transform: rotate(24deg);
    transform-origin: top center;
    animation: pawHold 1.2s ease-in-out infinite alternate;
  }
  @keyframes pawHold { from { transform: rotate(24deg); } to { transform: rotate(34deg); } }
  .sq-leg {
    position: absolute; bottom: 0; width: 12px; height: 22px;
    background: #8a5526; border-radius: 6px;
  }
  .sq-leg.l { left: 34px; }
  .sq-leg.r { left: 66px; }

  /* ---- ШИШКА В ГОВНЕ (снаряд) ---- */
  .cone {
    position: absolute; top: 0; left: 0;
    width: 32px; height: 38px;
    z-index: 8;
    will-change: transform;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,.4));
  }
  .cone::before {
    content: ''; position: absolute; inset: 0;
    background:
      radial-gradient(circle at 30% 25%, #8a5a2e 2px, transparent 3px),
      radial-gradient(circle at 65% 30%, #8a5a2e 2px, transparent 3px),
      radial-gradient(circle at 45% 55%, #7c4a20 2px, transparent 3px),
      radial-gradient(circle at 25% 75%, #7c4a20 2px, transparent 3px),
      radial-gradient(circle at 70% 78%, #8a5a2e 2px, transparent 3px),
      radial-gradient(circle at 48% 20%, #a06a35, #5e3a18 80%);
    border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  }
  /* облеплено зёлком */
  .cone .poop {
    position: absolute; inset: -1px;
    background:
      radial-gradient(ellipse 9px 12px at 45% 8%, #6f8a2c 60%, transparent 68%),
      radial-gradient(circle 5px at 22% 30%, #5c7a28 70%, transparent 78%),
      radial-gradient(circle 6px at 68% 26%, #7c9433 65%, transparent 75%),
      radial-gradient(circle 5px at 35% 58%, #55702a 70%, transparent 78%),
      radial-gradient(circle 6px at 72% 62%, #6b862e 65%, transparent 75%),
      radial-gradient(ellipse 8px 10px at 50% 95%, #4e6a26 65%, transparent 75%),
      radial-gradient(circle 4px at 15% 80%, #5c7a28 70%, transparent 78%);
    filter: drop-shadow(0 1px 1px rgba(40,60,10,.5));
  }
  /* хвост из капель */
  .cone .trail {
    position: absolute; right: 92%; top: 15px;
    width: 64px; height: 12px;
    background: linear-gradient(90deg, transparent 5%, rgba(107,134,46,.8) 90%);
    border-radius: 6px;
    filter: blur(.5px);
  }
  .cone .trail::before, .cone .trail::after {
    content: ''; position: absolute; border-radius: 50%;
    background: rgba(92,122,40,.8);
  }
  .cone .trail::before { left: 8px; top: -3px; width: 7px; height: 7px; }
  .cone .trail::after  { left: -8px; top: 2px; width: 9px; height: 9px; }
  /* брызги при попадании */
  .splat {
    position: absolute; width: 52px; height: 44px; z-index: 7;
    background:
      radial-gradient(ellipse 30px 24px at 45% 45%, #6f8a2c 25%, #55702a 48%, transparent 68%),
      radial-gradient(circle 10px at 78% 30%, #5c7a28 65%, transparent 75%),
      radial-gradient(circle 8px  at 15% 70%, #4e6a26 65%, transparent 75%),
      radial-gradient(circle 7px  at 85% 78%, #6b862e 60%, transparent 70%);
    animation: splatPop .65s ease-out forwards;
    pointer-events: none;
  }
  @keyframes splatPop {
    0%   { transform: scale(.15); opacity: 1; }
    55%  { transform: scale(1.1); opacity: .95; }
    100% { transform: scale(1.35); opacity: 0; }
  }

  /* ---- ПОДСКАЗКА / GAME OVER ---- */
  .hint {
    position: absolute; top: 16px; left: 16px; z-index: 10;
    color: #dfe6f5; font-size: 14px; line-height: 1.7;
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 10px; padding: 10px 14px;
    user-select: none;
  }
  .hint b { color: #fff; }
  kbd {
    display: inline-block; padding: 1px 7px; margin: 0 2px;
    background: #2c3e6b; border: 1px solid #5a6f9e; border-bottom-width: 3px;
    border-radius: 5px; font-family: inherit; font-size: 12px;
  }
  .gameover {
    position: absolute; inset: 0; z-index: 20;
    display: none;
    align-items: center; justify-content: center; flex-direction: column;
    background: rgba(10,10,25,.7);
    color: #fff; text-align: center;
  }
  .gameover.show { display: flex; }
  .gameover h1 { font-size: 44px; margin-bottom: 12px; }
  .gameover p  { font-size: 18px; opacity: .8; }
  /* победный и проигрышный вердикты */
  .gameover.win h1  { color: #ffd24a; text-shadow: 0 0 24px rgba(255,210,74,.7); }
  .gameover.lose h1 { color: #9fb2d8; font-size: 34px; }

  /* ---- HUD: таймер выживания + счётчики ---- */
  .hud {
    position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
    z-index: 10; text-align: center; pointer-events: none;
    background: rgba(0,0,0,.4);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 12px; padding: 6px 22px;
    color: #fff; user-select: none;
  }
  .hud .timer {
    font-size: 26px; font-weight: 900; line-height: 1.2;
    font-variant-numeric: tabular-nums;
  }
  .hud .timer.urgent {
    color: #ff6b6b;
    animation: urgentPulse .5s ease-in-out infinite alternate;
  }
  @keyframes urgentPulse {
    from { transform: scale(1); }
    to   { transform: scale(1.15); }
  }
  .hud .score { font-size: 14px; opacity: .9; }

  /* ---- ПОЕДАНИЕ ШИШКИ ---- */
  .mushroom.eating .mouth {
    width: 30px; height: 34px;
    border: 4px solid #7a4a2b; border-radius: 50%;
    background: #5a2020;
  }
  .mushroom.eating .body { animation: gulp .45s ease-out; }
  @keyframes gulp {
    0%   { transform: translateY(0) scaleY(1); }
    30%  { transform: translateY(8px) scaleY(.9); }
    100% { transform: translateY(0) scaleY(1); }
  }
  /* всплывающий текст лечения */
  .healtext {
    position: absolute; z-index: 9;
    color: #8ef58a; font-weight: 700; font-size: 20px;
    text-shadow: 0 1px 3px #000;
    white-space: nowrap;
    animation: rise .9s ease-out forwards;
    pointer-events: none;
  }
  @keyframes rise {
    from { transform: translateY(0); opacity: 1; }
    to   { transform: translateY(-60px); opacity: 0; }
  }

  /* ---- КРИК ГРИБА (над шляпкой) ---- */
  .mushroom .shout { top: -74px; color: #a8f0a0; }
  .mushroom.yell .shout { display: block; }

  /* ---- КРИК БЕЛКИ-БЕШЕНОЙ (выше обычного) ---- */
  .squirrel .shout.shout2 { top: -112px; color: #ffd24a; }
  .squirrel.furious .shout.shout2 { display: block; }
  /* белка без хвоста: хвост ВИДНО, как он отрывается — дёргается и летит */
  .squirrel.no-tail .sq-tail {
    animation: tailTear .45s ease-in forwards;
  }
  @keyframes tailTear {
    0%   { opacity: 1; transform: rotate(-18deg) scale(1); }
    30%  { opacity: 1; transform: rotate(28deg) scale(1.22); }
    100% { opacity: 0; transform: rotate(80deg) scale(.2) translateY(34px); }
  }
  /* бешеная белка дергается */
  .squirrel.furious .sprite { filter: saturate(1.4) brightness(1.05); }

  /* ---- ХВОСТ КАК СНАРЯД (коричневый, без зёлка) ---- */
  .cone.tail .poop { display: none; }
  .cone.tail::before {
    background:
      radial-gradient(circle at 40% 30%, #b5722f 30%, transparent 40%),
      radial-gradient(circle at 60% 60%, #7c4a1d 40%, transparent 50%),
      radial-gradient(circle at 48% 20%, #a96a2c, #5e3a18 85%);
    border-radius: 55% 45% 60% 40% / 70% 70% 30% 30%;
  }
  .cone.tail .trail {
    background: linear-gradient(90deg, transparent 5%, rgba(181,114,47,.8) 90%);
  }
  .cone.tail .trail::before, .cone.tail .trail::after { background: rgba(140,85,38,.8); }

  /* ---- КРЫСА НА ШЛЯПКЕ ГРИБА ---- */
  .rat {
    position: absolute; top: -34px; left: 50%; transform: translateX(-50%);
    width: 46px; height: 34px; z-index: 6;
    animation: ratSquirm .25s ease-in-out infinite alternate;
  }
  @keyframes ratSquirm {
    from { transform: translateX(-50%) scaleY(1) rotate(-2deg); }
    to   { transform: translateX(-50%) scaleY(.85) rotate(3deg); }
  }
  .rat .rat-body {
    position: absolute; bottom: 4px; left: 0;
    width: 34px; height: 22px;
    background: radial-gradient(circle at 35% 30%, #9a9aa5, #5c5c66 75%);
    border-radius: 50%;
  }
  .rat .rat-head {
    position: absolute; bottom: 10px; left: 28px;
    width: 18px; height: 15px;
    background: #6d6d78; border-radius: 50%;
  }
  .rat .rat-ear {
    position: absolute; bottom: 23px; left: 30px;
    width: 8px; height: 8px;
    background: #b06a7a; border-radius: 50%;
  }
  .rat .rat-eye {
    position: absolute; bottom: 17px; left: 40px;
    width: 3px; height: 3px; background: #1c1c1c; border-radius: 50%;
  }
  .rat .rat-tail {
    position: absolute; bottom: 8px; left: -12px;
    width: 16px; height: 4px;
    background: #7c7c86; border-radius: 2px;
    transform: rotate(25deg);
  }

  /* ---- СОВЫ (крупные, чтобы было видно) ---- */
  .owl {
    position: absolute; top: 0; left: 0;
    width: 120px; height: 100px; z-index: 6;
    will-change: transform;
    filter: drop-shadow(0 0 10px rgba(255,230,180,.18));
  }
  .owl .sprite { position: absolute; inset: 0; transform-origin: 50% 100%; }
  .owl .body {
    position: absolute; bottom: 0; left: 15px;
    width: 90px; height: 75px;
    background: radial-gradient(circle at 35% 30%, #a5825c, #6e5233 75%);
    border-radius: 50% 50% 45% 45%;
  }
  .owl .body::after {
    /* грудка */
    content: ''; position: absolute; bottom: 5px; left: 21px;
    width: 48px; height: 44px;
    background: #d6bd93; border-radius: 50%;
  }
  .owl .ear {
    position: absolute; top: 0; width: 0; height: 0;
    border-left: 13px solid transparent;
    border-right: 13px solid transparent;
    border-bottom: 20px solid #6e5233;
  }
  .owl .ear.l { left: 24px; transform: rotate(-15deg); }
  .owl .ear.r { left: 76px; transform: rotate(15deg); }
  .owl .eye {
    position: absolute; top: 18px; width: 30px; height: 30px;
    background: #fff; border-radius: 50%; z-index: 2;
  }
  .owl .eye.l { left: 26px; }
  .owl .eye.r { left: 64px; }
  .owl .pupil { position: absolute; inset: 9px; background: #1c1c1c; border-radius: 50%; }
  .owl .beak {
    position: absolute; top: 46px; left: 53px;
    width: 0; height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 14px solid #e8b44c; z-index: 2;
  }
  .owl .wing {
    position: absolute; top: 38px; width: 48px; height: 28px;
    background: #5e4730; border-radius: 70% 30% 60% 40%;
    transform-origin: top center;
    animation: owlFlap .35s ease-in-out infinite alternate;
    z-index: 3;
  }
  .owl .wing.l { left: -8px; }
  .owl .wing.r { right: -8px; transform: scaleX(-1); }
  @keyframes owlFlap {
    from { transform: rotate(28deg); }
    to   { transform: rotate(-18deg); }
  }
  /* сова срастляет */
  .owl.strain .sprite { animation: squirm .16s ease-in-out infinite alternate; }
  .owl.strain .pupil { transform: scaleY(.25); }
  .owl.strain .body { background: radial-gradient(circle at 35% 30%, #a5642c, #7a3517 75%); }
  .owl.strain .wing { animation-duration: .12s; }

  /* ============================================================
   * МОБИЛЬНОЕ УПРАВЛЕНИЕ: джойстик (слева) + кнопки (справа).
   * Виден на тач-устройствах или узких окнах; на десктопе — display:none.
   * ============================================================ */
  .joy, .tbtns, .hint-touch { display: none; }
  .joy {
    position: absolute; left: 16px; bottom: 16px;
    width: 124px; height: 124px; border-radius: 50%;
    background: rgba(255,255,255,.07);
    border: 2px solid rgba(255,255,255,.22);
    box-shadow: inset 0 0 24px rgba(0,0,0,.3);
    z-index: 12; touch-action: none;
  }
  .joy-thumb {
    position: absolute; left: 50%; top: 50%;
    width: 54px; height: 54px; margin: -27px 0 0 -27px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    border: 2px solid rgba(255,255,255,.45);
    box-shadow: 0 2px 10px rgba(0,0,0,.45);
  }
  .tbtns {
    position: absolute; right: 16px; bottom: 16px;
    display: flex; align-items: flex-end; gap: 12px;
    z-index: 12;
  }
  .tbtn {
    width: 84px; height: 84px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,.3);
    background: rgba(18,24,42,.55);
    color: #fff; font-family: inherit; font-weight: 900;
    font-size: 12px; line-height: 1.2; letter-spacing: .5px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    touch-action: none; user-select: none; -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent; cursor: pointer;
  }
  .tbtn .ico { font-size: 24px; line-height: 1.1; }
  .tbtn.jump { width: 96px; height: 96px; background: rgba(40,64,46,.6); }
  .tbtn.spoon { background: rgba(84,58,32,.6); }
  .tbtn.active { transform: scale(.9); }
  .tbtn.jump.active { background: rgba(110,160,110,.5); }
  .tbtn.spoon.active { background: rgba(160,120,70,.5); }
  .hint-touch {
    position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
    z-index: 11; color: #dfe6f5; font-size: 11px; white-space: nowrap;
    background: rgba(0,0,0,.4); border-radius: 8px; padding: 3px 12px;
    user-select: none;
  }

  /* ============================================================
   * МОБИЛЬНАЯ РАСЛОЖКА: персонажи уменьшены (220→121 px),
   * крики/крыса/HP сдвинуты к уменьшённому спрайту,
   * HUD компактнее, тач-контролы видны.
   * ============================================================ */
  @media (pointer: coarse), (max-width: 760px) {
    .joy { display: block; }
    .tbtns { display: flex; }
    .hint { display: none; }
    .hint-touch { display: block; }

    /* персонажи меньше: гриб 220→121, белка 110→60 (анимации внутри не трогаем) */
    .flip .sprite, .squirrel .sprite { transform: scale(.55); }
    .mushroom .shadow { width: 100px; }

    /* крики, крыса и HP белки — теперь около уменьшенного спрайта */
    .mushroom .shout { top: 92px; }
    .mushroom .rat { top: 96px; }
    .squirrel .shout { top: 18px; }
    .squirrel .shout.shout2 { top: -26px; }
    .squirrel .hp.sq { top: -54px; }

    /* HUD и полоска HP гриба — компактнее, не наезжают друг на друга */
    .hud { top: 8px; padding: 4px 14px; border-radius: 10px; }
    .hud .timer { font-size: 20px; }
    .hud .score { font-size: 12px; }
    .hp.mush { right: 8px; top: 8px; font-size: 12px; }
    .hp.mush .track { width: 104px; height: 13px; }

    /* game over — текст поменьше под маленький экран */
    .gameover h1 { font-size: 30px; }
    .gameover.lose h1 { font-size: 24px; }
    .gameover p { font-size: 14px; }
  }
