/* ===== Responsive Gaming Enhancements ===== */

/* Enhanced Media Queries for Cursor */
@media (max-width: 1024px) and (hover: hover) {
  .cursor {
    width: 18px;
    height: 18px;
  }

  .cursor-trail {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 768px) and (hover: hover) {
  .cursor {
    width: 16px;
    height: 16px;
  }

  .cursor-trail {
    width: 32px;
    height: 32px;
  }
}

/* Force disable cursor on touch devices */
@media (pointer: coarse) {
  .cursor,
  .cursor-trail,
  .cursor-particle,
  .cursor-click-ripple {
    display: none !important;
  }

  * {
    cursor: auto !important;
  }
}

/* Viewport-based responsive adjustments */
@media (max-height: 600px) {
  .scroll-to-top {
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
  }
}

/* Large screens enhancements */
@media (min-width: 1920px) {
  ::-webkit-scrollbar {
    width: 16px;
    height: 16px;
  }

  .cursor {
    width: 26px;
    height: 26px;
  }

  .cursor-trail {
    width: 55px;
    height: 55px;
  }

  .scroll-progress-container {
    height: 8px;
  }
}

/* Ultra-wide screens */
@media (min-width: 2560px) {
  ::-webkit-scrollbar {
    width: 18px;
    height: 18px;
  }

  .cursor {
    width: 28px;
    height: 28px;
  }

  .cursor-trail {
    width: 60px;
    height: 60px;
  }
}

/* Device orientation handling */
@media (orientation: landscape) and (max-height: 500px) {
  .scroll-progress-container {
    height: 3px;
  }

  .scroll-to-top {
    width: 40px;
    height: 40px;
    bottom: 10px;
    right: 10px;
  }
}

/* Performance optimization for low-end devices */
@media (max-width: 480px), (pointer: coarse) {
  .cursor-particle,
  .cursor-click-ripple {
    display: none !important;
  }

  ::-webkit-scrollbar-thumb {
    animation: none;
  }

  .scroll-progress-bar {
    animation: none;
  }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .cursor {
    border-width: 1px;
  }

  .cursor-trail {
    border-width: 2px;
  }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
  ::-webkit-scrollbar-track {
    background: linear-gradient(45deg, #0a0a0f, #1a1a2e);
  }
}

/* Light mode adjustments */
@media (prefers-color-scheme: light) {
  .cursor {
    mix-blend-mode: multiply;
  }

  ::-webkit-scrollbar-track {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border-color: rgba(108, 117, 125, 0.3);
  }
}

/* Animation preference handling */
@media (prefers-reduced-motion: reduce) {
  .cursor,
  .cursor-trail {
    animation: none;
    transition: transform 0.1s linear;
  }

  .cursor-particle,
  .cursor-click-ripple {
    display: none;
  }

  .scroll-progress-bar {
    animation: none;
  }

  .scroll-to-top {
    animation: none;
  }
}

/* Focus management for accessibility */
@media (prefers-reduced-motion: no-preference) {
  .cursor {
    animation-duration: 2s;
  }

  .cursor-trail {
    animation-duration: 4s;
  }
}

/* Container queries support (when available) */
@container (max-width: 768px) {
  .game-scroll::-webkit-scrollbar {
    width: 8px;
  }
}

/* Print styles */
@media print {
  .cursor,
  .cursor-trail,
  .cursor-particle,
  .cursor-click-ripple,
  .scroll-progress-container,
  .scroll-to-top {
    display: none !important;
  }
}

/* Support for foldable devices */
@media (max-width: 280px) {
  ::-webkit-scrollbar {
    width: 4px;
  }

  .scroll-progress-container {
    height: 2px;
  }

  .scroll-to-top {
    display: none;
  }
}
