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

html,
body {
  height: 100%;
  background: #fbede2;
  overflow: hidden;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
}

/* The screen keeps the design's exact aspect ratio (790 × 1470)
   and covers the whole viewport on mobile (trimming the sides slightly if needed) */
.screen {
  position: relative;
  flex: none;
  width: max(100vw, calc(100dvh * 790 / 1470));
  aspect-ratio: 790 / 1470;
  user-select: none;
  -webkit-user-select: none;
}

.backdrop {
  display: none;
}

/* Desktop / tablet: the full design is shown as a centered card,
   with the same artwork blurred as a full-screen background */
@media (min-aspect-ratio: 3/4) {
  body {
    padding: clamp(16px, 3vh, 40px);
  }

  .backdrop {
    display: block;
    position: fixed;
    inset: -60px;
    background: url("assets/screen.webp") center / cover no-repeat;
    filter: blur(40px) saturate(1.1);
    opacity: 0.55;
    pointer-events: none;
  }

  .screen {
    width: min(
      calc(100vw - 32px),
      calc((100dvh - clamp(16px, 3vh, 40px) * 2) * 790 / 1470)
    );
    border-radius: clamp(20px, 4vh, 40px);
    overflow: hidden;
    box-shadow:
      0 30px 80px rgba(120, 60, 40, 0.25),
      0 0 0 1px rgba(120, 60, 40, 0.06);
  }

  .notify:hover {
    background: rgba(255, 240, 230, 0.12);
    box-shadow: 0 0 0 3px rgba(226, 122, 134, 0.55);
  }

  .notify:active,
  .notify.pressed {
    background: rgba(40, 15, 5, 0.18);
    box-shadow: inset 0 3px 8px rgba(40, 15, 5, 0.35);
  }
}

.art {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Hit area over the big cookie */
.cookie-hit {
  position: absolute;
  left: 16.5%;
  top: 34.8%;
  width: 67%;
  height: 36%;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

/* Hit area over the "Notify Me" button in the image */
.notify {
  position: absolute;
  left: 26.1%;
  top: 53.3%;
  width: 47.8%;
  height: 8.4%;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.notify:active,
.notify.pressed {
  background: rgba(40, 15, 5, 0.18);
  box-shadow: inset 0 3px 8px rgba(40, 15, 5, 0.35);
}

.notify:focus-visible {
  outline: 3px solid #e27a86;
  outline-offset: 3px;
}

.screen.wiggle .art {
  animation: wiggle 0.45s ease;
}

@keyframes wiggle {
  0%, 100% { transform: scale(1) rotate(0); }
  30% { transform: scale(0.985) rotate(-0.4deg); }
  60% { transform: scale(1.01) rotate(0.4deg); }
}

/* Hearts and cookies that burst out on tap */
.burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  font-size: clamp(16px, 5.5vw, 28px);
  line-height: 1;
  animation: fly 1.1s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes fly {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  15% { opacity: 1; }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot));
    opacity: 0;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: #5a2e1a;
  color: #fff4ea;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(90, 46, 26, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
