/**
 * AR Scanner Overlay Styles
 * Cupid AR - Valentine's Tech Booth
 * Split-View Design: AR Camera + 3D Map
 */

/* ============================================
   AR OVERLAY CONTAINER - Split View
   ============================================ */
.ar-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

/* ============================================
   TOP UI BAR - Floating Controls
   ============================================ */
.ar-ui-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: auto;
  z-index: 10;
}

.ar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

/* Pink Back Button */
.ar-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: #FF6B9D;
  border-radius: 14px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
  transition: all 0.2s;
}

.ar-back-btn:hover {
  background: #E85A8C;
  transform: scale(1.05);
}

.ar-back-btn svg {
  stroke: white;
}

/* Right Side Controls */
.ar-right-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* Building Icon Button */
.ar-building-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.ar-building-btn:hover {
  transform: scale(1.05);
}

.ar-building-btn img {
  width: 28px;
  height: 28px;
}

/* Points Display */
.ar-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: white;
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ar-score span {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #333;
}

.ar-score small {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #999;
  font-weight: 600;
}

/* Header Collection Count */
.ar-collection-count {
  display: flex;
  align-items: center;
  background: white;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #FF6B9D;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Hide old title */
.ar-title {
  display: none;
}

.ar-crosshair {
  display: none;
}

/* ============================================
   FEEDBACK TOAST
   ============================================ */
.ar-feedback {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 16px;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
  animation: feedback-slide-in 0.4s ease-out;
  z-index: 200;
}

.ar-feedback.hidden {
  display: none;
}

.ar-feedback.success {
  border: 3px solid #4CAF50;
}

.ar-feedback.warning {
  border: 3px solid #FFC107;
}

.ar-feedback.error {
  border: 3px solid #F44336;
}

@keyframes feedback-slide-in {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.ar-feedback-icon {
  font-size: 3rem;
  animation: bounce-icon 0.6s ease-out;
}

@keyframes bounce-icon {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.3);
  }

  70% {
    transform: scale(0.9);
  }

  100% {
    transform: scale(1);
  }
}

.ar-feedback-text {
  display: flex;
  flex-direction: column;
}

.ar-feedback-text strong {
  font-size: 1.125rem;
  color: #2D2D2D;
  margin-bottom: 4px;
}

.ar-feedback-text span {
  font-size: 0.875rem;
  color: #E91E63;
  font-weight: 600;
}

/* Rarity-based colors */
.ar-feedback[data-rarity="common"] .ar-feedback-text span {
  color: #666;
}

.ar-feedback[data-rarity="rare"] .ar-feedback-text span {
  color: #2196F3;
}

.ar-feedback[data-rarity="epic"] .ar-feedback-text span {
  color: #9C27B0;
}

.ar-feedback[data-rarity="legendary"] .ar-feedback-text span {
  color: #FF9800;
}

/* ============================================
   BOTTOM UI BAR
   ============================================ */
.ar-ui-bottom {
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  pointer-events: auto;
}

.ar-hints {
  text-align: center;
  color: white;
  font-size: 0.875rem;
  margin-bottom: 12px;
  opacity: 0.9;
}

.ar-hints strong {
  color: #FF4081;
}

.ar-collected {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.2);
  padding: 12px 24px;
  border-radius: 24px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 auto;
  width: fit-content;
}

.ar-collected span:first-child {
  color: #FF4081;
  font-size: 1.25rem;
}

/* ============================================
   SCANNING ANIMATION
   ============================================ */
.ar-scanning-line {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #FF4081, transparent);
  animation: scan-line 2s ease-in-out infinite;
}

@keyframes scan-line {

  0%,
  100% {
    top: 30%;
    opacity: 0;
  }

  50% {
    top: 70%;
    opacity: 1;
  }
}

/* ============================================
   MARKER DETECTED STATE
   ============================================ */
.ar-marker-detected .ar-crosshair {
  opacity: 0;
}

.ar-marker-detected .ar-status {
  color: #4CAF50;
}

/* ============================================
   COLLECTION CELEBRATION - Enhanced
   ============================================ */
.ar-celebration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
  overflow: hidden;
}

.ar-confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #FF4081;
  animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Screen flash effect */
.ar-flash {
  position: fixed;
  inset: 0;
  background: white;
  pointer-events: none;
  z-index: 350;
  opacity: 0;
  animation: screen-flash 0.3s ease-out forwards;
}

@keyframes screen-flash {
  0% {
    opacity: 0.8;
  }

  100% {
    opacity: 0;
  }
}

.ar-screen-shake {
  animation: screen-shake 0.5s ease-out;
}

@keyframes screen-shake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-8px) rotate(-0.5deg); }
  20% { transform: translateX(8px) rotate(0.5deg); }
  30% { transform: translateX(-6px) rotate(-0.3deg); }
  40% { transform: translateX(6px) rotate(0.3deg); }
  50% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

/* Floating points animation */
.ar-floating-points {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3rem;
  font-weight: 800;
  color: #FFD700;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 40px rgba(255, 215, 0, 0.5);
  pointer-events: none;
  z-index: 400;
  animation: float-up-points 1.5s ease-out forwards;
}

@keyframes float-up-points {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0) scale(0.5);
  }

  20% {
    opacity: 1;
    transform: translateX(-50%) translateY(-20px) scale(1.2);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-150px) scale(0.8);
  }
}

/* Heart burst animation */
.ar-heart-burst {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 6rem;
  pointer-events: none;
  z-index: 360;
  animation: heart-burst 0.8s ease-out forwards;
}

@keyframes heart-burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.3);
  }

  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.5);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2);
  }
}

.ar-particle-burst {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 355;
}

.ar-burst-particle {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0;
  animation: particle-explode 0.8s ease-out forwards;
  animation-delay: var(--delay, 0ms);
  --distance: 80px;
}

.ar-burst-rare {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 4px rgba(156, 39, 176, 0.6));
}

.ar-burst-epic {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 6px rgba(233, 30, 99, 0.7));
  animation-duration: 1s;
}

.ar-burst-legendary {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.9));
  animation-duration: 1.2s;
}

@keyframes particle-explode {
  0% {
    opacity: 1;
    transform: rotate(var(--angle)) translateX(0) scale(0.5);
  }
  60% {
    opacity: 1;
    transform: rotate(var(--angle)) translateX(var(--distance)) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--angle)) translateX(calc(var(--distance) * 1.5)) scale(0.6);
  }
}

/* ============================================
   QUICK-COLLECT PROGRESS RING
   ============================================ */
.ar-quick-collect-ring {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s;
}

.ar-quick-collect-ring.active {
  opacity: 1;
}

.ar-quick-collect-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ar-quick-collect-ring .ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.3);
  stroke-width: 8;
}

.ar-quick-collect-ring .ring-progress {
  fill: none;
  stroke: #FF6B9D;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 0.1s linear;
  filter: drop-shadow(0 0 8px rgba(255, 107, 157, 0.6));
}

.ar-quick-collect-ring .ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  text-align: center;
}

/* ============================================
   DETECTION FEEDBACK - Enhanced
   ============================================ */
.ar-detection-border {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  border: 2px solid transparent;
  transition: border-color 0.4s ease, border-width 0.3s ease, box-shadow 0.4s ease;
}

/* Searching State - Subtle red/pink pulsing */
.ar-detection-border.searching {
  border-color: rgba(244, 67, 54, 0.3);
  border-width: 2px;
  animation: border-pulse-search 2s ease-in-out infinite;
}

/* Detecting State - Subtle yellow/orange with gentle pulse */
.ar-detection-border.detecting {
  border-color: rgba(255, 193, 7, 0.5);
  border-width: 3px;
  animation: border-pulse-detect 0.8s ease-in-out infinite;
  box-shadow: inset 0 0 20px rgba(255, 193, 7, 0.08);
}

/* Locked State - Subtle green success with glow */
.ar-detection-border.locked {
  border-color: rgba(76, 175, 80, 0.6);
  border-width: 3px;
  animation: border-success-glow 1s ease-out forwards;
  box-shadow: inset 0 0 30px rgba(76, 175, 80, 0.12),
              0 0 10px rgba(76, 175, 80, 0.15);
}

/* Already Collected State - Muted green */
.ar-detection-border.collected {
  border-color: rgba(76, 175, 80, 0.35);
  border-width: 2px;
  animation: none;
  box-shadow: none;
}

@keyframes border-pulse-search {
  0%, 100% {
    opacity: 0.3;
    border-color: rgba(244, 67, 54, 0.25);
  }
  50% {
    opacity: 0.6;
    border-color: rgba(255, 107, 157, 0.4);
  }
}

@keyframes border-pulse-detect {
  0%, 100% {
    opacity: 0.5;
    border-width: 3px;
    border-color: rgba(255, 193, 7, 0.5);
  }
  50% {
    opacity: 0.7;
    border-width: 3px;
    border-color: rgba(255, 152, 0, 0.6);
  }
}

@keyframes border-success-glow {
  0% {
    box-shadow: inset 0 0 30px rgba(76, 175, 80, 0.12),
                0 0 0 rgba(76, 175, 80, 0);
  }
  50% {
    box-shadow: inset 0 0 40px rgba(76, 175, 80, 0.18),
                0 0 15px rgba(76, 175, 80, 0.2);
  }
  100% {
    box-shadow: inset 0 0 30px rgba(76, 175, 80, 0.12),
                0 0 8px rgba(76, 175, 80, 0.12);
  }
}

/* ============================================
   DETECTION STATUS INDICATOR (Progress Bar)
   ============================================ */
.ar-detection-status {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 160;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ar-detection-status.visible {
  opacity: 1;
}

.ar-detection-status-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ar-detection-status-bar {
  width: 120px;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.ar-detection-status-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #FFC107, #4CAF50);
  border-radius: 3px;
  transition: width 0.2s ease;
}

/* Status colors based on state */
.ar-detection-status.searching .ar-detection-status-text {
  background: rgba(244, 67, 54, 0.7);
}

.ar-detection-status.detecting .ar-detection-status-text {
  background: rgba(255, 152, 0, 0.8);
}

.ar-detection-status.locked .ar-detection-status-text {
  background: rgba(76, 175, 80, 0.8);
}

/* Detection hint text - Enhanced */
.ar-detection-hint {
  position: fixed;
  top: 140px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: none;
  z-index: 150;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s, background 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.ar-detection-hint.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ar-detection-hint .hint-icon {
  font-size: 1.4rem;
  animation: hint-icon-pulse 1.5s ease-in-out infinite;
}

@keyframes hint-icon-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* State-based hint colors */
.ar-detection-hint.searching {
  background: rgba(244, 67, 54, 0.85);
}

.ar-detection-hint.detecting {
  background: rgba(255, 152, 0, 0.9);
}

.ar-detection-hint.locked {
  background: rgba(76, 175, 80, 0.9);
}

.ar-detection-hint.collected {
  background: rgba(158, 158, 158, 0.85);
}

/* ============================================
   LOADING STATE
   ============================================ */
.ar-loading {
  position: fixed;
  inset: 0;
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 500;
  color: white;
}

.ar-loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #E91E63;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.ar-loading-text {
  font-size: 1rem;
  opacity: 0.8;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   CAMERA PERMISSION DENIED
   ============================================ */
.ar-permission-denied {
  position: fixed;
  inset: 0;
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 500;
  color: white;
  text-align: center;
}

.ar-permission-denied svg {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  opacity: 0.6;
}

.ar-permission-denied h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.ar-permission-denied p {
  opacity: 0.7;
  margin-bottom: 24px;
  max-width: 300px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 360px) {
  .ar-feedback {
    padding: 16px 20px;
  }

  .ar-feedback-icon {
    font-size: 2.5rem;
  }

  .ar-feedback-text strong {
    font-size: 1rem;
  }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
@media (prefers-color-scheme: dark) {
  .ar-feedback {
    background: #2D2D2D;
  }

  .ar-feedback-text strong {
    color: white;
  }
}

/* Floating Points Badge - Compact Design */
.ar-points-badge {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 2px solid #FF6B9D;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #FF6B9D;
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.25);
  z-index: 50;
  animation: float-badge-subtle 2s ease-in-out infinite;
  white-space: nowrap;
  pointer-events: none;
}

@keyframes float-badge-subtle {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-4px);
  }
}

/* ============================================
   ICON BUTTONS (List, Building toggle)
   ============================================ */
.ar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.ar-icon-btn:hover {
  transform: scale(1.05);
}

.ar-icon-btn.active {
  background: #FF6B9D;
}

.ar-icon-btn.active img {
  filter: brightness(0) invert(1);
}

.ar-icon-btn img {
  width: 24px;
  height: 24px;
}

/* Right controls horizontal layout */
.ar-right-controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

/* ============================================
   COLLECTIBLES LIST PANEL
   ============================================ */
.ar-collectibles-panel {
  position: absolute;
  top: 80px;
  right: 16px;
  width: 280px;
  max-height: 300px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  pointer-events: auto;
  z-index: 150;
  overflow: hidden;
  display: none;
}

.ar-collectibles-panel.active {
  display: block;
  animation: slide-in-right 0.3s ease-out;
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.ar-collectibles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #FF6B9D, #E85A8C);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.ar-panel-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.ar-panel-close:hover {
  opacity: 1;
}

.ar-collectibles-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
}

.ar-collectible-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background 0.2s;
}

.ar-collectible-item:not(.loading):hover {
  background: #FFF0F5;
}

.ar-collectible-item.collected {
  opacity: 0.6;
}

.ar-collectible-item .item-emoji {
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFF0F5;
  border-radius: 10px;
}

.ar-collectible-item.collected .item-emoji {
  background: #E8F5E9;
}

.ar-collectible-item.collected .item-emoji::after {
  content: '✓';
  position: absolute;
  font-size: 0.8rem;
  color: #4CAF50;
}

.ar-collectible-item .item-info {
  flex: 1;
}

.ar-collectible-item .item-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: #333;
}

.ar-collectible-item .item-points {
  font-size: 0.75rem;
  color: #FF6B9D;
  font-weight: 500;
}

.ar-collectible-item .item-status {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.ar-collectible-item .item-status.pending {
  background: #FFF3E0;
  color: #FF9800;
}

.ar-collectible-item .item-status.found {
  background: #E8F5E9;
  color: #4CAF50;
}

/* ============================================
   FULLSCREEN MAP BUTTON
   ============================================ */
.ar-map-fullscreen-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
}

.ar-map-fullscreen-btn:hover {
  background: white;
  transform: scale(1.05);
}

.ar-map-fullscreen-btn svg {
  stroke: #333;
}

/* Fullscreen state */
.ar-map-split.fullscreen {
  height: 100%;
  border-radius: 0;
  border: none;
}

.ar-map-split.fullscreen .ar-map-fullscreen-btn svg {
  transform: rotate(180deg);
}

/* ============================================
   SPLIT VIEW - 3D MAP SECTION
   ============================================ */
.ar-map-split {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: #FFF8FA;
  border-top-left-radius: 32px;
  border-top-right-radius: 32px;
  border: 4px solid #FF6B9D;
  border-bottom: none;
  box-shadow: 0 -8px 32px rgba(255, 107, 157, 0.2);
  z-index: 90;
  overflow: hidden;
  pointer-events: auto;
  transition: all 0.3s ease;
}

.ar-map-split-container {
  width: 100%;
  height: calc(100% - 60px);
}

.ar-map-split-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  padding-bottom: env(safe-area-inset-bottom, 8px);
}

.ar-map-split-footer .map-icon {
  width: 32px;
  height: 32px;
}

.ar-collected-split {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
}

.ar-collected-split .count {
  font-weight: 700;
  color: #FF6B9D;
}

.ar-collected-split .label {
  color: #FF6B9D;
  font-weight: 500;
}

/* ============================================
   TAP TO COLLECT HINT
   ============================================ */
.tap-hint {
  position: absolute;
  bottom: 180px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease-out;
  z-index: 150;
}

.tap-hint.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tap-hint-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  background: white;
  border: 3px solid #FF6B9D;
  padding: 14px 24px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(255, 107, 157, 0.3);
  animation: tap-bounce 1.5s ease-in-out infinite;
}

.tap-hint-icon {
  font-size: 1.8rem;
  animation: tap-finger 0.8s ease-in-out infinite;
}

.tap-hint-text {
  color: #E91E63;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

@keyframes tap-bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes tap-finger {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }
}

/* Tappable collectible visual feedback */
.collectible.tappable {
  cursor: pointer;
}

/* ============================================
   AR ONBOARDING TUTORIAL
   ============================================ */
.ar-onboarding {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: auto;
}

.ar-onboarding.hidden {
  display: none;
}

.ar-onboarding-card {
  background: white;
  border-radius: 24px;
  padding: 32px 24px;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ar-onboarding-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #FF6B9D;
  margin-bottom: 8px;
}

.ar-onboarding-subtitle {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 24px;
}

.ar-onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.ar-onboarding-step {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  padding: 12px;
  background: #FFE4EC;
  border-radius: 16px;
}

.ar-step-icon {
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.ar-step-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
}

.ar-step-text strong {
  color: #E85A8C;
}

.ar-onboarding-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #FF6B9D, #E85A8C);
  border: none;
  border-radius: 16px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

/* ============================================
   AR PROXIMITY EFFECTS
   ============================================ */
.ar-proximity-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.3s;
}

.ar-proximity-glow.active {
  opacity: 1;
}

.ar-proximity-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(255, 107, 157, 0.4) 100%);
  animation: ar-proximity-pulse 1.5s ease-in-out infinite;
}

@keyframes ar-proximity-pulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* ============================================
   DIRECTIONAL ARROW INDICATOR
   ============================================ */
.ar-direction-indicator {
  position: fixed;
  bottom: 50%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 140;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.ar-direction-indicator.visible {
  opacity: 1;
}

.ar-direction-arrow {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 107, 157, 0.9);
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.5);
  transition: transform 0.3s ease;
}

.ar-direction-arrow svg {
  width: 32px;
  height: 32px;
  fill: white;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}

.ar-direction-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.75);
  padding: 8px 16px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ar-direction-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ar-direction-distance {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Pulsing animation for close proximity */
.ar-direction-indicator.close .ar-direction-arrow {
  animation: direction-pulse-close 0.8s ease-in-out infinite;
  background: rgba(76, 175, 80, 0.9);
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.5);
}

@keyframes direction-pulse-close {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ============================================
   CONTEXT-AWARE HELP TIPS
   ============================================ */
.ar-context-tip {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: white;
  color: #333;
  padding: 12px 20px;
  border-radius: 16px;
  border: 3px solid #FF6B9D;
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 160;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  max-width: 300px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ar-context-tip.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ar-context-tip.warning {
  background: white;
  border-color: #FF6B9D;
  color: #FF6B9D;
}

.ar-context-tip.info {
  background: white;
  border-color: #FF6B9D;
  color: #333;
}

.ar-context-tip.success {
  background: white;
  border-color: #4CAF50;
  color: #4CAF50;
}

.ar-context-tip-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ============================================
   DISMISSIBLE ONBOARDING TIPS
   ============================================ */
.ar-onboarding-tip {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 14px 44px 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 320px;
  width: calc(100% - 32px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(255, 107, 157, 0.2);
  border: 1px solid rgba(255, 107, 157, 0.3);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ar-onboarding-tip.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.ar-onboarding-tip-dismiss {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.ar-onboarding-tip-dismiss:hover,
.ar-onboarding-tip-dismiss:active {
  background: rgba(255, 107, 157, 0.2);
  color: #FF6B9D;
}

.ar-onboarding-tip-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.ar-onboarding-tip-content {
  flex: 1;
  min-width: 0;
}

.ar-onboarding-tip-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 2px;
}

.ar-onboarding-tip-text {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.4;
}

/* ============================================
   PREVIEW MODE INDICATOR - Header integrated
   ============================================ */
.ar-preview-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #FF6B9D, #FF8FAD);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.ar-preview-indicator .preview-count {
  opacity: 0.9;
  font-weight: 400;
}

/* ============================================
   PAYMENT UPSELL MODAL
   ============================================ */
.modal-upsell {
  max-width: 340px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #FFF8FA 0%, #FFFFFF 100%);
}

.modal-upsell .modal-body {
  padding: 28px 24px 20px;
}

.upsell-emoji {
  font-size: 4rem;
  margin-bottom: 12px;
}

.upsell-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.upsell-text {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.5;
  margin-bottom: 16px;
}

.upsell-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.upsell-feature {
  font-size: 0.85rem;
  color: #444;
  padding: 8px 12px;
  background: rgba(255, 107, 157, 0.08);
  border-radius: 8px;
}

.upsell-footer {
  flex-direction: column;
  gap: 8px;
  padding: 16px 24px 24px;
  background: transparent;
}

.upsell-footer .btn-text {
  background: none;
  border: none;
  color: #999;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 8px;
}

.upsell-footer .btn-text:hover {
  color: #666;
}

/* ============================================
   RARITY-BASED CELEBRATION EFFECTS
   Phase 2.1: Different celebrations per rarity
   ============================================ */

/* Rarity-specific flash colors */
.ar-flash-common {
  background: linear-gradient(135deg, #FFB6C1, #FF69B4) !important;
}

.ar-flash-rare {
  background: linear-gradient(135deg, #9C27B0, #E040FB) !important;
}

.ar-flash-epic {
  background: linear-gradient(135deg, #E91E63, #FF4081) !important;
}

.ar-flash-legendary {
  background: linear-gradient(135deg, #FFD700, #FFA000) !important;
}

/* Rarity-specific heart burst effects */
.ar-heart-burst-rare {
  filter: drop-shadow(0 0 20px rgba(156, 39, 176, 0.8));
}

.ar-heart-burst-epic {
  filter: drop-shadow(0 0 30px rgba(233, 30, 99, 0.9));
}

.ar-heart-burst-legendary {
  filter: drop-shadow(0 0 40px rgba(255, 215, 0, 1));
  animation: legendary-burst 0.8s ease-out forwards !important;
}

@keyframes legendary-burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.8) rotate(15deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.5) rotate(-10deg);
  }
}

/* Rarity-specific floating points styling */
.ar-floating-points-common {
  color: #FF6B9D;
  text-shadow: 0 4px 12px rgba(255, 107, 157, 0.5), 0 0 20px rgba(255, 107, 157, 0.3);
}

.ar-floating-points-rare {
  color: #E040FB;
  text-shadow: 0 4px 12px rgba(156, 39, 176, 0.6), 0 0 30px rgba(224, 64, 251, 0.5);
}

.ar-floating-points-epic {
  color: #FF4081;
  text-shadow: 0 4px 12px rgba(255, 64, 129, 0.6), 0 0 30px rgba(233, 30, 99, 0.5);
  font-size: 3.5rem !important;
}

.ar-floating-points-legendary {
  color: #FFD700;
  text-shadow: 0 4px 16px rgba(255, 215, 0, 0.8), 0 0 50px rgba(255, 215, 0, 0.6), 0 0 80px rgba(255, 193, 7, 0.4);
  font-size: 4rem !important;
  animation: legendary-points-float 1.5s ease-out forwards !important;
}

@keyframes legendary-points-float {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0) scale(0.5) rotate(-5deg);
  }
  20% {
    opacity: 1;
    transform: translateX(-50%) translateY(-30px) scale(1.3) rotate(5deg);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-180px) scale(1) rotate(0deg);
  }
}

/* Legendary golden ring burst effect */
.ar-legendary-ring-burst {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border: 6px solid #FFD700;
  border-radius: 50%;
  pointer-events: none;
  z-index: 350;
  animation: ring-burst-expand 1s ease-out forwards;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), inset 0 0 20px rgba(255, 215, 0, 0.4);
}

@keyframes ring-burst-expand {
  0% {
    width: 60px;
    height: 60px;
    opacity: 1;
    border-width: 8px;
  }
  100% {
    width: 400px;
    height: 400px;
    opacity: 0;
    border-width: 2px;
  }
}

/* Legendary sparkle effect */
.ar-legendary-sparkle {
  position: fixed;
  font-size: 2rem;
  pointer-events: none;
  z-index: 360;
  animation: sparkle-pop 0.8s ease-out forwards;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.9));
}

@keyframes sparkle-pop {
  0% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  30% {
    opacity: 1;
    transform: scale(1.3) rotate(20deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.8) rotate(-20deg) translateY(-40px);
  }
}

/* Epic diamond burst effect */
.ar-epic-diamond-burst {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 5rem;
  pointer-events: none;
  z-index: 355;
  animation: diamond-burst 1s ease-out forwards;
  filter: drop-shadow(0 0 20px rgba(233, 30, 99, 0.8));
}

@keyframes diamond-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) rotate(-20deg);
  }
  40% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.4) rotate(10deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6) rotate(0deg) translateY(-60px);
  }
}

/* Rarity-specific confetti animations */
.ar-confetti-rare {
  animation-name: confetti-fall-spiral !important;
}

.ar-confetti-epic {
  animation-name: confetti-fall-zigzag !important;
}

.ar-confetti-legendary {
  animation-name: confetti-fall-float !important;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
}

@keyframes confetti-fall-spiral {
  0% {
    transform: translateY(-100vh) rotate(0deg) translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(1080deg) translateX(50px);
    opacity: 0;
  }
}

@keyframes confetti-fall-zigzag {
  0% {
    transform: translateY(-100vh) rotate(0deg) translateX(0);
    opacity: 1;
  }
  25% {
    transform: translateY(-50vh) rotate(180deg) translateX(30px);
  }
  50% {
    transform: translateY(0) rotate(360deg) translateX(-30px);
  }
  75% {
    transform: translateY(50vh) rotate(540deg) translateX(30px);
  }
  100% {
    transform: translateY(100vh) rotate(720deg) translateX(0);
    opacity: 0;
  }
}

@keyframes confetti-fall-float {
  0% {
    transform: translateY(-100vh) rotate(0deg) scale(1);
    opacity: 1;
  }
  50% {
    transform: translateY(0) rotate(360deg) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg) scale(0.8);
    opacity: 0;
  }
}

/* ============================================
   PROXIMITY SCAN NOW MESSAGE (Phase 2.3)
   ============================================ */
.ar-scan-now-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.95), rgba(56, 142, 60, 0.95));
  color: white;
  padding: 20px 32px;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 700;
  pointer-events: none;
  z-index: 180;
  opacity: 0;
  box-shadow: 0 8px 32px rgba(76, 175, 80, 0.5), 0 0 60px rgba(76, 175, 80, 0.3);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.ar-scan-now-message.visible {
  opacity: 1;
  animation: scan-now-pulse 1s ease-in-out infinite;
}

.ar-scan-now-message .scan-icon {
  font-size: 2.5rem;
  animation: scan-icon-bounce 0.6s ease-in-out infinite;
}

.ar-scan-now-message .scan-text {
  font-size: 1.1rem;
  font-weight: 600;
}

.ar-scan-now-message .scan-subtext {
  font-size: 0.85rem;
  opacity: 0.9;
}

@keyframes scan-now-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.5), 0 0 60px rgba(76, 175, 80, 0.3);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 12px 48px rgba(76, 175, 80, 0.6), 0 0 80px rgba(76, 175, 80, 0.4);
  }
}

@keyframes scan-icon-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Enhanced proximity glow for very close (Phase 2.3) */
.ar-proximity-glow.very-close {
  opacity: 1;
}

.ar-proximity-glow.very-close::before {
  background: radial-gradient(ellipse at center, transparent 30%, rgba(76, 175, 80, 0.5) 100%);
  animation: ar-proximity-pulse-fast 0.8s ease-in-out infinite;
}

@keyframes ar-proximity-pulse-fast {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* ============================================
   MAP TOGGLE FAB BUTTON
   ============================================ */
.ar-map-toggle-fab {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF6B9D, #E85A8C);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 107, 157, 0.4);
  z-index: 200;
  pointer-events: auto;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ar-map-toggle-fab:hover,
.ar-map-toggle-fab:active {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
}

.ar-map-toggle-fab.map-active {
  background: linear-gradient(135deg, #4CAF50, #388E3C);
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.4);
}

.ar-map-toggle-fab img {
  width: 28px;
  height: 28px;
}

/* ============================================
   HEADER COLLECTION COUNT
   ============================================ */
.ar-collection-count {
  background: white;
  padding: 8px 12px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 2px;
}

.ar-collection-count span:first-child {
  color: #FF6B9D;
  font-weight: 700;
}

/* ============================================
   FULLSCREEN MAP PANEL (Toggle View)
   ============================================ */
.ar-map-panel.ar-map-fullscreen {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 250;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  max-height: none;
}

.ar-map-panel.ar-map-fullscreen.active {
  transform: translateY(0);
}

.ar-map-panel.ar-map-fullscreen .ar-map-header {
  border-radius: 0;
  padding-top: max(16px, env(safe-area-inset-top));
}

.ar-map-panel.ar-map-fullscreen .ar-map-container {
  flex: 1;
  height: auto;
}

/* ============================================
   LOW PERFORMANCE MODE
   Optimizations for low-end devices
   ============================================ */
.low-performance-mode .particle-ring {
  display: none !important;
}

.low-performance-mode .ar-confetti {
  display: none !important;
}

.low-performance-mode .ar-celebration {
  display: none !important;
}

.low-performance-mode .ar-legendary-ring-burst,
.low-performance-mode .ar-legendary-sparkle,
.low-performance-mode .ar-epic-diamond-burst {
  display: none !important;
}

/* Reduce animation complexity */
.low-performance-mode .ar-heart-burst {
  animation-duration: 0.5s !important;
}

.low-performance-mode .ar-floating-points {
  animation-duration: 1s !important;
}

.low-performance-mode .ar-flash {
  animation-duration: 0.2s !important;
}

/* Disable screen shake on low-end devices */
.low-performance-mode .ar-screen-shake {
  animation: none !important;
}

/* Simplify detection border animations */
.low-performance-mode .ar-detection-border {
  animation: none !important;
  transition: border-color 0.2s !important;
}

/* Hide proximity glow effects */
.low-performance-mode .ar-proximity-glow {
  display: none !important;
}

/* Simplify floating badge animation */
.low-performance-mode .ar-points-badge {
  animation: none !important;
}

/* Hide tap glow animation on 3D models */
.low-performance-mode .tap-glow {
  display: none !important;
}

/* ============================================
   HIDE REDUNDANT ONBOARDING TIP WHEN MARKER DETECTED
   ============================================ */
.ar-marker-detected .ar-onboarding-tip {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Hide the separate tap hint - the floating badge already says "Tap to collect" */
.tap-hint {
  display: none !important;
}

/* ============================================
   GPS-BASED AR COLLECTIBLES (Phase 2)
   Pokemon GO-style location-based AR
   ============================================ */

/* GPS Distance Badge - Shows nearby collectible info */
.ar-gps-badge {
  position: fixed;
  top: 140px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 160;
  pointer-events: none;
  animation: gps-badge-appear 0.3s ease-out;
}

.ar-gps-badge-icon {
  font-size: 2rem;
  animation: gps-icon-pulse 2s ease-in-out infinite;
}

.ar-gps-badge-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ar-gps-badge-name {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
}

.ar-gps-badge-distance {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}

.ar-gps-badge-action {
  font-size: 0.8rem;
  font-weight: 600;
  color: #FF6B9D;
  padding: 6px 12px;
  background: linear-gradient(135deg, #FFE4EC, #FFCDD9);
  border-radius: 12px;
}

@keyframes gps-badge-appear {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes gps-icon-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* GPS In-Range Collect Prompt - Shows when within 15m */
.ar-gps-collect-prompt {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.98), rgba(56, 142, 60, 0.98));
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(76, 175, 80, 0.4), 0 0 60px rgba(76, 175, 80, 0.2);
  z-index: 170;
  pointer-events: auto;
  animation: gps-collect-appear 0.4s ease-out;
}

.ar-gps-collect-icon {
  font-size: 2.5rem;
  animation: gps-collect-bounce 0.8s ease-in-out infinite;
}

.ar-gps-collect-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ar-gps-collect-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
}

.ar-gps-collect-points {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.ar-gps-collect-btn {
  padding: 12px 20px;
  background: white;
  border: none;
  border-radius: 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #388E3C;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: gps-btn-pulse 1.5s ease-in-out infinite;
}

.ar-gps-collect-btn:hover,
.ar-gps-collect-btn:active {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

@keyframes gps-collect-appear {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes gps-collect-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.1); }
}

@keyframes gps-btn-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
  50% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); }
}

/* GPS Mode Indicator Badge */
.ar-gps-mode-indicator {
  position: fixed;
  top: max(90px, calc(env(safe-area-inset-top) + 70px));
  left: 16px;
  background: rgba(76, 175, 80, 0.9);
  color: white;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 150;
  pointer-events: none;
}

.ar-gps-mode-indicator .gps-signal {
  width: 8px;
  height: 8px;
  background: #98FB98;
  border-radius: 50%;
  animation: gps-signal-blink 1.5s ease-in-out infinite;
}

.ar-gps-mode-indicator.poor-signal {
  background: rgba(255, 152, 0, 0.9);
}

.ar-gps-mode-indicator.poor-signal .gps-signal {
  background: #FFE082;
  animation: gps-signal-blink-slow 2s ease-in-out infinite;
}

.ar-gps-mode-indicator.no-signal {
  background: rgba(244, 67, 54, 0.9);
}

.ar-gps-mode-indicator.no-signal .gps-signal {
  background: #EF9A9A;
  animation: none;
}

@keyframes gps-signal-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes gps-signal-blink-slow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* GPS Collectible 3D Model Styling (via A-Frame) */
.gps-collectible {
  cursor: pointer;
}

/* GPS Accuracy Warning */
.ar-gps-accuracy-warning {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 152, 0, 0.95);
  color: white;
  padding: 10px 20px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 165;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ar-gps-accuracy-warning .warning-icon {
  font-size: 1.2rem;
}

/* Hide GPS UI when marker-based AR is active */
.ar-marker-detected .ar-gps-badge,
.ar-marker-detected .ar-gps-collect-prompt {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* GPS Loading State */
.ar-gps-loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 24px 32px;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 500;
  z-index: 180;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.ar-gps-loading .gps-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Low performance mode - disable GPS animations */
.low-performance-mode .ar-gps-badge-icon,
.low-performance-mode .ar-gps-collect-icon {
  animation: none !important;
}

.low-performance-mode .ar-gps-collect-btn {
  animation: none !important;
}

.low-performance-mode .ar-gps-mode-indicator .gps-signal {
  animation: none !important;
}