/* Chicken Dash - Responsive CSS */

/* Mobile First Approach - Base styles are for mobile */

/* Small Mobile Devices (320px - 480px) */
@media (max-width: 480px) {
  /* Header adjustments */
  .game-header {
    padding: var(--spacing-sm);
  }

  .logo-text {
    display: none;
  }

  .player-stats {
    gap: var(--spacing-sm);
  }

  .stat-item {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.9rem;
  }

  .icon-btn {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  /* XP Bar */
  .xp-text {
    font-size: 0.7rem;
  }

  /* Slot Machine */
  .slot-machine {
    padding: var(--spacing-md);
  }

  .slot-header h2 {
    font-size: 1.4rem;
  }

  .symbol {
    font-size: 1.8rem;
  }

  .spin-btn {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1.2rem;
    min-width: 120px;
  }

  .auto-spin-controls {
    flex-direction: column;
    gap: var(--spacing-xs);
  }

  /* Win Display */
  .win-amount {
    font-size: 2rem;
  }

  .win-message {
    font-size: 1rem;
  }

  /* Bonus Game */
  #bonus-canvas {
    width: 100%;
    height: auto;
    max-height: 300px;
  }

  .bonus-header h2 {
    font-size: 1.5rem;
  }

  .bonus-stats {
    flex-direction: column;
    gap: var(--spacing-sm);
    font-size: 1rem;
  }

  /* Collection Screen */
  .collection-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .chicken-sprite {
    width: 80px;
    height: 80px;
    font-size: 3rem;
  }

  .skins-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--spacing-sm);
  }

  .skin-sprite {
    font-size: 2rem;
  }

  .skin-name {
    font-size: 0.8rem;
  }

  /* Stats Screen */
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
  }

  .stat-number {
    font-size: 2rem;
  }

  .stat-label {
    font-size: 0.9rem;
  }

  /* Modal adjustments */
  .modal-content {
    width: 95%;
    margin: 5% auto;
    max-height: 85vh;
  }

  .modal-header {
    padding: var(--spacing-md);
  }

  .modal-body {
    padding: var(--spacing-md);
  }

  /* Bottom Navigation */
  .nav-icon {
    font-size: 1.2rem;
  }

  .nav-label {
    font-size: 0.7rem;
  }
}

/* Large Mobile Devices (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  /* Slot Machine */
  .symbol {
    font-size: 2.2rem;
  }

  .spin-btn {
    font-size: 1.3rem;
    min-width: 140px;
  }

  /* Bonus Game */
  #bonus-canvas {
    max-height: 400px;
  }

  .bonus-stats {
    gap: var(--spacing-lg);
  }

  /* Collection */
  .chicken-sprite {
    width: 100px;
    height: 100px;
    font-size: 3.5rem;
  }

  .skins-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .skin-sprite {
    font-size: 2.2rem;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .stat-number {
    font-size: 2.2rem;
  }
}

/* Tablet Devices (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Header */
  .game-header {
    padding: var(--spacing-lg);
  }

  .player-stats {
    gap: var(--spacing-xl);
  }

  /* Slot Machine */
  .slot-container {
    max-width: 700px;
  }

  .symbol {
    font-size: 2.8rem;
  }

  /* Bonus Game */
  #bonus-canvas {
    max-height: 500px;
  }

  .bonus-header h2 {
    font-size: 2.2rem;
  }

  /* Collection */
  .collection-content {
    grid-template-columns: 1fr 2fr;
  }

  .skins-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

/* Desktop Devices (1025px+) */
@media (min-width: 1025px) {
  /* Full desktop experience - base styles apply */

  /* Enhanced hover effects for desktop */
  .slot-machine:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px var(--shadow-color);
  }

  .stat-card:hover {
    transform: translateY(-8px);
  }

  .skin-item:hover {
    transform: translateY(-8px);
  }

  /* Larger canvas for desktop */
  #bonus-canvas {
    max-height: 600px;
  }

  /* Better spacing for large screens */
  .game-main {
    padding: var(--spacing-xl);
  }

  .collection-content {
    gap: var(--spacing-xl) * 1.5;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
  }
}

/* Landscape Orientation Adjustments */
@media (orientation: landscape) and (max-height: 600px) {
  /* Compact layout for landscape mobile */
  .game-header {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .xp-container {
    padding: var(--spacing-xs) var(--spacing-md);
  }

  .game-main {
    padding: var(--spacing-md);
  }

  .slot-machine {
    padding: var(--spacing-md);
  }

  .slot-header h2 {
    font-size: 1.4rem;
    margin-bottom: var(--spacing-sm);
  }

  .symbol {
    font-size: 2rem;
  }

  .spin-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1.1rem;
  }

  /* Bonus game adjustments */
  #bonus-screen {
    padding: var(--spacing-md);
  }

  .bonus-header {
    margin-bottom: var(--spacing-md);
  }

  .bonus-header h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
  }

  #bonus-canvas {
    max-height: 250px;
  }

  .bonus-controls {
    margin-top: var(--spacing-sm);
  }

  .control-instructions p {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-xs);
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Sharper text rendering */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Crisper borders */
  .slot-machine,
  .stat-card,
  .skin-item {
    border-width: 1px;
  }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  /* Disable animations for users who prefer reduced motion */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .chicken-logo,
  .bonus-header h2,
  .chicken-sprite {
    animation: none !important;
  }

  .reel.spinning .reel-symbols {
    animation: none !important;
  }
}

/* Dark Mode Support (if system preference) */
@media (prefers-color-scheme: dark) {
  /* Note: This is optional since the game has a bright, cheerful theme
       But we can provide subtle dark mode adjustments */

  :root {
    --background-color: #2c3e50;
    --text-color: #ecf0f1;
    --border-color: #34495e;
    --shadow-color: rgba(0, 0, 0, 0.3);
  }

  body {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  }

  .modal-content,
  .stat-card,
  .current-chicken,
  .available-skins {
    background: #34495e;
    color: #ecf0f1;
  }

  .slot-machine {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
  }
}

/* Print Styles (hide game elements) */
@media print {
  body * {
    visibility: hidden;
  }

  .stats-content,
  .stats-content * {
    visibility: visible;
  }

  .stats-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }

  .game-header,
  .bottom-nav,
  .modal,
  .btn {
    display: none !important;
  }
}

/* Touch Device Optimizations */
@media (pointer: coarse) {
  /* Larger touch targets */
  .icon-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .nav-btn {
    min-height: 60px;
  }

  .spin-btn {
    min-height: 60px;
    min-width: 160px;
  }

  .skin-item {
    min-height: 100px;
  }

  /* Remove hover effects on touch devices */
  .slot-machine:hover,
  .stat-card:hover,
  .skin-item:hover {
    transform: none;
  }

  /* Add active states instead */
  .spin-btn:active {
    transform: scale(0.98);
  }

  .nav-btn:active {
    background: rgba(74, 124, 89, 0.2);
  }

  .skin-item:active {
    transform: scale(0.98);
  }
}

/* Very Large Screens (1440px+) */
@media (min-width: 1440px) {
  .slot-container {
    max-width: 800px;
  }

  .symbol {
    font-size: 3.2rem;
  }

  .game-main {
    padding: var(--spacing-xl) * 2;
  }

  .modal-content {
    max-width: 600px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 900px;
    margin: 0 auto;
  }
}

/* Ultra-wide Screens (1920px+) */
@media (min-width: 1920px) {
  .slot-container {
    max-width: 1000px;
  }

  .collection-content,
  .stats-content {
    max-width: 1200px;
    margin: 0 auto;
  }
}

body {
  background-image: url("../bg.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
