.terrasynth-root {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f3fbff;
  background: radial-gradient(circle at top, rgba(0, 221, 255, 0.12), transparent 60%),
              radial-gradient(circle at bottom, rgba(255, 148, 88, 0.09), transparent 60%),
              rgba(5, 10, 24, 0.88);
  border-radius: 20px;
  padding: 20px 20px 18px;
  max-width: 980px;
  margin: 24px auto;
  border: 1px solid rgba(116, 199, 255, 0.8);
  box-shadow: 0 16px 40px rgba(1, 4, 18, 0.9);
}

.terrasynth-inner {
  width: 100%;
}

.terrasynth-header {
  text-align: center;
  margin-bottom: 18px;
}

.terrasynth-title {
  margin: 0 0 6px;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.terrasynth-subtitle {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* Layout */
.terrasynth-main {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr) minmax(0, 260px);
  gap: 12px;
  margin-bottom: 14px;
}

.terrasynth-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.terrasynth-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 4px;
}

/* Cards */
.terrasynth-card {
  padding: 10px 10px 12px;
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(13, 23, 52, 0.96), rgba(20, 35, 70, 0.96));
  border: 1px solid rgba(143, 196, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(28, 62, 120, 0.4);
}

.terrasynth-card-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.92;
}

/* Labels, hints, selects, sliders */
.terrasynth-control-row {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.terrasynth-control-row-inline {
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
}

.terrasynth-label {
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.terrasynth-hint {
  font-size: 0.75rem;
  opacity: 0.8;
}

.terrasynth-select {
  width: 100%;
  border-radius: 999px;
  background: rgba(9, 15, 36, 0.97);
  color: #f3fbff;
  border: 1px solid rgba(135, 189, 255, 0.9);
  padding: 4px 10px;
  font-size: 0.8rem;
}

/* Buttons */
.terrasynth-btn {
  border-radius: 999px;
  border: 1px solid rgba(162, 219, 255, 0.95);
  background: radial-gradient(circle at 30% 0%, #ffffff, #40e9ff);
  color: #021118;
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, filter 0.08s ease-out;
}

.terrasynth-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 0 12px rgba(170, 232, 255, 0.95);
}

.terrasynth-btn:active {
  transform: scale(0.96);
  box-shadow: 0 0 4px rgba(96, 159, 204, 0.95);
}

.terrasynth-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.terrasynth-btn-random-world {
  margin-top: 4px;
  width: 100%;
  text-align: center;
}

/* Sliders styled like spaceship controls */
.terrasynth-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: rgba(21, 33, 70, 0.9);
  outline: none;
}

.terrasynth-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #ffffff, #ff9a54);
  border: 1px solid rgba(255, 230, 210, 0.95);
  box-shadow: 0 0 8px rgba(255, 182, 117, 0.9);
  cursor: pointer;
}

.terrasynth-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #ffffff, #ff9a54);
  border: 1px solid rgba(255, 230, 210, 0.95);
  box-shadow: 0 0 8px rgba(255, 182, 117, 0.9);
  cursor: pointer;
}

.terrasynth-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(21, 33, 70, 0.9);
}

/* Stones (12-note keyboard) */
.terrasynth-stones-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.terrasynth-stone {
  position: relative;
  width: 100%;
  padding-top: 70%; /* aspect ratio */
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.9), rgba(1, 186, 255, 0.1));
  box-shadow:
    0 0 0 1px rgba(169, 225, 255, 0.9),
    0 10px 18px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  overflow: hidden;
}

.terrasynth-stone-inner {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.95), rgba(13, 207, 255, 0.7), rgba(12, 38, 88, 0.9));
  box-shadow: 0 0 12px rgba(141, 234, 255, 0.8);
  display: block;
}

.terrasynth-stone:active .terrasynth-stone-inner,
.terrasynth-stone.terrasynth-stone-active .terrasynth-stone-inner {
  transform: scale(0.96);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.95);
}

/* Footer */
.terrasynth-footer {
  margin-top: 16px;
  text-align: center;
}

.terrasynth-btn-start {
  min-width: 200px;
}

.terrasynth-footer-hint {
  margin-top: 6px;
  font-size: 0.8rem;
  opacity: 0.85;
}

/* Responsive */
@media (max-width: 900px) {
  .terrasynth-main {
    grid-template-columns: minmax(0, 1fr);
  }
  .terrasynth-bottom {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .terrasynth-root {
    padding: 16px 12px 14px;
    margin: 16px auto;
  }

  .terrasynth-title {
    font-size: 1.3rem;
  }

  .terrasynth-stones-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* ============================================================
   RAINBOW ACTIVE STONE EFFECT
   ============================================================ */

/* Базовая неактивная */
.terrasynth-stone {
  position: relative;
  overflow: visible; /* чтобы сияние выходило за пределы */
  transition: transform 0.15s ease, box-shadow 0.25s ease;
}

/* Радужный ореол (будет переключаться через nth-child) */
.terrasynth-stone::after {
  content: "";
  position: absolute;
  inset: -10px; 
  border-radius: 50%;
  filter: blur(12px);
  opacity: 0;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

/* При активации */
.terrasynth-stone-active::after {
  opacity: 1;
  transform: scale(1.1);
}

/* Радужные цвета по порядку кнопок (12 камней) */
.terrasynth-stone:nth-child(1)::after  { background: rgba(255, 70, 70, 0.75); }
.terrasynth-stone:nth-child(2)::after  { background: rgba(255, 117, 60, 0.75); }
.terrasynth-stone:nth-child(3)::after  { background: rgba(255, 170, 50, 0.75); }
.terrasynth-stone:nth-child(4)::after  { background: rgba(255, 225, 40, 0.75); }
.terrasynth-stone:nth-child(5)::after  { background: rgba(210, 255, 40, 0.75); }
.terrasynth-stone:nth-child(6)::after  { background: rgba(120, 255, 60, 0.75); }
.terrasynth-stone:nth-child(7)::after  { background: rgba(60, 255, 160, 0.75); }
.terrasynth-stone:nth-child(8)::after  { background: rgba(50, 220, 255, 0.75); }
.terrasynth-stone:nth-child(9)::after  { background: rgba(60, 160, 255, 0.75); }
.terrasynth-stone:nth-child(10)::after { background: rgba(120, 100, 255, 0.75); }
.terrasynth-stone:nth-child(11)::after { background: rgba(180, 70, 255, 0.75); }
.terrasynth-stone:nth-child(12)::after { background: rgba(240, 60, 255, 0.75); }

/* Дополнительный эффект — немного поднять камень */
.terrasynth-stone-active {
  transform: scale(0.95);
  box-shadow: 0 0 25px rgba(255,255,255,0.4);
}
/* ============================================================
   RAINBOW PAD THEMES (12 pads, unique colors)
   ============================================================ */

/* Remove default inside gradient (we override it) */
.terrasynth-stone-inner {
  background: none !important;
}

/* Base stone appearance */
.terrasynth-stone {
  position: relative;
  overflow: visible;
  transition: transform 0.15s ease, box-shadow 0.25s ease;
}

/* Soft glow background circle */
.terrasynth-stone::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.55;
  transition: opacity 0.25s ease-out;
}

/* Strong active glow */
.terrasynth-stone::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  filter: blur(22px);
  opacity: 0;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  transform: scale(0.9);
}

.terrasynth-stone-active::after {
  opacity: 1;
  transform: scale(1.1);
}

/* ACTIVE stone inner pulse */
.terrasynth-stone-active {
  transform: scale(0.93);
  box-shadow: 0 0 20px rgba(255,255,255,0.35);
}

/* ============================================================
   COLORS (12 stones)
   ============================================================ */

/* 1 — RED */
.terrasynth-stone:nth-child(1)::before  { background: radial-gradient(circle, #ff9090, #ff3131); }
.terrasynth-stone:nth-child(1)::after   { background: rgba(255, 60, 60, 0.95); }

/* 2 — ORANGE */
.terrasynth-stone:nth-child(2)::before  { background: radial-gradient(circle, #ffc090, #ff6a20); }
.terrasynth-stone:nth-child(2)::after   { background: rgba(255, 110, 40, 0.95); }

/* 3 — GOLD */
.terrasynth-stone:nth-child(3)::before  { background: radial-gradient(circle, #ffe79b, #ffba1f); }
.terrasynth-stone:nth-child(3)::after   { background: rgba(255, 180, 40, 0.95); }

/* 4 — YELLOW LIME */
.terrasynth-stone:nth-child(4)::before  { background: radial-gradient(circle, #f2ff94, #dcec22); }
.terrasynth-stone:nth-child(4)::after   { background: rgba(220, 240, 60, 0.95); }

/* 5 — LIME GREEN */
.terrasynth-stone:nth-child(5)::before  { background: radial-gradient(circle, #d4ff8a, #94ff29); }
.terrasynth-stone:nth-child(5)::after   { background: rgba(150, 255, 60, 0.95); }

/* 6 — GREEN */
.terrasynth-stone:nth-child(6)::before  { background: radial-gradient(circle, #b0ffb0, #29ff4f); }
.terrasynth-stone:nth-child(6)::after   { background: rgba(80, 255, 120, 0.95); }

/* 7 — AQUA */
.terrasynth-stone:nth-child(7)::before  { background: radial-gradient(circle, #b3fff4, #25ffd1); }
.terrasynth-stone:nth-child(7)::after   { background: rgba(70, 255, 200, 0.95); }

/* 8 — CYAN / BLUE */
.terrasynth-stone:nth-child(8)::before  { background: radial-gradient(circle, #b5e9ff, #1fd0ff); }
.terrasynth-stone:nth-child(8)::after   { background: rgba(50, 200, 255, 0.95); }

/* 9 — AZURE */
.terrasynth-stone:nth-child(9)::before  { background: radial-gradient(circle, #c3d4ff, #437aff); }
.terrasynth-stone:nth-child(9)::after   { background: rgba(70, 120, 255, 0.95); }

/*10 — VIOLET */
.terrasynth-stone:nth-child(10)::before { background: radial-gradient(circle, #d8beff, #844aff); }
.terrasynth-stone:nth-child(10)::after  { background: rgba(130, 60, 255, 0.95); }

/*11 — PURPLE */
.terrasynth-stone:nth-child(11)::before { background: radial-gradient(circle, #f5b8ff, #d328ff); }
.terrasynth-stone:nth-child(11)::after  { background: rgba(200, 40, 255, 0.95); }

/*12 — PINK */
.terrasynth-stone:nth-child(12)::before { background: radial-gradient(circle, #ffb8e2, #ff3e9f); }
.terrasynth-stone:nth-child(12)::after  { background: rgba(255, 70, 160, 0.95); }
