/* ==========================================================================
   Fim da aula (5.5): folha com o resultado. No computador e no tablet é um cartão no centro;
   no celular sobe do rodapé. Nota em anel que se completa, números que sobem, competências
   em barras e a chama da sequência. Animações desligam com "reduzir movimento".
   ========================================================================== */
.ld-sheet { border: 0; padding: 0; background: transparent; color: var(--ink); width: 100%; max-width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: visible; }
.ld-sheet::backdrop { background: color-mix(in srgb, #0b0a14 60%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ld-sheet[open] { animation: ld-in .5s cubic-bezier(.2, .9, .3, 1.2) both; }
.ld-sheet { --tone: var(--accent); }
.ld-sheet.tone-top, .ld-sheet.tone-good { --tone: var(--pass); }
.ld-sheet.tone-low { --tone: var(--warn); }

.ld-card { position: relative; display: grid; gap: 16px; padding: 26px 22px 20px; border-radius: 28px; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
  background: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--tone) 16%, transparent), transparent 65%), var(--surface);
  border: 1px solid var(--line); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .5); }
.ld-x { position: absolute; right: 12px; top: 12px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.ld-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ld-x:hover { color: var(--ink); }

.ld-head { display: grid; justify-items: center; gap: 4px; text-align: center; }
.ld-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.75rem; letter-spacing: -.02em; animation: ld-pop .5s cubic-bezier(.2, .9, .3, 1.5) .5s both; }
.ld-sub { margin: 0; color: var(--muted); font-size: .9375rem; }
.ld-ring { position: relative; width: 128px; height: 128px; margin-bottom: 6px; }
.ld-ring svg { width: 100%; height: 100%; rotate: -90deg; }
.ld-ring circle { fill: none; stroke-width: 10; }
.ld-ring-bg { stroke: var(--surface-2); }
.ld-ring-fg { stroke: var(--tone); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--to)); animation: ld-ring 1.1s cubic-bezier(.3, .8, .3, 1) .15s both;
  filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--tone) 45%, transparent)); }
.ld-ring-n { position: absolute; inset: 0; display: grid; place-content: center; grid-auto-flow: column; align-items: baseline; font-family: var(--font-display); }
.ld-ring-n b { font-size: 2.5rem; letter-spacing: -.03em; }
.ld-ring-n small { font-size: 1.125rem; font-weight: 700; color: var(--muted); }

.ld-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ld-stats li { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: 16px; background: var(--surface-2); animation: ld-up .45s cubic-bezier(.2, .9, .3, 1.3) both; }
.ld-stats li:nth-child(1) { animation-delay: .25s; } .ld-stats li:nth-child(2) { animation-delay: .32s; } .ld-stats li:nth-child(3) { animation-delay: .39s; }
.ld-stats b { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; }
.ld-stats span { font-size: .75rem; font-weight: 600; color: var(--muted); }
.ld-stats .ok b { color: var(--pass); } .ld-stats .warn b { color: var(--warn); } .ld-stats .fail b { color: var(--fail); }

.ld-skills { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ld-skills li { display: grid; grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr) 3em; align-items: center; gap: 10px; font-size: .8125rem; animation: ld-up .4s ease both; animation-delay: calc(.45s + var(--i) * .07s); }
.ld-skills li > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 600; }
.ld-skills b { text-align: right; font-family: var(--font-label); }
.ld-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--tone)); transform-origin: left; animation: h-grow .9s cubic-bezier(.2, .8, .2, 1) .55s both; }

.ld-streak { --fl-a: #FF9A3C; --fl-b: #FF5A3C; --fl-c: #FFE08A; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 20px;
  background: radial-gradient(100% 140% at 0% 50%, color-mix(in srgb, var(--fl-a) 18%, transparent), transparent 70%), var(--surface-2); animation: ld-up .45s ease .6s both; }
.ld-flame { width: 46px; height: 56px; flex: none; animation: st-pop .7s cubic-bezier(.2, .9, .3, 1.5) .8s both; }
.ld-flame .st-flame-svg { width: 100%; height: 100%; overflow: visible; }
.ld-streak-t { display: grid; gap: 2px; min-width: 0; }
.ld-streak-t strong { font-size: 1rem; }
.ld-streak-t strong b { font-family: var(--font-display); font-size: 1.375rem; background: linear-gradient(180deg, var(--fl-a), var(--fl-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ld-streak-t > span { font-size: .8125rem; color: var(--muted); }
.ld-dots { display: flex; gap: 5px; margin-top: 4px; }
.ld-d { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 1.5px dashed var(--line); }
.ld-d.we { width: 9px; height: 9px; align-self: center; }
.ld-d.is-on { border: 0; background: linear-gradient(160deg, var(--fl-a), var(--fl-b)); }
.ld-d.is-folga { border: 0; background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.ld-d.is-today { border: 2px solid var(--fl-b); }

.ld-newsl { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ld-news { padding: 6px 12px; border-radius: 999px; font-size: .8125rem; font-weight: 700; background: var(--accent-soft); color: var(--accent); animation: ld-pop .5s cubic-bezier(.2, .9, .3, 1.5) .9s both; }
.ld-news.is-open { background: color-mix(in srgb, var(--pass) 16%, transparent); color: var(--pass); }

.ld-acts { display: grid; gap: 8px; }
.ld-acts .btn { justify-content: center; width: 100%; }
.ld-acts .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.ld-acts .btn:hover svg { transform: translateX(3px); }

/* celular: folha que sobe do rodapé */
@media (max-width: 680px) {
  .ld-sheet { max-width: 100vw; margin: auto 0 0; }
  .ld-sheet[open] { animation-name: ld-sheet-up; }
  .ld-card { border-radius: 28px 28px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
}

/* na semana: o cartão da aula que acabou de ser enviada acende uma vez */
.sched-item.just-done { animation: ld-glow 1.6s ease .2s both; }
.sched-item.just-done .sched-bar i { animation: h-grow .9s cubic-bezier(.2, .8, .2, 1) .3s both; }

@keyframes ld-in { from { opacity: 0; transform: translateY(24px) scale(.94); } }
@keyframes ld-sheet-up { from { transform: translateY(100%); } }
@keyframes ld-ring { from { stroke-dashoffset: 100; } }
@keyframes ld-up { from { opacity: 0; transform: translateY(10px); } }
@keyframes ld-pop { from { opacity: 0; transform: scale(.6); } }
@keyframes ld-glow { 0% { transform: scale(1); } 25% { transform: scale(1.04); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pass) 45%, transparent), var(--shadow-lg); } 100% { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .ld-sheet[open], .ld-card *, .sched-item.just-done, .sched-item.just-done * { animation: none !important; }
}
