/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PAWPALS · shared design system
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

:root {
  --pp-cream: #f5e7c8;
  --pp-cream-light: #fef5e6;
  --pp-warm: #fef0e6;
  --pp-gold: #d4af37;
  --pp-gold-light: #e6c450;
  --pp-gold-warm: #c47a4a;
  --pp-gold-deep: #8b4d2a;
  --pp-forest: #1a3a2a;
  --pp-forest-deep: #0f2419;
  --pp-night: #061812;
  --pp-text: #2d3a32;
  --pp-soft: #5a6b62;
  --pp-faint: #8a9690;
  --pp-fire: #ff7a45;
  --pp-energy: #5fbf91;
  --pp-happiness: #f0a04b;
  --pp-bond: #d97084;
  --pp-shadow: 0 30px 80px -30px rgba(15,36,25,0.35);
  --pp-shadow-soft: 0 10px 30px -10px rgba(15,36,25,0.15);
  --pp-bg: linear-gradient(180deg, #fef8ed 0%, #f5e7c8 55%, #f0d4ad 100%);
  --pp-bg-rich: radial-gradient(ellipse at top, #fef8ed 0%, #f5e7c8 55%, #ecc89a 100%);
  --pp-glass: rgba(255,255,255,0.62);
  --pp-glass-line: rgba(212,175,55,0.30);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; color: var(--pp-text); background: var(--pp-bg); overflow: hidden; -webkit-font-smoothing: antialiased; }

/* App shell */
.app { height: 100vh; display: flex; flex-direction: column; max-width: 480px; margin: 0 auto; position: relative; overflow: hidden; background: var(--pp-bg-rich); }

/* Top bar */
.topbar { padding: 16px 20px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar .back { color: var(--pp-soft); text-decoration: none; font-size: 14px; padding: 6px 8px; }
.topbar .title { font-family: 'Italiana', serif; font-size: 19px; color: var(--pp-forest-deep); flex: 1; text-align: center; }

/* Pills + chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 100px; font-size: 11px; font-weight: 600; letter-spacing: 0.2px; }
.chip-glass { background: var(--pp-glass); border: 1px solid var(--pp-glass-line); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); color: var(--pp-forest-deep); }
.chip-gold { background: linear-gradient(135deg, #fff5d8, #f5e2b0); border: 1px solid rgba(212,175,55,0.5); color: var(--pp-gold-deep); }
.chip-fire { background: linear-gradient(135deg, #fff1e8, #ffe0cc); border: 1px solid rgba(255,122,69,0.45); color: #c2502b; }
.chip-coins { background: linear-gradient(135deg, #fffbe8, #f5e8b0); border: 1px solid rgba(212,175,55,0.5); color: var(--pp-gold-deep); }

/* Glass cards */
.glass { background: var(--pp-glass); border: 1px solid var(--pp-glass-line); border-radius: 20px; backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 22px; border-radius: 100px; font-size: 12.5px; letter-spacing: 1.8px; text-transform: uppercase; font-weight: 600; border: none; cursor: pointer; text-decoration: none; transition: transform 0.2s, box-shadow 0.2s; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--pp-forest-deep); color: #fff; box-shadow: 0 12px 24px -10px rgba(15,36,25,0.45); }
.btn-gold { background: linear-gradient(135deg, var(--pp-gold-warm), var(--pp-gold-deep)); color: #fff; box-shadow: 0 12px 24px -10px rgba(196,122,74,0.55); }
.btn-ghost { background: rgba(255,255,255,0.55); color: var(--pp-forest-deep); border: 1px solid var(--pp-glass-line); }

/* Bottom nav */
.nav { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,251,243,0.85); border-top: 1px solid var(--pp-glass-line); backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; text-decoration: none; color: var(--pp-soft); transition: color 0.2s, transform 0.2s; }
.nav a.active { color: var(--pp-gold-deep); }
.nav a:active { transform: scale(0.93); }
.nav .nav-icon { width: 22px; height: 22px; opacity: 0.8; }
.nav a.active .nav-icon { opacity: 1; }
.nav .nav-lab { font-size: 9.5px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 600; }

/* Floating reward popup */
.reward-pop { position: fixed; left: 50%; top: 38%; transform: translate(-50%, 0); background: linear-gradient(135deg, var(--pp-gold-warm), var(--pp-gold-deep)); color: #fff; padding: 14px 28px; border-radius: 100px; font-family: 'Italiana', serif; font-size: 22px; font-style: italic; box-shadow: 0 20px 40px -15px rgba(196,122,74,0.6); pointer-events: none; opacity: 0; z-index: 1000; }
.reward-pop.show { animation: rewardFloat 2.2s cubic-bezier(0.4,0,0.2,1) forwards; }
@keyframes rewardFloat { 0% { opacity: 0; transform: translate(-50%, 30px) scale(0.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 25% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50px) scale(0.95); } }

/* Level-up overlay */
.levelup { position: fixed; inset: 0; background: radial-gradient(circle at center, rgba(212,175,55,0.95), rgba(139,77,42,0.95)); display: none; align-items: center; justify-content: center; flex-direction: column; gap: 16px; z-index: 2000; color: #fff; text-align: center; padding: 32px; }
.levelup.show { display: flex; animation: levelupFade 0.6s ease forwards; }
@keyframes levelupFade { from { opacity: 0; backdrop-filter: blur(0); } to { opacity: 1; backdrop-filter: blur(8px); } }
.levelup .lu-eye { font-size: 11px; letter-spacing: 5px; text-transform: uppercase; opacity: 0.85; }
.levelup .lu-num { font-family: 'Italiana', serif; font-size: 96px; font-style: italic; line-height: 1; text-shadow: 0 6px 24px rgba(0,0,0,0.3); }
.levelup .lu-title { font-family: 'Italiana', serif; font-size: 32px; font-style: italic; }
.levelup .lu-msg { font-size: 14px; opacity: 0.9; max-width: 320px; line-height: 1.6; }
.levelup .lu-close { margin-top: 16px; padding: 12px 28px; background: rgba(255,255,255,0.25); border: 1px solid rgba(255,255,255,0.4); color: #fff; border-radius: 100px; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; }

/* Sparkles */
.sparkle { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--pp-gold-light); pointer-events: none; opacity: 0; }
.sparkle.go { animation: sparkleOut 1.4s ease forwards; }
@keyframes sparkleOut { 0% { opacity: 1; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); } }

/* Phone frame on desktop */
@media (min-width: 481px) {
  body { background: linear-gradient(135deg, #1a3a2a 0%, #061812 100%); padding: 24px; align-items: center; justify-content: center; display: flex; }
  .app { height: 92vh; max-height: 920px; border-radius: 38px; overflow: hidden; box-shadow: 0 40px 100px -30px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,175,55,0.2); }
}

/* ━━━ PET WALKING SVG ━━━ */
.pet-svg { display: block; }
.pet-walking { animation: petBob 0.7s ease-in-out infinite; }
@keyframes petBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.leg-a { animation: legSwingA 0.7s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0%; }
.leg-b { animation: legSwingB 0.7s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0%; }
@keyframes legSwingA { 0%,100% { transform: rotate(18deg); } 50% { transform: rotate(-18deg); } }
@keyframes legSwingB { 0%,100% { transform: rotate(-18deg); } 50% { transform: rotate(18deg); } }
.tail-wag { animation: tailWag 0.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 0% 50%; }
@keyframes tailWag { 0%,100% { transform: rotate(-12deg); } 50% { transform: rotate(20deg); } }
.ear-flop { animation: earFlop 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0%; }
@keyframes earFlop { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(4deg); } }
.eye-blink { animation: blink 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }

/* Wandering pet */
.pet-wander { animation: wanderXY 14s ease-in-out infinite; }
@keyframes wanderXY {
  0% { transform: translateX(-90px); }
  48% { transform: translateX(90px); }
  50% { transform: translateX(90px) scaleX(-1); }
  98% { transform: translateX(-90px) scaleX(-1); }
  100% { transform: translateX(-90px) scaleX(1); }
}

/* Hop animation for rabbit */
.pet-hopping { animation: hopBob 0.65s ease-in-out infinite; }
@keyframes hopBob { 0%,100% { transform: translateY(0); } 35% { transform: translateY(-12px); } 60% { transform: translateY(0); } }

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(14px); animation: revealUp 0.7s ease forwards; }
.reveal.d1 { animation-delay: 0.1s; }
.reveal.d2 { animation-delay: 0.2s; }
.reveal.d3 { animation-delay: 0.3s; }
.reveal.d4 { animation-delay: 0.4s; }
@keyframes revealUp { to { opacity: 1; transform: translateY(0); } }
