:root {
  --orange: #ff6a1a;
  --orange-dark: #d9500a;
  --ink: #1a1a1a;
  --paper: #ffffff;
  --card: #fff6ef;
  --muted: #6b6560;
  --error: #d9364a;
  --success: #2fa860;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

#app {
  width: 100%;
  max-width: 480px;
  padding: 24px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 106, 26, 0.25);
  border-radius: 18px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.ball-icon {
  font-size: 2.5rem;
  line-height: 1;
  align-self: center;
}

h1 {
  font-size: 1.5rem;
  margin: 0;
  text-align: center;
  color: var(--orange-dark);
}

h2 {
  font-size: 1.15rem;
  margin: 0;
}

p {
  margin: 0;
  line-height: 1.5;
}

.narrator {
  font-style: italic;
  color: var(--muted);
  min-height: 1.4em;
}

.progress {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.progress-label {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: -8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 106, 26, 0.25);
}

.dot.filled {
  background: var(--orange);
}

button {
  font: inherit;
  cursor: pointer;
}

.btn {
  min-height: 48px;
  border: none;
  border-radius: 12px;
  background: var(--orange);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 20px;
  transition: transform 0.1s ease, background 0.15s ease;
}

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

.btn:hover {
  background: var(--orange-dark);
}

.btn.secondary {
  background: transparent;
  color: var(--orange-dark);
  border: 1px solid var(--orange);
}

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

.choice-btn {
  min-height: 48px;
  text-align: left;
  border: 2px solid rgba(255, 106, 26, 0.35);
  border-radius: 12px;
  background: white;
  padding: 12px 16px;
  font-size: 1rem;
}

.choice-btn:hover {
  border-color: var(--orange);
}

.choice-btn.correct {
  border-color: var(--success);
  background: rgba(47, 168, 96, 0.12);
}

.choice-btn.wrong {
  border-color: var(--error);
  background: rgba(217, 54, 74, 0.1);
}

input[type="text"] {
  min-height: 48px;
  font-size: 1rem;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid rgba(255, 106, 26, 0.35);
  width: 100%;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--orange);
}

.scrambled {
  font-size: 1.6rem;
  letter-spacing: 0.3em;
  font-weight: 700;
  text-align: center;
  color: var(--orange-dark);
}

.feedback {
  font-size: 0.95rem;
  min-height: 1.3em;
}

.feedback.error {
  color: var(--error);
}

.feedback.success {
  color: var(--success);
}

.token-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chip {
  background: white;
  border: 2px solid var(--orange);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--orange-dark);
}

.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

.reveal-title {
  font-size: 1.8rem;
  text-align: center;
  color: var(--orange-dark);
}

.reveal-hint {
  background: white;
  border: 2px dashed var(--orange);
  border-radius: 14px;
  padding: 18px;
  font-size: 1.1rem;
  text-align: center;
}

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.reset-link {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: underline;
  background: none;
  border: none;
  padding: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .shake {
    animation: none;
  }
  .btn, .choice-btn {
    transition: none;
  }
}
