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

body {
  background-color: #0a0f1e;
  background-image: none;
  font-family: 'Nunito', 'monospace', sans-serif;
  color: #e2e8f0;
  overflow: hidden;
}

#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 24px 10px;
  height: 100vh;
}

/* ── Titre ── */
h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #93c5fd;
  text-shadow: 0 0 14px rgba(99,179,237,0.5);
}

/* ── Panneaux ── */
.panel {
  background: rgba(18, 40, 80, 0.82);
  border: 1px solid rgba(99,179,237,0.2);
  border-radius: 14px;
  padding: 12px 18px;
  width: 100%;
  max-width: 860px;
}

.panel-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #63b3ed;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ── Sélecteur de forme d'onde ── */
#wave-selector {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.wave-btn {
  background: rgba(99,179,237,0.1);
  border: 1.5px solid rgba(99,179,237,0.3);
  border-radius: 10px;
  color: #93c5fd;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 7px 22px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wave-btn svg { flex-shrink: 0; }

.wave-btn:hover {
  background: rgba(99,179,237,0.2);
  border-color: rgba(99,179,237,0.7);
}

.wave-btn.active {
  background: rgba(99,179,237,0.28);
  border-color: #63b3ed;
  box-shadow: 0 0 12px rgba(99,179,237,0.35);
  color: #e2e8f0;
}

/* ── Canaux fréquence ── */
#freq-channels {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.freq-channel {
  flex: 1;
  min-width: 200px;
  max-width: 380px;
}

.ch-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ch-toggle {
  appearance: none;
  width: 36px;
  height: 20px;
  background: rgba(99,179,237,0.15);
  border: 1.5px solid rgba(99,179,237,0.35);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.ch-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #64748b;
  transition: transform 0.2s, background 0.2s;
}

.ch-toggle:checked {
  background: rgba(99,179,237,0.35);
  border-color: #63b3ed;
}

.ch-toggle:checked::after {
  transform: translateX(16px);
  background: #63b3ed;
}

.ch-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #93c5fd;
}

.freq-display {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: monospace;
  color: #e2e8f0;
  text-align: center;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.freq-display span {
  font-size: 0.9rem;
  color: #63b3ed;
}

/* ── Slider ── */
.freq-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(99,179,237,0.2);
  outline: none;
  cursor: pointer;
  margin: 6px 0;
}

.freq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #63b3ed;
  box-shadow: 0 0 8px rgba(99,179,237,0.6);
  cursor: pointer;
}

/* ── Clavier ── */
.keyboard {
  display: flex;
  position: relative;
  height: 60px;
  margin-top: 8px;
  user-select: none;
}

.key-w {
  flex: 1;
  height: 100%;
  background: rgba(220, 232, 240, 0.92);
  border: 1px solid rgba(99,179,237,0.4);
  border-radius: 0 0 6px 6px;
  cursor: pointer;
  position: relative;
  transition: background 0.1s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  font-size: 0.55rem;
  color: #334155;
  font-weight: 700;
}

.key-w:hover, .key-w.active {
  background: #63b3ed;
  color: #0a0f1e;
}

.key-b {
  position: absolute;
  top: 0;
  width: 9%;
  height: 62%;
  background: #1e293b;
  border: 1px solid rgba(99,179,237,0.5);
  border-radius: 0 0 5px 5px;
  cursor: pointer;
  z-index: 2;
  transition: background 0.1s;
}

.key-b:hover, .key-b.active {
  background: #2563eb;
}

/* ── Canvas signal ── */
#signal-canvas {
  display: block;
  width: 100%;
  border-radius: 10px;
}

/* ── Info période ── */
#period-info {
  display: flex;
  gap: 24px;
  justify-content: center;
  font-size: 0.82rem;
  color: #93c5fd;
  margin-top: 4px;
  font-family: monospace;
}
