    html, body {
      touch-action: none;
    }

    body {
      cursor: move;
      margin: 0;
      overflow: hidden;
      background-color: black;
      font-family: 'PT Serif', serif;
      caret-color: white;
      user-select: none;
      width: 100dvw;
      height: 100dvh;
      position: fixed;
      inset: 0;
      -webkit-touch-callout: none;
      -webkit-user-select: none;
      -khtml-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
    }
    body.editing {
      overflow-y: auto;
      /* position: static; */
      width: auto;
      height: auto;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      min-height: 100dvh;
      touch-action: pan-y;
    }

    /* Кнопка добавления стикера */
    .add-sticker-btn {
      position: fixed;
      top: 20px;
      right: 20px;
      width: 50px;
      height: 50px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.2);
      border: 2px solid rgba(255, 255, 255, 0.5);
      color: white;
      font-size: 24px;
      font-weight: bold;
      cursor: pointer;
      z-index: 1000;
      transition: all 0.3s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      backdrop-filter: blur(10px);
    }

    .add-sticker-btn:hover {
      background: rgba(255, 255, 255, 0.3);
      border-color: rgba(255, 255, 255, 0.7);
      transform: scale(1.1);
    }

    .add-sticker-btn:active {
      transform: scale(0.95);
    }

    /* Скрываем кнопку в режиме редактирования */
    body.editing .add-sticker-btn {
      display: none;
    }

    /* Контейнер для стикеров */
    #stickersContainer {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 10;
    }

    #stickersContainer .sticker {
      pointer-events: auto;
    }

    #background {
      position: fixed;
      overflow: hidden;
      top: 0;
      left: 0;
      width: 100dvw;
      height: 100dvh;
      background: url('bg.jpg') no-repeat center center / cover;
      z-index: -1;
      pointer-events: none;
      touch-action: none;
      -webkit-touch-callout: none;
      -webkit-user-select: none;
      -khtml-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
      transform: scale(1);
      transform-origin: center;
    }

    #overlay {
      position: absolute;
      inset: 0;
      background: rgba(0, 0, 0, 0.8);
      z-index: 1;
      display: none;
      pointer-events: auto;
    }

    .sticker {
      touch-action: auto;
      cursor: move;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 96vw;
      padding: 32px 0 32px 0;
      box-sizing: content-box;
      display: inline-block;
      will-change: transform;
      text-align: center;
      image-rendering: -webkit-optimize-contrast;
      image-rendering: -moz-crisp-edges;
      image-rendering: crisp-edges;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      backface-visibility: hidden;
      transform-style: preserve-3d;
    }

    .sticker.transitioned {
      transition: transform 0.3s ease, opacity 0.3s ease;
      z-index: 10;
    }

    .sticker.editing {
      width: 96vw;
      box-sizing: border-box;
      scale: 1;
      rotate: 0deg;
      z-index: 10;
      touch-action: auto;
      padding: 0;
    }

    .blob {
      position: relative;
      display: inline;
      padding: 0 8px 4px;
      line-height: 1.3;
      font-size: 28px;
      color: white;
      background-color: black;
      box-decoration-break: clone;
      -webkit-box-decoration-break: clone;
      filter: url('#blob-filter');
      outline: none;
      overflow-wrap: break-word;
      white-space: pre-wrap;
      touch-action: auto;
    }

    .blob:focus {
      outline: none;
    }

    /* Стили для плейсхолдера */
    .blob.placeholder {
      color: #888 !important;
    }

    /* Ручки масштабирования и вращения */
    .scale-handle, .rotate-handle {
      position: absolute;
      width: 12px;
      height: 12px;
      border: 1px solid white;
      background: rgba(255,255,255,0.3);
      z-index: 10;
      cursor: pointer;
      opacity: 0;
      transition: opacity 0.3s ease;
      pointer-events: none;
      border-radius: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      box-sizing: border-box;
      font-family: 'PT Serif', serif;
      font-size: 12px;
      color: #fff;
      line-height: 1;
      transform: translateX(-50%) scale(calc(1 / var(--sticker-scale, 1)));
      will-change: transform;
      backface-visibility: hidden;
      image-rendering: -webkit-optimize-contrast;
      image-rendering: crisp-edges;
      image-rendering: pixelated;
    }

    .scale-handle {
      left: calc(50% - 4%);
      top: 0.6em;
      cursor: nwse-resize;
      border-radius: 0;
    }

    .rotate-handle {
      left: calc(50% + 4%);
      top: 0.6em;
      cursor: grab;
      border-radius: 50%;
    }

    .sticker:hover .scale-handle,
    .sticker:hover .rotate-handle {
      opacity: 1;
      pointer-events: auto;
    }

    .sticker.editing .scale-handle,
    .sticker.editing .rotate-handle {
      opacity: 0 !important;
      pointer-events: none !important;
    }

    .sticker.interacting .scale-handle,
    .sticker.interacting .rotate-handle {
      opacity: 1 !important;
      pointer-events: auto !important;
    }


    #mobileFocusHack {
      position: absolute;
      top: -1000px;
      left: -1000px;
      width: 1px;
      height: 1px;
      opacity: 0;
      pointer-events: none;
    }

    #hapticToggle {
      position: absolute;
      top: -1000px;
      left: -1000px;
      width: 1px;
      height: 1px;
      opacity: 0;
      pointer-events: none;
    }

    /* Скрываем ручки на мобильных устройствах */
    @media (pointer: coarse) {
      .scale-handle, .rotate-handle {
        display: none !important;
      }
    }

    /* Trash icon for deleting stickers */
    .icon-trash {
      position: fixed;
      bottom: 10px;
      left: 50%;
      transform: translateX(-50%);
      width: 40px;
      height: 40px;
      z-index: 1000;
      display: none;
      pointer-events: none;
    }

    .icon-trash path {
      fill: white;
    }

    .trash-lid {
      transform-origin: right bottom;
      transition: transform 200ms cubic-bezier(0.4, 0.0, 0.2, 1);
    }

    .icon-trash.open .trash-lid,
    .icon-trash:hover .trash-lid {
      transform: translateY(-2px) rotate(30deg);
    }
