/* Base styles with mobile-first approach */
:root {
    --primary-color: #1a73e8;
    --secondary-color: #4CAF50;
    --background-color: #f0f2f5;
    --card-background: #ffffff;
    --text-color: #333333;
    --border-radius: 12px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
  
  * {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }
  
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  
  .container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
  }
  
  /* Enhanced Card Styles */
  .card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
  }
  
  /* Typography */
  h1 {
    font-size: 24px;
    text-align: center;
    color: var(--primary-color);
    margin: 16px 0;
  }
  
  /* Game Rules Section */
  .rules-section {
    background-color: rgba(26, 115, 232, 0.05);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 20px;
  }
  
  .rules-content ol {
    padding-left: 24px;
    margin: 0;
  }
  
  .rules-content li {
    margin-bottom: 8px;
    font-size: 14px;
  }
  
  /* Form Elements */
  input, select, button {
    width: 100%;
    padding: 16px;
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    font-size: 16px;
    margin-bottom: 12px;
    appearance: none;
    min-height: 48px;
  }
  
  select {
    background-image: url("data:image/svg+xml,%3Csvg fill='none' stroke='currentColor' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
  }
  
  button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    transition: background-color 0.2s;
  }
  
  button:active {
    transform: scale(0.98);
  }
  
  /* Game Stats Grid */
  .game-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }
  
  .stat-box {
    background-color: rgba(26, 115, 232, 0.05);
    padding: 12px;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 14px;
  }
  
  /* Game History and Used Words */
  .history, .used-words {
    max-height: 120px;
    overflow-y: auto;
    padding: 12px;
    background-color: rgba(26, 115, 232, 0.05);
    border-radius: var(--border-radius);
    font-size: 14px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Sticky Game Controls */
  .game-controls {
    position: sticky;
    bottom: 0;
    background-color: var(--card-background);
    padding: 12px;
    border-top: 1px solid #eee;
    z-index: 10;
  }
  
  /* Achievement Animation */
  .achievement-popup {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--secondary-color);
    color: white;
    padding: 16px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease-out;
    width: 90%;
    max-width: 300px;
    text-align: center;
    z-index: 1000;
  }
  
  @keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
  }
  
  /* Loading Spinner */
  .loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* Landscape Mode Optimizations */
  @media (orientation: landscape) and (max-height: 500px) {
    .container {
      padding: 8px;
    }
    
    .rules-section {
      display: none;
    }
    
    .game-stats {
      grid-template-columns: repeat(4, 1fr);
    }
    
    .card {
      margin-bottom: 8px;
    }
  }
  
  /* Dark Mode Support */
  @media (prefers-color-scheme: dark) {
    :root {
      --background-color: #121212;
      --card-background: #1e1e1e;
      --text-color: #ffffff;
    }
    
    input, select {
      background-color: #2d2d2d;
      color: white;
      border-color: #404040;
    }
    
    .stat-box, .rules-section, .history, .used-words {
      background-color: rgba(255, 255, 255, 0.05);
    }
  }
  /* Footer Styles */
.footer {
    background-color: var(--card-background);
    padding: 24px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    width: 100%;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
    text-align: center;
}

.footer-content p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.8;
}

/* Dark mode support for footer */
@media (prefers-color-scheme: dark) {
    .footer {
        border-top-color: rgba(255, 255, 255, 0.1);
    }
}

/* Ensure footer stays at bottom with short content */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
}

/* Adjust container padding for better spacing */
.container {
    padding-bottom: 40px;
}

/* Mobile optimization for footer */
@media (max-width: 480px) {
    .footer {
        padding: 16px 0;
        margin-top: 24px;
    }
    
    .footer-content p {
        font-size: 12px;
        margin: 6px 0;
    }
}