:root {
  color-scheme: light;
  --bg-top: #fdf6ea;
  --bg-bottom: #f6e9d3;
  --card: #fffdf9;
  --gold: #c9a15b;
  --gold-dark: #ad8342;
  --gold-soft: #f1e0bd;
  --beige: #f3e6cf;
  --beige-line: #e8d8ba;
  --text: #5b4a34;
  --muted: #a6906f;
  --danger: #d98a72;
  --danger-dark: #c56e56;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
  font-family: "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  background: radial-gradient(circle at top, var(--bg-top), var(--bg-bottom));
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior-y: contain;
}

.card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: 24px;
  padding: 36px 26px;
  box-shadow: 0 16px 40px rgba(173, 131, 66, 0.18), 0 2px 0 var(--gold-soft) inset;
  border: 1px solid var(--beige-line);
  text-align: center;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
}

h1::after {
  content: "✦";
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--gold);
}

.subtitle {
  color: var(--muted);
  margin: 0 0 24px;
}

.progress {
  color: var(--gold-dark);
  font-weight: 600;
  letter-spacing: 0.03em;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  min-height: 48px;
  background: linear-gradient(180deg, #d9b571, var(--gold));
  color: #4a3618;
  font-weight: 700;
  width: 100%;
  margin-top: 12px;
  box-shadow: 0 4px 10px rgba(173, 131, 66, 0.3);
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

button:hover {
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

button.secondary {
  background: var(--beige);
  color: var(--text);
  border: 1px solid var(--beige-line);
  box-shadow: none;
}

.button-row {
  display: flex;
  gap: 10px;
}

.button-row button {
  margin-top: 0;
}

.playing-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--gold-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.eq span {
  width: 3px;
  background: var(--gold-dark);
  border-radius: 2px;
  animation: eq-bounce 0.9s ease-in-out infinite;
}

.eq span:nth-child(1) {
  animation-delay: 0s;
}

.eq span:nth-child(2) {
  animation-delay: 0.15s;
}

.eq span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes eq-bounce {
  0%, 100% {
    height: 4px;
  }
  50% {
    height: 16px;
  }
}

.snippet-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--beige);
  margin-top: 10px;
  overflow: hidden;
}

.snippet-progress-fill {
  height: 100%;
  width: 100%;
  transform: scaleX(1);
  transform-origin: left;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
}

.snippet-progress-fill.playing {
  animation: shrink-progress 3s linear forwards;
}

@keyframes shrink-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.field-label {
  display: block;
  text-align: left;
  color: var(--gold-dark);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 16px 0 0;
}

input[type="text"],
select {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--beige-line);
  background: #fffaf1;
  color: var(--text);
  font: inherit;
  margin-top: 6px;
}

input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

input[type="text"]::placeholder {
  color: var(--muted);
}

select:invalid {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.answers-text {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--beige-line);
  background: #fffaf1;
  color: var(--text);
  font: 0.85rem/1.5 "Quicksand", monospace;
  resize: vertical;
}

.answers-text:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.copy-hint {
  margin: 10px 0 0;
  text-align: center;
  font-weight: 700;
  color: var(--gold-dark);
}
