* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif;
  background: #1a1a1a;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  color: #fff;
}

h1, h2, h3 { font-family: 'Fredoka', sans-serif; }
.hidden { display: none !important; }
.screen { display: none !important; position: fixed; inset: 0; }
.screen.active { display: block !important; }

/* ===== Background Image ===== */
.bg-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-image {
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: center top;
}

/* ===== Compass Overlay =====
   Positioned to land right on top of the compass in the image. */
.compass-overlay {
  position: absolute;
  top: 59%;
  left: 45%;
  transform: translate(-50%, -50%);
  width: 38vw;
  height: 38vw;
  max-width: 180px;
  max-height: 180px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Compass Needle ===== */
.compass-needle {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.needle-north, .needle-south {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
}

.needle-north {
  bottom: 50%;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 60px solid #e74c3c;
}

.needle-south {
  top: 50%;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 60px solid #ecf0f1;
}

@media (max-width: 380px) {
  .needle-north {
    border-left-width: 5px; border-right-width: 5px;
    border-bottom-width: 50px;
  }
  .needle-south {
    border-left-width: 5px; border-right-width: 5px;
    border-top-width: 50px;
  }
}

.compass-center-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  background: radial-gradient(circle, #f5c842 0%, #c9952b 100%);
  border-radius: 50%;
  border: 2px solid #a07520;
  z-index: 3;
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
}

/* ===== Distance Text (inside the compass) ===== */
.distance-text {
  position: absolute;
  bottom: 16%;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #2c1810;
  text-shadow:
    0 0 4px rgba(245, 230, 200, 0.9),
    0 0 8px rgba(245, 230, 200, 0.6);
  z-index: 4;
  text-align: center;
  line-height: 1.1;
  pointer-events: none;
}

/* ===== Status Bar (bottom) ===== */
.status-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 12px 20px calc(env(safe-area-inset-bottom, 8px) + 12px);
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.progress-eggs {
  display: flex; gap: 6px;
}

.progress-egg {
  font-size: 22px;
  transition: all 0.4s ease;
  filter: saturate(0.2) brightness(0.6);
}
.progress-egg.completed {
  filter: saturate(1) brightness(1);
  animation: eggPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes eggPop {
  0% { transform: scale(0.5); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.status-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  text-align: center;
}

/* ===== Task Screen ===== */
#taskScreen {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
#taskScreen.active {
  display: block !important;
  overflow-y: auto;
}

.task-container {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px 20px;
  gap: 16px;
}

.task-burst {
  font-size: 64px;
  animation: burstPulse 1.5s ease-in-out infinite;
}
@keyframes burstPulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.15) rotate(5deg); }
}

.task-container h2 {
  font-size: 1.8rem;
  background: linear-gradient(135deg, #55efc4, #00b894);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.task-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; padding: 24px;
  max-width: 400px; width: 100%;
  animation: taskReveal 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes taskReveal {
  from { opacity: 0; transform: scale(0.7) translateY(30px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.task-text {
  font-size: 1.15rem; line-height: 1.6;
  font-weight: 700; color: #fff; text-align: center;
}

/* ===== Photo Section ===== */
.photo-section { width: 100%; max-width: 400px; }
.camera-buttons { display: flex; justify-content: center; }
.capture-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 16px 32px; width: 100%;
  background: linear-gradient(135deg, #00b894, #55efc4);
  border: none; border-radius: 12px;
  font-family: 'Fredoka', sans-serif; font-size: 1.1rem; font-weight: 600;
  color: #1a1a2e; cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,184,148,0.4);
}
.capture-btn:hover { transform: translateY(-2px); }
.hidden-input { position: absolute; opacity: 0; width: 0; height: 0; }

.photo-preview-container {
  margin-bottom: 12px; position: relative;
  border-radius: 12px; overflow: hidden;
  border: 2px solid rgba(255,255,255,0.2);
}
.photo-preview {
  width: 100%; display: block; border-radius: 12px;
  max-height: 280px; object-fit: cover;
}
.retake-btn {
  position: absolute; top: 10px; right: 10px;
  padding: 8px 14px; background: rgba(0,0,0,0.7);
  color: #fff; border: none; border-radius: 8px;
  font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 0.85rem; cursor: pointer;
}

.submit-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; width: 100%; padding: 16px;
  background: linear-gradient(135deg, #e17055, #d63031);
  border: none; border-radius: 12px;
  font-family: 'Fredoka', sans-serif; font-size: 1.15rem; font-weight: 600;
  color: #fff; cursor: pointer; margin-top: 10px;
  box-shadow: 0 4px 20px rgba(214,48,49,0.4);
  animation: submitGlow 2s ease-in-out infinite;
}
@keyframes submitGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(214,48,49,0.4); }
  50% { box-shadow: 0 4px 35px rgba(214,48,49,0.7); }
}
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; animation: none; }

/* ===== Verification Overlay ===== */
.verification-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.verification-content {
  background: #1a1a2e; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px; padding: 40px 28px;
  max-width: 360px; width: 90%; text-align: center;
  animation: contentPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes contentPop {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}
.egg-spin {
  font-size: 56px; display: inline-block;
  animation: spinEgg 1s linear infinite;
}
@keyframes spinEgg {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.verification-spinner p { margin-top: 14px; font-weight: 700; color: rgba(255,255,255,0.7); }
.result-icon { font-size: 64px; margin-bottom: 14px; }
.result-message {
  font-size: 1rem; line-height: 1.6; color: #fff;
  margin-bottom: 20px; white-space: pre-line;
}
.continue-btn {
  padding: 14px 32px;
  background: linear-gradient(135deg, #00b894, #55efc4);
  border: none; border-radius: 12px;
  font-family: 'Fredoka', sans-serif; font-size: 1.05rem; font-weight: 600;
  color: #1a1a2e; cursor: pointer;
}

/* ===== Victory ===== */
#victoryScreen {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
#victoryScreen.active {
  display: flex !important;
  align-items: center; justify-content: center;
}
.victory-content {
  text-align: center;
  animation: victoryAppear 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes victoryAppear {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}
.trophy {
  font-size: 96px;
  animation: trophyBounce 1s ease-in-out infinite;
}
@keyframes trophyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}
#victoryScreen h1 {
  font-size: 3rem; margin-top: 12px;
  background: linear-gradient(135deg, #f9ca24, #e17055, #e84393);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
#victoryScreen h2 { font-size: 1.3rem; color: rgba(255,255,255,0.7); margin-top: 6px; }
.victory-message { font-size: 1.4rem; font-weight: 700; margin-top: 24px; }

/* ===== Confetti ===== */
.confetti-piece {
  position: fixed; width: 10px; height: 20px; top: -20px;
  animation: confettiFall linear forwards; z-index: 200;
}
@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ===== Success/Fail Videos ===== */
#successVideo, #failVideo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;  /* Fills viewport without black bars */
  background-color: black;
  z-index: 9999;
  pointer-events: auto;
}
