:root {
  --fundo: #f8efec;
  --fundo-2: #f3e4e1;
  --cartao: #fffaf8;
  --texto: #3b2630;
  --texto-suave: #8a6f77;
  --rose: #c8657f;
  --rose-forte: #a94564;
  --blush: #f1d3da;
  --ouro: #c9a46a;
  --ouro-claro: #ead9b6;
  --linha: #ead8d4;
  --sombra: 0 10px 30px -14px rgba(122, 61, 82, 0.35);
  --raio: 22px;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--texto);
  background:
    radial-gradient(1200px 500px at 85% -10%, #f6dbe1 0%, transparent 60%),
    radial-gradient(900px 400px at -10% 30%, #f7e9da 0%, transparent 60%),
    var(--fundo);
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: 0.01em; }

/* ---------- Topo ---------- */
.topo {
  max-width: 720px;
  margin: 0 auto;
  padding: 22px 18px 6px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.marca { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 30px; font-weight: 600; }
.marca em { font-style: italic; color: var(--rose); font-weight: 500; }
.coroa { width: 34px; height: 24px; fill: var(--ouro); filter: drop-shadow(0 2px 3px rgba(201, 164, 106, 0.4)); }
.coroa.grande { width: 64px; height: 44px; }
.saudacao { margin: 0 0 6px; color: var(--texto-suave); font-size: 14px; font-style: italic; font-family: var(--serif); font-size: 18px; text-align: right; }

main { max-width: 720px; margin: 0 auto; padding: 8px 16px 20px; }
.aba { display: none; animation: surgir 0.35s ease; }
.aba.ativa { display: block; }
@keyframes surgir { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Cartão do dia ---------- */
.cartao-dia {
  background: linear-gradient(135deg, #fffaf8 0%, #fbe9ec 100%);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 20px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.cartao-dia::after {
  content: '';
  position: absolute;
  inset: auto -40px -60px auto;
  width: 160px; height: 160px;
  border-radius: 50%;
  border: 1px solid var(--ouro-claro);
  opacity: 0.7;
}
.dia-data { margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.16em; font-size: 11.5px; color: var(--ouro); font-weight: 500; }
.dia-titulo { font-size: 30px; line-height: 1.05; }
.dia-titulo small { display: block; font-family: var(--sans); font-size: 13px; font-weight: 400; color: var(--texto-suave); margin-top: 6px; letter-spacing: 0; }
.link-hoje { margin-top: 10px; background: none; border: 0; padding: 0; color: var(--rose); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }

.anel { position: relative; width: 78px; height: 78px; flex: none; z-index: 1; }
.anel svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anel circle { fill: none; stroke-width: 3.2; }
.anel-fundo { stroke: var(--blush); }
.anel-valor { stroke: var(--rose); stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 119.4; transition: stroke-dashoffset 0.6s ease; }
.anel span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 21px; font-weight: 700; color: var(--rose-forte); }

/* ---------- Escolha do treino ---------- */
.escolha-treino { display: flex; gap: 8px; margin: 16px 0 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.escolha-treino::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1px solid var(--linha);
  background: var(--cartao);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 13.5px;
  color: var(--texto-suave);
  transition: all 0.2s;
}
.chip b { font-family: var(--serif); font-size: 16px; color: var(--texto); margin-right: 4px; }
.chip.ativo { background: var(--texto); color: #fbeff0; border-color: var(--texto); }
.chip.ativo b { color: var(--ouro-claro); }

/* ---------- Exercícios ---------- */
.lista { display: grid; gap: 12px; margin-top: 12px; }
.exercicio {
  background: var(--cartao);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  display: grid;
  grid-template-columns: 118px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  transition: opacity 0.25s, transform 0.25s;
}
.exercicio.feito { opacity: 0.72; }
.exercicio.feito .ex-nome { text-decoration: line-through; text-decoration-color: var(--ouro); text-decoration-thickness: 1.5px; }
.ex-animacao {
  width: 118px; height: 98px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fdf3f1, #f6e3e3);
  border: 0; padding: 0;
  display: block;
}
.ex-animacao svg { width: 100%; height: 100%; display: block; }
.ex-info { min-width: 0; text-align: left; background: none; border: 0; padding: 4px 0; }
.ex-nome { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.1; display: block; }
.ex-meta { font-size: 13px; color: var(--texto-suave); margin-top: 5px; display: block; }
.ex-hora { display: block; font-size: 12px; margin-top: 3px; color: var(--ouro); font-weight: 500; }
.ex-musculo { display: inline-block; margin-top: 7px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rose-forte); background: #f8e1e6; border-radius: 999px; padding: 3px 9px; }
.ex-ver { display: block; font-size: 12px; margin-top: 7px; color: var(--ouro); }

.check {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--ouro);
  background: transparent;
  display: grid; place-items: center;
  transition: all 0.2s;
  flex: none;
}
.check svg { width: 20px; height: 20px; stroke: #fff; stroke-width: 2.6; fill: none; opacity: 0; transform: scale(0.6); transition: all 0.2s; }
.check[aria-pressed='true'] { background: linear-gradient(135deg, var(--rose), var(--rose-forte)); border-color: var(--rose-forte); }
.check[aria-pressed='true'] svg { opacity: 1; transform: none; }

.fg-brilho { animation: pulsar 1.6s ease-in-out infinite; mix-blend-mode: multiply; }
@keyframes pulsar { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.85; } }

/* ---------- Botão treinado ---------- */
.botao-treinado {
  width: 100%;
  margin-top: 18px;
  padding: 15px;
  border-radius: 999px;
  border: 1px solid var(--ouro);
  background: transparent;
  color: var(--texto);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.botao-treinado.marcado { background: linear-gradient(135deg, #d4b07a, var(--ouro)); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -10px rgba(201, 164, 106, 0.9); }

.descanso { text-align: center; padding: 40px 20px 20px; }
.descanso h2 { font-size: 30px; margin: 10px 0 8px; }
.descanso p { color: var(--texto-suave); max-width: 340px; margin: 0 auto; line-height: 1.5; }

/* ---------- Calendário ---------- */
.numeros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.numeros div { background: var(--cartao); border: 1px solid var(--linha); border-radius: 18px; padding: 14px 8px; text-align: center; box-shadow: var(--sombra); }
.numeros strong { display: block; font-family: var(--serif); font-size: 32px; color: var(--rose-forte); line-height: 1; }
.numeros span { font-size: 11.5px; color: var(--texto-suave); }
.cal-cabecalho { display: flex; align-items: center; justify-content: space-between; margin: 22px 4px 10px; }
.cal-cabecalho h2 { font-size: 26px; }
.seta { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--linha); background: var(--cartao); font-size: 22px; line-height: 1; color: var(--rose); }
.cal-semana, .cal-grade { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-semana span { text-align: center; font-size: 11px; color: var(--texto-suave); letter-spacing: 0.1em; padding-bottom: 4px; }
.dia {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--cartao);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 14px;
  position: relative;
  padding: 0;
}
.dia.vazio { background: transparent; pointer-events: none; }
.dia.hoje { border-color: var(--rose); }
.dia .letra { font-size: 10px; color: var(--texto-suave); font-family: var(--serif); font-weight: 700; margin-top: 1px; }
.dia.previsto .letra { color: var(--rose); }
.dia.parcial { background: #fbe6ea; }
.dia.treinado { background: linear-gradient(135deg, #d9b37c, var(--ouro)); color: #fff; }
.dia.treinado .letra { color: #fff; }
.dia.treinado::before {
  content: '';
  position: absolute; top: 4px; right: 4px;
  width: 10px; height: 7px;
  background: #fff;
  clip-path: polygon(0 100%, 0 20%, 28% 55%, 50% 0, 72% 55%, 100% 20%, 100% 100%);
  opacity: 0.9;
}
.legenda { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; color: var(--texto-suave); margin-top: 14px; }
.ponto { display: inline-block; width: 11px; height: 11px; border-radius: 4px; }
.ponto.treinado { background: var(--ouro); }
.ponto.parcial { background: #fbe6ea; border: 1px solid var(--blush); }
.ponto.previsto { border: 1px solid var(--rose); }

/* ---------- Treinos e agenda ---------- */
.titulo-secao { font-size: 30px; margin: 6px 2px 4px; }
.sub { color: var(--texto-suave); font-size: 14px; margin: 0 2px 14px; }
.treino-bloco { background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px; margin-top: 14px; box-shadow: var(--sombra); }
.treino-bloco h3 { font-size: 23px; display: flex; align-items: baseline; gap: 10px; }
.treino-bloco h3 .letra-grande { font-size: 34px; color: var(--ouro); font-style: italic; }
.mini-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.mini { border: 1px solid var(--linha); border-radius: 16px; background: #fdf5f3; padding: 6px 6px 10px; text-align: center; }
.mini svg { width: 100%; height: 96px; display: block; }
.mini span { display: block; font-size: 13px; line-height: 1.25; padding: 0 4px; }

.agenda { display: grid; gap: 8px; }
.agenda-linha { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--cartao); border: 1px solid var(--linha); border-radius: 18px; padding: 10px 12px 10px 16px; }
.agenda-linha strong { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.agenda-linha .opcoes { display: flex; gap: 4px; }
.agenda-linha .opcoes button { min-width: 38px; height: 34px; border-radius: 999px; border: 1px solid var(--linha); background: transparent; font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--texto-suave); padding: 0 8px; }
.agenda-linha .opcoes button.ativo { background: var(--texto); border-color: var(--texto); color: var(--ouro-claro); }

/* ---------- Detalhe do exercício ---------- */
.detalhe {
  border: 0;
  padding: 0;
  width: min(560px, 100%);
  max-height: 92vh;
  margin: auto auto 0;
  border-radius: 28px 28px 0 0;
  background: var(--cartao);
  color: var(--texto);
  box-shadow: 0 -10px 40px -10px rgba(59, 38, 48, 0.4);
}
@media (min-width: 640px) { .detalhe { margin: auto; border-radius: 28px; } }
.detalhe::backdrop { background: rgba(59, 38, 48, 0.42); backdrop-filter: blur(3px); }
.detalhe[open] { animation: subir 0.3s ease; }
@keyframes subir { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.detalhe-conteudo { padding: 18px 20px 26px; }
.detalhe-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.detalhe-topo h2 { font-size: 28px; line-height: 1.05; }
.fechar { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--linha); background: transparent; font-size: 20px; line-height: 1; flex: none; }
.detalhe .grande-animacao { width: 100%; aspect-ratio: 6 / 5; border-radius: 20px; background: linear-gradient(180deg, #fdf3f1, #f4dfe0); margin: 14px 0 6px; display: block; }
.selo-series { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.selo-series span { font-size: 13px; border: 1px solid var(--ouro-claro); color: var(--texto); border-radius: 999px; padding: 4px 11px; }
.detalhe h3 { font-size: 20px; margin: 18px 0 8px; }
.passos { margin: 0; padding: 0; list-style: none; counter-reset: passo; display: grid; gap: 10px; }
.passos li { counter-increment: passo; display: grid; grid-template-columns: 28px 1fr; gap: 10px; line-height: 1.45; font-size: 15px; }
.passos li::before { content: counter(passo); width: 26px; height: 26px; border-radius: 50%; background: var(--blush); color: var(--rose-forte); font-family: var(--serif); font-weight: 700; display: grid; place-items: center; font-size: 15px; }
.dica { margin-top: 16px; background: linear-gradient(135deg, #fbf1e2, #f8e8ea); border-left: 3px solid var(--ouro); border-radius: 12px; padding: 12px 14px; font-size: 14.5px; line-height: 1.45; }
.dica b { font-family: var(--serif); font-size: 16px; }

.mm {
  display: flex; gap: 18px; justify-content: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,.92), transparent 46%),
    linear-gradient(145deg, #fff9f7, #f8e9ea);
  border: 1px solid rgba(202, 151, 151, 0.22);
  border-radius: 22px;
  padding: 15px 10px 9px;
  box-shadow: inset 0 1px 0 #fff, 0 8px 22px rgba(91, 55, 62, 0.05);
}
.mm-fig { margin: 0; text-align: center; position: relative; }
.mm-fig svg { width: 108px; height: 224px; display: block; filter: drop-shadow(0 5px 7px rgba(91,55,62,.08)); }
.mm-fig figcaption {
  display: inline-block; margin-top: 1px; padding: 3px 9px;
  border-radius: 999px; background: rgba(255,255,255,.72);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--texto-suave);
}
.mm-silhueta .mm-corpo { fill: #ead8d5; }
.mm-silhueta .mm-cabelo { fill: #745044; }
.mm-silhueta .mm-mecha { fill: #946b5c; opacity: .9; }
.mm-silhueta .mm-linha { fill: none; stroke: rgba(255,255,255,.72); stroke-width: 1; stroke-linecap: round; }
.mm-base, .mm-sec, .mm-pri { stroke: rgba(255,255,255,.5); stroke-width: .45; stroke-linejoin: round; transition: fill .2s; }
.mm-base { fill: #e2cfcc; opacity: .58; }
.mm-sec { fill: #eca5b7; }
.mm-pri { fill: #d2456f; filter: drop-shadow(0 1px 1px rgba(160,45,83,.22)); }
.mm-legenda { display: flex; justify-content: center; gap: 14px; font-size: 12.5px; color: var(--texto-suave); margin-top: 8px; flex-wrap: wrap; }
.mm-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Menu inferior ---------- */
.menu {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(460px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(59, 38, 48, 0.94);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 14px 30px -12px rgba(59, 38, 48, 0.6);
  z-index: 10;
}
.menu button { background: none; border: 0; color: #cdb8bd; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0 6px; border-radius: 999px; letter-spacing: 0.03em; }
.menu svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.menu button.ativo { color: var(--ouro-claro); background: rgba(255, 255, 255, 0.08); }
.menu button.ativo svg { fill: rgba(234, 217, 182, 0.18); }

/* ---------- Toast e festa ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: var(--texto);
  color: #fbeff0;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 20;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.visivel { opacity: 1; transform: translate(-50%, 0); }
.brilhinho { position: fixed; top: -20px; pointer-events: none; z-index: 30; animation: cair linear forwards; }
@keyframes cair { to { transform: translateY(105vh) rotate(540deg); opacity: 0.2; } }

@media (max-width: 420px) {
  .exercicio { grid-template-columns: 96px 1fr auto; gap: 10px; }
  .ex-animacao { width: 96px; height: 84px; }
  .ex-nome { font-size: 18px; }
  .dia-titulo { font-size: 26px; }
  .marca { font-size: 26px; }
  .saudacao { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .fg-brilho, .aba, .detalhe[open] { animation: none; }
}
