/* Color Grid */
.color-grid {
  display: grid;
  max-width: 400px;
  margin: 0 auto;
  gap: 8px;
}

.grid-2x2 { grid-template-columns: repeat(2, 1fr); }
.grid-3x3 { grid-template-columns: repeat(3, 1fr); }
.grid-4x4 { grid-template-columns: repeat(4, 1fr); }
.grid-5x5 { grid-template-columns: repeat(5, 1fr); }

.color-tile {
  aspect-ratio: 1;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.color-tile:hover {
  transform: scale(1.05);
}

.color-tile.correct {
  outline: 3px solid #10b981;
  outline-offset: -3px;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
  animation: correctPulse 0.6s ease;
}

.color-tile.wrong {
  outline: 3px solid #ef4444;
  outline-offset: -3px;
  animation: shake 0.5s ease;
}

@keyframes correctPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #8b5cf6);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Level Indicator */
.level-indicator {
  position: relative;
  width: 100%;
  height: 20px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin: 60px 0 80px 0;
}

.level-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, #10b981, #3b82f6, #8b5cf6);
  border-radius: 10px;
  transition: width 0.8s ease-out;
}

.level-marker {
  position: absolute;
  top: -30px;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.level-marker::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 36px;
  background: currentColor;
  opacity: 0.3;
}

/* Challenge Comparison */
.challenge-comparison {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.challenge-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  min-width: 120px;
}

.challenge-player.winner {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.challenge-vs {
  font-size: 24px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.3);
}

/* Lives */
.lives-display {
  font-size: 20px;
  letter-spacing: 4px;
}

/* User Level Marker */
#userLevelMarker {
  top: auto;
  bottom: -30px;
}

#userLevelMarker::after {
  bottom: auto;
  top: -8px;
}

/* Mobile */
@media (max-width: 480px) {
  .color-grid {
    max-width: 300px;
    gap: 4px;
  }
  .color-tile {
    border-radius: 8px;
  }
  .challenge-comparison {
    gap: 12px;
  }
  .challenge-player {
    padding: 12px 16px;
    min-width: 90px;
  }
}
