/* ==========================================================================
   Revisar (5.1): placar, revisão do dia, caderno de erros, flashcards, conquistas
   e a sessão de cartões (um por vez). Animações desligam com "reduzir movimento".
   ========================================================================== */

/* ---------- placar: sequência e meta do dia ---------- */
.rv-score { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rv-stat { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); min-width: 0; }
.rv-stat b { font-family: var(--font-display); font-size: 1.25rem; line-height: 1; color: var(--ink); }
.rv-stat small { grid-column: 1 / -1; font-size: .75rem; color: var(--muted); margin-top: 4px; }
.rv-ic { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center; background: var(--surface); }
.rv-ic svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.rv-stat.fire .rv-ic { color: var(--muted); }
.rv-stat.fire.lit .rv-ic { color: #fff; background: linear-gradient(160deg, #FF9A5A, var(--brand-dot, #E2553A)); }
.rv-goal { display: inline-flex; gap: 4px; }
.rv-goal span { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; border: 1.5px dashed var(--line); color: var(--muted); background: var(--surface); }
.rv-goal span.ok { border: 0; background: var(--pass); color: #fff; }
.rv-goal svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.rv-stat.goal { grid-template-columns: 1fr; }

/* ---------- tela Revisar ---------- */
.revisao .rv-score { margin: 4px 0 2px; }
.rv-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@container (min-width: 760px) {
  .rv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rv-rec, .rv-badges { grid-column: 1 / -1; }
}
.rv-daily { background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--brand-b) 14%, transparent), transparent 60%), var(--surface); }
.rv-daily .btn { justify-self: start; }
.rv-daily-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
.rv-daily-main:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.rv-daily-main p { margin: 6px 0 0; }
.rv-daily-main p b { color: var(--ink); }
.rv-daily.is-due h2, .rv-daily.is-due p { color: #fff; }
.rv-daily.is-due .pill { background: rgba(255, 255, 255, .18); color: #fff; }
.rv-daily.is-due .btn { background: linear-gradient(135deg, var(--brand-dot), color-mix(in srgb, var(--brand-dot) 60%, var(--brand-b))); color: #fff; border: 0; }
.rv-daily.is-done { border-color: color-mix(in srgb, var(--pass) 40%, var(--line)); background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--pass) 16%, transparent), transparent 58%), var(--surface); }
.rv-done-check { width: 64px; height: 64px; flex: none; }
.rv-done-check circle { fill: var(--pass); transform-origin: center; animation: rv-pop-in .5s cubic-bezier(.2, .9, .3, 1.4) .1s both; }
.rv-done-check path { fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: rv-draw .45s ease-out .5s forwards; }
.rv-end-done { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--pass-soft); color: var(--pass); font-weight: 700; font-size: .875rem; }
.rv-end-done .rv-done-check { width: 28px; height: 28px; }
.rv-rec { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 60%, var(--surface)); }
.rv-rec h2 { font-size: 1.2rem; }
.rv-sub { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.panel .row { display: flex; flex-wrap: wrap; gap: 8px; }
.revisao .panel > .btn { justify-self: start; }

/* barras das competências (liberação, recuperação e avaliação final) */
.rv-gaps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rv-gaps li { display: grid; grid-template-columns: minmax(8.5em, auto) 1fr 3em; align-items: center; gap: 10px; font-size: .875rem; }
.rv-gaps b { text-align: right; font-variant-numeric: tabular-nums; }
.rv-gap-bar { position: relative; height: 8px; border-radius: 99px; background: var(--surface-2); }
.rv-gap-bar i { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 99px; background: var(--pass); }
.rv-gaps li.weak .rv-gap-bar i, .rv-rec .rv-gap-bar i { background: var(--warn); }
.rv-gaps li.weak b { color: var(--warn); }
.rv-gap-bar u { position: absolute; top: -4px; bottom: -4px; border-left: 2px dashed var(--ink); opacity: .45; text-decoration: none; }
.final-skills { display: grid; gap: 10px; padding-top: 6px; border-top: 1px dashed var(--line); }
.final-skills p { margin: 0; }

/* agenda: 1, 3, 7, 15, 30 dias */
.rv-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.rv-steps li { display: grid; gap: 2px; justify-items: center; padding: 10px 4px; border-radius: var(--r-md); background: var(--surface-2); text-align: center; }
.rv-steps b { font-family: var(--font-display); font-size: 1.125rem; color: var(--accent); }
.rv-steps span { font-size: .6875rem; color: var(--muted); }
.rv-steps li.fixed { background: var(--pass-soft); }
.rv-steps li.fixed b { color: var(--pass); }

.rv-hard { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rv-hard li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); background: var(--warn-soft); font-size: .875rem; }
.rv-hard small { color: var(--muted); white-space: nowrap; }

/* conquistas */
.rv-badge-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.rv-badge { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); opacity: .62; }
.rv-badge.got { opacity: 1; background: var(--surface); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.rv-b-ic { grid-row: span 2; font-size: 1.5rem; line-height: 1; }
.rv-badge b { font-size: .875rem; }
.rv-badge small { font-size: .75rem; color: var(--muted); }

/* ---------- Revisão de hoje na tela Hoje (5.3): antes (pendente) e depois (feita) ---------- */
.h-review { overflow: hidden; gap: 16px; }
.h-rv-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
.h-rv-t h2 { margin-top: 2px; }
.h-rv-st { font-style: normal; }
.h-rv-msg { margin: 4px 0 0; color: var(--muted); font-size: .9375rem; }
.h-rv-msg b { color: var(--ink); }
.h-review .h-go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: auto; }
.h-rv-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--surface-2); color: var(--muted); }
.h-rv-ic svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.h-review.is-empty .h-rv-ic svg { fill: currentColor; stroke: none; }
.h-rv-sub { font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: -8px; }

/* o que vem hoje */
.h-rv-mix { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.h-rv-mix li { display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 11px; border-radius: 999px; font-size: .8125rem; background: rgba(255, 255, 255, .12); animation: rv-chip .45s cubic-bezier(.2, .9, .3, 1.3) both; }
.h-rv-mix li:nth-child(2) { animation-delay: .08s; } .h-rv-mix li:nth-child(3) { animation-delay: .16s; }
.h-rv-mix b { font-family: var(--font-display); font-size: 1rem; }
.h-rv-mix .mx-e b { color: #FFB199; } .h-rv-mix .mx-w b { color: #C9C2FF; } .h-rv-mix .mx-s b { color: #9EE6C9; }

/* trilho: antes → depois */
.h-rv-track { display: grid; grid-template-columns: minmax(0, auto) minmax(20px, 1fr) minmax(0, auto); align-items: center; gap: 10px; font-size: .75rem; font-weight: 700; }
.h-rv-track > span:not(.h-rv-line) { display: inline-flex; align-items: center; gap: 6px; opacity: .65; min-width: 0; line-height: 1.25; }
.h-rv-track > span.on { opacity: 1; }
.h-rv-track i { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; font-style: normal; font-size: .6875rem; border: 1.5px solid currentColor; }
.h-rv-track .ok i { border: 0; background: var(--pass); color: #fff; }
.h-rv-track i svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.h-rv-line { position: relative; height: 6px; border-radius: 99px; background: color-mix(in srgb, currentColor 18%, transparent); overflow: hidden; }
.h-rv-line i { position: absolute; inset: 0 auto 0 0; width: var(--w); height: auto; border: 0; border-radius: 99px; background: linear-gradient(90deg, var(--brand-dot), #FFC46B); transform-origin: left; animation: h-grow 1s .3s cubic-bezier(.2, .8, .2, 1) both; }
.h-review.is-done .h-rv-line i { background: linear-gradient(90deg, var(--pass), color-mix(in srgb, var(--pass) 55%, #9EE6C9)); }

/* próximas revisões */
.h-rv-next { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.h-rv-next li { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); animation: rv-chip .45s cubic-bezier(.2, .9, .3, 1.3) both; animation-delay: calc(.4s + var(--d) * .08s); }
.h-rv-next small { font-size: .75rem; color: var(--muted); }
.h-rv-next b { font-family: var(--font-display); font-size: 1.125rem; }
.h-rv-next b::after { content: " cartões"; font-family: var(--font-body); font-size: .75rem; font-weight: 500; color: var(--muted); }

/* pendente: cartão escuro, contador coral pulsando */
.h-review.is-due, .rv-daily.is-due { border: 0; color: #fff; background:
  radial-gradient(70% 120% at 0% 50%, color-mix(in srgb, var(--brand-dot) 38%, transparent), transparent 70%),
  radial-gradient(90% 140% at 100% 0%, color-mix(in srgb, var(--brand-b) 55%, transparent), transparent 60%),
  linear-gradient(145deg, #1B1640, color-mix(in srgb, var(--brand-a) 70%, #1B1640)); box-shadow: 0 22px 44px -24px color-mix(in srgb, var(--brand-a) 80%, #000); }
.h-review.is-due .eyebrow { color: rgba(255, 255, 255, .8); }
.h-review.is-due .h-rv-st { color: #FFC46B; }
.h-review.is-due .h-rv-msg { color: rgba(255, 255, 255, .88); }
.h-review.is-due .h-btn { background: linear-gradient(135deg, var(--brand-dot), color-mix(in srgb, var(--brand-dot) 60%, var(--brand-b))); color: #fff; box-shadow: 0 12px 24px -12px var(--brand-dot); }
.h-rv-count { position: relative; display: grid; place-content: center; text-align: center; width: 84px; height: 84px; border-radius: 50%; color: #fff;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--brand-dot) 70%, #fff), var(--brand-dot) 60%, color-mix(in srgb, var(--brand-dot) 70%, #000)); box-shadow: 0 10px 24px -8px var(--brand-dot); }
.h-rv-count::before, .h-rv-count::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--brand-dot); animation: rv-ring 2.4s ease-out infinite; }
.h-rv-count::after { animation-delay: 1.2s; }
.h-rv-count b { font-family: var(--font-display); font-size: 2rem; line-height: 1; }
.h-rv-count small { font-size: .6875rem; font-weight: 700; letter-spacing: .04em; opacity: .9; }

/* feita: verde, com o sinal de certo desenhado */
.h-review.is-done { border-color: color-mix(in srgb, var(--pass) 40%, var(--line));
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--pass) 16%, transparent), transparent 58%), var(--surface); }
.h-review.is-done .h-rv-st { color: var(--pass); }
.h-rv-check { width: 72px; height: 72px; }
.h-rv-check circle { fill: var(--pass); stroke: none; transform-origin: center; animation: rv-pop-in .5s cubic-bezier(.2, .9, .3, 1.4) .2s both; }
.h-rv-check path { fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: rv-draw .45s ease-out .6s forwards; }
.h-review.is-clear .h-rv-ic { background: var(--pass-soft); color: var(--pass); }
.h-review.is-done .h-rv-track, .h-review.is-clear .h-rv-track { color: var(--ink); }

@keyframes rv-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.45); opacity: 0; } }
@keyframes rv-pop-in { from { transform: scale(.3); opacity: 0; } }
@keyframes rv-draw { to { stroke-dashoffset: 0; } }
@keyframes rv-chip { from { opacity: 0; transform: translateY(6px) scale(.9); } }

/* aviso no menu: há revisão pendente */
.nav a .nav-dot { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center; font-size: .625rem; font-weight: 800; line-height: 1; color: #fff; background: var(--brand-dot, var(--highlight)); box-shadow: 0 0 0 2px var(--surface); animation: rv-pop .5s ease; }
.nav a[data-route="revisao"] { position: relative; }
@media (max-width: 1023px) { .nav a .nav-dot { position: absolute; top: 1px; right: 6px; margin: 0; min-width: 16px; height: 16px; font-size: .5625rem; padding: 0 4px; } }

/* ---------- sessão: um cartão por vez ---------- */
.revisao.is-session { max-width: 640px; margin-inline: auto; }
.rv-session { display: grid; gap: 14px; }
.rv-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.rv-prog { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.rv-prog i { display: block; height: 100%; width: var(--w); border-radius: 99px; background: linear-gradient(90deg, var(--brand-a, var(--accent)), var(--brand-b, var(--accent))); transition: width .35s ease; }
.rv-combo { display: inline-flex; align-items: center; gap: 4px; font-size: .8125rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 4.5em; justify-content: flex-end; }
.rv-combo svg { width: 16px; height: 16px; fill: currentColor; }
.rv-combo.on { color: var(--brand-dot, var(--highlight)); animation: rv-pop .35s ease; }
.rv-card { display: grid; gap: 14px; padding: 22px; border-radius: var(--r-xl, var(--r-lg)); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-lg); }
.rv-card.enter { animation: rv-in .3s ease; }
.rv-card.is-pass { border-color: color-mix(in srgb, var(--pass) 55%, var(--line)); }
.rv-card.is-warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.rv-card.is-fail { border-color: color-mix(in srgb, var(--fail) 45%, var(--line)); }
.rv-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-card-top small { color: var(--muted); font-size: .75rem; }
.rv-ask { margin: 0; color: var(--muted); font-size: .9375rem; }
.rv-q { margin: 0; font-size: 1.25rem; line-height: 1.45; }
.rv-gap { display: inline-block; min-width: 3em; padding: 0 6px; border-bottom: 2px solid var(--accent); color: var(--accent); font-weight: 700; text-align: center; }
.rv-word { margin: 0; font-family: var(--font-display); font-size: clamp(1.75rem, 6vw, 2.5rem); line-height: 1.15; text-align: center; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.rv-word.pt { font-size: clamp(1.25rem, 4.5vw, 1.625rem); color: var(--muted); font-family: var(--font-body); }
.rv-ex { margin: 0; text-align: center; font-style: italic; color: var(--ink); display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-center { justify-content: center; display: flex; flex-wrap: wrap; gap: 8px; }
.rv-card > .btn { justify-self: center; }
.rv-rate { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rv-rate .btn { white-space: normal; padding-inline: 10px; }
.rv-r.fail { color: var(--fail); border-color: color-mix(in srgb, var(--fail) 40%, var(--line)); }
.rv-r.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.rv-r.pass { background: var(--pass); color: #fff; }
.rv-opts { display: grid; gap: 8px; }
@container (min-width: 520px) { .rv-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rv-opt { min-height: 48px; padding: 10px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-align: left; transition: border-color .15s ease, transform .15s ease; }
.rv-opt:hover:not([disabled]) { border-color: var(--accent); transform: translateY(-1px); }
.rv-opt.right { border-color: var(--pass); background: var(--pass-soft); color: var(--pass); }
.rv-opt.wrong { border-color: var(--fail); background: var(--fail-soft); color: var(--fail); }
.rv-opt[disabled] { cursor: default; }
.rv-form { display: flex; gap: 8px; flex-wrap: wrap; }
.rv-input { flex: 1 1 220px; min-height: 48px; font-size: 1.0625rem; }
.rv-bank .word-chip[disabled] { opacity: .5; }
.rv-yours { margin: 0; }
.rv-fb { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r-md); animation: rv-in .25s ease; }
.rv-fb b { font-family: var(--font-display); font-size: 1.125rem; }
.rv-fb span { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-fb small { color: var(--muted); }
.rv-fb.pass { background: var(--pass-soft); }
.rv-fb.pass b { color: var(--pass); }
.rv-fb.warn { background: var(--warn-soft); }
.rv-fb.warn b { color: var(--warn); }
.rv-fb.fail { background: var(--fail-soft); }
.rv-fb.fail b { color: var(--fail); }
.rv-next { justify-self: stretch; }

/* resultado */
.rv-end { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 26px 20px; border-radius: var(--r-xl, var(--r-lg)); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: rv-in .35s ease; }
.rv-end h2 { font-size: 1.5rem; }
.rv-end p { margin: 0; max-width: 46ch; color: var(--muted); }
.rv-ring { --c: var(--warn); width: 132px; height: 132px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(closest-side, var(--surface) 78%, transparent 79%), conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); }
.rv-end.good .rv-ring { --c: var(--pass); }
.rv-ring b { font-family: var(--font-display); font-size: 1.75rem; line-height: 1; }
.rv-ring small { color: var(--muted); font-size: .75rem; }
.rv-end-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
@container (min-width: 520px) { .rv-end-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rv-end-stats li { display: grid; gap: 2px; padding: 10px; border-radius: var(--r-md); background: var(--surface-2); }
.rv-end-stats b { font-family: var(--font-display); font-size: 1.25rem; color: var(--accent); }
.rv-end-stats span { font-size: .75rem; color: var(--muted); }
.rv-new-badges { display: grid; gap: 8px; }
.rv-new-badges .rv-badge { animation: rv-pop .5s ease; }

@keyframes rv-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes rv-pop { 40% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) {
  .rv-card.enter, .rv-fb, .rv-end, .rv-combo.on, .rv-new-badges .rv-badge, .h-rv-count::before, .h-rv-count::after, .nav a .nav-dot, .rv-done-check circle { animation: none; }
  .h-rv-check path, .rv-done-check path { animation: none; stroke-dashoffset: 0; }
  .rv-prog i, .rv-opt { transition: none; }
}
