:root {
  --cream: #FFF8F0;
  --cream-deep: #F5E6D3;
  --blush: #F5C6CB;
  --blush-deep: #E89BA3;
  --lilac: #D4C4E8;
  --lilac-deep: #B8A0D4;
  --mint: #C8E8D4;
  --peach: #FFDAB9;
  --ink: #5A4A5C;
  --ink-soft: #8A7A8C;
  --card: rgba(255, 255, 255, 0.82);
  --shadow: 0 10px 28px rgba(184, 160, 212, 0.28);
  --radius: 22px;
  --max: 820px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 0%, #FFE8F0 0%, transparent 50%),
    radial-gradient(ellipse at 90% 10%, #E8D8F8 0%, transparent 45%),
    radial-gradient(ellipse at 50% 100%, #FFF0E0 0%, transparent 40%),
    var(--cream);
}

body {
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sparkle-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1.5px 1.5px at 78% 12%, rgba(255,220,240,0.95), transparent),
    radial-gradient(2px 2px at 55% 28%, rgba(220,200,255,0.85), transparent),
    radial-gradient(1.5px 1.5px at 30% 70%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 88% 65%, rgba(255,230,210,0.9), transparent),
    radial-gradient(2px 2px at 42% 88%, rgba(200,230,220,0.8), transparent);
  animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

.app {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 18px 48px;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  padding: 8px 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-cat canvas {
  display: block;
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 4px 8px rgba(184, 160, 212, 0.35));
}

.logo {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--blush-deep), var(--lilac-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
}

.hero {
  text-align: center;
  padding: 28px 20px 24px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background: linear-gradient(120deg, rgba(245,198,203,0.35), rgba(212,196,232,0.35));
  border-radius: 50%;
  pointer-events: none;
}

.hero-cats {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 18px;
  position: relative;
}

.hero-cats canvas {
  width: 72px;
  height: 72px;
  animation: bob 2.8s ease-in-out infinite;
}
.hero-cats canvas:nth-child(2) { animation-delay: 0.35s; }
.hero-cats canvas:nth-child(3) { animation-delay: 0.7s; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero h2 {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 800;
  position: relative;
}

.hero p {
  margin: 0 auto 18px;
  max-width: 28rem;
  color: var(--ink-soft);
  font-weight: 600;
  line-height: 1.45;
  position: relative;
}

.btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

button, .btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

button:active, .btn:active { transform: scale(0.97); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--blush), var(--lilac));
  color: #4A3A4C;
  box-shadow: 0 6px 16px rgba(232, 155, 163, 0.4);
}

.btn-primary:hover { box-shadow: 0 8px 20px rgba(184, 160, 212, 0.5); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border: 1.5px solid rgba(212, 196, 232, 0.7);
}

.btn-ghost:hover { background: #fff; }

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.form-card h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
}

.form-card .sub {
  margin: 0 0 18px;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.9rem;
}

label {
  display: block;
  font-weight: 700;
  font-size: 0.82rem;
  margin: 0 0 6px;
  color: var(--ink);
}

.field { margin-bottom: 14px; }

input[type="text"],
input[type="password"],
input[type="tel"] {
  width: 100%;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid rgba(212, 196, 232, 0.65);
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}

input:focus {
  border-color: var(--lilac-deep);
  box-shadow: 0 0 0 3px rgba(212, 196, 232, 0.35);
}

.pin-input {
  letter-spacing: 0.35em;
  text-align: center;
  font-size: 1.4rem !important;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.avatar-option {
  appearance: none;
  background: rgba(255, 255, 255, 0.85);
  border: 2.5px solid transparent;
  border-radius: 16px;
  padding: 10px 6px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(184, 160, 212, 0.18);
}

.avatar-option canvas {
  width: 56px;
  height: 56px;
}

.avatar-option span {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.2;
}

.avatar-option.selected {
  border-color: var(--blush-deep);
  background: linear-gradient(160deg, #FFF5F7, #F5EEFF);
  box-shadow: 0 6px 16px rgba(232, 155, 163, 0.3);
}

.error {
  background: rgba(245, 198, 203, 0.55);
  color: #8A3A48;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 12px;
  display: none;
}

.error.show { display: block; }

.switch-auth {
  text-align: center;
  margin-top: 14px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.switch-auth button {
  background: none;
  border: none;
  color: var(--lilac-deep);
  font-weight: 800;
  padding: 0 4px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 26px 20px;
}

.profile-card canvas {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 8px 16px rgba(184, 160, 212, 0.4));
}

.profile-card h2 {
  margin: 4px 0 0;
  font-size: 1.5rem;
  font-weight: 800;
}

.badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--mint), var(--lilac));
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
}

.section-title {
  margin: 4px 2px 0;
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .spark {
  font-size: 1rem;
}

.toybox {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 560px) {
  .toybox { grid-template-columns: repeat(3, 1fr); }
}

.toy {
  background: var(--card);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px 12px 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.toy::after {
  content: 'soon';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-soft);
  padding: 3px 8px;
  border-radius: 999px;
}

.toy-emoji {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}

.toy h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.toy p {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.3;
}

.toy.t1 { background: linear-gradient(160deg, #FFF5F0, #FFE8EE); }
.toy.t2 { background: linear-gradient(160deg, #F5F0FF, #EDE8FF); }
.toy.t3 { background: linear-gradient(160deg, #F0FFF5, #E8F8F0); }
.toy.t4 { background: linear-gradient(160deg, #FFF8E8, #FFF0D8); }
.toy.t5 { background: linear-gradient(160deg, #E8F4FF, #F0F0FF); }
.toy.t6 { background: linear-gradient(160deg, #FFE8F5, #FFF0F8); }

.footer-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 600;
  margin-top: 8px;
}

.hidden { display: none !important; }

@media (min-width: 768px) {
  .app { padding: 24px 28px 64px; }
  .logo { font-size: 1.65rem; }
  .hero h2 { font-size: 1.9rem; }
  .hero-cats canvas { width: 88px; height: 88px; }
}
