/* Mobile-First Retro Gaming Styles */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P:wght@400&display=swap');

/* Disable text selection and zoom on mobile */
* {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: 'Press Start 2P', monospace;
  touch-action: manipulation;
}

.retro-font {
  font-family: 'Press Start 2P', monospace;
  line-height: 1.6;
}

/* Touch-friendly button styling */
button, .touch-manipulation {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* Mobile CRT Effect (lighter for battery) */
@media (max-width: 768px) {
  .crt-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent 50%, rgba(0, 255, 0, 0.02) 50%);
    background-size: 100% 3px;
    pointer-events: none;
    z-index: 10;
  }
}

/* Scanlines animation (disabled for performance on mobile) */
@media (min-width: 1024px) {
  @keyframes scanlines {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
  }

  .scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent 50%, rgba(68, 255, 0, 0.02) 50%);
    background-size: 100% 4px;
    animation: scanlines 0.15s linear infinite;
    pointer-events: none;
    z-index: 1000;
  }
}

/* Retro button styling with mobile-friendly sizing */
.retro-button {
  background: linear-gradient(145deg, #4a5568, #2d3748);
  border: 2px solid #718096;
  box-shadow: 
    inset 2px 2px 4px rgba(255, 255, 255, 0.1),
    inset -2px -2px 4px rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  min-height: 44px; /* iOS minimum touch target */
  min-width: 44px;
}

.retro-button:active {
  transform: scale(0.98);
  box-shadow: 
    inset -2px -2px 4px rgba(255, 255, 255, 0.1),
    inset 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Room cell hover effects (touch-friendly) */
.room-cell:active {
  transform: scale(0.95);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Achievement glow effect */
@keyframes glow {
  0%, 100% {
    text-shadow: 0 0 10px #ffd700;
  }
  50% {
    text-shadow: 0 0 20px #ffd700, 0 0 30px #ffd700;
  }
}

.achievement-glow {
  animation: glow 2s ease-in-out infinite;
}

/* Progress meter styling */
.progress-meter {
  background: linear-gradient(90deg, 
    #dc2626 0%, 
    #f59e0b 33%, 
    #eab308 66%, 
    #16a34a 100%);
  border: 2px inset #4b5563;
}

/* Pixel perfect rendering for retrodiffusion images */
img[src*="retrodiffusion"] {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Digital display styling */
.digital-display {
  background: #000;
  color: #00ff00;
  font-family: 'Courier New', monospace;
  padding: 4px 8px;
  border: 2px inset #333;
  text-align: center;
  letter-spacing: 2px;
}

/* Tiny people animation (optimized for mobile) */
@keyframes walkCycle {
  0%, 100% { transform: translateX(0px); }
  50% { transform: translateX(1px); }
}

.tiny-person {
  animation: walkCycle 3s infinite;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  .retro-font {
    font-size: 12px;
    line-height: 1.4;
  }
  
  /* Larger touch targets on small screens */
  button {
    min-height: 48px;
    min-width: 48px;
    padding: 8px;
  }
  
  /* Optimize animations for mobile performance */
  * {
    animation-duration: 1.5s !important;
  }
  
  /* Hide complex visual effects on mobile */
  .scanlines {
    display: none;
  }
}

/* Landscape mobile adjustments */
@media (max-width: 900px) and (orientation: landscape) {
  .retro-font {
    font-size: 10px;
  }
  
  button {
    min-height: 40px;
    min-width: 40px;
    padding: 6px;
  }
}

/* Gesture hint styling */
.gesture-hint {
  background: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  padding: 8px;
  color: white;
  font-size: 10px;
}

/* Bottom panel slide animation */
.slide-panel {
  transition: transform 0.3s ease-out;
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
  .safe-top {
    padding-top: max(20px, env(safe-area-inset-top));
  }
  
  .safe-bottom {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}

/* High DPI/Retina display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  img[src*="retrodiffusion"] {
    image-rendering: auto;
  }
}

/* Backdrop blur support */
@supports (backdrop-filter: blur(10px)) {
  .backdrop-blur-sm {
    backdrop-filter: blur(10px);
  }
}

/* Custom scrollbar for webkit */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #374151;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #6b7280;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Floor number mobile styling */
.floor-number {
  background: linear-gradient(145deg, #4b5563, #374151);
  border: 1px solid #6b7280;
  color: #f3f4f6;
  text-align: center;
  font-weight: bold;
  font-size: 10px;
}

/* Room occupancy indicators */
.occupancy-high {
  box-shadow: inset 0 0 8px rgba(34, 197, 94, 0.5);
}

.occupancy-medium {
  box-shadow: inset 0 0 8px rgba(251, 191, 36, 0.5);
}

.occupancy-low {
  box-shadow: inset 0 0 8px rgba(239, 68, 68, 0.5);
}

/* PWA splash screen styling */
.pwa-splash {
  background: linear-gradient(135deg, #1f2937, #374151);
  color: #f3f4f6;
}