:root {
  color-scheme: dark;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --panel-bg: rgba(15, 18, 28, 0.75);
  --panel-border: rgba(255, 255, 255, 0.08);
  --accent: #3fa9f5;
  --text-muted: rgba(255, 255, 255, 0.7);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem clamp(1.5rem, 2vw, 4rem);
  background: radial-gradient(circle at top, #2a2d3a, #12131a 60%);
  color: #f8f9ff;
}

.app-header,
.app-footer {
  text-align: center;
  max-width: 960px;
}

.app-header h1 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 3rem);
}

.app-header p,
.app-footer small {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.app-content {
  width: min(90vw, 1200px);
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

canvas.webgl {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 1.5rem;
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 35px 60px rgba(0, 0, 0, 0.45);
}

.control-panel {
  padding: 1.5rem;
  border-radius: 1rem;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
}

.control-panel h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.button-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.color-button {
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.color-button:hover,
.color-button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.35);
  outline: none;
}

.color-button:active {
  transform: translateY(0);
  box-shadow: none;
}

@media (min-width: 960px) {
  .app-content {
    grid-template-columns: 3fr 1fr;
    align-items: stretch;
  }

  .control-panel {
    align-self: stretch;
  }
}
