html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.chromadrift-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 50%, #16213e 100%);
  font-family: Arial, sans-serif;
  color: #fff;
  overflow: hidden;
}

.chromadrift-header {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 10;
}

.lives-display-container {
  display: none;
  align-items: center;
  gap: .5rem;
  font-size: 1.5rem;
  background: #0000004d;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #fff3;
}

#lives-display {
  display: none;
  gap: .2rem;
  align-items: center;
}

.score-display-container {
  display: none;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  background: #0000004d;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #fff3;
}

.label {
  color: #aaa;
  font-weight: bold;
}

.chromadrift-game {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#game-canvas {
  cursor: pointer;
  image-rendering: pixelated;
  display: block;
}

.chromadrift-controls {
  position: fixed;
  top: 65%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 100;
}

.chromadrift-controls.visible {
  display: flex;
}

.control-btn {
  padding: .8rem 1.5rem;
  font-size: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all .3s;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.control-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px #667eea66;
}

.control-btn:active {
  transform: translateY(0);
}

.chromadrift-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  background: #000000d9;
  padding: 60px 40px;
  border-radius: 12px;
  border: 2px solid #667eea80;
  max-width: 600px;
  z-index: 200;
  box-shadow: 0 0 40px #667eea4d;
}

.chromadrift-overlay.hidden {
  display: none;
}

.chromadrift-title {
  font-size: 64px;
  font-weight: bold;
  color: #667eea;
  text-shadow: 0 0 20px #667eea99;
  letter-spacing: 2px;
}

.chromadrift-instructions {
  font-size: 18px;
  color: #ddd;
  text-align: center;
  line-height: 1.8;
  color: #ccc;
}

.chromadrift-instructions strong {
  color: #667eea;
  font-weight: bold;
}

.chromadrift-btn {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: bold;
  transition: all .3s;
}

.chromadrift-btn-start {
  padding: 16px 40px;
  font-size: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chromadrift-btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px #667eea66;
}

.chromadrift-btn-start:active {
  transform: translateY(0);
}

.color-legend {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #0009;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #444;
  max-width: 400px;
  z-index: 10;
}

.color-legend h3 {
  margin: 0 0 .5rem;
  text-align: center;
  color: #aaa;
  font-size: .9rem;
}

.legend-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem;
  background: #ffffff0d;
  border-radius: 4px;
  border: 1px solid #555;
}

.legend-item span {
  font-size: .8rem;
  color: #ddd;
}

@media (width <= 768px) {
  .header-info {
    font-size: .9rem;
    gap: 1rem;
  }

  .chromadrift-controls {
    gap: .5rem;
  }

  .control-btn {
    padding: .6rem 1rem;
    font-size: .9rem;
  }

  .color-legend {
    max-width: 300px;
    padding: .8rem;
  }

  .color-legend h3 {
    font-size: .8rem;
  }

  .legend-item span {
    font-size: .7rem;
  }
}
