/* Fairyland Village - Game UI & HUD Styling */

/* TOP HUD BAR */
.top-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  z-index: 20;
}

.hud-pill {
  background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
  border: 3px solid #f59e0b;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18), inset 0 2px 2px rgba(255, 255, 255, 0.8);
  padding: 4px 14px 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #78350f;
  transition: transform 0.15s ease;
}

.hud-pill:hover {
  transform: translateY(-2px);
}

.hud-pill-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.icon-coin {
  background: linear-gradient(135deg, #fef08a, #eab308, #ca8a04);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.icon-gem {
  background: linear-gradient(135deg, #a7f3d0, #10b981, #047857);
  color: #fff;
}

.icon-level {
  background: linear-gradient(135deg, #c084fc, #9333ea, #6b21a8);
  color: #fff;
}

.level-bar-container {
  display: flex;
  flex-direction: column;
  min-width: 90px;
}

.level-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.level-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  width: 0%;
  transition: width 0.3s ease;
}

.hud-btn {
  background: linear-gradient(180deg, #ffffff 0%, #ffedd5 100%);
  border: 3px solid #f97316;
  color: #c2410c;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18), inset 0 2px 2px rgba(255,255,255,0.8);
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hud-btn:hover {
  transform: scale(1.08) translateY(-2px);
  background: #ffedd5;
}

.hud-btn:active {
  transform: scale(0.95);
}

/* QUEST TRACKER HUD */
.quest-tracker-hud {
  position: absolute;
  top: 72px;
  left: 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 2px solid #fbbf24;
  border-radius: 16px;
  padding: 8px 14px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 280px;
  cursor: pointer;
  transition: transform 0.2s ease;
  z-index: 20;
}

.quest-tracker-hud:hover {
  transform: translateY(-2px);
}

.quest-badge-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* INTERACTION PROMPT (3D floating / center) */
#interaction-prompt {
  position: absolute;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%) scale(0.9);
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
  border: 3px solid #f59e0b;
  border-radius: 999px;
  padding: 10px 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25), 0 0 16px rgba(245, 158, 11, 0.5);
  display: none;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.1rem;
  color: #78350f;
  cursor: pointer;
  z-index: 25;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: promptBob 1.5s infinite ease-in-out;
}

#interaction-prompt.visible {
  display: flex;
  transform: translateX(-50%) scale(1);
}

#interaction-prompt:active {
  transform: translateX(-50%) scale(0.95);
}

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

.prompt-key-badge {
  background: #f59e0b;
  color: white;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* STEALING MINIGAME PROGRESS BAR */
#steal-progress-container {
  position: absolute;
  left: 50%;
  bottom: 175px;
  transform: translateX(-50%);
  width: 240px;
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 10px;
  border-radius: 12px;
  border: 2px solid #ef4444;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 30;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

#steal-progress-bar {
  height: 12px;
  background: linear-gradient(90deg, #eab308, #ef4444);
  border-radius: 6px;
  width: 0%;
  transition: width 0.1s linear;
}

/* BOTTOM NAVIGATION DOCK */
.bottom-dock {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(254, 243, 199, 0.95) 100%);
  border: 3px solid #f59e0b;
  border-radius: 28px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2), inset 0 2px 3px rgba(255,255,255,0.8);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 22;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 95vw;
}

.dock-btn {
  background: transparent;
  border: none;
  border-radius: 18px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #78350f;
  font-weight: 800;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 60px;
}

.dock-btn i {
  font-size: 1.45rem;
  color: #d97706;
  transition: transform 0.2s ease, color 0.2s ease;
}

.dock-btn:hover, .dock-btn.active {
  background: #fef08a;
  transform: translateY(-4px);
  color: #b45309;
}

.dock-btn:hover i, .dock-btn.active i {
  transform: scale(1.15);
  color: #b45309;
}

.dock-btn:active {
  transform: scale(0.95);
}

/* MOBILE VIRTUAL JOYSTICK */
#joystick-zone {
  position: absolute;
  bottom: 24px;
  left: 24px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 2px dashed rgba(255, 255, 255, 0.6);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

#joystick-thumb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff 0%, #fde68a 100%);
  border: 3px solid #f59e0b;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  position: absolute;
  pointer-events: none;
}

/* MOBILE ACTION BUTTONS (Right side) */
#mobile-actions {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  z-index: 20;
}

.mobile-action-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff 0%, #ffedd5 100%);
  border: 3px solid #f97316;
  color: #c2410c;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(0,0,0,0.22);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s ease;
}

.mobile-action-btn:active {
  transform: scale(0.9);
  background: #fed7aa;
}

.btn-jump {
  border-color: #3b82f6;
  color: #1d4ed8;
}

.btn-sprint {
  border-color: #8b5cf6;
  color: #6d28d9;
}

.btn-interact-mobile {
  border-color: #10b981;
  color: #047857;
  width: 68px;
  height: 68px;
  font-size: 1.7rem;
}

/* FANTASY MODAL STYLING */
.fantasy-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.fantasy-modal-backdrop.open {
  display: flex;
  opacity: 1;
}

.fantasy-modal {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border: 4px solid #f59e0b;
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35), inset 0 2px 4px rgba(255,255,255,0.9);
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fantasy-modal-backdrop.open .fantasy-modal {
  transform: scale(1);
}

.modal-header-ribbon {
  background: linear-gradient(90deg, #d97706 0%, #f59e0b 50%, #d97706 100%);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid #b45309;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.modal-close-btn {
  background: #dc2626;
  border: 2px solid #ffffff;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.15s ease;
}

.modal-close-btn:hover {
  transform: scale(1.1);
}

.fantasy-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

/* CARDS & ITEMS IN MODALS */
.fantasy-card {
  background: #ffffff;
  border: 2px solid #fde68a;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
}

.fantasy-card:hover {
  border-color: #f59e0b;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.1);
}

.fantasy-btn-primary {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 2px solid #d97706;
  border-radius: 14px;
  color: #78350f;
  font-weight: 800;
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(217, 119, 6, 0.3), inset 0 1px 1px rgba(255,255,255,0.7);
  transition: all 0.15s ease;
}

.fantasy-btn-primary:hover {
  background: #f59e0b;
  transform: translateY(-2px);
}

.fantasy-btn-primary:active {
  transform: scale(0.96);
}

.fantasy-btn-secondary {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  color: #475569;
  font-weight: 800;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fantasy-btn-secondary:hover {
  background: #f8fafc;
  transform: translateY(-2px);
}

/* FLOATING NOTIFICATION TOASTS */
#notification-container {
  position: absolute;
  top: 70px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
  pointer-events: none;
}

.toast-item {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #f59e0b;
  border-radius: 14px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #78350f;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, toastOut 0.3s ease 2.7s forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

/* FLOATING 3D REWARD LABELS */
.floating-reward {
  position: absolute;
  font-weight: 900;
  font-size: 1.3rem;
  color: #f59e0b;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5), -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
  pointer-events: none;
  animation: floatUpFade 1.2s ease-out forwards;
  z-index: 40;
}

@keyframes floatUpFade {
  0% { opacity: 1; transform: translate(-50%, 0) scale(0.8); }
  30% { transform: translate(-50%, -25px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(1); }
}

/* CONFETTI CANVAS */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 100;
}

/* START SCREEN / MAIN MENU */
#start-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #60a5fa 0%, #1e3a8a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  color: white;
  text-align: center;
  padding: 20px;
}

.start-title-container {
  margin-bottom: 24px;
  max-width: 767px;
}

.start-logo {
  font-size: 3rem;
  font-weight: 900;
  text-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 20px rgba(251, 191, 36, 0.7);
  color: #fef08a;
  letter-spacing: 1px;
}

.start-btn {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  border: 4px solid #ffffff;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 900;
  padding: 14px 42px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.start-btn:hover {
  transform: scale(1.06) translateY(-4px);
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
}

.start-btn:active {
  transform: scale(0.96);
}

/* LOADING SCREEN */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #38bdf8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
  color: white;
  transition: opacity 0.5s ease;
}

.progress-bar-container {
  width: 260px;
  height: 16px;
  background: rgba(0,0,0,0.2);
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid white;
  margin-top: 20px;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #facc15, #f97316);
  transition: width 0.2s ease;
}

/* RESPONSIVE TWEAKS */
@media (max-width: 768px) {
  .top-hud {
    top: 8px;
    left: 8px;
    right: 8px;
  }
  .hud-pill {
    padding: 3px 10px 3px 6px;
    font-size: 0.85rem;
  }
  .hud-pill-icon {
    width: 26px;
    height: 26px;
    font-size: 1rem;
  }
  .quest-tracker-hud {
    top: 58px;
    left: 8px;
    max-width: 220px;
    font-size: 0.8rem;
    padding: 6px 10px;
  }
  .bottom-dock {
    bottom: 8px;
    padding: 4px 8px;
    gap: 4px;
  }
  .dock-btn {
    padding: 4px 6px;
    font-size: 0.65rem;
    min-width: 48px;
  }
  .dock-btn i {
    font-size: 1.25rem;
  }
  #joystick-zone {
    width: 110px;
    height: 110px;
    bottom: 74px;
    left: 12px;
  }
  #joystick-thumb {
    width: 44px;
    height: 44px;
  }
  #mobile-actions {
    bottom: 74px;
    right: 12px;
  }
  .mobile-action-btn {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
  .btn-interact-mobile {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
  }
}
