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

body {
  background-color: #1a1a1a;
  color: #b8b8b8;
  font-family: "Merriweather", Georgia, serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  width: 100%;
  max-width: 900px;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
  color: #e8e8e8;
}

.subtitle {
  font-size: 0.9rem;
  opacity: 0.6;
  font-weight: 300;
  font-style: italic;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
}

.btn {
  background: rgba(45, 42, 38, 0.8);
  border: 1px solid rgba(200, 170, 110, 0.3);
  color: #b8b8b8;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: "Merriweather", Georgia, serif;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover {
  background: rgba(60, 55, 48, 0.9);
  border-color: rgba(200, 170, 110, 0.5);
  color: #e8e8e8;
}

.btn.primary {
  background: rgba(200, 170, 110, 0.15);
  border-color: rgba(200, 170, 110, 0.4);
  color: #c8aa6e;
}

.btn.primary:hover {
  background: rgba(200, 170, 110, 0.25);
  border-color: rgba(200, 170, 110, 0.6);
}

.btn.primary.playing {
  background: rgba(200, 170, 110, 0.2);
  border-color: rgba(200, 170, 110, 0.5);
  color: #c8aa6e;
}

.btn .icon {
  font-size: 0.7rem;
  color: #c8aa6e;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.control-group label {
  font-size: 0.8rem;
  opacity: 0.7;
  color: #b8b8b8;
}

input[type="range"] {
  /* -webkit-appearance: none; */
  width: 80px;
  height: 4px;
  background: rgba(200, 170, 110, 0.2);
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #c8aa6e;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #c8aa6e;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.instrument-select {
  margin-left: 0.5rem;
}

.toggle-group {
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(200, 170, 110, 0.3);
}

.toggle-btn {
  background: rgba(45, 42, 38, 0.6);
  border: none;
  color: rgba(184, 184, 184, 0.7);
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: "Merriweather", Georgia, serif;
  transition: all 0.2s ease;
  border-right: 1px solid rgba(200, 170, 110, 0.15);
}

.toggle-btn:last-child {
  border-right: none;
}

.toggle-btn:hover {
  background: rgba(60, 55, 48, 0.8);
  color: #b8b8b8;
}

.toggle-btn.active {
  background: rgba(200, 170, 110, 0.2);
  color: #c8aa6e;
}

.patterns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
}

.pattern-label {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-right: 0.5rem;
  color: #b8b8b8;
}

.pattern-btn {
  background: rgba(45, 42, 38, 0.6);
  border: 1px solid rgba(200, 170, 110, 0.2);
  color: #b8b8b8;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: "Merriweather", Georgia, serif;
  transition: all 0.2s ease;
}

.pattern-btn:hover {
  background: rgba(200, 170, 110, 0.15);
  border-color: rgba(200, 170, 110, 0.4);
  color: #c8aa6e;
}

.canvas-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

#gameCanvas {
  border: 1px solid rgba(200, 170, 110, 0.15);
  border-radius: 8px;
  cursor: crosshair;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  font-size: 0.8rem;
  opacity: 0.6;
  margin-bottom: 1.5rem;
  color: #b8b8b8;
}

.stats strong {
  font-weight: 400;
  opacity: 1;
  color: #c8aa6e;
}

footer {
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.4;
  font-style: italic;
  color: #b8b8b8;
}

@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .controls {
    gap: 0.5rem;
  }

  .btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }

  .stats {
    flex-wrap: wrap;
    gap: 1rem;
  }
}
