* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #1b2a2f 0%, #0a0f12 70%);
  color: #e8f0ee;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

.wrap {
  width: 100%;
  max-width: 900px;
}

h1 {
  font-weight: 300;
  margin-bottom: 28px;
}

h1 .tword {
  letter-spacing: 0.2em;
}

.sub {
  color: #8fa6a1;
  margin-top: 0;
  margin-bottom: 28px;
  font-size: 14px;
}

#playBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3d8b7d;
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 46px;
  height: 42px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

#playBtn:hover { background: #4aa591; }
#playBtn.playing { background: #3a4a47; }
#playBtn.playing:hover { background: #48605c; }

.pause-icon {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pause-icon span {
  display: block;
  width: 4px;
  height: 15px;
  background: currentColor;
  border-radius: 1px;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

#status {
  color: #8fa6a1;
  font-size: 14px;
}


.world-wrap {
  position: relative;
  margin-top: 24px;
}

.world {
  display: block;
  width: 100%;
  height: 520px;
  border-radius: 12px;
  background: radial-gradient(ellipse at center, #12211f 0%, #0a1513 100%);
  border: 1px solid #1e2f2c;
}

.fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(13, 22, 21, 0.7);
  border: 1px solid #2a453e;
  color: #cdf5e8;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.fullscreen-btn:hover {
  background: rgba(20, 32, 31, 0.9);
}

.world-wrap:fullscreen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #0a1513;
  padding: 20px;
}

.world-wrap:fullscreen .world {
  height: 100%;
  flex: 1;
}

.viz-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.viz-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2a453e;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.viz-dot:hover {
  background: #4a6a60;
}

.viz-dot.active {
  background: #6fd6bd;
  transform: scale(1.3);
}

.pattern-picker {
  margin-top: 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: #101c1a;
  border: 1px solid #23413a;
  border-radius: 10px;
}

.pattern-picker label {
  font-size: 14px;
  color: #e8f0ee;
}

.pattern-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  width: 100%;
}

.pattern-item {
  font-size: 14px;
  color: #8fa6a1;
  cursor: pointer;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.pattern-item:hover {
  color: #cdf5e8;
}

.pattern-item.active {
  color: #6fd6bd;
  font-weight: 600;
  border-color: #6fd6bd;
}

.pattern-item.wanderer-item {
  color: #b98af0;
}

.pattern-item.wanderer-item:hover {
  color: #d2b0ff;
}

.pattern-item.wanderer-item.active {
  color: #b98af0;
  border-color: #b98af0;
}

.globals.hidden {
  display: none;
}

.wanderer-controls {
  display: none;
}

.wanderer-controls.visible {
  display: grid;
}

.pattern-picker small {
  width: 100%;
  color: #64807b;
  font-size: 12px;
}

.globals {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  padding: 16px 18px;
  background: #101c1a;
  border: 1px solid #23413a;
  border-radius: 10px;
}

.global-slider label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
  margin-bottom: 4px;
}

.global-slider label span {
  color: #6fd6bd;
  font-size: 12px;
}

.global-slider input[type="range"] {
  width: 100%;
  accent-color: #6fd6bd;
}

.global-slider small {
  color: #64807b;
  font-size: 12px;
}

.section-title {
  margin-top: 36px;
  margin-bottom: 4px;
  font-weight: 400;
  font-size: 18px;
  color: #cdf5e8;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.section-title .chevron {
  display: inline-block;
  font-size: 13px;
  color: #6fd6bd;
  transition: transform 0.2s;
}

.section-title.collapsed .chevron {
  transform: rotate(-90deg);
}

.sounds.collapsed {
  display: none;
}

.credit {
  margin-top: 40px;
  font-size: 11px;
  color: #4a615c;
}

.sounds {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.sound {
  background: #14201f;
  border: 1px solid #1e2f2c;
  border-radius: 10px;
  padding: 14px 16px;
  transition: background 0.4s, border-color 0.4s;
}

.sound.active {
  background: #1c352e;
  border-color: #3d8b7d;
}

.sound-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 10px;
}

.sound-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3a4a47;
  transition: background 0.4s, box-shadow 0.4s;
  flex-shrink: 0;
}

.sound.active .sound-dot {
  background: #6fd6bd;
  box-shadow: 0 0 6px 2px rgba(111, 214, 189, 0.6);
}

.sound-slider {
  margin-bottom: 8px;
}

.sound-slider label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #8fa6a1;
  margin-bottom: 2px;
}

.sound-slider label span {
  color: #6fd6bd;
  font-variant-numeric: tabular-nums;
}

.sound-slider input[type="range"] {
  width: 100%;
  accent-color: #3d8b7d;
  height: 14px;
}

@media (max-width: 600px) {
  body {
    padding-top: 14px;
  }

  .world {
    height: 260px;
  }

  .fullscreen-btn {
    display: none;
  }
}
