/* Base Styles */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 10px;
    text-align: center;
    background: linear-gradient(120deg, #ff9a9e 0%, #fad0c4 100%);
  }
  
  h1 {
    margin-bottom: 5px;
    color: #3e2723;
  }
  
  p {
    color: #4e342e;
    margin: 10px;
  }
  
  /* Game Info */
  .game-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    font-weight: bold;
  }
  
  #levelInfo, #timer, #score {
    color: #ffffff;
    background-color: #f57c00;
    padding: 5px 10px;
    border-radius: 20px;
  }
  
  /* Game Board */
  #game-board {
    display: grid;
    gap: 10px;
    margin: 20px auto;
    max-width: 600px;
    /* The grid-template-columns will be set dynamically by JS */
  }
  
  /* Card Styling */
  .card {
    background: #4e342e;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    font-size: 1.2em;
    user-select: none;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    /* Use an aspect ratio to help keep cards sized proportionally */
    aspect-ratio: 1 / 1.4;
  }
  
  .card.flip {
    transform: rotateY(180deg);
  }
  
  .card .front,
  .card .back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
  }
  
  .card .front {
    background: #ffffff;
    color: #000;
    font-size: 1em;
    transform: rotateY(180deg);
  }
  
  .card .back {
    background: #4e342e;
    font-size: 2em;
  }
  
  /* Matched Cards */
  .card.matched.disabled {
    opacity: 0.6;
    background-color: #ccc !important;
    pointer-events: none !important;
    color: #666 !important;
    transform: none !important;
  }
  
  /* Message */
  #message {
    font-size: 1.2em;
    margin-top: 20px;
    height: 2em;
    color: #d84315;
    font-weight: bold;
  }
  
  /* Controls & Buttons */
  .controls {
    margin-top: 15px;
  }
  
  button {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    background: #f57c00;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px;
  }
  
  button:hover {
    background: #ef6c00;
  }
  
  /* Image and Text on Card Faces */
  .symbol-img {
    max-width: 60px;
    max-height: 60px;
    margin-top: 5px;
  }
  
  .symbol-text {
    font-size: 1.4em;
    margin-top: 5px;
    font-weight: bold;
  }
  
  /* Responsive Adjustments for Smartphones */
  @media (max-width: 600px) {
    body {
      padding: 5px;
    }
    
    #game-board {
      max-width: 95%;
      gap: 15px;
    }
    
    .card {
      font-size: 1em;
    }
    
    button {
      padding: 8px 16px;
      font-size: 14px;
    }
    
    .game-info {
      flex-direction: column;
      gap: 10px;
    }
  }
  