@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Quicksand";
  src: url("assets/fonts/quicksand-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg-1: #fff8fd;
  --bg-2: #ffeef7;
  --bg-3: #fef6e8;
  --card: rgba(255, 255, 255, 0.88);
  --border: rgba(232, 170, 201, 0.45);
  --text: #5b4762;
  --accent: #ff9dc6;
  --accent-2: #c9a8ff;
  --shadow: 0 24px 60px rgba(212, 156, 188, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 157, 198, 0.32), transparent 30%),
    radial-gradient(circle at bottom right, rgba(201, 168, 255, 0.22), transparent 28%),
    radial-gradient(circle at left center, rgba(255, 217, 141, 0.2), transparent 22%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2) 50%, var(--bg-3));
  overflow-x: hidden;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  position: relative;
}

.card {
  width: min(100%, 760px);
  padding: 28px;
  border-radius: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  position: relative;
}

.card::before {
  content: "🐾";
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 1.8rem;
  opacity: 0.75;
  transform: rotate(14deg);
}

.card::after {
  content: "✨";
  position: absolute;
  top: 20px;
  right: 56px;
  font-size: 1rem;
  opacity: 0.8;
}

h1 {
  margin: 0 0 20px;
  font-family: "Quicksand", "Inter", system-ui, sans-serif;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 700;
  line-height: 1.08;
  text-align: center;
  letter-spacing: -0.03em;
}

.image-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(232, 170, 201, 0.4);
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  width: 100%;
}

.image-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #ffffff;
  z-index: 2;
}

.image-placeholder[hidden] {
  display: none !important;
}

.placeholder-paw {
  font-size: clamp(3.2rem, 10vw, 5rem);
  line-height: 1;
  opacity: 0.8;
  transform: translateY(8px);
}

#cat-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.22s ease;
}

#cat-image.is-visible {
  opacity: 1;
}

.status {
  position: absolute;
  inset: auto 16px 16px 16px;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #6e5871;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  font-weight: 600;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(232, 170, 201, 0.35);
  z-index: 3;
}

.status-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 3px solid rgba(201, 168, 255, 0.28);
  border-top-color: var(--accent);
  flex: 0 0 auto;
  animation: spin 0.9s linear infinite;
}

.status[hidden] {
  display: none !important;
}

.actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  width: 100%;
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 12px 26px rgba(215, 146, 190, 0.28);
  max-width: 100%;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(215, 146, 190, 0.34);
}

button:active {
  transform: translateY(1px);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.paw-trail {
  position: fixed;
  display: grid;
  gap: 16px;
  pointer-events: none;
  user-select: none;
  opacity: 0.5;
}

.paw-trail span {
  display: block;
  font-size: clamp(1.5rem, 2vw, 2rem);
  filter: drop-shadow(0 6px 10px rgba(255, 157, 198, 0.18));
}

.paw-trail-left {
  top: 90px;
  left: 22px;
}

.paw-trail-left span:nth-child(2) {
  transform: translateX(20px) rotate(-16deg);
}

.paw-trail-left span:nth-child(3) {
  transform: translateX(6px) rotate(10deg);
}

.paw-trail-right {
  right: 26px;
  bottom: 80px;
}

.paw-trail-right span:nth-child(1) {
  transform: translateX(-14px) rotate(-8deg);
}

.paw-trail-right span:nth-child(2) {
  transform: translateX(10px) rotate(16deg);
}

.paw-trail-right span:nth-child(3) {
  transform: translateX(-6px) rotate(-10deg);
}

@media (max-width: 640px) {
  .shell {
    padding: 12px;
    align-items: start;
  }

  .card {
    padding: 18px;
    border-radius: 22px;
  }

  .card::before {
    top: 12px;
    right: 14px;
    font-size: 1.35rem;
  }

  .card::after {
    top: 14px;
    right: 40px;
    font-size: 0.85rem;
  }

  h1 {
    margin: 0 0 16px;
    font-size: clamp(1.6rem, 9vw, 2.2rem);
    padding-right: 18px;
  }

  .image-wrap {
    aspect-ratio: 1 / 1;
    border-radius: 18px;
  }

  .status {
    inset: auto 10px 10px 10px;
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .status-spinner {
    width: 14px;
    height: 14px;
  }

  .actions {
    margin-top: 16px;
  }

  button {
    width: min(100%, 320px);
    padding: 13px 18px;
  }

  .paw-trail {
    display: none;
  }
}

@media (max-width: 380px) {
  .card {
    padding: 14px;
  }

  h1 {
    font-size: 1.45rem;
    margin-bottom: 14px;
  }

  button {
    width: 100%;
    font-size: 0.95rem;
  }
}
