@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600&family=Fraunces:opsz,wght@9..144,600&display=swap");

:root {
  color-scheme: only light;
  --bg-1: #ffe9c7;
  --bg-2: #fff4e6;
  --accent: #ff7a59;
  --accent-dark: #e4572e;
  --ink: #2c2433;
  --ink-soft: #6b5b7a;
  --card: #fffdf9;
  --shadow: 0 18px 40px rgba(44, 36, 51, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Fredoka", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, var(--bg-2) 0%, var(--bg-1) 55%, #ffd8b3 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.6) 2px, transparent 2px);
  background-size: 32px 32px;
  opacity: 0.4;
  pointer-events: none;
}

.app {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.hero {
  text-align: center;
  margin-bottom: 24px;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff1e0;
  color: var(--accent-dark);
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-size: 12px;
}

h1 {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 36px;
  margin: 12px 0 6px;
}

.subtitle {
  margin: 0 auto;
  max-width: 420px;
  color: var(--ink-soft);
  font-size: 16px;
}

.card {
  background: var(--card);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hidden {
  display: none;
}

.intro-text {
  font-size: 18px;
  color: var(--ink-soft);
}

.progress {
  font-size: 14px;
  color: var(--ink-soft);
  background: #fff1e0;
  padding: 8px 12px;
  border-radius: 12px;
  align-self: flex-start;
}

h2 {
  font-size: 26px;
  margin: 0;
}

.riddle-text {
  font-size: 18px;
  color: var(--ink-soft);
  margin: 0;
  white-space: pre-line;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.play-button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.input-label {
  font-weight: 600;
}

input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 18px;
  border-radius: 14px;
  border: 2px solid #f1d7c2;
  background: #fffaf3;
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 89, 0.2);
}

.primary,
.secondary {
  border: none;
  border-radius: 16px;
  padding: 12px 18px;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 20px rgba(255, 122, 89, 0.3);
}

.secondary {
  background: #ffe9dc;
  color: var(--accent-dark);
}

.primary:active,
.secondary:active {
  transform: scale(0.98);
}

.feedback {
  min-height: 24px;
  font-weight: 600;
}

.feedback.good {
  color: #2e8b57;
}

.feedback.bad {
  color: #c0392b;
}

@media (max-width: 480px) {
  .card {
    padding: 22px;
  }

  h1 {
    font-size: 30px;
  }

  .primary,
  .secondary,
  input[type="text"] {
    font-size: 16px;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.screen {
  animation: popIn 0.4s ease;
}
