.grid {
  display: grid;
  grid-template-columns: repeat(12, var(--grid-cell-size));
  grid-template-rows: repeat(3, var(--grid-cell-size));
  gap: var(--grid-gap);
  padding: 15px;
  background: rgba(10, 15, 25, 0.7);
  border: 1px solid rgba(0, 243, 255, 0.1);
  border-radius: 4px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  position: relative;
}

/* Tech corners for the grid */
.grid::before, .grid::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent-cyan);
  transition: all 0.3s ease;
}
.grid::before { top: -1px; left: -1px; border-bottom: none; border-right: none; }
.grid::after { bottom: -1px; right: -1px; border-top: none; border-left: none; }

.grid-cell {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  position: relative;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.grid-cell:hover {
  border-color: rgba(0, 243, 255, 0.3);
  background: rgba(0, 243, 255, 0.05);
}

.grid-cell.valid-drop {
  background: rgba(0, 255, 157, 0.1);
  border: 1px dashed var(--accent-green);
  box-shadow: 0 0 15px rgba(0, 255, 157, 0.2);
}

.grid-cell.invalid-drop {
  background: rgba(255, 0, 85, 0.1);
  border: 1px dashed var(--accent-pink);
}

/* Opponent Grid 3D Effect */
#opponent-grid {
  transform: perspective(1000px) rotateX(15deg) scale(0.95);
  opacity: 0.9;
  filter: brightness(0.8);
  border-color: rgba(255, 0, 85, 0.2);
}

#opponent-grid::before, #opponent-grid::after {
  border-color: var(--accent-pink);
}

/* 2 Player Layout */
body[data-players="2"] .grid {
  grid-template-columns: repeat(6, var(--grid-cell-size));
}

body[data-players="2"] .player-section.active .grid {
  box-shadow: 0 0 40px rgba(0, 243, 255, 0.15);
  border-color: var(--accent-cyan);
}

body[data-players="2"] .player-section:not(.active) .grid {
  opacity: 0.6;
  filter: grayscale(0.8);
  transform: scale(0.95);
}