:root {
  color-scheme: light;
  --ink: #4b2632;
  --muted: #8a6a73;
  --pink: #f589a9;
  --red: #ef3f54;
  --yellow: #ffd95a;
  --blue: #2f73d9;
  --cream: #fff8f2;
  --card: rgba(255, 255, 255, 0.86);
  --shadow: 0 24px 70px rgba(117, 43, 65, 0.16);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 217, 90, .32), transparent 22%),
    radial-gradient(circle at 80% 78%, rgba(47, 115, 217, .18), transparent 24%),
    linear-gradient(135deg, #fff7f8 0%, #fffaf0 48%, #f4fbff 100%);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
}

.sparkles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.sparkles span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  color: rgba(239, 63, 84, .35);
  font-size: clamp(18px, 4vw, 34px);
  animation: floaty 4s ease-in-out infinite;
  animation-delay: var(--d);
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: .45; }
  50% { transform: translateY(-18px) rotate(12deg); opacity: .9; }
}

.dex-frame {
  width: min(100%, 560px);
  min-height: 680px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
  position: relative;
}

.dex-topline {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 2px solid rgba(75, 38, 50, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--red);
  font-weight: 850;
  box-shadow: 0 8px 24px rgba(117, 43, 65, .08);
}

.pill.muted {
  color: var(--blue);
}

.card {
  display: none;
  width: 100%;
  padding: clamp(24px, 6vw, 42px);
  border: 2px solid rgba(255, 255, 255, .88);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  text-align: center;
  transform: translateY(8px) scale(.98);
  opacity: 0;
}

.card.active {
  display: block;
  animation: cardIn .42s cubic-bezier(.22, 1, .36, 1) forwards;
}

@keyframes cardIn {
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.sprite-card {
  width: 112px;
  height: 112px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background:
    linear-gradient(#ef3f54 0 48%, #35252a 48% 52%, #fff 52%),
    #fff;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, .4), 0 16px 34px rgba(239, 63, 84, .22);
  position: relative;
}

.sprite-card.confirm-gif {
  background: linear-gradient(135deg, var(--cream), #fff);
  overflow: hidden;
}

.confirm-gif-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 20px;
}

.sprite-card.confirm-gif.fallback {
  background: linear-gradient(135deg, #fff4a8, #ffd95a);
  font-size: 54px;
}

.sprite-card.confirm-gif.fallback::before {
  content: "⚡";
}

.poke-ball {
  width: 62px;
  height: 62px;
  border-radius: 999px;
  border: 5px solid #392830;
  background: linear-gradient(#ef3f54 0 46%, #392830 46% 54%, #fff 54%);
  display: grid;
  place-items: center;
}

.poke-ball span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 4px solid #392830;
  background: #fff;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.15rem, 8vw, 4rem);
}

h2 {
  font-size: clamp(2rem, 7vw, 3.3rem);
}

.soft-copy,
.micro-copy {
  color: var(--muted);
}

.soft-copy {
  margin: 16px auto 26px;
  max-width: 32rem;
  font-weight: 650;
}

.micro-copy {
  margin: 16px 0 0;
  min-height: 22px;
  font-size: .9rem;
}

.button-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.chase-zone {
  min-height: 76px;
  position: relative;
}

.primary-btn,
.ghost-btn,
.no-btn {
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  color: white;
  background: linear-gradient(135deg, var(--red), var(--pink));
  box-shadow: 0 14px 28px rgba(239, 63, 84, .28);
  text-decoration: none;
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-2px);
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: .5;
  transform: none;
}

.ghost-btn {
  padding: 0 22px;
  color: var(--ink);
  background: #fff;
  border: 2px solid rgba(75, 38, 50, .12);
}

.no-btn {
  position: relative;
  z-index: 2;
  min-width: 66px;
  padding: 0 20px;
  color: var(--muted);
  background: #ffe5ee;
}

.sprite-row {
  margin: 0 auto 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 2rem;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  text-align: left;
  color: var(--ink);
  font-size: .86rem;
  font-weight: 850;
}

input,
select {
  width: 100%;
  min-height: 52px;
  border: 2px solid rgba(75, 38, 50, .12);
  border-radius: 16px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(255, 217, 90, .72);
  outline-offset: 3px;
}

.wide {
  width: 100%;
  margin-top: 20px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.choice-grid button {
  min-height: 112px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 2px solid rgba(75, 38, 50, .08);
  border-radius: 22px;
  background: rgba(255, 255, 255, .66);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.choice-grid button:hover,
.choice-grid button.selected {
  transform: translateY(-2px);
  border-color: var(--pink);
  background: #fff1f6;
}

.choice-grid button::first-line {
  font-size: 2rem;
}

.choice-grid button span {
  display: block;
  font-size: .9rem;
}

.trainer-badge {
  width: 108px;
  height: 108px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 3rem;
  background:
    radial-gradient(circle at 50% 40%, #fff 0 12%, transparent 13%),
    linear-gradient(145deg, var(--red), #3d7dca);
  box-shadow: 0 18px 38px rgba(47, 115, 217, .22);
}

.final-summary {
  margin: 20px 0 8px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 245, 196, .62);
  color: var(--ink);
  font-weight: 750;
  line-height: 1.45;
}

.button-stack {
  margin-top: 10px;
}

.link-btn {
  margin-top: 18px;
}

.custom-food-wrap {
  margin-top: 14px;
  animation: cardIn .3s ease;
}

.custom-food-wrap label {
  color: var(--muted);
}

.confirm-btn {
  margin-bottom: 0;
}

.confirm-status {
  margin: 10px 0 4px;
  font-size: .92rem;
  font-weight: 700;
  min-height: 22px;
}

.confirm-status.success {
  color: #1e7a3c;
}

.confirm-status.error {
  color: var(--red);
}

@media (max-width: 560px) {
  .app-shell {
    padding: 16px;
  }

  .dex-frame {
    min-height: 100svh;
    justify-content: center;
  }

  .card {
    border-radius: 24px;
  }

  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choice-grid button {
    min-height: 96px;
  }

  .button-row {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}
