/* ---------- tokens ---------- */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #1d2433;
  --muted: #5b6475;
  --line: #e4e0d6;
  --track: #efebe2;

  --primary: #c2410c;          /* laranja queimado: contraste AA com texto branco */
  --primary-hover: #9a3412;
  --primary-soft: #fff1e6;

  --teal: #0f766e;
  --teal-soft: #e6f4f1;

  --indigo: #4338ca;
  --indigo-soft: #eef2ff;

  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --retry: #92400e;
  --retry-soft: #fff4e0;

  --radius: 20px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.07);
  --focus: #4f46e5;

  font-family: "Nunito", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
}

h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 6px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }

.app,
#screen {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ---------- barra superior ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--primary-soft);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.round { font-weight: 700; color: var(--muted); font-size: 0.95rem; }

.stars {
  font-weight: 800;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}

.icon-btn {
  background: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  color: var(--indigo);
  padding: 8px 6px;
  min-height: 44px;
  cursor: pointer;
  border-radius: 10px;
}

/* ---------- cartões ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.notice { text-align: center; }
.notice.is-error { border-color: #f5c2b0; }

/* ---------- início ---------- */
.intro .muted { margin-bottom: 4px; }

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--track);
  border-radius: 14px;
  padding: 4px;
  margin: 16px 0 12px;
}

.seg {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  border-radius: 11px;
  color: var(--muted);
  cursor: pointer;
}

.seg[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.activity-list { display: flex; flex-direction: column; gap: 12px; }

.activity {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 84px;
  padding: 14px 16px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.2s ease;
}

.activity:hover { border-color: #cfc8b8; }
.activity:active { transform: scale(0.99); }

.activity-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.activity-text { display: flex; flex-direction: column; flex: 1; gap: 2px; }
.activity-text strong { font-size: 1.1rem; }
.activity-text span:last-child { color: var(--muted); font-size: 0.95rem; }
.chevron { font-size: 1.7rem; color: var(--muted); }

.tone-orange .activity-icon { background: var(--primary-soft); }
.tone-teal .activity-icon { background: var(--teal-soft); }
.tone-indigo .activity-icon { background: var(--indigo-soft); }

/* ---------- botões ---------- */
.btn {
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 16px;
  border: 2px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.08s ease, background-color 0.2s ease;
}

.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-block { width: 100%; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-secondary { background: var(--teal); color: #fff; }
.btn-secondary:hover:not(:disabled) { background: #115e59; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--track); }

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.actions .btn { flex: 1; min-width: 140px; }

.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* ---------- consentimento ---------- */
.consent { display: flex; flex-direction: column; gap: 14px; }
.consent .brand { margin-bottom: 4px; }

.checklist {
  margin: 0;
  padding: 0 0 0 20px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checkbox-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
}
.checkbox-row input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--teal);
}

/* ---------- atividades ---------- */
.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  padding: 28px 20px;
}

.emoji {
  font-size: 6rem;
  line-height: 1;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.08));
}

.question { font-size: 1.2rem; font-weight: 800; }

.bigword {
  font-size: 3.4rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

.self-check {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* Opções de número de sílabas */
.options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 340px;
}

.option {
  aspect-ratio: 1;
  min-height: 60px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1.7rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.option:hover:not(:disabled) { border-color: var(--indigo); background: var(--indigo-soft); }
.option:disabled { opacity: 0.5; cursor: default; }

/* Montar a palavra */
.slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 72px;
}

.slot {
  min-width: 92px;
  min-height: 64px;
  padding: 0 12px;
  border-radius: 16px;
  border: 2px dashed #cbd5e1;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  font-weight: 800;
}

.slot.filled {
  border: 2px solid var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}

.slots.shake { animation: shake 0.4s; }

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

.chip {
  min-width: 96px;
  min-height: 64px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: var(--indigo);
  color: #fff;
  font: inherit;
  font-size: 1.6rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 #312e81;
  transition: transform 0.08s ease;
}
.chip:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #312e81; }
.chip:disabled { background: #d9dcf5; color: #6b6f9b; box-shadow: none; cursor: default; }

/* Ler em voz alta */
.btn.is-listening { animation: pulse 1.2s ease-in-out infinite; }

/* ---------- feedback ---------- */
.feedback:empty { display: none; }

.feedback {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback-msg {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 700;
}

.feedback-msg p { font-size: 1.05rem; }

.feedback-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  flex-shrink: 0;
}

.feedback.is-ok .feedback-msg { background: var(--ok-soft); color: #14532d; }
.feedback.is-ok .feedback-icon { color: var(--ok); }
.feedback.is-retry .feedback-msg { background: var(--retry-soft); color: var(--retry); }
.feedback.is-retry .feedback-icon { color: var(--retry); }

/* ---------- animações ---------- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(194, 65, 12, 0.45); }
  50% { box-shadow: 0 0 0 12px rgba(194, 65, 12, 0); }
}

@media (min-width: 720px) {
  .app,
  #screen { max-width: 620px; padding-top: 32px; }
  .emoji { font-size: 7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
