* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111827;
  color: #f9fafb;
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, #1f2937, #0f172a);
  box-shadow: 0 18px 50px rgba(0,0,0,0.28);
}

.eyebrow {
  margin: 0 0 6px;
  color: #93c5fd;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1, h2, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 46px);
}

h2 {
  margin-bottom: 12px;
}

.lead {
  margin-bottom: 0;
  color: #cbd5e1;
}

.transport {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  color: #0f172a;
  background: #facc15;
  box-shadow: 0 8px 24px rgba(250,204,21,0.18);
}

button.ghost,
.presets button {
  color: #e5e7eb;
  background: #374151;
  box-shadow: none;
}

.panel {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  background: #1f2937;
  box-shadow: 0 14px 40px rgba(0,0,0,0.22);
}

.chartHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

#formulaText {
  color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.settingsStatus {
  margin: 8px 0 0;
  color: #a7f3d0;
  font-size: 13px;
}

.settingsStatus.error {
  color: #fecaca;
}

.readout {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
  color: #a7f3d0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

#waveCanvas {
  width: 100%;
  height: 330px;
  display: block;
  border-radius: 18px;
  background: #0b1220;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.controls label {
  display: grid;
  grid-template-columns: 140px 1fr 78px;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
}

.controls span {
  color: #e5e7eb;
  font-weight: 700;
}

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

output {
  color: #bfdbfe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: right;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

footer {
  color: #94a3b8;
  padding: 18px 4px;
}

@media (max-width: 820px) {
  .hero, .chartHead {
    flex-direction: column;
  }

  .transport {
    justify-content: flex-start;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .controls label {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  output {
    text-align: left;
  }
}


/* v2: バネ特上ぷるぷる用の高速パラメータが増えたので少し詰める */
.controls label {
  min-height: 28px;
}

.presets button {
  padding: 10px 14px;
}


.settingsNameInput{
  padding:8px 10px;
  border-radius:10px;
  border:1px solid #666;
  background:#111;
  color:#fff;
  min-width:140px;
}

.controlSep {
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin: 22px 0 16px;
}
