:root {
  --white: #ffffff;
  --sky: #b7c3dc;
  --rose: #e487ac;
  --glass: rgba(255, 255, 255, 0.2);
  --glass-edge: rgba(255, 255, 255, 0.45);
  --track: rgba(255, 255, 255, 0.3);
  --core: #fff4c9;
  --halo: #f7b6c6;
  --pulse: #ffffff;

  --font: 'Manrope', Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  font-size: clamp(14px, min(1vw, 1.65vh), 18px);
}

body {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--white);
  background-color: var(--sky);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 0.1875rem;
}

/* ---------- Аура ---------- */

.AuraCanvas {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.AuraCanvas canvas {
  width: 100% !important;
  height: 100% !important;
}

.Grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.18;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.Wordmark {
  position: fixed;
  top: 2.5rem;
  left: 2.75rem;
  font-size: 1.375rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

/* ---------- Стекло: общий вид всех панелей ---------- */

.TopBar,
.Voice {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* ---------- Общий пульт сверху ---------- */

.TopBar {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.375rem;
  padding: 0.375rem 0.375rem 0.375rem 1.5rem;
  border-radius: 2rem;
}

.Fader--compact {
  width: 7.5rem;
}

.PlayButton {
  min-width: 6rem;
  height: 2.75rem;
  padding: 0 1.5rem;
  border-radius: 1.375rem;
  font-weight: 700;
  color: var(--rose);
  background: var(--white);
  transition: transform 0.15s;
}

.PlayButton:hover:not(:disabled) {
  transform: scale(1.04);
}

.PlayButton:focus-visible {
  outline: none;
}

.PlayButton:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ---------- Голос ---------- */

.Voice {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1.375rem;
  border-radius: 1.75rem;
  transition: opacity 0.3s;
}

.Voice--left,
.Voice--right {
  top: calc(50% - 1.5rem);
  transform: translateY(-50%);
  width: 18rem;
}

.Voice--left {
  left: 2.5rem;
}

.Voice--right {
  right: 2.5rem;
}

.Voice--bottom {
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(56.25rem, calc(100% - 5rem));
  flex-direction: row;
  align-items: center;
  gap: 1.25rem;
  padding: 0.875rem 1.375rem;
  border-radius: 2.5rem;
}

.Voice.is-muted {
  opacity: 0.5;
}

.Voice__header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.Voice__dot {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
}

[data-voice='core'] .Voice__dot {
  background: var(--core);
  box-shadow: 0 0 12px var(--core);
}

[data-voice='halo'] .Voice__dot {
  background: var(--halo);
  box-shadow: 0 0 12px var(--halo);
}

[data-voice='pulse'] .Voice__dot {
  background: var(--pulse);
  box-shadow: 0 0 12px var(--pulse);
}

.Voice__name {
  flex-grow: 1;
  font-size: 1.375rem;
  font-weight: 500;
}

.Voice--bottom .Voice__name {
  font-size: 1.25rem;
}

.Voice__section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--track);
}

.Voice__title,
.PatternSwitch__label {
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.9;
}

.Voice__faders {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.Voice--bottom .Voice__section {
  flex: 3;
  padding-top: 0;
  padding-left: 1.125rem;
  border-top: 0;
  border-left: 1px solid var(--track);
}

.Voice--bottom .Voice__section:last-of-type {
  flex: 2;
}

.Voice--bottom .Voice__faders {
  flex-direction: row;
  gap: 0.75rem;
}

.Voice--bottom .Voice__faders .Fader {
  flex: 1;
}

/* ---------- Кнопка вкл / выкл ---------- */

.ToggleButton {
  flex-shrink: 0;
  height: 1.75rem;
  padding: 0 0.75rem;
  border-radius: 0.875rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--rose);
  background: var(--white);
}

.ToggleButton[aria-pressed='false'] {
  color: var(--white);
  background: transparent;
  border: 1px solid var(--white);
}

/* ---------- Узор: спокойный или плотный ---------- */

.PatternSwitch {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.Fader__label {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.85;
}

.PatternSwitch__buttons {
  display: flex;
  gap: 0.375rem;
}

.PatternSwitch button {
  flex: 1;
  height: 1.875rem;
  min-width: 3rem;
  display: grid;
  place-items: center;
  border-radius: 0.9375rem;
  border: 1px solid var(--track);
}

.PatternSwitch button[aria-pressed='true'] {
  border-color: var(--white);
  background: var(--glass);
}

.PatternSwitch svg {
  width: 2rem;
  height: 0.4375rem;
  fill: currentColor;
}

/* ---------- Форма волны ---------- */

.WaveSwitch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.375rem;
}

.WaveSwitch button {
  height: 2.125rem;
  display: grid;
  place-items: center;
  border-radius: 1.0625rem;
  background: rgba(255, 255, 255, 0.15);
}

.WaveSwitch button[aria-pressed='true'] {
  color: var(--rose);
  background: var(--white);
}

.WaveSwitch svg {
  width: 1.625rem;
  height: 0.8125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* ---------- Фейдер ---------- */

.Fader {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.Fader input[type='range'] {
  --fill: 50%;
  width: 100%;
  height: 0.25rem;
  margin: 0.1875rem 0;
  border-radius: 2px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(
    to right,
    var(--white) var(--fill),
    var(--track) var(--fill)
  );
  cursor: pointer;
}

.Fader input[data-pan] {
  background: var(--track);
}

.Fader input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}

.Fader input[type='range']::-moz-range-thumb {
  width: 0.875rem;
  height: 0.875rem;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}

@media (max-width: 1000px) {
  body {
    overflow-y: auto;
  }

  .TopBar,
  .Voice,
  .Voice--left,
  .Voice--right,
  .Voice--bottom {
    position: relative;
    inset: auto;
    transform: none;
    width: auto;
    margin: 16px;
  }

  .TopBar {
    margin-top: 90px;
    flex-wrap: wrap;
  }

  .Voice--bottom {
    flex-direction: column;
    align-items: stretch;
  }

  .Voice--bottom .Voice__faders {
    flex-direction: column;
  }

  .Voice--bottom .Voice__section {
    padding-left: 0;
    padding-top: 14px;
    border-left: 0;
    border-top: 1px solid var(--track);
  }

  .AuraCanvas,
  .Grain {
    position: fixed;
  }
}
