:root {
      --ink: #59364b;
      --pink: #ff7faf;
      --rose: #ffd1de;
      --cream: #fff8ee;
      --mint: #b9f4d8;
      --sky: #c7f2ff;
      --butter: #ffe88c;
      --berry: #d64c82;
      --shadow: rgba(116, 67, 92, 0.22);
    }

    * { box-sizing: border-box; }

    html, body {
      margin: 0;
      min-height: 100%;
      overflow: hidden;
      color: var(--ink);
      font-family: "Trebuchet MS", "Segoe UI", sans-serif;
      background:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.86) 0 52px, transparent 53px),
        radial-gradient(circle at 86% 16%, rgba(255, 255, 255, 0.72) 0 68px, transparent 69px),
        linear-gradient(180deg, #ffe1ec 0%, #fff4f0 48%, #d9f9ff 100%);
    }

    body::before {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      background-image:
        radial-gradient(circle, rgba(255, 127, 175, 0.36) 0 2px, transparent 3px),
        radial-gradient(circle, rgba(255, 232, 140, 0.42) 0 2px, transparent 3px);
      background-size: 54px 54px, 78px 78px;
      background-position: 8px 12px, 34px 28px;
    }

    .game-shell {
      position: relative;
      width: 100vw;
      height: 100vh;
      display: grid;
      place-items: center;
      padding: 18px;
    }

    .stage-wrap {
      position: relative;
      width: min(96vw, 980px);
      height: min(92vh, 660px);
      min-height: 520px;
      border: 4px solid #fff;
      border-radius: 8px;
      box-shadow: 0 22px 60px var(--shadow);
      overflow: hidden;
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0)),
        linear-gradient(180deg, #ffedf4 0%, #fff8ef 61%, #bdf1dc 62%, #a6e9cb 100%);
    }

    canvas {
      display: block;
      width: 100%;
      height: 100%;
      image-rendering: auto;
    }

    .hud {
      position: absolute;
      top: 14px;
      left: 14px;
      right: 14px;
      display: flex;
      justify-content: space-between;
      gap: 10px;
      pointer-events: none;
      align-items: flex-start;
    }

    .meter-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      max-width: 70%;
    }

    .pill {
      min-width: 84px;
      height: 40px;
      padding: 0 12px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      border: 2px solid #fff;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.78);
      box-shadow: 0 5px 0 rgba(211, 105, 145, 0.16);
      font-weight: 800;
      font-size: 15px;
    }

    .lives {
      display: flex;
      gap: 5px;
      height: 40px;
      align-items: center;
      padding: 0 10px;
      border: 2px solid #fff;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.78);
      box-shadow: 0 5px 0 rgba(211, 105, 145, 0.16);
    }

    .heart {
      width: 16px;
      height: 16px;
      transform: rotate(45deg);
      background: var(--pink);
      position: relative;
    }

    .heart::before,
    .heart::after {
      content: "";
      position: absolute;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: inherit;
    }

    .heart::before { left: -8px; }
    .heart::after { top: -8px; }
    .heart.empty { background: #e6dce1; }

    .overlay {
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      padding: 22px;
      background: rgba(255, 245, 250, 0.48);

    }

    .panel {
      width: min(520px, 92%);
      padding: 24px;
      border: 3px solid #fff;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.9);
      box-shadow: 0 16px 36px rgba(116, 67, 92, 0.18);
      text-align: center;
    }

    .logo-kitty {
      position: relative;
      margin: 0 auto 12px;
      width: 104px;
      height: 82px;
      border: 4px solid var(--ink);
      border-radius: 49% 49% 44% 44%;
      background: #fff;
      box-shadow: 0 7px 0 #ffd2e3;
    }

    .logo-kitty::before,
    .logo-kitty::after {
      content: "";
      position: absolute;
      top: -18px;
      width: 36px;
      height: 36px;
      border-left: 4px solid var(--ink);
      border-top: 4px solid var(--ink);
      background: #fff;
      transform: rotate(45deg);
      border-radius: 5px;
      z-index: -1;
    }

    .logo-kitty::before { left: 7px; }
    .logo-kitty::after { right: 7px; }

    .eye {
      position: absolute;
      top: 37px;
      width: 8px;
      height: 11px;
      background: var(--ink);
      border-radius: 50%;
    }

    .eye.left { left: 29px; }
    .eye.right { right: 29px; }

    .nose {
      position: absolute;
      left: 50%;
      top: 47px;
      width: 12px;
      height: 9px;
      transform: translateX(-50%);
      background: var(--butter);
      border: 2px solid var(--ink);
      border-radius: 50%;
    }

    .bow {
      position: absolute;
      right: -13px;
      top: 2px;
      width: 36px;
      height: 25px;
    }

    .bow::before,
    .bow::after {
      content: "";
      position: absolute;
      width: 18px;
      height: 23px;
      border: 3px solid var(--ink);
      background: var(--pink);
      border-radius: 50% 45% 45% 50%;
    }

    .bow::before { left: 0; transform: rotate(-22deg); }
    .bow::after { right: 0; transform: rotate(22deg); }

    .bow span {
      position: absolute;
      left: 13px;
      top: 7px;
      width: 12px;
      height: 12px;
      border: 3px solid var(--ink);
      border-radius: 50%;
      background: #ffb7d0;
      z-index: 2;
    }

    h1 {
      margin: 0 0 7px;
      font-size: clamp(30px, 6vw, 54px);
      letter-spacing: 0;
      color: var(--berry);
      line-height: 1.02;
    }

    p {
      margin: 9px 0;
      font-size: 16px;
      line-height: 1.45;
    }

    .controls {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: center;
      margin-top: 17px;
    }

    button {
      appearance: none;
      border: 0;
      height: 44px;
      padding: 0 18px;
      border-radius: 8px;
      background: var(--pink);
      color: #fff;
      font: inherit;
      font-size: 16px;
      font-weight: 900;
      box-shadow: 0 5px 0 #c94f82;
      cursor: pointer;
    }

    button:hover { transform: translateY(1px); box-shadow: 0 4px 0 #c94f82; }
    button:active { transform: translateY(4px); box-shadow: 0 1px 0 #c94f82; }

    .sound {
      position: absolute;
      right: 14px;
      bottom: 14px;
      width: 44px;
      padding: 0;
      pointer-events: auto;
      background: #77d8b3;
      box-shadow: 0 5px 0 #4faf8a;
    }

    .hidden { display: none; }

    .touch-controls {
      position: absolute;
      left: 14px;
      right: 14px;
      bottom: 14px;
      display: none;
      justify-content: space-between;
      pointer-events: none;
    }

    .touch-controls button {
      width: 64px;
      height: 54px;
      padding: 0;
      pointer-events: auto;
      background: rgba(255, 127, 175, 0.82);
    }

    @media (max-width: 720px) {
      .game-shell { padding: 0; }
      .stage-wrap {
        width: 100%;
        height: 100svh;
        min-height: 0;
        border-radius: 0;
        border-width: 0;
      }
      .pill { min-width: 72px; height: 36px; font-size: 13px; }
      .meter-row { max-width: 78%; }
      .touch-controls { display: flex; }
      .panel { padding: 20px 16px; }
    }