/* Tetris Game Styles */

/* Game container */
.tetris-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
  font-family: Arial, sans-serif;
  gap: 20px;
}

/* Canvas wrapper */
.tetris-canvas-wrapper {
  position: relative;
  background-color: #111;
  border: 3px solid #333;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Game canvas */
#tetrisCanvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Game info panel */
.tetris-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 150px;
  background-color: #222;
  border-radius: 5px;
  padding: 15px;
  color: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.tetris-info h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 18px;
  color: #0DC2FF;
}

#nextPieceCanvas {
  background-color: #111;
  border: 2px solid #333;
  border-radius: 3px;
  display: block;
  margin: 0 auto 10px;
}

/* Controls */
.tetris-controls {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.tetris-controls button {
  width: 60px;
  height: 60px;
  font-size: 24px;
  border-radius: 50%;
  border: none;
  background-color: #333;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px #222;
  transition: all 0.1s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: manipulation;
}

.tetris-controls button:active {
  box-shadow: 0 2px #222;
  transform: translateY(2px);
}

#tetris-rotate {
  background-color: #0DC2FF;
}

#tetris-drop {
  background-color: #FF0D72;
}

/* Game over popup */
#tetris-game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  min-width: 250px;
  z-index: 10;
}

#tetris-game-over h2 {
  color: #FF0D72;
  margin-top: 0;
}

#tetris-restart {
  background-color: #0DC2FF;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 10px;
  transition: background-color 0.3s ease;
}

#tetris-restart:hover {
  background-color: #09a0d3;
}

/* Responsive design */
@media (max-width: 768px) {
  .tetris-container {
    padding: 10px;
  }
  
  .tetris-controls button {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
}

@media (max-width: 500px) {
  .tetris-info {
    flex-direction: row;
    width: 100%;
    margin-top: 15px;
  }
  
  .tetris-controls {
    margin-top: 10px;
  }
  
  .tetris-controls button {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
  
  #tetrisCanvas {
    width: 100%;
    height: auto;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#tetris-game-over {
  animation: fadeIn 0.5s ease;
}

.tetris-complete-line {
  animation: flash 0.5s ease;
}

@keyframes flash {
  0% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}

/* Pause screen */
.tetris-paused {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  z-index: 5;
}