:root {
  --bg: #020805;
  --panel: rgba(4, 22, 10, 0.9);
  --panel-2: rgba(2, 13, 7, 0.96);
  --line: rgba(88, 255, 96, 0.34);
  --line-soft: rgba(88, 255, 96, 0.16);
  --text: #9cff91;
  --text-dim: #4fcf55;
  --hot: #b5ff7d;
  --warn: #fff38a;
  --shadow: rgba(76, 255, 88, 0.35);
  --font: "Courier New", Consolas, ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0.04em;
  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(32, 120, 45, 0.18),
      transparent 48%
    ),
    linear-gradient(rgba(80, 255, 90, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 255, 90, 0.028) 1px, transparent 1px),
    var(--bg);
  background-size:
    auto,
    24px 24px,
    24px 24px,
    auto;
  text-shadow: 0 0 8px rgba(120, 255, 110, 0.42);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(130, 255, 120, 0.055),
    rgba(130, 255, 120, 0.055) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: screen;
  opacity: 0.45;
  z-index: 5;
}

.site-top {
  width: min(1400px, calc(100vw - 28px));
  margin: 10px auto;

  position: relative;
  text-align: center;
}

.site-fish {
  height: 28px;
  opacity: 0.85;
}

.home-button {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);

  color: var(--text);
  border: 1px solid var(--line);

  background: linear-gradient(
    180deg,
    rgba(24, 80, 28, 0.45),
    rgba(4, 20, 9, 0.88)
  );

  box-shadow:
    inset 0 0 16px rgba(72, 255, 88, 0.08),
    0 0 10px rgba(72, 255, 88, 0.08);

  border-radius: 4px;
  padding: 0.65rem 0.8rem;

  text-decoration: none;
  text-transform: uppercase;

  transition: all 0.2s ease;
}

.home-button:hover {
  color: #eaffd7;
  border-color: rgba(160, 255, 120, 0.85);

  background: rgba(55, 160, 48, 0.28);

  box-shadow:
    0 0 16px var(--shadow),
    inset 0 0 18px rgba(140, 255, 120, 0.12);
}
button,
input,
select,
summary {
  font: inherit;
}

button {
  color: var(--text);
  border: 1px solid var(--line);
  background: linear-gradient(
    180deg,
    rgba(24, 80, 28, 0.45),
    rgba(4, 20, 9, 0.88)
  );
  box-shadow:
    inset 0 0 16px rgba(72, 255, 88, 0.08),
    0 0 10px rgba(72, 255, 88, 0.08);
  border-radius: 4px;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  text-transform: uppercase;
}

button:hover,
button.active {
  color: #eaffd7;
  border-color: rgba(160, 255, 120, 0.85);
  background: rgba(55, 160, 48, 0.28);
  box-shadow:
    0 0 16px var(--shadow),
    inset 0 0 18px rgba(140, 255, 120, 0.12);
}

.sfx-layout {
  width: min(1400px, calc(100vw - 28px));
  margin: 14px auto 0;
  min-height: auto;

  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);

  align-items: start;

  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 12, 5, 0.76);
  box-shadow:
    0 0 36px rgba(70, 255, 82, 0.12),
    inset 0 0 42px rgba(70, 255, 82, 0.06);
  position: relative;
}

.sfx-layout::after {
  display: none;
}

.sounds-panel,
.editor-panel,
details,
.source-block,
.effect-block,
.lfo-block,
#waveCanvas {
  border: 1px solid var(--line-soft);
  background: var(--panel);
  box-shadow: inset 0 0 24px rgba(72, 255, 88, 0.045);
}

.sounds-panel,
.editor-panel {
  border-radius: 8px;
  padding: 16px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  margin-bottom: 18px;
  color: var(--hot);
  font-size: 1.25rem;
  text-transform: uppercase;
}

h1::before {
  content: "◉ ";
}

.sound-list {
  display: grid;
  gap: 8px;
}
.sound-list h2 {
  margin-bottom: 4px;
  font-size: 0.9rem;
  color: var(--text-dim);
  text-transform: uppercase;
}
.sound-item {
  text-align: left;
}
.sound-item::before {
  content: "▸ ";
  color: var(--text-dim);
}
.sound-item.active::before {
  content: "▶ ";
  color: var(--hot);
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.editor-header p {
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
}
#soundName {
  margin-top: 4px;
  color: var(--hot);
  font-size: 1.5rem;
  text-transform: uppercase;
}
.editor-header > div:last-child {
  display: flex;
  gap: 8px;
}

#waveCanvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 190px;
  margin-bottom: 12px;
  border-radius: 6px;
  background:
    linear-gradient(rgba(80, 255, 90, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 255, 90, 0.08) 1px, transparent 1px),
    radial-gradient(
      circle at 50% 50%,
      rgba(40, 140, 44, 0.16),
      transparent 68%
    ),
    var(--panel-2);
  background-size:
    20px 20px,
    20px 20px,
    auto,
    auto;
}

.playbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
#playBtn {
  min-width: 140px;
  color: #d9ffd0;
  border-color: rgba(150, 255, 115, 0.75);
}

.inspector {
  display: grid;
  gap: 10px;
}

details {
  border-radius: 6px;
  padding: 10px;
}

summary {
  color: var(--hot);
  cursor: pointer;
  list-style: none;
  text-transform: uppercase;
  margin-bottom: 8px;
}
summary::-webkit-details-marker {
  display: none;
}
summary::before {
  content: "[+] ";
  color: var(--text-dim);
}
details[open] summary::before {
  content: "[-] ";
}

label {
  display: grid;
  grid-template-columns: 145px minmax(120px, 1fr) 78px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--text-dim);
  border-top: 1px solid rgba(88, 255, 96, 0.08);
}

label span {
  color: var(--hot);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(130, 255, 105, 0.9),
    rgba(60, 160, 64, 0.25)
  );
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--hot);
  background: #071608;
  box-shadow: 0 0 12px var(--shadow);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--hot);
  background: #071608;
  box-shadow: 0 0 12px var(--shadow);
}

select {
  color: var(--text);
  background: #061408;
  border: 1px solid var(--line);
  padding: 0.35rem;
}

.source-block,
.effect-block,
.lfo-block {
  border-radius: 5px;
  padding: 10px;
  margin: 8px 0;
}

.source-block h3,
.effect-block h3,
.lfo-block h4 {
  margin-bottom: 8px;
  color: var(--hot);
  text-transform: uppercase;
  font-size: 0.95rem;
}

.source-block button,
.effect-block button,
#sourcesEditor > div:last-child button,
#effectsEditor > div:last-child button {
  margin: 6px 6px 0 0;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
}

.app-footer {
  margin-top: 18px;
  padding: 12px 20px;

  display: flex;
  justify-content: center;
  gap: 12px;

  border-top: 1px solid rgba(156, 255, 145, 0.15);

  color: rgba(156, 255, 145, 0.45);

  font-size: 0.8rem;
  letter-spacing: 1px;
}

.footer-links {
  margin-top: 8px;
  font-size: 0.7rem;
  opacity: 0.45;
  text-align: center;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

#helpTooltip {
  position: fixed;
  display: none;

  max-width: 260px;

  padding: 10px 14px;

  background: rgba(5, 20, 10, 0.96);
  border: 1px solid rgba(0, 255, 120, 0.4);

  color: rgba(156, 255, 145, 0.35);

  font-size: 0.85rem;
  line-height: 1.4;

  box-shadow: 0 0 15px rgba(0, 255, 120, 0.15);

  pointer-events: none;
  z-index: 9999;
}

.unity-banner {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.unity-banner img {
  max-width: 100%;
  height: auto;

  border: 1px solid rgba(156, 255, 145, 0.15);
  border-radius: 0;
  box-shadow: 0 0 10px rgba(0, 255, 128, 0.15);

  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.unity-banner img:hover {
  opacity: 1;
}

@media (max-width: 860px) {
  .sfx-layout {
    grid-template-columns: 1fr;
  }
  .sounds-panel {
    order: 2;
  }
  .editor-panel {
    order: 1;
  }
  label {
    grid-template-columns: 1fr;
  }
  label span {
    text-align: left;
  }
  .editor-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
