:root {
  --milk: #FFF8F3;
  --plum: #5A4550;
  --plum-soft: #8B7480;
  --strawberry: #FF8FB1;
  --matcha: #9FD8A8;
  --butter: #FFD98A;
  --peri: #B9B8FF;
  --card-w: 340px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

/* soft pastel backdrop — fixed to the viewport so tall pages stay consistent (no color band) */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 15% -10%, #FFE7F0 0%, transparent 55%),
    radial-gradient(1000px 800px at 110% 20%, #E6F6E8 0%, transparent 55%),
    radial-gradient(900px 900px at 50% 120%, #ECEBFF 0%, transparent 60%);
}

body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--plum);
  background: var(--milk);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* center when it fits, but align to top when taller than the screen (no clipping) */
  justify-content: safe center;
  gap: 26px;
  padding: 40px 18px 56px;
  overflow-x: hidden;
}

/* floating paw/heart confetti in background */
.bg-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-deco span { position: absolute; font-size: 22px; opacity: .5; animation: float 9s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-16px) rotate(8deg); } }

.stage { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 22px; }

.brand { text-align: center; }
.brand h1 {
  font-family: 'Mochiy Pop One', sans-serif;
  font-size: 26px; letter-spacing: .5px; color: var(--plum);
}
.brand h1 .dot { color: var(--strawberry); }
.brand p { font-size: 13px; color: var(--plum-soft); font-weight: 600; margin-top: 2px; }

/* ---------- CARD ---------- */
.card-wrap { perspective: 1100px; touch-action: pan-y; will-change: transform; }

/* carousel controls — frosted round arrows on the card's side edges */
.card-stage { position: relative; z-index: 1; }
.cnav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  width: 40px; height: 40px; border: none; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--plum); font-size: 22px; font-weight: 900; line-height: 1;
  display: grid; place-items: center; padding: 0;
  box-shadow: 0 6px 16px -6px rgba(120, 80, 110, .45);
  transition: background .15s, transform .12s;
}
.cnav.prev { left: -20px; }
.cnav.next { right: -20px; }
.cnav:hover { background: rgba(255, 255, 255, .82); }
.cnav:active { transform: translateY(-50%) scale(.9); }
.cnav:focus-visible { outline: 3px solid var(--peri); outline-offset: 2px; }
.dots { display: flex; gap: 7px; align-items: center; justify-content: center; z-index: 1; }
.dot {
  width: 8px; height: 8px; border-radius: 50%; border: none; cursor: pointer; padding: 0;
  background: #F0D9E3; transition: width .2s ease, background .2s ease;
}
.dot.active { width: 22px; border-radius: 999px; background: var(--strawberry); }
.dot:focus-visible { outline: 2px solid var(--peri); outline-offset: 2px; }
.card {
  width: var(--card-w);
  border-radius: 26px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
  background: #fff;
  padding: 14px;
  box-shadow:
    0 18px 40px -18px rgba(120, 80, 110, .55),
    0 4px 0 rgba(0, 0, 0, .02);
  border: 3px solid #fff;
  will-change: transform;
}
/* the colored rarity frame sits behind the white card */
.card::before {
  content: ""; position: absolute; inset: -3px; border-radius: 28px; z-index: -1;
  background: var(--frame, linear-gradient(135deg, #FFD98A, #FF8FB1, #B9B8FF));
  filter: saturate(1.05);
}

/* holographic sheen overlay */
.holo {
  position: absolute; inset: 0; border-radius: 24px; pointer-events: none;
  background:
    linear-gradient(115deg,
      transparent 30%,
      rgba(255, 180, 220, .55) 42%,
      rgba(185, 184, 255, .55) 50%,
      rgba(159, 216, 168, .55) 58%,
      transparent 70%);
  background-size: 240% 240%;
  background-position: var(--hx, 50%) var(--hy, 50%);
  mix-blend-mode: soft-light;
  opacity: var(--holo-op, .35);
  transition: opacity .3s ease;
  z-index: 5;
}
.holo.sparkle {
  background:
    radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), rgba(255, 255, 255, .9) 0%, transparent 18%),
    linear-gradient(115deg, transparent 30%, rgba(255, 180, 220, .55) 42%, rgba(185, 184, 255, .55) 50%, rgba(159, 216, 168, .55) 58%, transparent 70%);
  background-size: auto, 240% 240%;
  background-position: center, var(--hx, 50%) var(--hy, 50%);
}

.inner {
  background: linear-gradient(180deg, #FFFDFB, #FFF6F1);
  border-radius: 18px;
  padding: 12px 12px 14px;
  position: relative;
  z-index: 2;
}

/* top ribbon */
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rarity {
  font-family: 'Mochiy Pop One', sans-serif;
  font-size: 11px; letter-spacing: .4px;
  padding: 5px 12px; border-radius: 999px; color: #fff;
  background: var(--rar-bg, #FF8FB1);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .06);
  display: flex; align-items: center; gap: 5px;
}
.verified {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; color: #3FA56B;
  background: #EAF8EF; border: 1.5px solid #C7EBD3;
  padding: 5px 9px; border-radius: 999px;
}
.verified.unverified { color: var(--plum-soft); background: #F4EEF1; border-color: #E7DBE2; }
.verified .pw { font-size: 12px; }

/* photo window */
.photo {
  position: relative; border-radius: 16px; overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--photo-bg, #FFE9C9);
  border: 3px solid #fff;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .03);
  display: flex; align-items: flex-end; justify-content: center;
}
.photo svg { width: 86%; height: 86%; display: block; }
/* show the whole pet (never crop it) as a sticker on the frame gradient */
.photo .cat-photo { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; z-index: 1; }
.hint {
  position: absolute; top: 8px; left: 8px;
  font-size: 10px; font-weight: 800; color: var(--plum-soft);
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(4px);
  padding: 3px 8px; border-radius: 999px; z-index: 2;
}

/* name + archetype */
.id { margin: 12px 2px 4px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.name { font-family: 'Mochiy Pop One', sans-serif; font-size: 24px; line-height: 1; color: var(--plum); }
.arche {
  font-size: 11px; font-weight: 800; color: #fff;
  background: var(--rar-bg, #FF8FB1);
  padding: 5px 10px; border-radius: 10px; white-space: nowrap;
  transform: rotate(2deg);
  box-shadow: 2px 3px 0 rgba(0, 0, 0, .08);
}
.tagline { font-size: 12px; font-weight: 700; color: var(--plum-soft); margin: 0 2px 12px; font-style: italic; }

/* stats */
.stats { display: flex; flex-direction: column; gap: 9px; }
.stat { display: grid; grid-template-columns: 78px 1fr 26px; align-items: center; gap: 8px; }
.stat .lab { font-size: 11.5px; font-weight: 800; display: flex; align-items: center; gap: 4px; color: var(--plum); }
.bar { height: 11px; border-radius: 999px; background: #F0E6EC; overflow: hidden; position: relative; }
.bar i {
  position: absolute; inset: 0; width: var(--v, 50%); border-radius: 999px;
  background: var(--bar, linear-gradient(90deg, #FFB3CE, #FF8FB1));
  transition: width .9s cubic-bezier(.2, .9, .2, 1);
}
.stat .num { font-size: 11px; font-weight: 900; text-align: right; color: var(--plum-soft); }

/* footer: level + streak */
.foot {
  margin-top: 13px; display: flex; align-items: center; justify-content: space-between;
  background: #FFFFFF; border: 1.5px dashed #F0D9E3; border-radius: 14px;
  padding: 9px 11px;
}
.lvl { display: flex; align-items: center; gap: 8px; }
.lvl .ring {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-family: 'Mochiy Pop One', sans-serif; font-size: 12px; color: #fff;
  background: conic-gradient(var(--strawberry) var(--xp, 70%), #F1E2EA 0);
  position: relative;
}
.lvl .ring b {
  position: absolute; inset: 4px; border-radius: 50%; background: #fff; color: var(--plum);
  display: grid; place-items: center; font-size: 13px;
}
.lvl .meta small { display: block; font-size: 9.5px; color: var(--plum-soft); font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.lvl .meta span { font-size: 12px; font-weight: 800; }
.streak { text-align: right; }
.streak b { font-size: 16px; font-family: 'Mochiy Pop One', sans-serif; color: var(--strawberry); }
.streak small { display: block; font-size: 9.5px; color: var(--plum-soft); font-weight: 800; }

/* controls */
.controls { display: flex; gap: 10px; align-items: center; z-index: 1; flex-wrap: wrap; justify-content: center; }
button.ctl {
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 14px; cursor: pointer;
  border: none; border-radius: 14px; padding: 12px 18px; color: var(--plum);
  background: #fff; box-shadow: 0 6px 0 #F0D9E3, 0 10px 18px -10px rgba(120, 80, 110, .5);
  transition: transform .12s, box-shadow .12s;
}
button.ctl:active { transform: translateY(4px); box-shadow: 0 2px 0 #F0D9E3; }
button.ctl.primary { color: #fff; background: linear-gradient(135deg, #FFA0BE, #FF8FB1); box-shadow: 0 6px 0 #E76B96, 0 12px 20px -10px rgba(231, 107, 150, .7); }
button.ctl.primary:active { box-shadow: 0 2px 0 #E76B96; }
button.ctl:focus-visible { outline: 3px solid var(--peri); outline-offset: 3px; }
button.ctl.block { width: var(--card-w); }

/* two-button row sized to the card */
.controls.row { width: var(--card-w); flex-wrap: nowrap; }
.controls.row .ctl { flex: 1 1 0; min-width: 0; white-space: nowrap; padding: 12px 14px; }

.note { font-size: 12px; color: var(--plum-soft); font-weight: 600; text-align: center; max-width: 330px; z-index: 1; line-height: 1.5; }

/* store badges */
.stores { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; z-index: 1; margin-top: 6px; }
.store {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; color: #fff; background: #1B1420;
  padding: 9px 16px; border-radius: 14px; min-width: 158px;
  box-shadow: 0 8px 18px -10px rgba(27, 20, 32, .7);
  transition: transform .12s, box-shadow .12s;
}
.store:hover { transform: translateY(-2px); box-shadow: 0 12px 22px -10px rgba(27, 20, 32, .75); }
.store:active { transform: translateY(0); }
.store:focus-visible { outline: 3px solid var(--peri); outline-offset: 3px; }
.store-ico { width: 26px; height: 26px; flex: none; }
.store-txt { display: flex; flex-direction: column; line-height: 1.15; }
.store-txt small { font-size: 9.5px; font-weight: 700; letter-spacing: .3px; opacity: .85; text-transform: none; }
.store-txt b { font-family: 'Mochiy Pop One', sans-serif; font-size: 15px; font-weight: 400; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  z-index: 80; pointer-events: none;
  background: #1B1420; color: #fff; font-weight: 800; font-size: 14px;
  padding: 12px 20px; border-radius: 999px;
  box-shadow: 0 12px 30px -12px rgba(27, 20, 32, .7);
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) {
  .toast { transition: opacity .25s ease; }
}

/* ---------- VERIFY: modal + form ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(90, 69, 80, .45); backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  position: relative; background: #fff; border-radius: 22px;
  width: 100%; max-width: 380px; padding: 24px 20px 20px;
  box-shadow: 0 24px 60px -20px rgba(120, 80, 110, .6);
}
.modal h3 { font-family: 'Mochiy Pop One', sans-serif; font-size: 18px; margin-bottom: 6px; }
.modal .help { font-size: 12.5px; color: var(--plum-soft); font-weight: 600; margin-bottom: 16px; line-height: 1.5; }
.modal .close {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
  border: none; border-radius: 50%; cursor: pointer;
  background: #F4EEF1; color: var(--plum); font-size: 18px; font-weight: 900; line-height: 1;
}
.modal .close:hover { background: #ECE0E7; }

.vform { display: flex; flex-direction: column; gap: 12px; }
.vform > .ctl { width: 100%; }
.vfield {
  display: flex; align-items: center; gap: 6px;
  background: #FBF4F8; border: 2px solid #F0D9E3; border-radius: 14px;
  padding: 4px 4px 4px 14px;
}
.vfield:focus-within { border-color: var(--strawberry); }
.vinput {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 700; color: var(--plum);
  padding: 10px 0;
}
.vinput::placeholder { color: #C9B6C1; font-weight: 600; }
.paste-btn {
  flex: none; display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  border: none; background: #fff; color: var(--plum); font-weight: 800; font-size: 12px;
  padding: 8px 11px; border-radius: 10px; box-shadow: 0 2px 0 #F0D9E3;
}
.paste-btn:active { transform: translateY(1px); box-shadow: none; }
.paste-btn svg { width: 14px; height: 14px; }
.vmsg { font-size: 12.5px; font-weight: 700; min-height: 18px; margin: 0; text-align: center; }
.vmsg.err { color: #E0517B; }
.vmsg.ok { color: #3FA56B; }

/* ---------- VERIFY: result page ---------- */
.verify-main { gap: 18px; }
.vpanel {
  width: 100%; max-width: 380px; background: #fff; border-radius: 22px; padding: 22px 20px;
  box-shadow: 0 18px 44px -22px rgba(120, 80, 110, .5); z-index: 1;
}
.vpanel h3 { font-family: 'Mochiy Pop One', sans-serif; font-size: 18px; margin-bottom: 6px; }
.vpanel .help { font-size: 12.5px; color: var(--plum-soft); font-weight: 600; margin-bottom: 16px; line-height: 1.5; }
.spinner {
  width: 34px; height: 34px; margin: 6px auto; border-radius: 50%;
  border: 4px solid #F0E6EC; border-top-color: var(--strawberry); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.back-link {
  font-size: 13px; font-weight: 800; color: var(--plum-soft); text-decoration: none;
  z-index: 1; padding: 6px 10px; border-radius: 10px;
}
.back-link:hover { color: var(--plum); background: rgba(255, 255, 255, .6); }
.vresult-head { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 12px; z-index: 1; }
.vresult-head .vmsg { margin: 0; font-size: 13.5px; }
.link-btn {
  border: none; cursor: pointer; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13px;
  color: var(--plum); background: #fff; padding: 9px 18px; border-radius: 12px;
  box-shadow: 0 4px 0 #F0D9E3, 0 8px 14px -8px rgba(120, 80, 110, .4);
}
.link-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #F0D9E3; }
.link-btn:focus-visible { outline: 3px solid var(--peri); outline-offset: 3px; }

/* ---------- top-right menu ---------- */
.menu-wrap { position: fixed; top: 16px; right: 16px; z-index: 60; }
.menu-btn {
  width: 44px; height: 44px; border-radius: 14px; cursor: pointer; border: none;
  background: #fff; box-shadow: 0 6px 0 #F0D9E3, 0 10px 18px -10px rgba(120, 80, 110, .5);
  display: grid; place-items: center; transition: transform .12s, box-shadow .12s;
}
.menu-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #F0D9E3; }
.menu-btn:focus-visible { outline: 3px solid var(--peri); outline-offset: 3px; }
.menu-ico { display: grid; gap: 4px; width: 20px; }
.menu-ico span { height: 2.5px; border-radius: 2px; background: var(--plum); transition: transform .2s, opacity .2s; }
.menu-wrap.open .menu-ico span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-wrap.open .menu-ico span:nth-child(2) { opacity: 0; }
.menu-wrap.open .menu-ico span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.menu-panel {
  position: absolute; top: 52px; right: 0; min-width: 216px;
  background: #fff; border-radius: 16px; padding: 8px;
  box-shadow: 0 20px 44px -18px rgba(120, 80, 110, .55);
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.menu-wrap.open .menu-panel { opacity: 1; transform: none; pointer-events: auto; }
.menu-link {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-weight: 800; font-size: 14px; color: var(--plum);
  padding: 11px 12px; border-radius: 11px;
}
.menu-link:hover { background: #FBF1F6; }
.menu-link[aria-current="page"] { background: #FFF0F5; color: #E76B96; }
.menu-emoji { font-size: 15px; width: 18px; text-align: center; }
.menu-link.menu-danger { color: #E0517B; }
.menu-link.menu-danger:hover { background: #FDECF1; }

/* ---------- document pages (Terms / Privacy) + forms ---------- */
body.page { justify-content: flex-start; }
.doc {
  position: relative; z-index: 1; width: 100%; max-width: 720px;
  background: #fff; border-radius: 22px; padding: 30px 26px;
  box-shadow: 0 18px 44px -22px rgba(120, 80, 110, .5);
  text-align: left; line-height: 1.65;
}
.doc h1 { font-family: 'Mochiy Pop One', sans-serif; font-size: 25px; margin-bottom: 6px; color: var(--plum); }
.doc .updated { font-size: 12.5px; color: var(--plum-soft); font-weight: 700; margin-bottom: 20px; }
.doc h2 { font-size: 17px; margin: 24px 0 8px; color: var(--plum); }
.doc p, .doc li { font-size: 14px; color: #5F4B56; }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc a { color: #E76B96; font-weight: 700; }
.doc strong { color: var(--plum); }

.field-label { font-size: 12.5px; font-weight: 800; color: var(--plum); margin: 2px 0 6px; display: block; }
textarea.vtextarea {
  width: 100%; border: 2px solid #F0D9E3; border-radius: 14px; background: #FBF4F8;
  padding: 12px 14px; font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--plum); resize: vertical; min-height: 84px; outline: none;
}
textarea.vtextarea:focus { border-color: var(--strawberry); }
.check-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; font-weight: 700; color: var(--plum-soft); text-align: left; }
.check-row input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--strawberry); flex: none; }
.brand a { color: inherit; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
}

/* visually hidden but available to screen readers / SEO */
.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;
}

@media (prefers-reduced-motion: reduce) {
  .bg-deco span { animation: none; }
  .card { transition: none; }
  .bar i { transition: none; }
}
