/* ================= V8: BOAS-VINDAS CINEMÁTICA ================= */
:root {
  --w-bg: linear-gradient(180deg, #121215 0%, #0A0A0C 100%);
  --m1: #4A4A55; --m2: #2C2C33; --m3: #5A5A66; --m4: #1E1E24;
  --w-fg: #FFFFFF; --w-muted: rgba(255,255,255,0.62);
  --w-name: linear-gradient(120deg, #FFFFFF 0%, #D4D4DC 100%);
  --w-glass: rgba(255,255,255,0.08); --w-glass-line: rgba(255,255,255,0.14);
  --w-halo: rgba(255,255,255,0.22);
  --w-cta-bg: #FFFFFF; --w-cta-fg: #000000; --w-cta-glow: rgba(255,255,255,0.35); --w-cta-ico: rgba(0,0,0,0.08);
  --w-sel-bg: #FFFFFF; --w-sel-fg: #000000; --w-accent: #FFFFFF; --w-spark: #FFFFFF;
}
[data-theme="lilas"] {
  --w-bg: linear-gradient(180deg, #FFEAF4 0%, #FCDDEC 50%, #F8D3E6 100%);
  --m1: #FF9CC8; --m2: #F9A8D4; --m3: #FFC4DD; --m4: #E9C7FA;
  --w-fg: #2E1A26; --w-muted: #8A6479;
  --w-name: linear-gradient(120deg, #F472B6 0%, #DB2777 55%, #9D174D 100%);
  --w-glass: rgba(255,255,255,0.55); --w-glass-line: rgba(255,255,255,0.9);
  --w-halo: rgba(244,114,182,0.55);
  --w-cta-bg: linear-gradient(135deg, #F472B6 0%, #EC4899 50%, #DB2777 100%); --w-cta-fg: #FFFFFF; --w-cta-glow: rgba(236,72,153,0.55); --w-cta-ico: rgba(255,255,255,0.25);
  --w-sel-bg: linear-gradient(160deg, #F472B6, #DB2777); --w-sel-fg: #FFFFFF; --w-accent: #DB2777; --w-spark: #F472B6;
}
[data-theme="indigo"] {
  --w-bg: linear-gradient(180deg, #8188F3 0%, #5B5DE6 60%, #4446CC 100%);
  --m1: #A5ABFF; --m2: #6E72F5; --m3: #C3C8FF; --m4: #4F46E5;
  --w-fg: #FFFFFF; --w-muted: rgba(255,255,255,0.75);
  --w-name: linear-gradient(120deg, #FFFFFF 0%, #DDE1FF 100%);
  --w-glass: rgba(255,255,255,0.14); --w-glass-line: rgba(255,255,255,0.24);
  --w-halo: rgba(255,255,255,0.40);
  --w-cta-bg: #FFFFFF; --w-cta-fg: #4A4BD4; --w-cta-glow: rgba(30,20,120,0.45); --w-cta-ico: rgba(74,75,212,0.12);
  --w-sel-bg: #FFFFFF; --w-sel-fg: #4A4BD4; --w-accent: #FFFFFF; --w-spark: #FFFFFF;
}

.welcome {
  --px: 0; --py: 0;
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100svh; display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 14px) 20px calc(var(--safe-b) + 40px);
  background: var(--w-bg); color: var(--w-fg);
}
/* manchas de cor animadas */
.mesh { position: absolute; inset: -10%; z-index: -1; transform: translate(calc(var(--px) * -14px), calc(var(--py) * -10px)); transition: transform 0.8s var(--ease-out); }
.mesh span { position: absolute; border-radius: 50%; filter: blur(48px); opacity: 0.85; animation: drift 18s ease-in-out infinite alternate; }
.mesh span:nth-child(1) { width: 300px; height: 300px; left: -60px; top: 6%; background: var(--m1); }
.mesh span:nth-child(2) { width: 260px; height: 260px; right: -70px; top: 22%; background: var(--m2); animation-duration: 22s; animation-delay: -6s; }
.mesh span:nth-child(3) { width: 340px; height: 340px; left: 10%; bottom: 8%; background: var(--m3); animation-duration: 26s; animation-delay: -12s; }
.mesh span:nth-child(4) { width: 220px; height: 220px; right: 0; bottom: 30%; background: var(--m4); animation-duration: 20s; animation-delay: -3s; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40px, -30px) scale(1.12); } 100% { transform: translate(-30px, 30px) scale(0.95); } }

.w-top { display: flex; align-items: center; justify-content: space-between; animation: wIn 0.7s var(--ease-out) both; }
.w-date { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--w-glass); border: 1px solid var(--w-glass-line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); font-size: 13px; font-weight: 500; }
.w-date svg { width: 14px; height: 14px; }
.w-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--w-glass); border: 1px solid var(--w-glass-line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--w-fg); }
.w-icon svg { width: 19px; height: 19px; }

/* avatar */
.w-avatar-wrap { position: relative; height: clamp(220px, 34svh, 290px); display: grid; place-items: center; margin-top: 4px; }
.w-halo { position: absolute; width: 78%; max-width: 280px; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, var(--w-halo) 0%, transparent 68%); animation: halo 3.4s ease-in-out infinite; }
@keyframes halo { 0%, 100% { transform: scale(0.9); opacity: 0.75; } 50% { transform: scale(1.08); opacity: 1; } }
.w-orbit { position: absolute; inset: 0; pointer-events: none; }
.w-orbit i { position: absolute; width: 14px; height: 14px; background: var(--w-spark); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: twinkle 2.6s ease-in-out infinite; opacity: 0; }
.w-orbit i:nth-child(1) { left: 16%; top: 18%; }
.w-orbit i:nth-child(2) { right: 14%; top: 34%; width: 10px; height: 10px; animation-delay: 0.6s; }
.w-orbit i:nth-child(3) { left: 22%; bottom: 14%; width: 9px; height: 9px; animation-delay: 1.2s; }
.w-orbit i:nth-child(4) { right: 22%; bottom: 10%; animation-delay: 1.8s; }
.w-orbit i:nth-child(5) { left: 50%; top: 2%; width: 8px; height: 8px; animation-delay: 0.9s; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); } 50% { opacity: 0.95; transform: scale(1) rotate(45deg); } }
.w-par { position: relative; transform: translate(calc(var(--px) * 14px), calc(var(--py) * 10px)) rotate(calc(var(--px) * 5deg)); transition: transform 0.5s var(--spring); }
.w-avatar { display: block; width: clamp(200px, 30svh, 250px); aspect-ratio: 1; padding: 0; border: 0; background: none; animation: avIn 1s var(--spring) 0.1s backwards; -webkit-tap-highlight-color: transparent; }
@keyframes avIn { from { transform: translateY(46px) scale(0.6); opacity: 0; } }
.w-float { display: block; width: 100%; height: 100%; animation: avBob 5s ease-in-out infinite; }
@keyframes avBob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-9px) rotate(1.5deg); } }
.w-float img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 26px 30px rgba(120, 30, 80, 0.28)); user-select: none; -webkit-user-drag: none; }
.w-float img.boing { animation: boing 0.75s var(--spring); }
@keyframes boing { 0% { transform: scale(1); } 25% { transform: scale(0.88, 1.08) rotate(-4deg); } 55% { transform: scale(1.1, 0.94) rotate(3deg); } 100% { transform: scale(1); } }
.w-bubble { position: absolute; top: 6%; left: 56%; white-space: nowrap; padding: 9px 14px; border-radius: 18px 18px 18px 6px; background: var(--w-glass); border: 1px solid var(--w-glass-line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); font-size: 14px; font-weight: 500; color: var(--w-fg); box-shadow: 0 10px 24px -14px rgba(0,0,0,0.35); transform-origin: 0 100%; animation: bubble 0.6s var(--spring) 1.1s both; }
.w-bubble.pop { animation: bubble 0.55s var(--spring) both; }
@keyframes bubble { from { opacity: 0; transform: scale(0.4) translateY(10px); } }

/* saudação */
.w-hello { text-align: center; margin-top: 2px; }
.w-greet { font-size: 18px; color: var(--w-muted); animation: wIn 0.7s var(--ease-out) 0.25s both; }
.w-name { font-size: clamp(42px, 12vw, 54px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; background: var(--w-name); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: wIn 0.8s var(--spring) 0.35s both; }
.w-sub { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; font-size: 15px; color: var(--w-muted); animation: wIn 0.7s var(--ease-out) 0.45s both; }
.w-sub svg { width: 15px; height: 15px; color: var(--w-accent); }
@keyframes wIn { from { opacity: 0; transform: translateY(16px); filter: blur(4px); } }

/* semana */
.w-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 18px 0 14px; animation: wIn 0.7s var(--ease-out) 0.55s both; }
.wk-day { height: 64px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: var(--w-glass); border: 1px solid var(--w-glass-line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--w-fg); transition: transform 0.35s var(--spring), background 0.3s ease; }
.wk-day small { font-size: 11px; font-weight: 500; color: var(--w-muted); }
.wk-day b { font-size: 17px; font-weight: 500; }
.wk-day i { height: 12px; display: grid; place-items: center; }
.wk-day.wk-train i::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--w-accent); }
.wk-day.wk-done i::before { display: none; }
.wk-day.wk-done i svg { width: 11px; height: 11px; color: #22C55E; }
.wk-day.wk-rest { opacity: 0.55; }
.wk-day.wk-today b { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.wk-day.wk-sel { background: var(--w-sel-bg); color: var(--w-sel-fg); border-color: transparent; box-shadow: 0 10px 22px -10px var(--w-cta-glow); opacity: 1; }
.wk-day.wk-sel small { color: inherit; opacity: 0.85; }
.wk-day.wk-sel.wk-train i::before { background: currentColor; }

/* card do treino */
.w-card { position: relative; padding: 18px; border-radius: 28px; background: var(--w-glass); border: 1px solid var(--w-glass-line); -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%); box-shadow: 0 20px 40px -24px rgba(60, 10, 40, 0.35); animation: wIn 0.8s var(--spring) 0.65s both; }
.w-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.w-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--w-muted); }
.w-kicker svg { width: 14px; height: 14px; color: var(--w-accent); }
.w-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; color: var(--w-accent); }
.w-link svg { width: 14px; height: 14px; }
.w-title { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; margin: 8px 0 10px; text-wrap: balance; }
.w-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.w-chips span { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--w-glass); border: 1px solid var(--w-glass-line); font-size: 12.5px; font-weight: 500; }
.w-chips svg { width: 13px; height: 13px; color: var(--w-accent); }
.w-cta { position: relative; overflow: hidden; width: 100%; height: 64px; margin-top: 16px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--w-cta-bg); color: var(--w-cta-fg); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; box-shadow: 0 16px 30px -14px var(--w-cta-glow); animation: ctaGlow 2.6s ease-in-out infinite; }
@keyframes ctaGlow { 0%, 100% { box-shadow: 0 16px 30px -14px var(--w-cta-glow); } 50% { box-shadow: 0 20px 44px -10px var(--w-cta-glow); } }
.w-cta-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--w-cta-ico); }
.w-cta-ico svg { width: 16px; height: 16px; margin-left: 2px; }
.w-cta-shine { position: absolute; top: 0; bottom: 0; left: -40%; width: 35%; background: linear-gradient(100deg, transparent, rgba(255,255,255,0.45), transparent); transform: skewX(-20deg); animation: shine 3.2s ease-in-out 1.4s infinite; }
@keyframes shine { 0% { left: -45%; } 45%, 100% { left: 120%; } }
.w-scroll { margin: 16px auto 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--w-muted); animation: wIn 0.7s var(--ease-out) 0.9s both; }
.w-scroll svg { width: 18px; height: 18px; transform: rotate(90deg); animation: nudgeDown 1.8s ease-in-out infinite; }
@keyframes nudgeDown { 0%, 100% { transform: rotate(90deg) translateX(0); } 50% { transform: rotate(90deg) translateX(5px); } }

/* depois da primeira entrada, sem repetir a animação ao trocar de dia */
.home.entered .w-top, .home.entered .w-avatar, .home.entered .w-greet, .home.entered .w-name, .home.entered .w-sub,
.home.entered .w-week, .home.entered .w-card, .home.entered .w-scroll { animation: none; }
.home.entered .w-bubble { animation-delay: 0s; }
.home.entered .w-card { animation: cardSwap 0.5s var(--spring); }
@keyframes cardSwap { from { opacity: 0.4; transform: translateY(10px) scale(0.98); } }

/* o resumo continua embaixo, como uma folha */
.welcome + .sheet-main { margin-top: -28px; position: relative; z-index: 1; }
[data-theme="lilas"] .welcome + .sheet-main { background: rgba(255,255,255,0.72); }

@media (prefers-reduced-motion: reduce) {
  .mesh span, .w-halo, .w-orbit i, .w-float, .w-cta, .w-cta-shine, .w-scroll svg { animation: none !important; }
}
