/**
 * HSA Store Product Eligibility Game
 * Mobile-specific optimization CSS
 * This file enhances mobile responsiveness without affecting desktop layouts
 */

/* Base mobile styles - only apply to small screens */
@media only screen and (max-width: 768px) {
  /* Game container optimization */
  .game-modal {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  /* Screen padding adjustments */
  .screen {
    padding: 16px;
    overflow-y: auto;
    min-height: 100vh;
  }

  /* Header adjustments */
  .header {
    margin-bottom: 12px;
  }

  /* Game stats section optimization */
  .game-stats-section {
    display: flex;
    justify-content: space-around;
    padding: 0;
    margin-bottom: 16px;
  }

  .stat-container {
    margin: 0 4px;
  }

  .stat-title {
    font-size: 14px;
    margin-bottom: 4px;
  }

  .stat-item {
    width: auto;
    min-width: 90px;
    height: 44px;
    padding: 6px 10px;
  }

  .stat-icon {
    width: 20px;
    height: 20px;
  }

  .stat-icon img {
    width: 16px;
    height: 16px;
  }

  .stat-value-container {
    padding: 4px 8px;
    min-width: 50px;
  }

  .stat-value {
    font-size: 14px;
  }

  /* Product container optimization */
  .product-container {
    flex-direction: column;
    padding: 10px;
    margin-top: 0;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  }

  .product-image {
    width: 100%;
    max-width: 220px;
    max-height: 30vh;
    margin: 0 auto 16px;
    padding: 0;
  }

  .product-image img {
    max-height: 180px;
  }

  .product-info {
    width: 100%;
  }

  .product-info p {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .product-question {
    text-align: center;
    margin: 16px 0;
    font-weight: 600;
  }

  /* Eligibility buttons */
  .eligibility-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .eligibility-buttons button {
    min-height: 48px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
  }
}

/* Extra small devices (phones under 375px) */
@media only screen and (max-width: 375px) {
  .screen {
    padding: 12px;
  }

  .game-stats-section {
    flex-wrap: wrap;
  }

  .stat-container {
    width: 48%;
    margin-bottom: 8px;
  }

  .stat-item {
    width: 100%;
    min-width: 0;
  }

  .product-image {
    max-width: 180px;
  }
}

/* Landscape mode specific adjustments */
@media only screen and (max-width: 900px) and (orientation: landscape) {
  .product-container {
    flex-direction: row;
    align-items: center;
  }

  .product-image {
    flex: 0 0 40%;
    max-width: 160px;
    margin-bottom: 0;
    margin-right: 16px;
  }

  .product-info {
    flex: 1;
  }

  .product-question {
    text-align: left;
  }

  .eligibility-buttons {
    flex-direction: row;
  }
}

/* Safari Mobile specific fixes */
@supports (-webkit-touch-callout: none) {
  .eligibility-buttons button {
    -webkit-appearance: none;
  }

  .product-image {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Mobile device detection helper */
.mobile-device .game-screen {
  background-color: #f8f5ff;
}

.mobile-device .separator-line {
  height: 1px;
  background-color: #e8e8e8;
  margin: 12px 0;
  width: 100%;
}

/* Tap target size improvements */
.mobile-device .close-btn {
  padding: 8px;
  font-size: 28px;
  min-width: 44px;
  min-height: 44px;
}

/* Fix for mobile scrolling issues */
.mobile-device body {
  position: fixed;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.mobile-device .game-modal {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
