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

body {
  font-family: "Comfortaa", sans-serif;
  min-height: 100vh;
  background: linear-gradient(
    0deg,
    rgb(255, 226, 255) 0%,
    rgb(139, 102, 241) 100%
  );
  color: #3b007e;

  display: flex;
  justify-content: center;
  align-items: center;
}

.layout {
  position: relative;
}

main,
aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 35px;
}

aside {
  position: absolute;
  right: -200px;
  top: 50%;
  transform: translateY(-50%);
}

.output {
  width: clamp(280px, 90vw, 700px);
  height: min(60vh, 400px);
  padding: 20px 30px;
  border-radius: 16px;
  border: 1px solid rgb(158, 158, 158);
  box-shadow: 0px 0px 26px 4px rgba(91, 4, 120, 0.2);
  background-color: rgba(255, 255, 255, 0.387);
  font-size: clamp(18px, 2.5vw, 26px);

  display: block;
  text-align: left;
  line-height: 1.2;
  white-space: pre-wrap;

  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #7b5cff rgba(255, 255, 255, 0.3);
}

.btn {
  width: min(80%, 400px);
  padding: 16px;
  border: none;
  border-radius: 10px;

  font-family: "Comfortaa", sans-serif;
  font-size: clamp(14px, 1.8vw, 16px);
  font-weight: 700;
  letter-spacing: 1px;

  color: rgb(255, 255, 255);
  box-shadow: 0px 0px 16px 4px rgba(97, 59, 110, 0.2);
  background-color: #8e9fe6;

  cursor: pointer;
  transition: transform 0.1s ease;
}

.btn:active {
  transform: scale(0.95);
}

.copy-btn,
.clear-btn {
  width: 60%;
  min-width: 120px;
  padding: 20px 10px;
  background-color: #fe7f2d;
  text-align: center;
  font-size: 14px;
}

.alert {
  background-color: #3a5635;
  color: white;
  font-size: clamp(14px, 1.8vw, 16px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 10px 20px;

  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  animation: fadeInOut 2s forwards;
}

@keyframes fadeInOut {
  0% {
    transform: translate(-50%, 10px);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
}

/* mic */
.mic {
  width: 50px;
  height: 80px;
  position: relative;
  opacity: 0.4;
  transform-origin: center bottom;
  transition: opacity 0.3s ease;
}

.mic-head {
  width: 36px;
  height: 36px;
  background: #3b007e;
  border-radius: 50%;
  margin: 0 auto;
}

.mic-body {
  width: 10px;
  height: 30px;
  background: #3b007e;
  margin: 0 auto;
}

.mic-base {
  width: 30px;
  height: 6px;
  background: #3b007e;
  border-radius: 6px;
  margin: 6px auto 0;
}

.mic.listening {
  opacity: 1;
  animation: pulse 0.8s infinite alternate;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 1150px) {
  body {
    margin: 25px;
  }

  aside {
    position: static;
    transform: none;
    flex-direction: row;
    gap: 15px;
  }

  .layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
  }

  .copy-btn,
  .clear-btn {
    width: auto;
    min-width: 120px;
  }
}
