/* ============================================
   🌸 Scavenger Hunt — Global Stylesheet
   ============================================ */

/* Google Fonts: Nunito (rounded, playful) */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;900&family=Fredoka+One&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --pink:    #ffb3c6;
  --peach:   #ffd6a5;
  --yellow:  #fffacd;
  --mint:    #b5ead7;
  --lavender:#d4b8e0;
  --sky:     #bde0fe;
  --cream:   #fff9f0;
  --text:    #5a4a6a;
  --btn-bg:  #ffb3c6;
  --btn-shadow: #f77faa;
  --radius:  2rem;
  --font-head: 'Fredoka One', cursive;
  --font-body: 'Nunito', sans-serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent; /* no grey flash on mobile tap */
  touch-action: manipulation;
}

/* ---------- Page Wrapper ---------- */
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 2rem 1.25rem 3rem;
  position: relative;
}

/* ---------- Gradient Backgrounds (per page) ---------- */
.bg-hunt1 { background: linear-gradient(160deg, #ffe4ee 0%, #fff0f7 60%, #ffe8f5 100%); }
.bg-hunt2 { background: linear-gradient(160deg, #e8f4fd 0%, #f5f0ff 60%, #e8edff 100%); }
.bg-hunt3 { background: linear-gradient(160deg, #fff0e0 0%, #fff8f0 60%, #ffe8d6 100%); }
.bg-hunt4 { background: linear-gradient(160deg, #e0f7e9 0%, #f0fff4 60%, #d6f5e3 100%); }
.bg-finale { background: linear-gradient(160deg, #fdf0ff 0%, #fff5fb 60%, #f0e8ff 100%); }

/* ---------- Header / Title ---------- */
.hunt-header {
  text-align: center;
  margin-bottom: 1.75rem;
  z-index: 1;
}

.hunt-number {
  display: inline-block;
  background: var(--lavender);
  color: #fff;
  font-family: var(--font-head);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  padding: 0.3rem 1.1rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 8px rgba(180,120,220,0.25);
}

.hunt-title {
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  color: var(--text);
  line-height: 1.2;
}

.hunt-subtitle {
  font-size: 1rem;
  color: #9a7eaa;
  margin-top: 0.4rem;
}

/* ---------- Continue Button ---------- */
.continue-btn {
  display: none; /* shown via JS */
  margin-top: 2rem;
  padding: 1rem 2.5rem;
  font-family: var(--font-head);
  font-size: 1.3rem;
  color: #fff;
  background: linear-gradient(135deg, #ffb3c6, #f77faa);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 0 var(--btn-shadow), 0 10px 24px rgba(247,127,170,0.35);
  transition: transform 0.12s, box-shadow 0.12s;
  z-index: 10;
  animation: popIn 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
}

.continue-btn:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 var(--btn-shadow), 0 6px 14px rgba(247,127,170,0.3);
}

.continue-btn.visible { display: inline-block; }

/* ---------- Floating Decorations ---------- */
.deco {
  position: fixed;
  pointer-events: none;
  user-select: none;
  font-size: 1.6rem;
  opacity: 0.55;
  z-index: 0;
  animation: floatDeco 6s ease-in-out infinite;
}

/* Stagger each decoration */
.deco:nth-child(1) { top: 6%;  left: 4%;  animation-delay: 0s;    font-size: 1.2rem; }
.deco:nth-child(2) { top: 12%; right: 6%; animation-delay: 1s;    font-size: 1.8rem; }
.deco:nth-child(3) { top: 55%; left: 3%;  animation-delay: 2s;    font-size: 1.4rem; }
.deco:nth-child(4) { top: 70%; right: 5%; animation-delay: 0.5s;  font-size: 1rem;   }
.deco:nth-child(5) { top: 85%; left: 8%;  animation-delay: 1.5s;  font-size: 1.6rem; }
.deco:nth-child(6) { top: 30%; right: 3%; animation-delay: 2.5s;  font-size: 1.3rem; }

@keyframes floatDeco {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-14px) rotate(8deg); }
}

/* ---------- Shared: Shake animation ---------- */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-6px) rotate(-5deg); }
  40%     { transform: translateX(6px) rotate(5deg); }
  60%     { transform: translateX(-5px) rotate(-3deg); }
  80%     { transform: translateX(5px) rotate(3deg); }
}

.shaking { animation: shake 0.45s ease both !important; }

/* ---------- Shared: Pop-in for items ---------- */
@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ---------- Success flash ---------- */
@keyframes successPulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.3); }
}

.correct-flash { animation: successPulse 0.5s ease both !important; }

/* ---------- Floating up/down loop ---------- */
@keyframes floatLoop {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* ---------- Spin loop ---------- */
@keyframes spinLoop {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
