/* Responsive overrides */
@media (max-width: 480px) {
  html { font-size: 14px; }

  .hero { padding: 24px 12px 40px; }
  .menu-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .menu-card { padding: 16px 12px; }

  .level-grid { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 8px; }

  .game-header { padding: 6px 8px; }
  .level-badge { font-size: 0.8rem; padding: 4px 12px; }

  .complete-modal { padding: 24px 16px; }

  .content-section { padding: 24px 12px; }

  .profile-stats { grid-template-columns: 1fr; }

  .ad-container { margin: 8px auto; }
}

@media (min-width: 769px) {
  .game-layout-desktop {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
  }

  .desktop-sidebar {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
  }

  .desktop-sidebar h3 {
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--primary);
  }
}

/* Prevent zoom on double tap */
@media (pointer: coarse) {
  * { touch-action: manipulation; }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .game-header { padding: 4px 8px; }
  .game-controls { padding: 4px 8px; }
  .game-ad-top, .game-ad-bottom { display: none; }
  .control-btn { padding: 6px 10px; min-width: 50px; }
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
  .game-controls {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
  .cookie-banner {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* Print */
@media print {
  .site-header, .site-footer, .ad-container, .cookie-banner { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast */
@media (prefers-contrast: high) {
  :root {
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  .btn-primary { border: 2px solid #000; }
}
