:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  background: #f2eadb;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(circle at 18% 24%, rgb(255 255 255 / 34%) 0 1px, transparent 1.6px) 0 0 / 19px 19px,
    radial-gradient(circle at 78% 66%, rgb(126 91 52 / 5%) 0 0.7px, transparent 1.5px) 0 0 / 23px 23px,
    linear-gradient(150deg, #f7f1e5 0%, #f1e8d7 54%, #eee2ce 100%);
}

#app {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  touch-action: none;
}

.scene {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.scene.is-stroking {
  cursor: grabbing;
}

.cat-rig,
.cat-body,
.face,
.eye-gaze,
.eye,
.mouth,
.paw {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform;
}

.cat-rig {
  transform-origin: 50% 14%;
  transition: transform 90ms linear;
}

.cat-silhouette {
  fill: url(#cat-fill);
  stroke: #783b26;
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.cat-sheen {
  fill: url(#body-sheen);
  pointer-events: none;
}

.ear-detail {
  fill: #31505a;
  opacity: 0.68;
}

.ear-detail.right {
  opacity: 0.56;
}

.paw {
  fill: url(#paw-fill);
  stroke: #773923;
  stroke-width: 1.4;
  filter: drop-shadow(0 3px 2px rgb(87 38 22 / 20%));
}

.eye {
  fill: #211c19;
  filter: drop-shadow(0 1.2px 0.8px rgb(255 221 180 / 28%));
  transition: transform 72ms ease-in;
}

.face.is-blinking .eye {
  transform: scaleY(0.08);
  transition-timing-function: ease-out;
}

.mouth {
  fill: none;
  stroke: #342a25;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-width 80ms linear;
}

.tail-shadow,
.tail,
.tail-highlight,
.tail-hit {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  will-change: d;
}

.tail-shadow {
  stroke: rgb(72 43 25 / 18%);
  stroke-width: 36;
  transform: translate(2px, 8px);
  filter: blur(7px);
}

.tail {
  stroke: url(#tail-fill);
  stroke-width: 29;
  filter: url(#cloth) drop-shadow(2px 4px 3px rgb(83 39 22 / 18%));
}

.tail-highlight {
  stroke: rgb(255 224 182 / 48%);
  stroke-width: 3.2;
  pointer-events: none;
}

.tail-hit {
  stroke: transparent;
  stroke-width: 126;
  pointer-events: stroke;
}

.touch-mark {
  fill: none;
  stroke: rgb(116 64 35 / 19%);
  stroke-width: 2;
  opacity: 0;
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
}

.scene.is-stroking .touch-mark {
  opacity: 1;
  animation: touch-pulse 900ms ease-in-out infinite;
}

@keyframes touch-pulse {
  0%, 100% { transform: scale(0.72); opacity: 0.12; }
  50% { transform: scale(1.08); opacity: 0.28; }
}

@media (min-width: 700px) {
  #app {
    left: 50%;
    width: min(100vw, 520px);
    transform: translateX(-50%);
    box-shadow: 0 0 80px rgb(80 48 25 / 9%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .touch-mark {
    animation: none !important;
  }

  .eye {
    transition: none;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
