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

body {
  font-family: 'Segoe UI', sans-serif;
  background: #f5f5f5;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
}

h2 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #34495e;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  margin-bottom: 20px;
}

.controls, .preview, .graph-container, .code-output {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

select {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  margin-bottom: 20px;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: #3498db;
}

.duration-control {
  margin-bottom: 20px;
}

.duration-control label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

input[type="range"] {
  width: 100%;
  cursor: pointer;
}

#play-btn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

#play-btn:hover {
  background: #2980b9;
}

.track {
  height: 60px;
  background: #ecf0f1;
  border-radius: 30px;
  position: relative;
  overflow: hidden;
}

.ball {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #3498db, #2980b9);
  border-radius: 50%;
  position: absolute;
  left: 0;
  top: 0;
  box-shadow: 0 4px 10px rgba(52, 152, 219, 0.4);
}

.graph-container {
  margin-bottom: 20px;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

#copy-btn {
  padding: 8px 16px;
  background: #2ecc71;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

#copy-btn:hover {
  background: #27ae60;
}

#copy-btn.copied {
  background: #9b59b6;
}

pre {
  background: #2c3e50;
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
}

code {
  color: #ecf0f1;
  font-family: 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.5;
}

footer{
  margin-top: 20px; text-align: center; font-size: 0.8em; color: #666;
}

@media (max-width: 600px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}
