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

body {
  font-family: Arial, sans-serif;
  background-color: #1a202c;
  color: white;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
}

h1 {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  text-align: center;
}

h2 {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

/* Game Container */
.game-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

@media (min-width: 768px) {
  .game-container {
    flex-direction: row;
  }
}

/* Game Info */
.game-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

@media (min-width: 768px) {
  .game-info {
    width: auto;
  }
}

.info-card {
  background-color: #2d3748;
  border-radius: 0.5rem;
  padding: 1rem;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.875rem;
}

/* Next Piece */
.next-piece-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  width: 5rem;
  height: 5rem;
  margin: 0 auto;
}

.next-piece-cell {
  width: 1.25rem;
  height: 1.25rem;
}

/* Buttons */
.button-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary-btn {
  background-color: #4299e1;
  color: white;
}

.primary-btn:hover:not(:disabled) {
  background-color: #3182ce;
}

.danger-btn {
  background-color: #f56565;
  color: white;
}

.danger-btn:hover:not(:disabled) {
  background-color: #e53e3e;
}

.outline-btn {
  background-color: transparent;
  color: white;
  border: 1px solid #4a5568;
}

.outline-btn:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.1);
}

.icon {
  margin-right: 0.5rem;
}

/* Mobile Controls */
.mobile-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.mobile-controls-row {
  display: grid;
  gap: 0.5rem;
}

.mobile-controls-row:first-child {
  grid-template-columns: 1fr 1fr 1fr;
}

.mobile-controls-row:last-child {
  grid-template-columns: 1fr 1fr;
}

@media (min-width: 768px) {
  .mobile-controls {
    display: none;
  }
}

/* Game Area */
.game-area {
  position: relative;
  background-color: #1a202c;
  border: 2px solid #4a5568;
  border-radius: 0.375rem;
  overflow: hidden;
  outline: none;
}

.board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
}

.cell {
  width: 1.5rem;
  height: 1.5rem;
}

@media (min-width: 640px) {
  .cell {
    width: 2rem;
    height: 2rem;
  }
}

/* Tetromino Colors */
.tetromino-I {
  background-color: #0bc5ea;
}

.tetromino-J {
  background-color: #3182ce;
}

.tetromino-L {
  background-color: #ed8936;
}

.tetromino-O {
  background-color: #ecc94b;
}

.tetromino-S {
  background-color: #48bb78;
}

.tetromino-T {
  background-color: #9f7aea;
}

.tetromino-Z {
  background-color: #f56565;
}

.tetromino-ghost {
  background-color: rgba(255, 255, 255, 0.2);
}

.empty {
  background-color: #2d3748;
}

/* Overlays */
.overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-content {
  text-align: center;
}

.overlay-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.overlay-score {
  margin-bottom: 1rem;
}

.hidden {
  display: none;
}
