:root {
  --bg: #fff7f0;
  --card: #ffffff;
  --accent: #ff7a18;
  --accent-700: #e05f00;
  --muted: #6b6b6b;
  --radius: 12px;
  --glass: rgba(255,255,255,0.8);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg, #fffaf5, #fff3eb);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 14px;
  color: #111;
}

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

.topbar {
  text-align: center;
  margin-bottom: 14px;
}
.topbar h1 {
  margin: 0;
  color: var(--accent-700);
  font-size: 1.6rem;
}
.hint {
  margin: 6px 0 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(14,14,14,0.06);
}
@media(max-width:400px){
  .card { padding: 12px; }
}

.label { display: block; color: var(--accent-700); font-weight: 600; margin-bottom: 8px; }
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.06);
  font-size: 1rem;
  background: white;
}

.controls-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.btn {
  border: 0;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  color: white;
  background: var(--accent);
  box-shadow: 0 6px 14px rgba(255,122,24,0.08);
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(0); }
.btn:focus {
  outline: 2px solid var(--accent-700);
  outline-offset: 2px;
}

.btn-info { background: #0ea5ff; color: white; }
.btn-play { background: linear-gradient(90deg, var(--accent), #ff9b47); }
.btn-record { background: #ef4444; }
.btn-download { background: #0ea5ff; }

.text-block { margin-top: 16px; }
.text-block h3 { margin: 0 0 8px; color: var(--accent-700); }
.text {
  background: linear-gradient(180deg,#fffefc,#fffaf8);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.03);
  white-space: pre-wrap;
  line-height: 1.5;
  color: #222;
  font-size: 0.98rem;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
}

.rec-block {
  margin-top: 18px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg,#fff8f3,#fff3ea);
  border: 1px solid rgba(255,122,24,0.06);
}
.mic-area {
  display: flex;
  align-items: center;
  gap: 14px;
}
.mic {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(180deg,#fff,#fff3eb);
  border: 3px solid rgba(255,122,24,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 8px 20px rgba(255,122,24,0.08);
}
.mic::after {
  content: "🎤";
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(1px);
}

.mic.pulse {
  animation: pulseScale 1s infinite ease-in-out;
  box-shadow: 0 0 0 0 rgba(255,122,24,0.2), 0 12px 30px rgba(255,122,24,0.12);
}
@keyframes pulseScale {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,122,24,0.12); }
  50% { transform: scale(1.06); box-shadow: 0 0 30px 6px rgba(255,122,24,0.06); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,122,24,0); }
}

.rec-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); margin-top: 10px; font-size: 0.95rem; }

.hidden { display: none; }
#answerBlock { transition: opacity 0.28s ease; }

.footer { margin-top: 12px; text-align: center; color: var(--muted); font-size: 0.9rem; }

@media(max-width:560px) {
  .controls-row { flex-direction: column; }
  .mic { width: 50px; height: 50px; }
  .btn { width: 100%; }
}
@media(max-width:400px) {
  .audio-progress::-webkit-slider-thumb,
  .audio-progress::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }
}

.audio-progress-wrapper {
  margin-top: 8px;
  width: 100%;
}

.audio-progress {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 6px;
  border-radius: 10px;
  background: linear-gradient(90deg, #ff7a18, #ffb347);
  box-shadow: 0 0 10px rgba(255,122,24,0.25);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease-in-out;
}

.audio-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px rgba(255,122,24,0.4);
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}
.audio-progress::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.audio-progress::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px rgba(255,122,24,0.4);
  cursor: pointer;
}
