* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Orbitron', sans-serif;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    touch-action: manipulation; /* Optimize touch actions */
  }
  
  body {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    color: #f9f9f9;
    text-align: center;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Prevent scrolling on mobile */
    position: relative;
  }
  
  body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
      radial-gradient(circle at 20% 20%, rgba(46, 204, 113, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 80% 80%, rgba(52, 152, 219, 0.1) 0%, transparent 50%);
    pointer-events: none;
  }
  
  .container {
    max-width: 500px;
    padding: 30px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: containerAppear 0.6s ease-out;
  }
  
  @keyframes containerAppear {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
      45deg,
      transparent,
      rgba(255, 255, 255, 0.03),
      transparent
    );
    transform: rotate(45deg);
    animation: containerShine 6s infinite;
  }
  
  @keyframes containerShine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
  }
  
  h1 {
    font-size: 3.5rem;
    margin-bottom: 25px;
    color: #2ecc71;
    position: relative;
    display: inline-block;
    animation: titleSlide 0.8s ease-out;
  }
  
  @keyframes titleSlide {
    from {
      opacity: 0;
      transform: translateX(-30px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #2ecc71;
    animation: lineGrow 0.8s ease-out 0.3s forwards;
  }
  
  @keyframes lineGrow {
    to {
      width: 80%;
    }
  }
  
  .start-btn {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    animation: buttonAppear 0.6s ease-out 0.4s both;
  }
  
  @keyframes buttonAppear {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .start-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
  }
  
  .start-btn:active {
    transform: translateY(1px) scale(0.98);
  }
  
  .start-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }
  
  .rules-btn {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    animation: buttonAppear 0.6s ease-out 0.6s both;
  }
  
  .rules-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
  }
  
  .rules-btn:active {
    transform: translateY(1px) scale(0.98);
  }
  
  .buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-content: space-between;
    width: 240px;
    height: 240px;
    margin: 0 auto;
    gap: 20px;
    padding: 10px;
    animation: buttonsAppear 0.8s ease-out 0.8s both;
  }
  
  @keyframes buttonsAppear {
    from {
      opacity: 0;
      transform: scale(0.9);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
  
  .btn {
    height: 100px;
    width: 100px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    overflow: hidden;
  }
  
  .btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
  }
  
  .btn:hover::after {
    opacity: 1;
  }
  
  .btn:active {
    transform: scale(0.95);
  }
  
  .bt1 {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
  }
  
  .bt2 {
    background: linear-gradient(45deg, #e67e22, #d35400);
  }
  
  .bt3 {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
  }
  
  .bt4 {
    background: linear-gradient(45deg, #3498db, #2980b9);
  }
  
  .flash {
    animation: flash 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .userflash {
    animation: userflash 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  @keyframes flash {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
  }
  
  @keyframes userflash {
    0% { transform: scale(1); background: #2ecc71; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
  }
  
  /* Modal Styles */
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    animation: modalFade 0.3s ease-out;
  }
  
  @keyframes modalFade {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  
  .modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    margin: 20px auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: modalSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  @keyframes modalSlide {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #cfcfcf;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.1);
  }
  
  .close-btn:hover {
    color: #f9f9f9;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
  }
  
  .rules-content {
    text-align: left;
    margin-top: 20px;
    padding-right: 10px;
    animation: contentAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
  }
  
  @keyframes contentAppear {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .rules-content h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #2ecc71;
    font-size: 1.8rem;
  }
  
  .rules-content h4 {
    color: #2ecc71;
    margin: 20px 0 15px 0;
    font-size: 1.3rem;
  }
  
  .rules-content ol, .rules-content ul {
    margin-left: 20px;
  }
  
  .rules-content li {
    margin: 12px 0;
    line-height: 1.6;
    color: #e0e0e0;
  }
  
  /* Media query for mobile devices */
  @media (max-width: 480px) {
    h1 {
      font-size: 2.8rem;
    }
    
    .start-btn {
      font-size: 1.1rem;
      padding: 12px 30px;
    }
    
    .buttons {
      width: 220px;
      height: 220px;
      gap: 15px;
    }
    
    .btn {
      height: 90px;
      width: 90px;
    }

    .modal {
      padding: 15px;
    }

    .modal-content {
      margin: 10px auto;
      padding: 25px;
      width: 95%;
    }

    .game-over-content h3 {
      font-size: 2.2rem;
    }

    .score-display span {
      font-size: 3rem;
    }

    .try-again-btn {
      font-size: 1.2rem;
      padding: 12px 30px;
    }

    .rules-content h3 {
      font-size: 1.5rem;
    }

    .rules-content h4 {
      font-size: 1.2rem;
    }

    .rules-content li {
      font-size: 1rem;
    }
  }
  
  /* Game Over Modal Specific Styles */
  .game-over-content {
    text-align: center;
    padding: 30px;
  }

  .game-over-content h3 {
    color: #e74c3c;
    font-size: 2.5rem;
    margin-bottom: 30px;
    animation: gameOverText 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  @keyframes gameOverText {
    from {
      opacity: 0;
      transform: scale(0.8);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  .score-display {
    margin: 30px 0;
    animation: scoreAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
  }

  @keyframes scoreAppear {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .score-display p {
    font-size: 1.2rem;
    color: #bdc3c7;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
  }

  .score-display span {
    font-size: 3.5rem;
    color: #2ecc71;
    font-weight: bold;
  }

  .try-again-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    margin-top: 20px;
    animation: buttonAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.6s both;
  }

  .try-again-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
  }

  .try-again-btn:active {
    transform: translateY(1px) scale(0.98);
  }
  
