* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: gray;
  text-align: center;
  padding: 1rem;
  min-height: 100vh;
  font-family: 'Orbitron', monospace;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  letter-spacing: 2px;
}
.container {
  height: auto;
  min-height: 60vh;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.game {
  width: min(90vw, 90vh, 450px);
  height: min(90vw, 90vh, 450px);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: min(2vw, 15px);
  margin: 1rem auto;
  padding: min(2vw, 15px);
  box-sizing: border-box;
}

.box {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  border: none;
  border-radius: clamp(8px, 2vw, 15px);
  font-size: clamp(2.5rem, 8vmin, 5rem);
  font-weight: bold;
  color: #000;
  background-color: #ffffc7;
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.3);
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

#reset-btn {
  padding: clamp(1rem, 4vw, 1.5rem) clamp(1.5rem, 6vw, 2.5rem);
  background: linear-gradient(135deg, #333, #555);
  color: white;
  border: none;
  border-radius: clamp(0.75rem, 3vw, 1.2rem);
  font-size: clamp(1.1rem, 4vmin, 1.5rem);
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 1.5rem auto 2rem auto;
  touch-action: manipulation;
  min-height: 50px;
  min-width: 150px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  display: block;
}

#reset-btn:hover {
  background: linear-gradient(135deg, #555, #777);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

#reset-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#reset-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

#reset-btn:hover::before {
  left: 100%;
}

#new-btn {
  padding: clamp(1rem, 4vw, 1.5rem) clamp(1.5rem, 6vw, 2.5rem);
  background: linear-gradient(135deg, #333, #555);
  color: white;
  border: none;
  border-radius: clamp(0.75rem, 3vw, 1.2rem);
  font-size: clamp(1.1rem, 4vmin, 1.5rem);
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  touch-action: manipulation;
  min-height: 50px;
  min-width: 150px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

#new-btn:hover {
  background: linear-gradient(135deg, #555, #777);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

#new-btn:active {
  transform: translateY(-1px) scale(1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#new-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

#new-btn:hover::before {
  left: 100%;
}
#msg {
  color: #ffffc7;
  font-size: clamp(1.5rem, 6vmin, 3rem);
  margin-bottom: 1rem;
  padding: 0 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.msg-container {
  height: auto;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: clamp(2rem, 5vw, 4rem);
  padding: 2rem;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(128, 128, 128, 0.95);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.hide {
  display: none;
}

/* Media Queries for better mobile experience */
@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }
  
  h1 {
    font-size: clamp(2.5rem, 10vw, 4.5rem);
    font-weight: 900;
    margin-bottom: 1.5rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 
      0 0 10px rgba(255, 255, 255, 0.5),
      0 0 20px rgba(255, 255, 255, 0.3),
      0 0 30px rgba(255, 255, 255, 0.2);
  }
  
  .game {
    width: min(90vw, 90vh, 360px);
    height: min(90vw, 90vh, 360px);
    gap: min(1.5vw, 12px);
    padding: min(1.5vw, 12px);
  }
  
  .box {
    font-size: clamp(2rem, 7vmin, 4rem);
    border-radius: clamp(6px, 1.5vw, 12px);
  }
  
  #reset-btn {
    padding: 1.5rem 3rem;
    font-size: 1.3rem;
    min-height: 65px;
    min-width: 200px;
    margin-top: 2rem;
    border-radius: 1rem;
  }
  
  #new-btn {
    padding: 1.5rem 3rem;
    font-size: 1.3rem;
    min-height: 65px;
    min-width: 200px;
    border-radius: 1rem;
  }
}

@media (max-width: 320px) {
  .game {
    width: min(93vw, 93vh, 300px);
    height: min(93vw, 93vh, 300px);
    gap: min(1vw, 8px);
    padding: min(1vw, 8px);
  }
  
  .box {
    font-size: clamp(1.8rem, 6vmin, 3.5rem);
    border-radius: clamp(4px, 1vw, 10px);
  }
  
  #reset-btn {
    padding: 1.3rem 2.5rem;
    font-size: 1.2rem;
    min-height: 60px;
    min-width: 180px;
  }
  
  #new-btn {
    padding: 1.3rem 2.5rem;
    font-size: 1.2rem;
    min-height: 60px;
    min-width: 180px;
  }
}
